var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __pow = Math.pow;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __objRest = (source, exclude) => {
  var target = {};
  for (var prop in source)
    if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
      target[prop] = source[prop];
  if (source != null && __getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(source)) {
      if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
        target[prop] = source[prop];
    }
  return target;
};
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
var __async = (__this, __arguments, generator) => {
  return new Promise((resolve, reject) => {
    var fulfilled = (value) => {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    };
    var rejected = (value) => {
      try {
        step(generator.throw(value));
      } catch (e) {
        reject(e);
      }
    };
    var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
    step((generator = generator.apply(__this, __arguments)).next());
  });
};
(function() {
  "use strict";
  var _a, _b, _c, _Tc, _Uc;
  var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
  function _mergeNamespaces(n2, m2) {
    for (var i2 = 0; i2 < m2.length; i2++) {
      const e = m2[i2];
      if (typeof e !== "string" && !Array.isArray(e)) {
        for (const k2 in e) {
          if (k2 !== "default" && !(k2 in n2)) {
            const d = Object.getOwnPropertyDescriptor(e, k2);
            if (d) {
              Object.defineProperty(n2, k2, d.get ? d : {
                enumerable: true,
                get: /* @__PURE__ */ __name(() => e[k2], "get")
              });
            }
          }
        }
      }
    }
    return Object.freeze(Object.defineProperty(n2, Symbol.toStringTag, { value: "Module" }));
  }
  __name(_mergeNamespaces, "_mergeNamespaces");
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  function getDefaultExportFromCjs(x2) {
    return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
  }
  __name(getDefaultExportFromCjs, "getDefaultExportFromCjs");
  var jsxRuntime = { exports: {} };
  var reactJsxRuntime_production = {};
  /**
   * @license React
   * react-jsx-runtime.production.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  var hasRequiredReactJsxRuntime_production;
  function requireReactJsxRuntime_production() {
    if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
    hasRequiredReactJsxRuntime_production = 1;
    var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
    function jsxProd(type, config2, maybeKey) {
      var key = null;
      void 0 !== maybeKey && (key = "" + maybeKey);
      void 0 !== config2.key && (key = "" + config2.key);
      if ("key" in config2) {
        maybeKey = {};
        for (var propName in config2)
          "key" !== propName && (maybeKey[propName] = config2[propName]);
      } else maybeKey = config2;
      config2 = maybeKey.ref;
      return {
        $$typeof: REACT_ELEMENT_TYPE,
        type,
        key,
        ref: void 0 !== config2 ? config2 : null,
        props: maybeKey
      };
    }
    __name(jsxProd, "jsxProd");
    reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
    reactJsxRuntime_production.jsx = jsxProd;
    reactJsxRuntime_production.jsxs = jsxProd;
    return reactJsxRuntime_production;
  }
  __name(requireReactJsxRuntime_production, "requireReactJsxRuntime_production");
  var hasRequiredJsxRuntime;
  function requireJsxRuntime() {
    if (hasRequiredJsxRuntime) return jsxRuntime.exports;
    hasRequiredJsxRuntime = 1;
    {
      jsxRuntime.exports = requireReactJsxRuntime_production();
    }
    return jsxRuntime.exports;
  }
  __name(requireJsxRuntime, "requireJsxRuntime");
  var jsxRuntimeExports = requireJsxRuntime();
  var PATTERN$1 = /%(((\d+)\$)|(\(([$_a-zA-Z][$_a-zA-Z0-9]*)\)))?[ +0#-]*\d*(\.(\d+|\*))?(ll|[lhqL])?([cduxXefgsp%])/g;
  function sprintf$4(string2, ...args) {
    var i2 = 0;
    if (Array.isArray(args[0])) {
      args = /** @type {import('../types').SprintfArgs<T>[]} */
      /** @type {unknown} */
      args[0];
    }
    return string2.replace(PATTERN$1, function() {
      var index2, name, precision, type, value;
      index2 = arguments[3];
      name = arguments[5];
      precision = arguments[7];
      type = arguments[9];
      if (type === "%") {
        return "%";
      }
      if (precision === "*") {
        precision = args[i2];
        i2++;
      }
      if (name === void 0) {
        if (index2 === void 0) {
          index2 = i2 + 1;
        }
        i2++;
        value = args[index2 - 1];
      } else if (args[0] && typeof args[0] === "object" && args[0].hasOwnProperty(name)) {
        value = args[0][name];
      }
      if (type === "f") {
        value = parseFloat(value) || 0;
      } else if (type === "d") {
        value = parseInt(value) || 0;
      }
      if (precision !== void 0) {
        if (type === "f") {
          value = value.toFixed(precision);
        } else if (type === "s") {
          value = value.substr(0, precision);
        }
      }
      return value !== void 0 && value !== null ? value : "";
    });
  }
  __name(sprintf$4, "sprintf$4");
  function sprintf$3(format2, ...args) {
    return sprintf$4(format2, ...args);
  }
  __name(sprintf$3, "sprintf$3");
  var PRECEDENCE, OPENERS, TERMINATORS, PATTERN;
  PRECEDENCE = {
    "(": 9,
    "!": 8,
    "*": 7,
    "/": 7,
    "%": 7,
    "+": 6,
    "-": 6,
    "<": 5,
    "<=": 5,
    ">": 5,
    ">=": 5,
    "==": 4,
    "!=": 4,
    "&&": 3,
    "||": 2,
    "?": 1,
    "?:": 1
  };
  OPENERS = ["(", "?"];
  TERMINATORS = {
    ")": ["("],
    ":": ["?", "?:"]
  };
  PATTERN = /<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;
  function postfix(expression) {
    var terms = [], stack = [], match, operator, term, element;
    while (match = expression.match(PATTERN)) {
      operator = match[0];
      term = expression.substr(0, match.index).trim();
      if (term) {
        terms.push(term);
      }
      while (element = stack.pop()) {
        if (TERMINATORS[operator]) {
          if (TERMINATORS[operator][0] === element) {
            operator = TERMINATORS[operator][1] || operator;
            break;
          }
        } else if (OPENERS.indexOf(element) >= 0 || PRECEDENCE[element] < PRECEDENCE[operator]) {
          stack.push(element);
          break;
        }
        terms.push(element);
      }
      if (!TERMINATORS[operator]) {
        stack.push(operator);
      }
      expression = expression.substr(match.index + operator.length);
    }
    expression = expression.trim();
    if (expression) {
      terms.push(expression);
    }
    return terms.concat(stack.reverse());
  }
  __name(postfix, "postfix");
  var OPERATORS = {
    "!": /* @__PURE__ */ __name(function(a2) {
      return !a2;
    }, "!"),
    "*": /* @__PURE__ */ __name(function(a2, b) {
      return a2 * b;
    }, "*"),
    "/": /* @__PURE__ */ __name(function(a2, b) {
      return a2 / b;
    }, "/"),
    "%": /* @__PURE__ */ __name(function(a2, b) {
      return a2 % b;
    }, "%"),
    "+": /* @__PURE__ */ __name(function(a2, b) {
      return a2 + b;
    }, "+"),
    "-": /* @__PURE__ */ __name(function(a2, b) {
      return a2 - b;
    }, "-"),
    "<": /* @__PURE__ */ __name(function(a2, b) {
      return a2 < b;
    }, "<"),
    "<=": /* @__PURE__ */ __name(function(a2, b) {
      return a2 <= b;
    }, "<="),
    ">": /* @__PURE__ */ __name(function(a2, b) {
      return a2 > b;
    }, ">"),
    ">=": /* @__PURE__ */ __name(function(a2, b) {
      return a2 >= b;
    }, ">="),
    "==": /* @__PURE__ */ __name(function(a2, b) {
      return a2 === b;
    }, "=="),
    "!=": /* @__PURE__ */ __name(function(a2, b) {
      return a2 !== b;
    }, "!="),
    "&&": /* @__PURE__ */ __name(function(a2, b) {
      return a2 && b;
    }, "&&"),
    "||": /* @__PURE__ */ __name(function(a2, b) {
      return a2 || b;
    }, "||"),
    "?:": /* @__PURE__ */ __name(function(a2, b, c2) {
      if (a2) {
        throw b;
      }
      return c2;
    }, "?:")
  };
  function evaluate$1(postfix2, variables) {
    var stack = [], i2, j, args, getOperatorResult, term, value;
    for (i2 = 0; i2 < postfix2.length; i2++) {
      term = postfix2[i2];
      getOperatorResult = OPERATORS[term];
      if (getOperatorResult) {
        j = getOperatorResult.length;
        args = Array(j);
        while (j--) {
          args[j] = stack.pop();
        }
        try {
          value = getOperatorResult.apply(null, args);
        } catch (earlyReturn) {
          return earlyReturn;
        }
      } else if (variables.hasOwnProperty(term)) {
        value = variables[term];
      } else {
        value = +term;
      }
      stack.push(value);
    }
    return stack[0];
  }
  __name(evaluate$1, "evaluate$1");
  function compile(expression) {
    var terms = postfix(expression);
    return function(variables) {
      return evaluate$1(terms, variables);
    };
  }
  __name(compile, "compile");
  function pluralForms(expression) {
    var evaluate2 = compile(expression);
    return function(n2) {
      return +evaluate2({ n: n2 });
    };
  }
  __name(pluralForms, "pluralForms");
  var DEFAULT_OPTIONS$1 = {
    contextDelimiter: "",
    onMissingKey: null
  };
  function getPluralExpression(pf) {
    var parts, i2, part;
    parts = pf.split(";");
    for (i2 = 0; i2 < parts.length; i2++) {
      part = parts[i2].trim();
      if (part.indexOf("plural=") === 0) {
        return part.substr(7);
      }
    }
  }
  __name(getPluralExpression, "getPluralExpression");
  function Tannin(data, options2) {
    var key;
    this.data = data;
    this.pluralForms = {};
    this.options = {};
    for (key in DEFAULT_OPTIONS$1) {
      this.options[key] = options2 !== void 0 && key in options2 ? options2[key] : DEFAULT_OPTIONS$1[key];
    }
  }
  __name(Tannin, "Tannin");
  Tannin.prototype.getPluralForm = function(domain, n2) {
    var getPluralForm = this.pluralForms[domain], config2, plural, pf;
    if (!getPluralForm) {
      config2 = this.data[domain][""];
      pf = config2["Plural-Forms"] || config2["plural-forms"] || // Ignore reason: As known, there's no way to document the empty
      // string property on a key to guarantee this as metadata.
      // @ts-ignore
      config2.plural_forms;
      if (typeof pf !== "function") {
        plural = getPluralExpression(
          config2["Plural-Forms"] || config2["plural-forms"] || // Ignore reason: As known, there's no way to document the empty
          // string property on a key to guarantee this as metadata.
          // @ts-ignore
          config2.plural_forms
        );
        pf = pluralForms(plural);
      }
      getPluralForm = this.pluralForms[domain] = pf;
    }
    return getPluralForm(n2);
  };
  Tannin.prototype.dcnpgettext = function(domain, context, singular, plural, n2) {
    var index2, key, entry;
    if (n2 === void 0) {
      index2 = 0;
    } else {
      index2 = this.getPluralForm(domain, n2);
    }
    key = singular;
    if (context) {
      key = context + this.options.contextDelimiter + singular;
    }
    entry = this.data[domain][key];
    if (entry && entry[index2]) {
      return entry[index2];
    }
    if (this.options.onMissingKey) {
      this.options.onMissingKey(singular, domain);
    }
    return index2 === 0 ? singular : plural;
  };
  var DEFAULT_LOCALE_DATA = {
    "": {
      plural_forms(n2) {
        return n2 === 1 ? 0 : 1;
      }
    }
  };
  var I18N_HOOK_REGEXP = /^i18n\.(n?gettext|has_translation)(_|$)/;
  var createI18n = /* @__PURE__ */ __name((initialData, initialDomain, hooks) => {
    const tannin = new Tannin({});
    const listeners = /* @__PURE__ */ new Set();
    const notifyListeners = /* @__PURE__ */ __name(() => {
      listeners.forEach((listener) => listener());
    }, "notifyListeners");
    const subscribe2 = /* @__PURE__ */ __name((callback) => {
      listeners.add(callback);
      return () => listeners.delete(callback);
    }, "subscribe");
    const getLocaleData2 = /* @__PURE__ */ __name((domain = "default") => tannin.data[domain], "getLocaleData");
    const doSetLocaleData = /* @__PURE__ */ __name((data, domain = "default") => {
      var _a2;
      tannin.data[domain] = __spreadValues(__spreadValues({}, tannin.data[domain]), data);
      tannin.data[domain][""] = __spreadValues(__spreadValues({}, DEFAULT_LOCALE_DATA[""]), (_a2 = tannin.data[domain]) == null ? void 0 : _a2[""]);
      delete tannin.pluralForms[domain];
    }, "doSetLocaleData");
    const setLocaleData2 = /* @__PURE__ */ __name((data, domain) => {
      doSetLocaleData(data, domain);
      notifyListeners();
    }, "setLocaleData");
    const addLocaleData = /* @__PURE__ */ __name((data, domain = "default") => {
      var _a2;
      tannin.data[domain] = __spreadProps(__spreadValues(__spreadValues({}, tannin.data[domain]), data), {
        // Populate default domain configuration (supported locale date which omits
        // a plural forms expression).
        "": __spreadValues(__spreadValues(__spreadValues({}, DEFAULT_LOCALE_DATA[""]), (_a2 = tannin.data[domain]) == null ? void 0 : _a2[""]), data == null ? void 0 : data[""])
      });
      delete tannin.pluralForms[domain];
      notifyListeners();
    }, "addLocaleData");
    const resetLocaleData2 = /* @__PURE__ */ __name((data, domain) => {
      tannin.data = {};
      tannin.pluralForms = {};
      setLocaleData2(data, domain);
    }, "resetLocaleData");
    const dcnpgettext = /* @__PURE__ */ __name((domain = "default", context, single, plural, number2) => {
      if (!tannin.data[domain]) {
        doSetLocaleData(void 0, domain);
      }
      return tannin.dcnpgettext(domain, context, single, plural, number2);
    }, "dcnpgettext");
    const getFilterDomain = /* @__PURE__ */ __name((domain) => domain || "default", "getFilterDomain");
    const __2 = /* @__PURE__ */ __name((text, domain) => {
      let translation = dcnpgettext(domain, void 0, text);
      if (!hooks) {
        return translation;
      }
      translation = hooks.applyFilters(
        "i18n.gettext",
        translation,
        text,
        domain
      );
      return hooks.applyFilters(
        "i18n.gettext_" + getFilterDomain(domain),
        translation,
        text,
        domain
      );
    }, "__");
    const _x2 = /* @__PURE__ */ __name((text, context, domain) => {
      let translation = dcnpgettext(domain, context, text);
      if (!hooks) {
        return translation;
      }
      translation = hooks.applyFilters(
        "i18n.gettext_with_context",
        translation,
        text,
        context,
        domain
      );
      return hooks.applyFilters(
        "i18n.gettext_with_context_" + getFilterDomain(domain),
        translation,
        text,
        context,
        domain
      );
    }, "_x");
    const _n2 = /* @__PURE__ */ __name((single, plural, number2, domain) => {
      let translation = dcnpgettext(
        domain,
        void 0,
        single,
        plural,
        number2
      );
      if (!hooks) {
        return translation;
      }
      translation = hooks.applyFilters(
        "i18n.ngettext",
        translation,
        single,
        plural,
        number2,
        domain
      );
      return hooks.applyFilters(
        "i18n.ngettext_" + getFilterDomain(domain),
        translation,
        single,
        plural,
        number2,
        domain
      );
    }, "_n");
    const _nx2 = /* @__PURE__ */ __name((single, plural, number2, context, domain) => {
      let translation = dcnpgettext(
        domain,
        context,
        single,
        plural,
        number2
      );
      if (!hooks) {
        return translation;
      }
      translation = hooks.applyFilters(
        "i18n.ngettext_with_context",
        translation,
        single,
        plural,
        number2,
        context,
        domain
      );
      return hooks.applyFilters(
        "i18n.ngettext_with_context_" + getFilterDomain(domain),
        translation,
        single,
        plural,
        number2,
        context,
        domain
      );
    }, "_nx");
    const isRTL2 = /* @__PURE__ */ __name(() => {
      return "rtl" === _x2("ltr", "text direction");
    }, "isRTL");
    const hasTranslation2 = /* @__PURE__ */ __name((single, context, domain) => {
      var _a2, _b2;
      const key = context ? context + "" + single : single;
      let result = !!((_b2 = (_a2 = tannin.data) == null ? void 0 : _a2[domain != null ? domain : "default"]) == null ? void 0 : _b2[key]);
      if (hooks) {
        result = hooks.applyFilters(
          "i18n.has_translation",
          result,
          single,
          context,
          domain
        );
        result = hooks.applyFilters(
          "i18n.has_translation_" + getFilterDomain(domain),
          result,
          single,
          context,
          domain
        );
      }
      return result;
    }, "hasTranslation");
    if (initialData) {
      setLocaleData2(initialData, initialDomain);
    }
    if (hooks) {
      const onHookAddedOrRemoved = /* @__PURE__ */ __name((hookName) => {
        if (I18N_HOOK_REGEXP.test(hookName)) {
          notifyListeners();
        }
      }, "onHookAddedOrRemoved");
      hooks.addAction("hookAdded", "core/i18n", onHookAddedOrRemoved);
      hooks.addAction("hookRemoved", "core/i18n", onHookAddedOrRemoved);
    }
    return {
      getLocaleData: getLocaleData2,
      setLocaleData: setLocaleData2,
      addLocaleData,
      resetLocaleData: resetLocaleData2,
      subscribe: subscribe2,
      __: __2,
      _x: _x2,
      _n: _n2,
      _nx: _nx2,
      isRTL: isRTL2,
      hasTranslation: hasTranslation2
    };
  }, "createI18n");
  function validateNamespace(namespace) {
    if ("string" !== typeof namespace || "" === namespace) {
      console.error("The namespace must be a non-empty string.");
      return false;
    }
    if (!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(namespace)) {
      console.error(
        "The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."
      );
      return false;
    }
    return true;
  }
  __name(validateNamespace, "validateNamespace");
  var validateNamespace_default = validateNamespace;
  function validateHookName(hookName) {
    if ("string" !== typeof hookName || "" === hookName) {
      console.error("The hook name must be a non-empty string.");
      return false;
    }
    if (/^__/.test(hookName)) {
      console.error("The hook name cannot begin with `__`.");
      return false;
    }
    if (!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(hookName)) {
      console.error(
        "The hook name can only contain numbers, letters, dashes, periods and underscores."
      );
      return false;
    }
    return true;
  }
  __name(validateHookName, "validateHookName");
  var validateHookName_default = validateHookName;
  function createAddHook(hooks, storeKey) {
    return /* @__PURE__ */ __name(function addHook(hookName, namespace, callback, priority = 10) {
      const hooksStore = hooks[storeKey];
      if (!validateHookName_default(hookName)) {
        return;
      }
      if (!validateNamespace_default(namespace)) {
        return;
      }
      if ("function" !== typeof callback) {
        console.error("The hook callback must be a function.");
        return;
      }
      if ("number" !== typeof priority) {
        console.error(
          "If specified, the hook priority must be a number."
        );
        return;
      }
      const handler = { callback, priority, namespace };
      if (hooksStore[hookName]) {
        const handlers = hooksStore[hookName].handlers;
        let i2;
        for (i2 = handlers.length; i2 > 0; i2--) {
          if (priority >= handlers[i2 - 1].priority) {
            break;
          }
        }
        if (i2 === handlers.length) {
          handlers[i2] = handler;
        } else {
          handlers.splice(i2, 0, handler);
        }
        hooksStore.__current.forEach((hookInfo) => {
          if (hookInfo.name === hookName && hookInfo.currentIndex >= i2) {
            hookInfo.currentIndex++;
          }
        });
      } else {
        hooksStore[hookName] = {
          handlers: [handler],
          runs: 0
        };
      }
      if (hookName !== "hookAdded") {
        hooks.doAction(
          "hookAdded",
          hookName,
          namespace,
          callback,
          priority
        );
      }
    }, "addHook");
  }
  __name(createAddHook, "createAddHook");
  var createAddHook_default = createAddHook;
  function createRemoveHook(hooks, storeKey, removeAll = false) {
    return /* @__PURE__ */ __name(function removeHook(hookName, namespace) {
      const hooksStore = hooks[storeKey];
      if (!validateHookName_default(hookName)) {
        return;
      }
      if (!removeAll && !validateNamespace_default(namespace)) {
        return;
      }
      if (!hooksStore[hookName]) {
        return 0;
      }
      let handlersRemoved = 0;
      if (removeAll) {
        handlersRemoved = hooksStore[hookName].handlers.length;
        hooksStore[hookName] = {
          runs: hooksStore[hookName].runs,
          handlers: []
        };
      } else {
        const handlers = hooksStore[hookName].handlers;
        for (let i2 = handlers.length - 1; i2 >= 0; i2--) {
          if (handlers[i2].namespace === namespace) {
            handlers.splice(i2, 1);
            handlersRemoved++;
            hooksStore.__current.forEach((hookInfo) => {
              if (hookInfo.name === hookName && hookInfo.currentIndex >= i2) {
                hookInfo.currentIndex--;
              }
            });
          }
        }
      }
      if (hookName !== "hookRemoved") {
        hooks.doAction("hookRemoved", hookName, namespace);
      }
      return handlersRemoved;
    }, "removeHook");
  }
  __name(createRemoveHook, "createRemoveHook");
  var createRemoveHook_default = createRemoveHook;
  function createHasHook(hooks, storeKey) {
    return /* @__PURE__ */ __name(function hasHook(hookName, namespace) {
      const hooksStore = hooks[storeKey];
      if ("undefined" !== typeof namespace) {
        return hookName in hooksStore && hooksStore[hookName].handlers.some(
          (hook) => hook.namespace === namespace
        );
      }
      return hookName in hooksStore;
    }, "hasHook");
  }
  __name(createHasHook, "createHasHook");
  var createHasHook_default = createHasHook;
  function createRunHook(hooks, storeKey, returnFirstArg, async) {
    return /* @__PURE__ */ __name(function runHook(hookName, ...args) {
      const hooksStore = hooks[storeKey];
      if (!hooksStore[hookName]) {
        hooksStore[hookName] = {
          handlers: [],
          runs: 0
        };
      }
      hooksStore[hookName].runs++;
      const handlers = hooksStore[hookName].handlers;
      if (!handlers || !handlers.length) {
        return returnFirstArg ? args[0] : void 0;
      }
      const hookInfo = {
        name: hookName,
        currentIndex: 0
      };
      function asyncRunner() {
        return __async(this, null, function* () {
          try {
            hooksStore.__current.add(hookInfo);
            let result = returnFirstArg ? args[0] : void 0;
            while (hookInfo.currentIndex < handlers.length) {
              const handler = handlers[hookInfo.currentIndex];
              result = yield handler.callback.apply(null, args);
              if (returnFirstArg) {
                args[0] = result;
              }
              hookInfo.currentIndex++;
            }
            return returnFirstArg ? result : void 0;
          } finally {
            hooksStore.__current.delete(hookInfo);
          }
        });
      }
      __name(asyncRunner, "asyncRunner");
      function syncRunner() {
        try {
          hooksStore.__current.add(hookInfo);
          let result = returnFirstArg ? args[0] : void 0;
          while (hookInfo.currentIndex < handlers.length) {
            const handler = handlers[hookInfo.currentIndex];
            result = handler.callback.apply(null, args);
            if (returnFirstArg) {
              args[0] = result;
            }
            hookInfo.currentIndex++;
          }
          return returnFirstArg ? result : void 0;
        } finally {
          hooksStore.__current.delete(hookInfo);
        }
      }
      __name(syncRunner, "syncRunner");
      return (async ? asyncRunner : syncRunner)();
    }, "runHook");
  }
  __name(createRunHook, "createRunHook");
  var createRunHook_default = createRunHook;
  function createCurrentHook(hooks, storeKey) {
    return /* @__PURE__ */ __name(function currentHook() {
      var _a2, _b2;
      const hooksStore = hooks[storeKey];
      const currentArray = Array.from(hooksStore.__current);
      return (_b2 = (_a2 = currentArray.at(-1)) == null ? void 0 : _a2.name) != null ? _b2 : null;
    }, "currentHook");
  }
  __name(createCurrentHook, "createCurrentHook");
  var createCurrentHook_default = createCurrentHook;
  function createDoingHook(hooks, storeKey) {
    return /* @__PURE__ */ __name(function doingHook(hookName) {
      const hooksStore = hooks[storeKey];
      if ("undefined" === typeof hookName) {
        return hooksStore.__current.size > 0;
      }
      return Array.from(hooksStore.__current).some(
        (hook) => hook.name === hookName
      );
    }, "doingHook");
  }
  __name(createDoingHook, "createDoingHook");
  var createDoingHook_default = createDoingHook;
  function createDidHook(hooks, storeKey) {
    return /* @__PURE__ */ __name(function didHook(hookName) {
      const hooksStore = hooks[storeKey];
      if (!validateHookName_default(hookName)) {
        return;
      }
      return hooksStore[hookName] && hooksStore[hookName].runs ? hooksStore[hookName].runs : 0;
    }, "didHook");
  }
  __name(createDidHook, "createDidHook");
  var createDidHook_default = createDidHook;
  var _Hooks = (_a = class {
    constructor() {
      __publicField(this, "actions");
      __publicField(this, "filters");
      __publicField(this, "addAction");
      __publicField(this, "addFilter");
      __publicField(this, "removeAction");
      __publicField(this, "removeFilter");
      __publicField(this, "hasAction");
      __publicField(this, "hasFilter");
      __publicField(this, "removeAllActions");
      __publicField(this, "removeAllFilters");
      __publicField(this, "doAction");
      __publicField(this, "doActionAsync");
      __publicField(this, "applyFilters");
      __publicField(this, "applyFiltersAsync");
      __publicField(this, "currentAction");
      __publicField(this, "currentFilter");
      __publicField(this, "doingAction");
      __publicField(this, "doingFilter");
      __publicField(this, "didAction");
      __publicField(this, "didFilter");
      this.actions = /* @__PURE__ */ Object.create(null);
      this.actions.__current = /* @__PURE__ */ new Set();
      this.filters = /* @__PURE__ */ Object.create(null);
      this.filters.__current = /* @__PURE__ */ new Set();
      this.addAction = createAddHook_default(this, "actions");
      this.addFilter = createAddHook_default(this, "filters");
      this.removeAction = createRemoveHook_default(this, "actions");
      this.removeFilter = createRemoveHook_default(this, "filters");
      this.hasAction = createHasHook_default(this, "actions");
      this.hasFilter = createHasHook_default(this, "filters");
      this.removeAllActions = createRemoveHook_default(this, "actions", true);
      this.removeAllFilters = createRemoveHook_default(this, "filters", true);
      this.doAction = createRunHook_default(this, "actions", false, false);
      this.doActionAsync = createRunHook_default(this, "actions", false, true);
      this.applyFilters = createRunHook_default(this, "filters", true, false);
      this.applyFiltersAsync = createRunHook_default(this, "filters", true, true);
      this.currentAction = createCurrentHook_default(this, "actions");
      this.currentFilter = createCurrentHook_default(this, "filters");
      this.doingAction = createDoingHook_default(this, "actions");
      this.doingFilter = createDoingHook_default(this, "filters");
      this.didAction = createDidHook_default(this, "actions");
      this.didFilter = createDidHook_default(this, "filters");
    }
  }, __name(_a, "_Hooks"), _a);
  function createHooks() {
    return new _Hooks();
  }
  __name(createHooks, "createHooks");
  var createHooks_default = createHooks;
  var defaultHooks = createHooks_default();
  var {
    addAction,
    addFilter,
    removeAction,
    removeFilter,
    hasAction,
    hasFilter,
    removeAllActions,
    removeAllFilters,
    doAction,
    doActionAsync,
    applyFilters,
    applyFiltersAsync,
    currentAction,
    currentFilter,
    doingAction,
    doingFilter,
    didAction,
    didFilter,
    actions,
    filters
  } = defaultHooks;
  var i18n$1 = createI18n(void 0, void 0, defaultHooks);
  var default_i18n_default = i18n$1;
  var getLocaleData = i18n$1.getLocaleData.bind(i18n$1);
  var setLocaleData = i18n$1.setLocaleData.bind(i18n$1);
  var resetLocaleData = i18n$1.resetLocaleData.bind(i18n$1);
  var subscribe$1 = i18n$1.subscribe.bind(i18n$1);
  var __$3 = i18n$1.__.bind(i18n$1);
  var _x = i18n$1._x.bind(i18n$1);
  var _n$1 = i18n$1._n.bind(i18n$1);
  var _nx = i18n$1._nx.bind(i18n$1);
  var isRTL$1 = i18n$1.isRTL.bind(i18n$1);
  var hasTranslation = i18n$1.hasTranslation.bind(i18n$1);
  const i18n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    __: __$3,
    _n: _n$1,
    _nx,
    _x,
    createI18n,
    defaultI18n: default_i18n_default,
    getLocaleData,
    hasTranslation,
    isRTL: isRTL$1,
    resetLocaleData,
    setLocaleData,
    sprintf: sprintf$3,
    subscribe: subscribe$1
  }, Symbol.toStringTag, { value: "Module" }));
  const TEXT_DOMAIN = "cookie-law-info";
  if (typeof window !== "undefined" && ((_b = window.ckyTranslations) == null ? void 0 : _b.translations)) {
    setLocaleData(
      window.ckyTranslations.translations,
      TEXT_DOMAIN
    );
  }
  const { __: __$2, sprintf: sprintf$2, _n } = i18n;
  const popupLayoutSvg = "" + new URL("../assets/popup-layout.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const layoutBoxSvg = "data:image/svg+xml,%3csvg%20width='79'%20height='50'%20viewBox='0%200%2079%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.5'%20width='77.7778'%20height='50'%20rx='4'%20fill='%23EAF1FE'/%3e%3crect%20x='9.75925'%20y='25.9258'%20width='24.0741'%20height='14.8148'%20rx='2'%20fill='%23154FD9'/%3e%3c/svg%3e";
  const layoutClassicBottomSvg = "data:image/svg+xml,%3csvg%20width='79'%20height='50'%20viewBox='0%200%2079%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.5'%20width='77.7778'%20height='50'%20rx='4'%20fill='%23EAF1FE'/%3e%3crect%20x='11.6111'%20y='32.4072'%20width='55.5556'%20height='5.55556'%20rx='1'%20fill='%23154FD9'/%3e%3c/svg%3e";
  const layoutBannerSvg = "data:image/svg+xml,%3csvg%20width='79'%20height='50'%20viewBox='0%200%2079%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.5'%20width='77.7778'%20height='50'%20rx='4'%20fill='%23EAF1FE'/%3e%3cpath%20d='M0.5%2045.4443C0.5%2044.8921%200.947715%2044.4443%201.5%2044.4443H77.2778C77.8301%2044.4443%2078.2778%2044.8921%2078.2778%2045.4443V45.9999C78.2778%2048.209%2076.4869%2049.9999%2074.2778%2049.9999H4.5C2.29086%2049.9999%200.5%2048.209%200.5%2045.9999V45.4443Z'%20fill='%23154FD9'/%3e%3c/svg%3e";
  const layoutPopupSvg = "data:image/svg+xml,%3csvg%20width='79'%20height='50'%20viewBox='0%200%2079%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.277771'%20width='77.78'%20height='50'%20rx='4'%20fill='%23EAF1FE'/%3e%3crect%20x='26.7235'%20y='17'%20width='24.0748'%20height='16'%20rx='2'%20fill='%23154FD9'/%3e%3c/svg%3e";
  const layoutCenterSvg = "data:image/svg+xml,%3csvg%20width='100'%20height='65'%20viewBox='0%200%20100%2065'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='popup-center%201'%20clip-path='url(%23clip0_14495_1677)'%3e%3cpath%20id='Vector'%20d='M93.744%200.956055H5.41485C2.61847%200.956055%200.351562%203.22297%200.351562%206.01935V59.1839C0.351562%2061.9803%202.61847%2064.2472%205.41485%2064.2472H93.744C96.5403%2064.2472%2098.8072%2061.9803%2098.8072%2059.1839V6.01935C98.8072%203.22297%2096.5403%200.956055%2093.744%200.956055Z'%20fill='%23EAF1FE'/%3e%3cpath%20id='Vector_2'%20d='M61.7699%2022.4751H36.3588C34.9606%2022.4751%2033.8271%2023.6086%2033.8271%2025.0067V40.1966C33.8271%2041.5948%2034.9606%2042.7283%2036.3588%2042.7283H61.7699C63.1681%2042.7283%2064.3016%2041.5948%2064.3016%2040.1966V25.0067C64.3016%2023.6086%2063.1681%2022.4751%2061.7699%2022.4751Z'%20fill='%23154FD9'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_14495_1677'%3e%3crect%20width='100'%20height='63.2911'%20fill='white'%20transform='translate(0%200.956055)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
  const layoutSidebarSvg = "data:image/svg+xml,%3csvg%20width='100'%20height='65'%20viewBox='0%200%20100%2065'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='banner-bottom%203'%20clip-path='url(%23clip0_14495_1791)'%3e%3cpath%20id='Vector'%20d='M94.0224%200.956055H5.6961C2.89972%200.956055%200.632812%203.22297%200.632812%206.01935V59.1839C0.632812%2061.9803%202.89972%2064.2472%205.6961%2064.2472H94.0224C96.8188%2064.2472%2099.0857%2061.9803%2099.0857%2059.1839V6.01935C99.0857%203.22297%2096.8188%200.956055%2094.0224%200.956055Z'%20fill='%23EAF1FE'/%3e%3cpath%20id='Rectangle%2020'%20d='M0.210938%205.95605C0.210938%203.19463%202.44951%200.956055%205.21094%200.956055H26.5822V64.2472H5.21093C2.44951%2064.2472%200.210938%2062.0086%200.210938%2059.2472V5.95605Z'%20fill='%23154FD9'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_14495_1791'%3e%3crect%20width='100'%20height='63.2911'%20fill='white'%20transform='translate(0%200.956055)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
  const layoutPushdownSvg = "data:image/svg+xml,%3csvg%20width='100'%20height='65'%20viewBox='0%200%20100%2065'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='popup-center%203'%20clip-path='url(%23clip0_14495_1760)'%3e%3cpath%20id='Vector'%20d='M93.744%200.941406H5.41485C2.61847%200.941406%200.351562%203.20832%200.351562%206.0047V59.1693C0.351562%2061.9656%202.61847%2064.2325%205.41485%2064.2325H93.744C96.5403%2064.2325%2098.8073%2061.9656%2098.8073%2059.1693V6.0047C98.8073%203.20832%2096.5403%200.941406%2093.744%200.941406Z'%20fill='%23EAF1FE'/%3e%3cpath%20id='Rectangle%2021'%20d='M5.00001%2064.2324C2.23858%2064.2324%200%2061.9938%200%2059.2324L0%2037.8611L99.1561%2037.8611V59.2324C99.1561%2061.9939%2096.9175%2064.2324%2094.1561%2064.2324H5.00001Z'%20fill='%23154FD9'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_14495_1760'%3e%3crect%20width='100'%20height='63.2911'%20fill='white'%20transform='translate(0%200.941406)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
  const closeSvg = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20384%20512'%3e%3cpath%20d='m231.6%20256%20130.1-130.1c4.7-4.7%204.7-12.3%200-17l-22.6-22.6c-4.7-4.7-12.3-4.7-17%200L192%20216.4%2061.9%2086.3c-4.7-4.7-12.3-4.7-17%200l-22.6%2022.6c-4.7%204.7-4.7%2012.3%200%2017L152.4%20256%2022.3%20386.1c-4.7%204.7-4.7%2012.3%200%2017l22.6%2022.6c4.7%204.7%2012.3%204.7%2017%200L192%20295.6l130.1%20130.1c4.7%204.7%2012.3%204.7%2017%200l22.6-22.6c4.7-4.7%204.7-12.3%200-17L231.6%20256z'%20fill='inherit'/%3e%3c/svg%3e";
  const externalSvg = "" + new URL("../assets/external.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const arrowRightSvg = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m9%206%206%206-6%206'%20stroke='%234E4B66'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
  const arrowBackSvg$1 = "data:image/svg+xml,%3csvg%20width='32'%20height='32'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.667%2016h18.666M6.667%2016l8%208m-8-8%208-8'%20stroke='%234E4B66'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
  const arrowLeftSvg = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20330%20330'%3e%3cpath%20d='M111.213%20165.004%20250.607%2025.607c5.858-5.858%205.858-15.355%200-21.213-5.858-5.858-15.355-5.858-21.213.001l-150%20150.004a15%2015%200%200%200%200%2021.212l150%20149.996C232.322%20328.536%20236.161%20330%20240%20330s7.678-1.464%2010.607-4.394c5.858-5.858%205.858-15.355%200-21.213L111.213%20165.004z'%20/%3e%3c/svg%3e";
  const arrowBoldSvg = "data:image/svg+xml,%3csvg%20width='7'%20height='5'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.75%205%20.502.5h6.496L3.75%205z'%20fill='%231863DC'/%3e%3c/svg%3e";
  const checkSvg = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M20%206%209%2017l-5-5'%20stroke='%231578F7'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
  const checkFillSvg = "data:image/svg+xml,%3csvg%20width='32'%20height='32'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m16%201.334%2010.956%202.435A1.333%201.333%200%200%201%2028%205.07v13.316a8%208%200%200%201-3.563%206.656L16%2030.667l-8.437-5.625A7.997%207.997%200%200%201%204%2018.387V5.07a1.333%201.333%200%200%201%201.044-1.301L16%201.334zm5.936%209.63-6.6%206.598-3.77-3.77-1.886%201.885%205.657%205.657%208.486-8.485-1.887-1.886z'%20fill='%232DAD70'/%3e%3c/svg%3e";
  const langSvg = "data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.4075%201.33398H4.10414C3.01129%201.33398%202.12335%202.22192%202.10059%203.33753V17.886C2.10059%2018.9789%202.98852%2019.8668%204.10414%2019.8896H18.7209L22.7736%2022.5989C23.0468%2022.7811%2023.3883%2022.5762%2023.3883%2022.2574V3.31477C23.3883%202.22192%2022.5004%201.33398%2021.4075%201.33398ZM22.6142%2021.4606L19.0625%2019.1155C18.9942%2019.07%2018.9259%2019.0472%2018.8348%2019.0472H4.10414C3.44388%2019.0472%202.92022%2018.5008%202.89745%2017.8405V3.31477C2.89745%202.65451%203.44388%202.13085%204.10414%202.10808H21.4075C22.0678%202.10808%2022.5914%202.65451%2022.6142%203.31477V21.4606Z'%20fill='%233D3E50'/%3e%3cpath%20d='M18.7664%2010.6454C18.7664%207.32135%2016.0798%204.63477%2012.7558%204.63477C9.45447%204.63477%206.74512%207.32135%206.74512%2010.6454C6.74512%2013.9695%209.45447%2016.6561%2012.7558%2016.6561C16.0571%2016.6561%2018.7437%2013.9695%2018.7664%2010.6454ZM17.6508%2012.4213H15.6017C15.7839%2011.2374%2015.7839%2010.0307%2015.6017%208.84678H17.6508C17.8557%209.3932%2017.9696%2010.0079%2017.9696%2010.6227C17.9696%2011.2601%2017.833%2011.8976%2017.6508%2012.4213ZM12.7558%2015.8592C12.05%2015.8592%2011.2986%2014.8574%2010.8888%2013.2409H14.6227C14.2129%2014.8574%2013.4616%2015.8592%2012.7558%2015.8592ZM10.7295%2012.4213C10.5473%2011.2374%2010.5473%2010.0307%2010.7295%208.84678H14.7821C14.9642%2010.0307%2014.9642%2011.2374%2014.7821%2012.4213H10.7295ZM7.54198%2010.6454C7.54198%209.96239%207.70136%209.23383%207.86073%208.86955H9.90982C9.75045%2010.0535%209.75045%2011.2601%209.90982%2012.4441H7.86073C7.72413%2012.1253%207.54198%2011.3512%207.54198%2010.6454ZM12.7558%205.43163C13.4616%205.43163%2014.2129%206.43341%2014.6227%208.04991H10.8888C11.2986%206.45618%2012.05%205.43163%2012.7558%205.43163ZM17.2638%208.07268H15.4196C15.2602%207.23028%2014.9187%206.45618%2014.4633%205.75038C15.67%206.1602%2016.649%206.97983%2017.2638%208.07268ZM11.0254%205.72761C10.5701%206.43341%2010.2286%207.23028%2010.0692%208.04991H8.22501C8.86251%206.97983%209.84152%206.1602%2011.0254%205.72761ZM8.24778%2013.2182H10.092C10.2513%2014.0606%2010.5928%2014.8347%2011.0482%2015.5405C9.84152%2015.1306%208.86251%2014.311%208.24778%2013.2182ZM14.4861%2015.5632C14.9415%2014.8574%2015.283%2014.0606%2015.4424%2013.2409H17.2865C16.649%2014.311%2015.67%2015.1306%2014.4861%2015.5632Z'%20fill='%233D3E50'/%3e%3c/svg%3e";
  const regSvg = "data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.3336%202C8.53358%202%204.63364%202.87198%202.5%204.29377V12.08C2.5%2018.0569%208.40014%2020.9644%2011.5334%2022.7737C11.7724%2022.9215%2012.05%2023%2012.3336%2023C12.6171%2023%2012.8947%2022.9215%2013.1337%2022.7737C16.3999%2020.8675%2022.5%2018.2826%2022.5%2012.08V4.29377C20.2999%202.87198%2016.4664%202%2012.3336%202Z'%20stroke='%231160C6'/%3e%3cpath%20d='M18.5%2010.2308H13.8929L12.5%206L11.1071%2010.2308H6.5L10.25%2012.7692L8.80357%2017L12.5%2014.3558L16.1964%2017L14.75%2012.7692L18.5%2010.2308Z'%20stroke='%231160C6'%20stroke-linejoin='round'/%3e%3c/svg%3e";
  const statusSvg = "" + new URL("../assets/status.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const locationSvg = "data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M24.2968%2011.6527H23.2125V11.3441C23.0576%208.79743%2021.9732%206.40514%2020.1144%204.63023C18.3331%202.85531%2015.8547%201.69775%2013.2988%201.54341H12.989V0.385852C12.989%200.154341%2012.8341%200%2012.6018%200C12.3694%200%2012.2145%200.154341%2012.2145%200.385852V1.46624H11.9047C9.34886%201.62058%206.9479%202.70096%205.16655%204.55305C3.38519%206.40515%202.22344%208.79743%202.06854%2011.2669V11.5756H0.906782C0.674432%2011.5756%200.519531%2011.7299%200.519531%2011.9614C0.519531%2012.1929%200.674432%2012.4244%200.906782%2012.4244H1.99109V12.7331C2.14599%2015.2797%203.23029%2017.672%205.0891%2019.4469C6.87045%2021.2219%209.34886%2022.3794%2011.8273%2022.5338H12.1371V23.6141C12.1371%2023.8457%2012.292%2024%2012.5243%2024C12.7567%2024%2012.9116%2023.8457%2012.9116%2023.6141V22.5338H13.2214C15.7772%2022.3794%2018.1782%2021.299%2020.037%2019.4469C21.8183%2017.672%2022.9801%2015.2026%2023.135%2012.7331V12.4244H24.2193C24.4517%2012.4244%2024.6066%2012.2701%2024.6066%2012.0386C24.6066%2011.8071%2024.5291%2011.6527%2024.2968%2011.6527ZM21.2762%2012.4244H22.3605V12.7331C21.9732%2017.4405%2018.1782%2021.299%2013.3763%2021.6849H13.0665V20.6045C13.0665%2020.373%2012.9116%2020.2187%2012.6792%2020.2187C12.4469%2020.2187%2012.292%2020.373%2012.292%2020.6045V21.6849H11.9822C7.1028%2021.3762%203.23029%2017.5177%202.92049%2012.8103V12.5016H4.00479C4.23714%2012.5016%204.39204%2012.3473%204.39204%2012.1158C4.39204%2011.8842%204.15969%2011.6527%203.92734%2011.6527H2.84304V11.3441C3.23029%206.55949%207.1028%202.70096%2011.8273%202.31511H12.1371V3.3955C12.1371%203.62701%2012.292%203.78135%2012.5243%203.78135C12.7567%203.78135%2012.9116%203.62701%2012.9116%203.3955V2.31511H13.2214C17.9458%202.70096%2021.8183%206.48232%2022.2056%2011.2669V11.5756H21.1213C20.8889%2011.5756%2020.734%2011.7299%2020.734%2011.9614C20.734%2012.1929%2021.0438%2012.4244%2021.2762%2012.4244Z'%20fill='%23A6742A'/%3e%3cpath%20d='M12.6012%205.86523C10.8199%205.86523%209.11599%206.86845%208.34149%208.48903C7.56698%2010.1096%207.72188%2012.0389%208.80619%2013.4279L12.2914%2018.0582C12.4463%2018.2897%2012.8336%2018.2897%2012.9885%2018.0582L16.4738%2013.4279C17.5581%2011.9617%2017.713%2010.1096%2016.9385%208.48903C16.0865%206.86845%2014.3826%205.86523%2012.6012%205.86523ZM15.7767%2012.9649L12.6012%2017.1321L9.42579%2012.9649C8.49639%2011.7302%208.41894%2010.1868%209.03854%208.87488C9.73559%207.48581%2011.0522%206.71411%2012.5238%206.71411C13.9954%206.71411%2015.3895%207.48581%2016.0091%208.87488C16.6287%2010.2639%2016.6287%2011.7302%2015.7767%2012.9649Z'%20fill='%23A6742A'/%3e%3cpath%20d='M12.602%208.7207C11.5951%208.7207%2010.7432%209.56958%2010.7432%2010.5728C10.7432%2011.576%2011.5951%2012.4249%2012.602%2012.4249C13.6088%2012.4249%2014.4608%2011.576%2014.4608%2010.5728C14.4608%209.56958%2013.6088%208.7207%2012.602%208.7207ZM12.602%2011.6532C12.0598%2011.6532%2011.5951%2011.1902%2011.5951%2010.65C11.5951%2010.1098%2012.0598%209.64675%2012.602%209.64675C13.1441%209.64675%2013.6088%2010.1098%2013.6088%2010.65C13.6088%2011.1902%2013.1441%2011.6532%2012.602%2011.6532Z'%20fill='%23A6742A'/%3e%3cdefs%3e%3cclipPath%3e%3crect%20width='24'%20height='24'%20fill='white'%20transform='translate(0.75)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
  const addLanguageSvg = "" + new URL("../assets/add-language.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const geoTargetSvg = "" + new URL("../assets/geo-location.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const tcfGcmSvg = "" + new URL("../assets/tcf-gcm.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const errorSvg = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23a)'%20stroke='%23B9172B'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cpath%20d='M10%2018.75a8.75%208.75%200%201%200%200-17.5%208.75%208.75%200%200%200%200%2017.5zM10%206.25V10M10%2013.75h.008'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h20v20H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
  const successSvg = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%20style='enable-background:new%200%200%2020%2020'%20xml:space='preserve'%3e%3ccircle%20transform='rotate(-86.479%209.997%209.997)%20scale(.99999)'%20cx='10'%20cy='10'%20style='fill-rule:evenodd;clip-rule:evenodd;fill:%2346b450'%20r='10'/%3e%3cpath%20d='M15.3%207.5c0-.2-.1-.3-.2-.5l-.9-.9c-.2-.1-.3-.1-.5-.1s-.3.1-.5.2l-4.5%204.5-2-2c0-.2-.2-.3-.4-.3s-.3.1-.5.2l-.9.9c-.1.2-.2.3-.2.5s.1.3.2.5l3.4%203.4c.1.1.3.1.5.1s.3-.1.5-.2L15.1%208c.1-.1.2-.3.2-.5z'%20style='fill-rule:evenodd;clip-rule:evenodd;fill:%23fff'/%3e%3c/svg%3e";
  const warningSvg = "data:image/svg+xml,%3csvg%20width='20'%20height='21'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.568%203.656%201.474%2015.498a1.675%201.675%200%200%200%201.433%202.513h14.186a1.675%201.675%200%200%200%201.433-2.513L11.431%203.656a1.675%201.675%200%200%200-2.864%200zM10%208.625v2.5M10%2014.25h.008'%20stroke='%23A6742A'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
  const circleWarningSvg = "data:image/svg+xml,%3csvg%20width='30'%20height='30'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23a)'%20stroke='%23A6742A'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cpath%20d='M15%2028.125c7.249%200%2013.125-5.876%2013.125-13.125S22.249%201.875%2015%201.875%201.875%207.751%201.875%2015%207.751%2028.125%2015%2028.125zM15%209.375V15M15%2020.625h.012'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h30v30H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
  const infoSvg = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23a)'%20stroke='%231160C6'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cpath%20d='M10%2018.75a8.75%208.75%200%201%200%200-17.5%208.75%208.75%200%200%200%200%2017.5zM10%2010v3.75M10%206.25h.008'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h20v20H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
  const searchSvg = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20'%20fill='%23888'%3e%3cpath%20d='M11.742%2010.344a6.5%206.5%200%201%200-1.397%201.398h-.001c.03.04.062.078.098.115l3.85%203.85a1%201%200%200%200%201.415-1.414l-3.85-3.85a1.007%201.007%200%200%200-.115-.1zM12%206.5a5.5%205.5%200%201%201-11%200%205.5%205.5%200%200%201%2011%200z'/%3e%3c/svg%3e";
  const timeScheduleSvg = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='20'%20fill='none'%3e%3cg%20clip-path='url(%23a)'%20stroke='%238F92AF'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cpath%20d='M10%2018.335a8.333%208.333%200%201%200%200-16.667%208.333%208.333%200%200%200%200%2016.667z'/%3e%3cpath%20d='M10%205v5l3.333%201.667'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h20v20H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
  const scanNowSvg = "" + new URL("../assets/scan-now.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const scheduleScanSvg = "" + new URL("../assets/schedule-scan.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const scanResultSvg = "" + new URL("../assets/scan-result.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const connectSuccessSvg = "data:image/svg+xml,%3csvg%20width='91'%20height='90'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M45.5.375a44.625%2044.625%200%201%201%200%2089.25%2044.625%2044.625%200%200%201%200-89.25zm-5.559%2053.429-9.913-9.92a3.827%203.827%200%201%200-5.412%205.413l12.622%2012.622a3.813%203.813%200%200%200%205.412%200l26.138-26.144a3.824%203.824%200%201%200-5.406-5.412L39.94%2053.803z'%20fill='%232DAD70'/%3e%3c/svg%3e";
  const affiliateBgSvg = "" + new URL("../assets/affiliate-bg.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const logoSvg = "data:image/svg+xml,%3csvg%20width='188'%20height='30'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.225%202.954c6.265%200%2010.947%203.5%2012.466%209.228h-7.024c-1.076-2.291-3.1-3.373-5.505-3.373-3.923%200-6.644%202.927-6.644%207.636%200%204.71%202.72%207.636%206.644%207.636%202.404%200%204.43-1.145%205.505-3.372h7.024c-1.519%205.727-6.201%209.227-12.466%209.227C5.442%2029.872%200%2024.336%200%2016.382%200%208.427%205.442%202.954%2013.225%202.954zM38.473%2030c-6.138%200-10.757-4.136-10.757-10.818%200-6.682%204.746-10.818%2010.884-10.818S49.483%2012.5%2049.483%2019.182c0%206.682-4.872%2010.818-11.01%2010.818zm0-5.6c2.278%200%204.43-1.718%204.43-5.218%200-3.564-2.089-5.218-4.367-5.218-2.341%200-4.366%201.654-4.366%205.218.063%203.5%201.962%205.218%204.303%205.218zM62.202%2030c-6.138%200-10.757-4.136-10.757-10.818%200-6.682%204.746-10.818%2010.884-10.818S73.213%2012.5%2073.213%2019.182C73.213%2025.864%2068.34%2030%2062.203%2030zm0-5.6c2.278%200%204.43-1.718%204.43-5.218%200-3.564-2.088-5.218-4.366-5.218-2.342%200-4.366%201.654-4.366%205.218%200%203.5%201.961%205.218%204.302%205.218zM75.49%202.954h6.392V17.21l6.328-8.527h7.91l-8.67%2010.5%208.796%2010.5h-7.91l-6.391-8.846v8.846h-6.391V2.953h-.063zM97.638%203.018c0-1.973%201.519-3.5%203.797-3.5%202.278%200%203.796%201.527%203.796%203.5%200%201.91-1.518%203.436-3.796%203.436-2.278%200-3.797-1.527-3.797-3.436zm.633%205.6h6.391v21h-6.391v-21zM117.571%2030c-6.138%200-10.568-4.136-10.568-10.818%200-6.682%204.366-10.818%2010.568-10.818%206.074%200%2010.44%204.072%2010.44%2010.5%200%20.572-.063%201.273-.126%201.909h-14.491c.253%202.736%201.899%204.009%203.987%204.009%201.772%200%202.784-.891%203.353-2.037h6.835c-1.076%204.073-4.746%207.255-9.998%207.255zm-4.113-12.854h8.036c0-2.291-1.772-3.628-3.923-3.628-2.152%200-3.734%201.273-4.113%203.628zM157.562%2030c-6.138%200-10.567-4.136-10.567-10.818%200-6.682%204.366-10.818%2010.567-10.818%206.075%200%2010.441%204.072%2010.441%2010.5%200%20.572-.063%201.273-.126%201.909h-14.491c.253%202.736%201.898%204.009%203.987%204.009%201.771%200%202.784-.891%203.353-2.037h6.834c-1.075%204.073-4.809%207.255-9.998%207.255zm-4.176-12.854h8.036c0-2.291-1.771-3.628-3.923-3.628-2.088%200-3.733%201.273-4.113%203.628zM179.583%2030c-5.568%200-9.302-3.118-9.618-7.19h6.328c.126%201.463%201.455%202.417%203.227%202.417%201.645%200%202.531-.763%202.531-1.718%200-3.372-11.39-.954-11.39-8.654%200-3.564%203.037-6.491%208.479-6.491%205.379%200%208.416%202.99%208.796%207.127h-5.948c-.19-1.4-1.266-2.354-3.101-2.354-1.519%200-2.341.572-2.341%201.59%200%203.373%2011.326.955%2011.453%208.846.063%203.627-3.164%206.427-8.416%206.427z'%20fill='%23404041'/%3e%3cpath%20d='M134.656%209h-6.645l6.075%2011.327h6.644L134.656%209z'%20fill='%230056A7'/%3e%3cpath%20d='m133.96%2020.01.189.317h6.645l-4.367-7.954-2.467%207.636z'%20fill='%232E3191'/%3e%3cpath%20d='m146.109-.545-11.96%2020.872h6.645L152.753-.545h-6.644zM134.149%2023.445h6.455V30h-6.455v-6.555z'%20fill='%230056A7'/%3e%3c/svg%3e";
  const sessionExpiredSvg = "" + new URL("../assets/session-expired.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const privacyPolicySvg = "" + new URL("../assets/privacy-policy.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const cookiePolicySvg = "" + new URL("../assets/cookie-policy.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const starSvg = "data:image/svg+xml,%3csvg%20width='16'%20height='17'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m8%2012.014%202.766%201.673a.665.665%200%200%200%20.994-.72l-.734-3.147%202.447-2.12a.665.665%200%200%200-.38-1.167l-3.22-.273-1.26-2.973a.667.667%200%200%200-1.227%200l-1.26%202.966-3.22.274a.665.665%200%200%200-.38%201.167l2.447%202.12-.733%203.146a.665.665%200%200%200%20.993.72L8%2012.014z'%20fill='%23fff'/%3e%3c/svg%3e";
  const infoNewSvg = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23a)'%20stroke='%238F92AF'%20stroke-width='1.25'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cpath%20d='M8%2015A7%207%200%201%200%208%201a7%207%200%200%200%200%2014zM8%208v3M8%205h.007'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='a'%3e%3cpath%20fill='%23fff'%20d='M0%200h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
  const gdprUsSvg = "" + new URL("../assets/gdpr-us.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const customThemeSvg = "" + new URL("../assets/custom-theme.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const customLogoSvg = "" + new URL("../assets/custom-logo.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const customIconSvg = "" + new URL("../assets/custom-icon.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const themeSvg = "data:image/svg+xml,%3csvg%20width='44'%20height='42'%20viewBox='0%200%2044%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%2012.5199C0%206.95291%204.51297%202.43994%2010.08%202.43994H29.04C34.607%202.43994%2039.12%206.95291%2039.12%2012.5199V31.4799C39.12%2037.047%2034.607%2041.5599%2029.04%2041.5599H10.08C4.51297%2041.5599%200%2037.047%200%2031.4799V12.5199Z'%20fill='%23E8F1FE'/%3e%3cg%20clip-path='url(%23clip0_916_1420)'%3e%3cmask%20id='mask0_916_1420'%20style='mask-type:luminance'%20maskUnits='userSpaceOnUse'%20x='8'%20y='9'%20width='24'%20height='25'%3e%3cpath%20d='M8%209.93946H32V33.9395H8V9.93946Z'%20fill='white'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_916_1420)'%3e%3cpath%20d='M16.4375%2029.252C16.4375%2031.323%2014.7586%2033.002%2012.6875%2033.002C10.6164%2033.002%208.9375%2031.323%208.9375%2029.252V12.752C8.9375%2011.7164%209.77698%2010.877%2010.8125%2010.877H14.5625C15.598%2010.877%2016.4375%2011.7164%2016.4375%2012.752V29.252Z'%20stroke='%23136FE8'%20stroke-width='2'%20stroke-miterlimit='10'/%3e%3cpath%20d='M20.1875%2016.4488L21.9683%2014.6681C22.7005%2013.9358%2023.8877%2013.9358%2024.6199%2014.6681L27.2716%2017.3197C28.0038%2018.052%2028.0038%2019.2391%2027.2716%2019.9714L15.3391%2031.9038'%20stroke='%23136FE8'%20stroke-width='2'%20stroke-miterlimit='10'/%3e%3cpath%20d='M26.669%2025.502H29.1875C30.223%2025.502%2031.0625%2026.3414%2031.0625%2027.377V31.127C31.0625%2032.1625%2030.223%2033.002%2029.1875%2033.002H12.6875'%20stroke='%23136FE8'%20stroke-width='2'%20stroke-miterlimit='10'/%3e%3cpath%20d='M11.75%2029.252H13.625'%20stroke='%23136FE8'%20stroke-width='2'%20stroke-miterlimit='10'/%3e%3c/g%3e%3c/g%3e%3crect%20x='26'%20y='0.000488281'%20width='18'%20height='18'%20rx='9'%20fill='%23FFE8C6'/%3e%3cpath%20d='M39.4902%208.20623L38.6403%2012.2095C38.6235%2012.2932%2038.5798%2012.3681%2038.5167%2012.4212C38.4537%2012.4743%2038.3752%2012.5023%2038.2949%2012.5004H31.6756C31.5953%2012.5023%2031.5168%2012.4743%2031.4538%2012.4212C31.3907%2012.3681%2031.347%2012.2932%2031.3302%2012.2095L30.5079%208.20623C30.4941%208.13859%2030.4984%208.06816%2030.5204%208.00302C30.5424%207.93788%2030.5812%207.88067%2030.6323%207.83795C30.6836%207.79508%2030.7451%207.76853%2030.8099%207.76136C30.8747%207.75419%2030.9401%207.7667%2030.9985%207.79744L33.0161%208.83968L34.6881%205.68719C34.7183%205.63051%2034.762%205.58337%2034.8148%205.55057C34.8676%205.51777%2034.9276%205.50049%2034.9887%205.50049C35.0498%205.50049%2035.1098%205.51777%2035.1626%205.55057C35.2154%205.58337%2035.2591%205.63051%2035.2893%205.68719L36.9613%208.84336L38.9927%207.79376C39.0516%207.76051%2039.1181%207.7461%2039.1845%207.75225C39.2508%207.75841%2039.3141%207.78487%2039.3666%207.82845C39.4192%207.87202%2039.4588%207.93087%2039.4807%207.99789C39.5027%208.06491%2039.5059%208.13726%2039.4902%208.20623Z'%20fill='%23FFB240'/%3e%3cdefs%3e%3cclipPath%20id='clip0_916_1420'%3e%3crect%20width='24'%20height='24'%20fill='white'%20transform='translate(7.56%2010)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
  const globalPrivacySvg = "" + new URL("../assets/global-privacy.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const partnerAgencySvg = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.7869%2015.7256H13.9999C13.9999%2015.7256%2017.4529%2015.7326%2017.4999%2015.7256L19.6799%2015.3256C19.9101%2015.2834%2020.1183%2015.1619%2020.2681%2014.9821C20.418%2014.8023%2020.5%2014.5756%2020.4999%2014.3416V8.90757C20.4999%208.70654%2020.4393%208.51018%2020.326%208.3441C20.2128%208.17802%2020.0521%208.04994%2019.8649%207.97657L14.8199%205.99957C14.5712%205.90229%2014.3011%205.87316%2014.0374%205.91517C13.7737%205.95719%2013.526%206.06883%2013.3199%206.23857L9.6549%209.25357C9.51588%209.36738%209.4211%209.52629%209.38702%209.70269C9.35293%209.8791%209.38168%2010.0619%209.46829%2010.2193C9.5549%2010.3767%209.69389%2010.4988%209.86115%2010.5645C10.0284%2010.6301%2010.2134%2010.6351%2010.3839%2010.5786L14.4999%209.22557'%20stroke='%231578F7'%20stroke-linecap='round'%20stroke-linejoin='round'%20/%3e%3cpath%20d='M3.5%2013.7264L6.1%2014.2264L9.685%2017.8114C9.79816%2017.9247%209.93688%2018.0092%2010.0895%2018.0577C10.2421%2018.1063%2010.4042%2018.1175%2010.562%2018.0904L11.062%2018.0034C11.2657%2017.9683%2011.4535%2017.8711%2011.5996%2017.7249C11.7457%2017.5788%2011.843%2017.391%2011.878%2017.1874L12.052%2016.1744L13.761%2015.8794L14.056%2014.1714L15.765%2013.8764L16.059%2012.1674L13.459%209.56737M11.57%207.67837L10.091%206.20037C9.95118%206.06007%209.77285%205.96445%209.57862%205.92564C9.38438%205.88682%209.183%205.90657%209%205.98237L6%207.22637L3.5%207.72637M0.5%206.22637H2.5C2.76522%206.22637%203.01957%206.33172%203.20711%206.51926C3.39464%206.7068%203.5%206.96115%203.5%207.22637V14.2264C3.5%2014.4916%203.39464%2014.7459%203.20711%2014.9335C3.01957%2015.121%202.76522%2015.2264%202.5%2015.2264H0.5V6.22637ZM21.5%207.22637H23.5V16.2264H21.5C21.2348%2016.2264%2020.9804%2016.121%2020.7929%2015.9335C20.6054%2015.7459%2020.5%2015.4916%2020.5%2015.2264V8.22637C20.5%207.96115%2020.6054%207.7068%2020.7929%207.51926C20.9804%207.33172%2021.2348%207.22637%2021.5%207.22637Z'%20stroke='%231578F7'%20stroke-linecap='round'%20stroke-linejoin='round'%20/%3e%3c/svg%3e";
  const partnerAffiliateSvg = "" + new URL("../assets/partner-affiliate.svg", document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" && document.currentScript.src || document.baseURI).href;
  const rocketSvg = "data:image/svg+xml,%3csvg%20width='32'%20height='33'%20viewBox='0%200%2032%2033'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_900_87)'%3e%3cpath%20d='M10.5202%2020.8299L15.139%2023.4966L21.9161%2017.2542C22.8685%2016.3774%2023.5938%2015.2825%2024.0299%2014.0637C24.466%2012.8448%2024.5997%2011.5384%2024.4198%2010.2565L23.6391%204.70196C23.6222%204.58153%2023.5781%204.46653%2023.5102%204.3657C23.4422%204.26487%2023.3521%204.18086%2023.2468%204.12006C23.1415%204.05926%2023.0237%204.02327%2022.9024%204.01482C22.7811%204.00637%2022.6595%204.02568%2022.5467%204.07129L17.3461%206.17246C16.1459%206.65755%2015.0813%207.42664%2014.2438%208.41371C13.4063%209.40078%2012.8208%2010.5764%2012.5377%2011.8395L10.5202%2020.8299ZM10.5202%2020.8299L5.72274%2021.1393C5.72274%2021.1393%206.08%2015.1872%2011.7881%2014.6338M8.52017%2024.294C7.18684%2026.6034%208.82957%2029.0914%208.82957%2029.0914C8.82957%2029.0914%2011.8056%2029.2701%2013.139%2026.9607M20.3687%2019.5878C22.7435%2024.8078%2017.7674%2028.0933%2017.7674%2028.0933L15.6366%2023.7839'%20stroke='%23136FE8'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M16.8297%2015.235C16.2173%2014.8814%2015.7703%2014.299%2015.5873%2013.6158C15.4042%2012.9327%2015.5001%2012.2048%2015.8537%2011.5923C16.2073%2010.9798%2016.7898%2010.5329%2017.4729%2010.3498C18.156%2010.1668%2018.8839%2010.2626%2019.4964%2010.6162C20.1089%2010.9699%2020.5558%2011.5523%2020.7389%2012.2354C20.9219%2012.9186%2020.8261%2013.6465%2020.4725%2014.259C20.1189%2014.8715%2019.5364%2015.3184%2018.8533%2015.5014C18.1701%2015.6845%2017.4422%2015.5887%2016.8297%2015.235Z'%20stroke='%23136FE8'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_900_87'%3e%3crect%20width='32'%20height='32'%20fill='white'%20transform='translate(0%200.5)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
  const assets = {
    popupLayout: popupLayoutSvg,
    layouts: {
      box: layoutBoxSvg,
      classic: layoutClassicBottomSvg,
      banner: layoutBannerSvg,
      popup: layoutPopupSvg,
      center: layoutCenterSvg,
      sidebar: layoutSidebarSvg,
      pushdown: layoutPushdownSvg
    },
    check: checkSvg,
    checkFill: checkFillSvg,
    lang: langSvg,
    reg: regSvg,
    status: statusSvg,
    location: locationSvg,
    addLanguage: addLanguageSvg,
    geoTarget: geoTargetSvg,
    tcfGcm: tcfGcmSvg,
    error: errorSvg,
    success: successSvg,
    warning: warningSvg,
    circleWarning: circleWarningSvg,
    info: infoSvg,
    search: searchSvg,
    timeSchedule: timeScheduleSvg,
    scanNow: scanNowSvg,
    scheduleScan: scheduleScanSvg,
    scanResult: scanResultSvg,
    connectSuccess: connectSuccessSvg,
    affiliateBg: affiliateBgSvg,
    logo: logoSvg,
    sessionExpired: sessionExpiredSvg,
    privacyPolicy: privacyPolicySvg,
    cookiePolicy: cookiePolicySvg,
    starPopular: starSvg,
    infoNew: infoNewSvg,
    gdprUs: gdprUsSvg,
    customTheme: customThemeSvg,
    customLogo: customLogoSvg,
    customIcon: customIconSvg,
    themeIllustration: themeSvg,
    globalPrivacy: globalPrivacySvg,
    partnerAgency: partnerAgencySvg,
    partnerAffiliate: partnerAffiliateSvg,
    rocket: rocketSvg
  };
  if (typeof document !== "undefined") {
    const root2 = document.documentElement;
    root2.style.setProperty("--asset-close", closeSvg);
    root2.style.setProperty("--asset-external", externalSvg);
    root2.style.setProperty("--asset-arrow-right", arrowRightSvg);
    root2.style.setProperty("--asset-arrow-back", arrowBackSvg$1);
    root2.style.setProperty(
      "--cky-breadcrumb-chevron-mask",
      `url(${JSON.stringify(arrowLeftSvg)})`
    );
    root2.style.setProperty("--asset-arrow-bold", arrowBoldSvg);
    root2.style.setProperty("--asset-check", checkSvg);
    root2.style.setProperty("--asset-lang", langSvg);
    root2.style.setProperty("--asset-reg", regSvg);
    root2.style.setProperty("--asset-status", statusSvg);
    root2.style.setProperty("--asset-location", locationSvg);
    root2.style.setProperty("--asset-add-language", addLanguageSvg);
    root2.style.setProperty("--asset-geo-target", geoTargetSvg);
    root2.style.setProperty("--asset-tcf-gcm", tcfGcmSvg);
    root2.style.setProperty("--asset-error", errorSvg);
    root2.style.setProperty("--asset-success", successSvg);
    root2.style.setProperty("--asset-warning", warningSvg);
    root2.style.setProperty("--asset-circle-warning", circleWarningSvg);
    root2.style.setProperty("--asset-info", infoSvg);
    root2.style.setProperty("--asset-connect-success", connectSuccessSvg);
    root2.style.setProperty("--asset-privacy-policy", privacyPolicySvg);
    root2.style.setProperty("--asset-cookie-policy", cookiePolicySvg);
  }
  var react = { exports: {} };
  var react_production = {};
  /**
   * @license React
   * react.production.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  var hasRequiredReact_production;
  function requireReact_production() {
    if (hasRequiredReact_production) return react_production;
    hasRequiredReact_production = 1;
    var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE2 = Symbol.for("react.lazy"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
    function getIteratorFn(maybeIterable) {
      if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
      maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
      return "function" === typeof maybeIterable ? maybeIterable : null;
    }
    __name(getIteratorFn, "getIteratorFn");
    var ReactNoopUpdateQueue = {
      isMounted: /* @__PURE__ */ __name(function() {
        return false;
      }, "isMounted"),
      enqueueForceUpdate: /* @__PURE__ */ __name(function() {
      }, "enqueueForceUpdate"),
      enqueueReplaceState: /* @__PURE__ */ __name(function() {
      }, "enqueueReplaceState"),
      enqueueSetState: /* @__PURE__ */ __name(function() {
      }, "enqueueSetState")
    }, assign = Object.assign, emptyObject = {};
    function Component(props, context, updater) {
      this.props = props;
      this.context = context;
      this.refs = emptyObject;
      this.updater = updater || ReactNoopUpdateQueue;
    }
    __name(Component, "Component");
    Component.prototype.isReactComponent = {};
    Component.prototype.setState = function(partialState, callback) {
      if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
        throw Error(
          "takes an object of state variables to update or a function which returns an object of state variables."
        );
      this.updater.enqueueSetState(this, partialState, callback, "setState");
    };
    Component.prototype.forceUpdate = function(callback) {
      this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
    };
    function ComponentDummy() {
    }
    __name(ComponentDummy, "ComponentDummy");
    ComponentDummy.prototype = Component.prototype;
    function PureComponent(props, context, updater) {
      this.props = props;
      this.context = context;
      this.refs = emptyObject;
      this.updater = updater || ReactNoopUpdateQueue;
    }
    __name(PureComponent, "PureComponent");
    var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
    pureComponentPrototype.constructor = PureComponent;
    assign(pureComponentPrototype, Component.prototype);
    pureComponentPrototype.isPureReactComponent = true;
    var isArrayImpl = Array.isArray, ReactSharedInternals = { H: null, A: null, T: null, S: null, V: null }, hasOwnProperty2 = Object.prototype.hasOwnProperty;
    function ReactElement(type, key, self2, source, owner, props) {
      self2 = props.ref;
      return {
        $$typeof: REACT_ELEMENT_TYPE,
        type,
        key,
        ref: void 0 !== self2 ? self2 : null,
        props
      };
    }
    __name(ReactElement, "ReactElement");
    function cloneAndReplaceKey(oldElement, newKey) {
      return ReactElement(
        oldElement.type,
        newKey,
        void 0,
        void 0,
        void 0,
        oldElement.props
      );
    }
    __name(cloneAndReplaceKey, "cloneAndReplaceKey");
    function isValidElement(object2) {
      return "object" === typeof object2 && null !== object2 && object2.$$typeof === REACT_ELEMENT_TYPE;
    }
    __name(isValidElement, "isValidElement");
    function escape(key) {
      var escaperLookup = { "=": "=0", ":": "=2" };
      return "$" + key.replace(/[=:]/g, function(match) {
        return escaperLookup[match];
      });
    }
    __name(escape, "escape");
    var userProvidedKeyEscapeRegex = /\/+/g;
    function getElementKey(element, index2) {
      return "object" === typeof element && null !== element && null != element.key ? escape("" + element.key) : index2.toString(36);
    }
    __name(getElementKey, "getElementKey");
    function noop$12() {
    }
    __name(noop$12, "noop$1");
    function resolveThenable(thenable) {
      switch (thenable.status) {
        case "fulfilled":
          return thenable.value;
        case "rejected":
          throw thenable.reason;
        default:
          switch ("string" === typeof thenable.status ? thenable.then(noop$12, noop$12) : (thenable.status = "pending", thenable.then(
            function(fulfilledValue) {
              "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
            },
            function(error) {
              "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
            }
          )), thenable.status) {
            case "fulfilled":
              return thenable.value;
            case "rejected":
              throw thenable.reason;
          }
      }
      throw thenable;
    }
    __name(resolveThenable, "resolveThenable");
    function mapIntoArray(children, array2, escapedPrefix, nameSoFar, callback) {
      var type = typeof children;
      if ("undefined" === type || "boolean" === type) children = null;
      var invokeCallback = false;
      if (null === children) invokeCallback = true;
      else
        switch (type) {
          case "bigint":
          case "string":
          case "number":
            invokeCallback = true;
            break;
          case "object":
            switch (children.$$typeof) {
              case REACT_ELEMENT_TYPE:
              case REACT_PORTAL_TYPE:
                invokeCallback = true;
                break;
              case REACT_LAZY_TYPE2:
                return invokeCallback = children._init, mapIntoArray(
                  invokeCallback(children._payload),
                  array2,
                  escapedPrefix,
                  nameSoFar,
                  callback
                );
            }
        }
      if (invokeCallback)
        return callback = callback(children), invokeCallback = "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar, isArrayImpl(callback) ? (escapedPrefix = "", null != invokeCallback && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array2, escapedPrefix, "", function(c2) {
          return c2;
        })) : null != callback && (isValidElement(callback) && (callback = cloneAndReplaceKey(
          callback,
          escapedPrefix + (null == callback.key || children && children.key === callback.key ? "" : ("" + callback.key).replace(
            userProvidedKeyEscapeRegex,
            "$&/"
          ) + "/") + invokeCallback
        )), array2.push(callback)), 1;
      invokeCallback = 0;
      var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";
      if (isArrayImpl(children))
        for (var i2 = 0; i2 < children.length; i2++)
          nameSoFar = children[i2], type = nextNamePrefix + getElementKey(nameSoFar, i2), invokeCallback += mapIntoArray(
            nameSoFar,
            array2,
            escapedPrefix,
            type,
            callback
          );
      else if (i2 = getIteratorFn(children), "function" === typeof i2)
        for (children = i2.call(children), i2 = 0; !(nameSoFar = children.next()).done; )
          nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i2++), invokeCallback += mapIntoArray(
            nameSoFar,
            array2,
            escapedPrefix,
            type,
            callback
          );
      else if ("object" === type) {
        if ("function" === typeof children.then)
          return mapIntoArray(
            resolveThenable(children),
            array2,
            escapedPrefix,
            nameSoFar,
            callback
          );
        array2 = String(children);
        throw Error(
          "Objects are not valid as a React child (found: " + ("[object Object]" === array2 ? "object with keys {" + Object.keys(children).join(", ") + "}" : array2) + "). If you meant to render a collection of children, use an array instead."
        );
      }
      return invokeCallback;
    }
    __name(mapIntoArray, "mapIntoArray");
    function mapChildren(children, func, context) {
      if (null == children) return children;
      var result = [], count2 = 0;
      mapIntoArray(children, result, "", "", function(child) {
        return func.call(context, child, count2++);
      });
      return result;
    }
    __name(mapChildren, "mapChildren");
    function lazyInitializer(payload) {
      if (-1 === payload._status) {
        var ctor = payload._result;
        ctor = ctor();
        ctor.then(
          function(moduleObject) {
            if (0 === payload._status || -1 === payload._status)
              payload._status = 1, payload._result = moduleObject;
          },
          function(error) {
            if (0 === payload._status || -1 === payload._status)
              payload._status = 2, payload._result = error;
          }
        );
        -1 === payload._status && (payload._status = 0, payload._result = ctor);
      }
      if (1 === payload._status) return payload._result.default;
      throw payload._result;
    }
    __name(lazyInitializer, "lazyInitializer");
    var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
      if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
        var event = new window.ErrorEvent("error", {
          bubbles: true,
          cancelable: true,
          message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
          error
        });
        if (!window.dispatchEvent(event)) return;
      } else if ("object" === typeof process && "function" === typeof process.emit) {
        process.emit("uncaughtException", error);
        return;
      }
      console.error(error);
    };
    function noop2() {
    }
    __name(noop2, "noop");
    react_production.Children = {
      map: mapChildren,
      forEach: /* @__PURE__ */ __name(function(children, forEachFunc, forEachContext) {
        mapChildren(
          children,
          function() {
            forEachFunc.apply(this, arguments);
          },
          forEachContext
        );
      }, "forEach"),
      count: /* @__PURE__ */ __name(function(children) {
        var n2 = 0;
        mapChildren(children, function() {
          n2++;
        });
        return n2;
      }, "count"),
      toArray: /* @__PURE__ */ __name(function(children) {
        return mapChildren(children, function(child) {
          return child;
        }) || [];
      }, "toArray"),
      only: /* @__PURE__ */ __name(function(children) {
        if (!isValidElement(children))
          throw Error(
            "React.Children.only expected to receive a single React element child."
          );
        return children;
      }, "only")
    };
    react_production.Component = Component;
    react_production.Fragment = REACT_FRAGMENT_TYPE;
    react_production.Profiler = REACT_PROFILER_TYPE;
    react_production.PureComponent = PureComponent;
    react_production.StrictMode = REACT_STRICT_MODE_TYPE;
    react_production.Suspense = REACT_SUSPENSE_TYPE;
    react_production.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
    react_production.__COMPILER_RUNTIME = {
      __proto__: null,
      c: /* @__PURE__ */ __name(function(size2) {
        return ReactSharedInternals.H.useMemoCache(size2);
      }, "c")
    };
    react_production.cache = function(fn) {
      return function() {
        return fn.apply(null, arguments);
      };
    };
    react_production.cloneElement = function(element, config2, children) {
      if (null === element || void 0 === element)
        throw Error(
          "The argument must be a React element, but you passed " + element + "."
        );
      var props = assign({}, element.props), key = element.key, owner = void 0;
      if (null != config2)
        for (propName in void 0 !== config2.ref && (owner = void 0), void 0 !== config2.key && (key = "" + config2.key), config2)
          !hasOwnProperty2.call(config2, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config2.ref || (props[propName] = config2[propName]);
      var propName = arguments.length - 2;
      if (1 === propName) props.children = children;
      else if (1 < propName) {
        for (var childArray = Array(propName), i2 = 0; i2 < propName; i2++)
          childArray[i2] = arguments[i2 + 2];
        props.children = childArray;
      }
      return ReactElement(element.type, key, void 0, void 0, owner, props);
    };
    react_production.createContext = function(defaultValue) {
      defaultValue = {
        $$typeof: REACT_CONTEXT_TYPE,
        _currentValue: defaultValue,
        _currentValue2: defaultValue,
        _threadCount: 0,
        Provider: null,
        Consumer: null
      };
      defaultValue.Provider = defaultValue;
      defaultValue.Consumer = {
        $$typeof: REACT_CONSUMER_TYPE,
        _context: defaultValue
      };
      return defaultValue;
    };
    react_production.createElement = function(type, config2, children) {
      var propName, props = {}, key = null;
      if (null != config2)
        for (propName in void 0 !== config2.key && (key = "" + config2.key), config2)
          hasOwnProperty2.call(config2, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (props[propName] = config2[propName]);
      var childrenLength = arguments.length - 2;
      if (1 === childrenLength) props.children = children;
      else if (1 < childrenLength) {
        for (var childArray = Array(childrenLength), i2 = 0; i2 < childrenLength; i2++)
          childArray[i2] = arguments[i2 + 2];
        props.children = childArray;
      }
      if (type && type.defaultProps)
        for (propName in childrenLength = type.defaultProps, childrenLength)
          void 0 === props[propName] && (props[propName] = childrenLength[propName]);
      return ReactElement(type, key, void 0, void 0, null, props);
    };
    react_production.createRef = function() {
      return { current: null };
    };
    react_production.forwardRef = function(render) {
      return { $$typeof: REACT_FORWARD_REF_TYPE, render };
    };
    react_production.isValidElement = isValidElement;
    react_production.lazy = function(ctor) {
      return {
        $$typeof: REACT_LAZY_TYPE2,
        _payload: { _status: -1, _result: ctor },
        _init: lazyInitializer
      };
    };
    react_production.memo = function(type, compare) {
      return {
        $$typeof: REACT_MEMO_TYPE,
        type,
        compare: void 0 === compare ? null : compare
      };
    };
    react_production.startTransition = function(scope) {
      var prevTransition = ReactSharedInternals.T, currentTransition = {};
      ReactSharedInternals.T = currentTransition;
      try {
        var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
        null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
        "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && returnValue.then(noop2, reportGlobalError);
      } catch (error) {
        reportGlobalError(error);
      } finally {
        ReactSharedInternals.T = prevTransition;
      }
    };
    react_production.unstable_useCacheRefresh = function() {
      return ReactSharedInternals.H.useCacheRefresh();
    };
    react_production.use = function(usable) {
      return ReactSharedInternals.H.use(usable);
    };
    react_production.useActionState = function(action, initialState, permalink) {
      return ReactSharedInternals.H.useActionState(action, initialState, permalink);
    };
    react_production.useCallback = function(callback, deps) {
      return ReactSharedInternals.H.useCallback(callback, deps);
    };
    react_production.useContext = function(Context) {
      return ReactSharedInternals.H.useContext(Context);
    };
    react_production.useDebugValue = function() {
    };
    react_production.useDeferredValue = function(value, initialValue) {
      return ReactSharedInternals.H.useDeferredValue(value, initialValue);
    };
    react_production.useEffect = function(create2, createDeps, update) {
      var dispatcher = ReactSharedInternals.H;
      if ("function" === typeof update)
        throw Error(
          "useEffect CRUD overload is not enabled in this build of React."
        );
      return dispatcher.useEffect(create2, createDeps);
    };
    react_production.useId = function() {
      return ReactSharedInternals.H.useId();
    };
    react_production.useImperativeHandle = function(ref, create2, deps) {
      return ReactSharedInternals.H.useImperativeHandle(ref, create2, deps);
    };
    react_production.useInsertionEffect = function(create2, deps) {
      return ReactSharedInternals.H.useInsertionEffect(create2, deps);
    };
    react_production.useLayoutEffect = function(create2, deps) {
      return ReactSharedInternals.H.useLayoutEffect(create2, deps);
    };
    react_production.useMemo = function(create2, deps) {
      return ReactSharedInternals.H.useMemo(create2, deps);
    };
    react_production.useOptimistic = function(passthrough, reducer) {
      return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
    };
    react_production.useReducer = function(reducer, initialArg, init) {
      return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
    };
    react_production.useRef = function(initialValue) {
      return ReactSharedInternals.H.useRef(initialValue);
    };
    react_production.useState = function(initialState) {
      return ReactSharedInternals.H.useState(initialState);
    };
    react_production.useSyncExternalStore = function(subscribe2, getSnapshot, getServerSnapshot) {
      return ReactSharedInternals.H.useSyncExternalStore(
        subscribe2,
        getSnapshot,
        getServerSnapshot
      );
    };
    react_production.useTransition = function() {
      return ReactSharedInternals.H.useTransition();
    };
    react_production.version = "19.1.1";
    return react_production;
  }
  __name(requireReact_production, "requireReact_production");
  var hasRequiredReact;
  function requireReact() {
    if (hasRequiredReact) return react.exports;
    hasRequiredReact = 1;
    {
      react.exports = requireReact_production();
    }
    return react.exports;
  }
  __name(requireReact, "requireReact");
  var reactExports = requireReact();
  const React = /* @__PURE__ */ getDefaultExportFromCjs(reactExports);
  const React$1 = /* @__PURE__ */ _mergeNamespaces({
    __proto__: null,
    default: React
  }, [reactExports]);
  var client = { exports: {} };
  var reactDomClient_production = {};
  var scheduler = { exports: {} };
  var scheduler_production = {};
  /**
   * @license React
   * scheduler.production.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  var hasRequiredScheduler_production;
  function requireScheduler_production() {
    if (hasRequiredScheduler_production) return scheduler_production;
    hasRequiredScheduler_production = 1;
    (function(exports2) {
      function push(heap, node) {
        var index2 = heap.length;
        heap.push(node);
        a: for (; 0 < index2; ) {
          var parentIndex = index2 - 1 >>> 1, parent = heap[parentIndex];
          if (0 < compare(parent, node))
            heap[parentIndex] = node, heap[index2] = parent, index2 = parentIndex;
          else break a;
        }
      }
      __name(push, "push");
      function peek(heap) {
        return 0 === heap.length ? null : heap[0];
      }
      __name(peek, "peek");
      function pop(heap) {
        if (0 === heap.length) return null;
        var first = heap[0], last2 = heap.pop();
        if (last2 !== first) {
          heap[0] = last2;
          a: for (var index2 = 0, length = heap.length, halfLength = length >>> 1; index2 < halfLength; ) {
            var leftIndex = 2 * (index2 + 1) - 1, left = heap[leftIndex], rightIndex = leftIndex + 1, right = heap[rightIndex];
            if (0 > compare(left, last2))
              rightIndex < length && 0 > compare(right, left) ? (heap[index2] = right, heap[rightIndex] = last2, index2 = rightIndex) : (heap[index2] = left, heap[leftIndex] = last2, index2 = leftIndex);
            else if (rightIndex < length && 0 > compare(right, last2))
              heap[index2] = right, heap[rightIndex] = last2, index2 = rightIndex;
            else break a;
          }
        }
        return first;
      }
      __name(pop, "pop");
      function compare(a2, b) {
        var diff = a2.sortIndex - b.sortIndex;
        return 0 !== diff ? diff : a2.id - b.id;
      }
      __name(compare, "compare");
      exports2.unstable_now = void 0;
      if ("object" === typeof performance && "function" === typeof performance.now) {
        var localPerformance = performance;
        exports2.unstable_now = function() {
          return localPerformance.now();
        };
      } else {
        var localDate2 = Date, initialTime = localDate2.now();
        exports2.unstable_now = function() {
          return localDate2.now() - initialTime;
        };
      }
      var taskQueue = [], timerQueue = [], taskIdCounter = 1, currentTask = null, currentPriorityLevel = 3, isPerformingWork = false, isHostCallbackScheduled = false, isHostTimeoutScheduled = false, needsPaint = false, localSetTimeout = "function" === typeof setTimeout ? setTimeout : null, localClearTimeout = "function" === typeof clearTimeout ? clearTimeout : null, localSetImmediate = "undefined" !== typeof setImmediate ? setImmediate : null;
      function advanceTimers(currentTime) {
        for (var timer = peek(timerQueue); null !== timer; ) {
          if (null === timer.callback) pop(timerQueue);
          else if (timer.startTime <= currentTime)
            pop(timerQueue), timer.sortIndex = timer.expirationTime, push(taskQueue, timer);
          else break;
          timer = peek(timerQueue);
        }
      }
      __name(advanceTimers, "advanceTimers");
      function handleTimeout(currentTime) {
        isHostTimeoutScheduled = false;
        advanceTimers(currentTime);
        if (!isHostCallbackScheduled)
          if (null !== peek(taskQueue))
            isHostCallbackScheduled = true, isMessageLoopRunning || (isMessageLoopRunning = true, schedulePerformWorkUntilDeadline());
          else {
            var firstTimer = peek(timerQueue);
            null !== firstTimer && requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
          }
      }
      __name(handleTimeout, "handleTimeout");
      var isMessageLoopRunning = false, taskTimeoutID = -1, frameInterval = 5, startTime = -1;
      function shouldYieldToHost() {
        return needsPaint ? true : exports2.unstable_now() - startTime < frameInterval ? false : true;
      }
      __name(shouldYieldToHost, "shouldYieldToHost");
      function performWorkUntilDeadline() {
        needsPaint = false;
        if (isMessageLoopRunning) {
          var currentTime = exports2.unstable_now();
          startTime = currentTime;
          var hasMoreWork = true;
          try {
            a: {
              isHostCallbackScheduled = false;
              isHostTimeoutScheduled && (isHostTimeoutScheduled = false, localClearTimeout(taskTimeoutID), taskTimeoutID = -1);
              isPerformingWork = true;
              var previousPriorityLevel = currentPriorityLevel;
              try {
                b: {
                  advanceTimers(currentTime);
                  for (currentTask = peek(taskQueue); null !== currentTask && !(currentTask.expirationTime > currentTime && shouldYieldToHost()); ) {
                    var callback = currentTask.callback;
                    if ("function" === typeof callback) {
                      currentTask.callback = null;
                      currentPriorityLevel = currentTask.priorityLevel;
                      var continuationCallback = callback(
                        currentTask.expirationTime <= currentTime
                      );
                      currentTime = exports2.unstable_now();
                      if ("function" === typeof continuationCallback) {
                        currentTask.callback = continuationCallback;
                        advanceTimers(currentTime);
                        hasMoreWork = true;
                        break b;
                      }
                      currentTask === peek(taskQueue) && pop(taskQueue);
                      advanceTimers(currentTime);
                    } else pop(taskQueue);
                    currentTask = peek(taskQueue);
                  }
                  if (null !== currentTask) hasMoreWork = true;
                  else {
                    var firstTimer = peek(timerQueue);
                    null !== firstTimer && requestHostTimeout(
                      handleTimeout,
                      firstTimer.startTime - currentTime
                    );
                    hasMoreWork = false;
                  }
                }
                break a;
              } finally {
                currentTask = null, currentPriorityLevel = previousPriorityLevel, isPerformingWork = false;
              }
              hasMoreWork = void 0;
            }
          } finally {
            hasMoreWork ? schedulePerformWorkUntilDeadline() : isMessageLoopRunning = false;
          }
        }
      }
      __name(performWorkUntilDeadline, "performWorkUntilDeadline");
      var schedulePerformWorkUntilDeadline;
      if ("function" === typeof localSetImmediate)
        schedulePerformWorkUntilDeadline = /* @__PURE__ */ __name(function() {
          localSetImmediate(performWorkUntilDeadline);
        }, "schedulePerformWorkUntilDeadline");
      else if ("undefined" !== typeof MessageChannel) {
        var channel = new MessageChannel(), port = channel.port2;
        channel.port1.onmessage = performWorkUntilDeadline;
        schedulePerformWorkUntilDeadline = /* @__PURE__ */ __name(function() {
          port.postMessage(null);
        }, "schedulePerformWorkUntilDeadline");
      } else
        schedulePerformWorkUntilDeadline = /* @__PURE__ */ __name(function() {
          localSetTimeout(performWorkUntilDeadline, 0);
        }, "schedulePerformWorkUntilDeadline");
      function requestHostTimeout(callback, ms) {
        taskTimeoutID = localSetTimeout(function() {
          callback(exports2.unstable_now());
        }, ms);
      }
      __name(requestHostTimeout, "requestHostTimeout");
      exports2.unstable_IdlePriority = 5;
      exports2.unstable_ImmediatePriority = 1;
      exports2.unstable_LowPriority = 4;
      exports2.unstable_NormalPriority = 3;
      exports2.unstable_Profiling = null;
      exports2.unstable_UserBlockingPriority = 2;
      exports2.unstable_cancelCallback = function(task) {
        task.callback = null;
      };
      exports2.unstable_forceFrameRate = function(fps) {
        0 > fps || 125 < fps ? console.error(
          "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"
        ) : frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5;
      };
      exports2.unstable_getCurrentPriorityLevel = function() {
        return currentPriorityLevel;
      };
      exports2.unstable_next = function(eventHandler) {
        switch (currentPriorityLevel) {
          case 1:
          case 2:
          case 3:
            var priorityLevel = 3;
            break;
          default:
            priorityLevel = currentPriorityLevel;
        }
        var previousPriorityLevel = currentPriorityLevel;
        currentPriorityLevel = priorityLevel;
        try {
          return eventHandler();
        } finally {
          currentPriorityLevel = previousPriorityLevel;
        }
      };
      exports2.unstable_requestPaint = function() {
        needsPaint = true;
      };
      exports2.unstable_runWithPriority = function(priorityLevel, eventHandler) {
        switch (priorityLevel) {
          case 1:
          case 2:
          case 3:
          case 4:
          case 5:
            break;
          default:
            priorityLevel = 3;
        }
        var previousPriorityLevel = currentPriorityLevel;
        currentPriorityLevel = priorityLevel;
        try {
          return eventHandler();
        } finally {
          currentPriorityLevel = previousPriorityLevel;
        }
      };
      exports2.unstable_scheduleCallback = function(priorityLevel, callback, options2) {
        var currentTime = exports2.unstable_now();
        "object" === typeof options2 && null !== options2 ? (options2 = options2.delay, options2 = "number" === typeof options2 && 0 < options2 ? currentTime + options2 : currentTime) : options2 = currentTime;
        switch (priorityLevel) {
          case 1:
            var timeout = -1;
            break;
          case 2:
            timeout = 250;
            break;
          case 5:
            timeout = 1073741823;
            break;
          case 4:
            timeout = 1e4;
            break;
          default:
            timeout = 5e3;
        }
        timeout = options2 + timeout;
        priorityLevel = {
          id: taskIdCounter++,
          callback,
          priorityLevel,
          startTime: options2,
          expirationTime: timeout,
          sortIndex: -1
        };
        options2 > currentTime ? (priorityLevel.sortIndex = options2, push(timerQueue, priorityLevel), null === peek(taskQueue) && priorityLevel === peek(timerQueue) && (isHostTimeoutScheduled ? (localClearTimeout(taskTimeoutID), taskTimeoutID = -1) : isHostTimeoutScheduled = true, requestHostTimeout(handleTimeout, options2 - currentTime))) : (priorityLevel.sortIndex = timeout, push(taskQueue, priorityLevel), isHostCallbackScheduled || isPerformingWork || (isHostCallbackScheduled = true, isMessageLoopRunning || (isMessageLoopRunning = true, schedulePerformWorkUntilDeadline())));
        return priorityLevel;
      };
      exports2.unstable_shouldYield = shouldYieldToHost;
      exports2.unstable_wrapCallback = function(callback) {
        var parentPriorityLevel = currentPriorityLevel;
        return function() {
          var previousPriorityLevel = currentPriorityLevel;
          currentPriorityLevel = parentPriorityLevel;
          try {
            return callback.apply(this, arguments);
          } finally {
            currentPriorityLevel = previousPriorityLevel;
          }
        };
      };
    })(scheduler_production);
    return scheduler_production;
  }
  __name(requireScheduler_production, "requireScheduler_production");
  var hasRequiredScheduler;
  function requireScheduler() {
    if (hasRequiredScheduler) return scheduler.exports;
    hasRequiredScheduler = 1;
    {
      scheduler.exports = requireScheduler_production();
    }
    return scheduler.exports;
  }
  __name(requireScheduler, "requireScheduler");
  var reactDom = { exports: {} };
  var reactDom_production = {};
  /**
   * @license React
   * react-dom.production.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  var hasRequiredReactDom_production;
  function requireReactDom_production() {
    if (hasRequiredReactDom_production) return reactDom_production;
    hasRequiredReactDom_production = 1;
    var React2 = requireReact();
    function formatProdErrorMessage(code) {
      var url = "https://react.dev/errors/" + code;
      if (1 < arguments.length) {
        url += "?args[]=" + encodeURIComponent(arguments[1]);
        for (var i2 = 2; i2 < arguments.length; i2++)
          url += "&args[]=" + encodeURIComponent(arguments[i2]);
      }
      return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
    }
    __name(formatProdErrorMessage, "formatProdErrorMessage");
    function noop2() {
    }
    __name(noop2, "noop");
    var Internals = {
      d: {
        f: noop2,
        r: /* @__PURE__ */ __name(function() {
          throw Error(formatProdErrorMessage(522));
        }, "r"),
        D: noop2,
        C: noop2,
        L: noop2,
        m: noop2,
        X: noop2,
        S: noop2,
        M: noop2
      },
      p: 0,
      findDOMNode: null
    }, REACT_PORTAL_TYPE = Symbol.for("react.portal");
    function createPortal$1(children, containerInfo, implementation) {
      var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
      return {
        $$typeof: REACT_PORTAL_TYPE,
        key: null == key ? null : "" + key,
        children,
        containerInfo,
        implementation
      };
    }
    __name(createPortal$1, "createPortal$1");
    var ReactSharedInternals = React2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
    function getCrossOriginStringAs(as, input) {
      if ("font" === as) return "";
      if ("string" === typeof input)
        return "use-credentials" === input ? input : "";
    }
    __name(getCrossOriginStringAs, "getCrossOriginStringAs");
    reactDom_production.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
    reactDom_production.createPortal = function(children, container) {
      var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
      if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
        throw Error(formatProdErrorMessage(299));
      return createPortal$1(children, container, null, key);
    };
    reactDom_production.flushSync = function(fn) {
      var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
      try {
        if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn();
      } finally {
        ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f();
      }
    };
    reactDom_production.preconnect = function(href, options2) {
      "string" === typeof href && (options2 ? (options2 = options2.crossOrigin, options2 = "string" === typeof options2 ? "use-credentials" === options2 ? options2 : "" : void 0) : options2 = null, Internals.d.C(href, options2));
    };
    reactDom_production.prefetchDNS = function(href) {
      "string" === typeof href && Internals.d.D(href);
    };
    reactDom_production.preinit = function(href, options2) {
      if ("string" === typeof href && options2 && "string" === typeof options2.as) {
        var as = options2.as, crossOrigin = getCrossOriginStringAs(as, options2.crossOrigin), integrity = "string" === typeof options2.integrity ? options2.integrity : void 0, fetchPriority = "string" === typeof options2.fetchPriority ? options2.fetchPriority : void 0;
        "style" === as ? Internals.d.S(
          href,
          "string" === typeof options2.precedence ? options2.precedence : void 0,
          {
            crossOrigin,
            integrity,
            fetchPriority
          }
        ) : "script" === as && Internals.d.X(href, {
          crossOrigin,
          integrity,
          fetchPriority,
          nonce: "string" === typeof options2.nonce ? options2.nonce : void 0
        });
      }
    };
    reactDom_production.preinitModule = function(href, options2) {
      if ("string" === typeof href)
        if ("object" === typeof options2 && null !== options2) {
          if (null == options2.as || "script" === options2.as) {
            var crossOrigin = getCrossOriginStringAs(
              options2.as,
              options2.crossOrigin
            );
            Internals.d.M(href, {
              crossOrigin,
              integrity: "string" === typeof options2.integrity ? options2.integrity : void 0,
              nonce: "string" === typeof options2.nonce ? options2.nonce : void 0
            });
          }
        } else null == options2 && Internals.d.M(href);
    };
    reactDom_production.preload = function(href, options2) {
      if ("string" === typeof href && "object" === typeof options2 && null !== options2 && "string" === typeof options2.as) {
        var as = options2.as, crossOrigin = getCrossOriginStringAs(as, options2.crossOrigin);
        Internals.d.L(href, as, {
          crossOrigin,
          integrity: "string" === typeof options2.integrity ? options2.integrity : void 0,
          nonce: "string" === typeof options2.nonce ? options2.nonce : void 0,
          type: "string" === typeof options2.type ? options2.type : void 0,
          fetchPriority: "string" === typeof options2.fetchPriority ? options2.fetchPriority : void 0,
          referrerPolicy: "string" === typeof options2.referrerPolicy ? options2.referrerPolicy : void 0,
          imageSrcSet: "string" === typeof options2.imageSrcSet ? options2.imageSrcSet : void 0,
          imageSizes: "string" === typeof options2.imageSizes ? options2.imageSizes : void 0,
          media: "string" === typeof options2.media ? options2.media : void 0
        });
      }
    };
    reactDom_production.preloadModule = function(href, options2) {
      if ("string" === typeof href)
        if (options2) {
          var crossOrigin = getCrossOriginStringAs(options2.as, options2.crossOrigin);
          Internals.d.m(href, {
            as: "string" === typeof options2.as && "script" !== options2.as ? options2.as : void 0,
            crossOrigin,
            integrity: "string" === typeof options2.integrity ? options2.integrity : void 0
          });
        } else Internals.d.m(href);
    };
    reactDom_production.requestFormReset = function(form) {
      Internals.d.r(form);
    };
    reactDom_production.unstable_batchedUpdates = function(fn, a2) {
      return fn(a2);
    };
    reactDom_production.useFormState = function(action, initialState, permalink) {
      return ReactSharedInternals.H.useFormState(action, initialState, permalink);
    };
    reactDom_production.useFormStatus = function() {
      return ReactSharedInternals.H.useHostTransitionStatus();
    };
    reactDom_production.version = "19.1.1";
    return reactDom_production;
  }
  __name(requireReactDom_production, "requireReactDom_production");
  var hasRequiredReactDom;
  function requireReactDom() {
    if (hasRequiredReactDom) return reactDom.exports;
    hasRequiredReactDom = 1;
    function checkDCE() {
      if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
        return;
      }
      try {
        __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
      } catch (err) {
        console.error(err);
      }
    }
    __name(checkDCE, "checkDCE");
    {
      checkDCE();
      reactDom.exports = requireReactDom_production();
    }
    return reactDom.exports;
  }
  __name(requireReactDom, "requireReactDom");
  /**
   * @license React
   * react-dom-client.production.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  var hasRequiredReactDomClient_production;
  function requireReactDomClient_production() {
    if (hasRequiredReactDomClient_production) return reactDomClient_production;
    hasRequiredReactDomClient_production = 1;
    var Scheduler = requireScheduler(), React2 = requireReact(), ReactDOM2 = requireReactDom();
    function formatProdErrorMessage(code) {
      var url = "https://react.dev/errors/" + code;
      if (1 < arguments.length) {
        url += "?args[]=" + encodeURIComponent(arguments[1]);
        for (var i2 = 2; i2 < arguments.length; i2++)
          url += "&args[]=" + encodeURIComponent(arguments[i2]);
      }
      return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
    }
    __name(formatProdErrorMessage, "formatProdErrorMessage");
    function isValidContainer(node) {
      return !(!node || 1 !== node.nodeType && 9 !== node.nodeType && 11 !== node.nodeType);
    }
    __name(isValidContainer, "isValidContainer");
    function getNearestMountedFiber(fiber) {
      var node = fiber, nearestMounted = fiber;
      if (fiber.alternate) for (; node.return; ) node = node.return;
      else {
        fiber = node;
        do
          node = fiber, 0 !== (node.flags & 4098) && (nearestMounted = node.return), fiber = node.return;
        while (fiber);
      }
      return 3 === node.tag ? nearestMounted : null;
    }
    __name(getNearestMountedFiber, "getNearestMountedFiber");
    function getSuspenseInstanceFromFiber(fiber) {
      if (13 === fiber.tag) {
        var suspenseState = fiber.memoizedState;
        null === suspenseState && (fiber = fiber.alternate, null !== fiber && (suspenseState = fiber.memoizedState));
        if (null !== suspenseState) return suspenseState.dehydrated;
      }
      return null;
    }
    __name(getSuspenseInstanceFromFiber, "getSuspenseInstanceFromFiber");
    function assertIsMounted(fiber) {
      if (getNearestMountedFiber(fiber) !== fiber)
        throw Error(formatProdErrorMessage(188));
    }
    __name(assertIsMounted, "assertIsMounted");
    function findCurrentFiberUsingSlowPath(fiber) {
      var alternate = fiber.alternate;
      if (!alternate) {
        alternate = getNearestMountedFiber(fiber);
        if (null === alternate) throw Error(formatProdErrorMessage(188));
        return alternate !== fiber ? null : fiber;
      }
      for (var a2 = fiber, b = alternate; ; ) {
        var parentA = a2.return;
        if (null === parentA) break;
        var parentB = parentA.alternate;
        if (null === parentB) {
          b = parentA.return;
          if (null !== b) {
            a2 = b;
            continue;
          }
          break;
        }
        if (parentA.child === parentB.child) {
          for (parentB = parentA.child; parentB; ) {
            if (parentB === a2) return assertIsMounted(parentA), fiber;
            if (parentB === b) return assertIsMounted(parentA), alternate;
            parentB = parentB.sibling;
          }
          throw Error(formatProdErrorMessage(188));
        }
        if (a2.return !== b.return) a2 = parentA, b = parentB;
        else {
          for (var didFindChild = false, child$0 = parentA.child; child$0; ) {
            if (child$0 === a2) {
              didFindChild = true;
              a2 = parentA;
              b = parentB;
              break;
            }
            if (child$0 === b) {
              didFindChild = true;
              b = parentA;
              a2 = parentB;
              break;
            }
            child$0 = child$0.sibling;
          }
          if (!didFindChild) {
            for (child$0 = parentB.child; child$0; ) {
              if (child$0 === a2) {
                didFindChild = true;
                a2 = parentB;
                b = parentA;
                break;
              }
              if (child$0 === b) {
                didFindChild = true;
                b = parentB;
                a2 = parentA;
                break;
              }
              child$0 = child$0.sibling;
            }
            if (!didFindChild) throw Error(formatProdErrorMessage(189));
          }
        }
        if (a2.alternate !== b) throw Error(formatProdErrorMessage(190));
      }
      if (3 !== a2.tag) throw Error(formatProdErrorMessage(188));
      return a2.stateNode.current === a2 ? fiber : alternate;
    }
    __name(findCurrentFiberUsingSlowPath, "findCurrentFiberUsingSlowPath");
    function findCurrentHostFiberImpl(node) {
      var tag = node.tag;
      if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return node;
      for (node = node.child; null !== node; ) {
        tag = findCurrentHostFiberImpl(node);
        if (null !== tag) return tag;
        node = node.sibling;
      }
      return null;
    }
    __name(findCurrentHostFiberImpl, "findCurrentHostFiberImpl");
    var assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = Symbol.for("react.provider"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE2 = Symbol.for("react.lazy");
    var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
    var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
    var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
    function getIteratorFn(maybeIterable) {
      if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
      maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
      return "function" === typeof maybeIterable ? maybeIterable : null;
    }
    __name(getIteratorFn, "getIteratorFn");
    var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
    function getComponentNameFromType(type) {
      if (null == type) return null;
      if ("function" === typeof type)
        return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
      if ("string" === typeof type) return type;
      switch (type) {
        case REACT_FRAGMENT_TYPE:
          return "Fragment";
        case REACT_PROFILER_TYPE:
          return "Profiler";
        case REACT_STRICT_MODE_TYPE:
          return "StrictMode";
        case REACT_SUSPENSE_TYPE:
          return "Suspense";
        case REACT_SUSPENSE_LIST_TYPE:
          return "SuspenseList";
        case REACT_ACTIVITY_TYPE:
          return "Activity";
      }
      if ("object" === typeof type)
        switch (type.$$typeof) {
          case REACT_PORTAL_TYPE:
            return "Portal";
          case REACT_CONTEXT_TYPE:
            return (type.displayName || "Context") + ".Provider";
          case REACT_CONSUMER_TYPE:
            return (type._context.displayName || "Context") + ".Consumer";
          case REACT_FORWARD_REF_TYPE:
            var innerType = type.render;
            type = type.displayName;
            type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
            return type;
          case REACT_MEMO_TYPE:
            return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
          case REACT_LAZY_TYPE2:
            innerType = type._payload;
            type = type._init;
            try {
              return getComponentNameFromType(type(innerType));
            } catch (x2) {
            }
        }
      return null;
    }
    __name(getComponentNameFromType, "getComponentNameFromType");
    var isArrayImpl = Array.isArray, ReactSharedInternals = React2.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ReactDOMSharedInternals = ReactDOM2.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, sharedNotPendingObject = {
      pending: false,
      data: null,
      method: null,
      action: null
    }, valueStack = [], index2 = -1;
    function createCursor(defaultValue) {
      return { current: defaultValue };
    }
    __name(createCursor, "createCursor");
    function pop(cursor) {
      0 > index2 || (cursor.current = valueStack[index2], valueStack[index2] = null, index2--);
    }
    __name(pop, "pop");
    function push(cursor, value) {
      index2++;
      valueStack[index2] = cursor.current;
      cursor.current = value;
    }
    __name(push, "push");
    var contextStackCursor = createCursor(null), contextFiberStackCursor = createCursor(null), rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null);
    function pushHostContainer(fiber, nextRootInstance) {
      push(rootInstanceStackCursor, nextRootInstance);
      push(contextFiberStackCursor, fiber);
      push(contextStackCursor, null);
      switch (nextRootInstance.nodeType) {
        case 9:
        case 11:
          fiber = (fiber = nextRootInstance.documentElement) ? (fiber = fiber.namespaceURI) ? getOwnHostContext(fiber) : 0 : 0;
          break;
        default:
          if (fiber = nextRootInstance.tagName, nextRootInstance = nextRootInstance.namespaceURI)
            nextRootInstance = getOwnHostContext(nextRootInstance), fiber = getChildHostContextProd(nextRootInstance, fiber);
          else
            switch (fiber) {
              case "svg":
                fiber = 1;
                break;
              case "math":
                fiber = 2;
                break;
              default:
                fiber = 0;
            }
      }
      pop(contextStackCursor);
      push(contextStackCursor, fiber);
    }
    __name(pushHostContainer, "pushHostContainer");
    function popHostContainer() {
      pop(contextStackCursor);
      pop(contextFiberStackCursor);
      pop(rootInstanceStackCursor);
    }
    __name(popHostContainer, "popHostContainer");
    function pushHostContext(fiber) {
      null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber);
      var context = contextStackCursor.current;
      var JSCompiler_inline_result = getChildHostContextProd(context, fiber.type);
      context !== JSCompiler_inline_result && (push(contextFiberStackCursor, fiber), push(contextStackCursor, JSCompiler_inline_result));
    }
    __name(pushHostContext, "pushHostContext");
    function popHostContext(fiber) {
      contextFiberStackCursor.current === fiber && (pop(contextStackCursor), pop(contextFiberStackCursor));
      hostTransitionProviderCursor.current === fiber && (pop(hostTransitionProviderCursor), HostTransitionContext._currentValue = sharedNotPendingObject);
    }
    __name(popHostContext, "popHostContext");
    var hasOwnProperty2 = Object.prototype.hasOwnProperty, scheduleCallback$3 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, now = Scheduler.unstable_now, getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel, ImmediatePriority = Scheduler.unstable_ImmediatePriority, UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, NormalPriority$1 = Scheduler.unstable_NormalPriority, LowPriority = Scheduler.unstable_LowPriority, IdlePriority = Scheduler.unstable_IdlePriority, log$1 = Scheduler.log, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null;
    function setIsStrictModeForDevtools(newIsStrictMode) {
      "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode);
      if (injectedHook && "function" === typeof injectedHook.setStrictMode)
        try {
          injectedHook.setStrictMode(rendererID, newIsStrictMode);
        } catch (err) {
        }
    }
    __name(setIsStrictModeForDevtools, "setIsStrictModeForDevtools");
    var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, log2 = Math.log, LN2 = Math.LN2;
    function clz32Fallback(x2) {
      x2 >>>= 0;
      return 0 === x2 ? 32 : 31 - (log2(x2) / LN2 | 0) | 0;
    }
    __name(clz32Fallback, "clz32Fallback");
    var nextTransitionLane = 256, nextRetryLane = 4194304;
    function getHighestPriorityLanes(lanes) {
      var pendingSyncLanes = lanes & 42;
      if (0 !== pendingSyncLanes) return pendingSyncLanes;
      switch (lanes & -lanes) {
        case 1:
          return 1;
        case 2:
          return 2;
        case 4:
          return 4;
        case 8:
          return 8;
        case 16:
          return 16;
        case 32:
          return 32;
        case 64:
          return 64;
        case 128:
          return 128;
        case 256:
        case 512:
        case 1024:
        case 2048:
        case 4096:
        case 8192:
        case 16384:
        case 32768:
        case 65536:
        case 131072:
        case 262144:
        case 524288:
        case 1048576:
        case 2097152:
          return lanes & 4194048;
        case 4194304:
        case 8388608:
        case 16777216:
        case 33554432:
          return lanes & 62914560;
        case 67108864:
          return 67108864;
        case 134217728:
          return 134217728;
        case 268435456:
          return 268435456;
        case 536870912:
          return 536870912;
        case 1073741824:
          return 0;
        default:
          return lanes;
      }
    }
    __name(getHighestPriorityLanes, "getHighestPriorityLanes");
    function getNextLanes(root3, wipLanes, rootHasPendingCommit) {
      var pendingLanes = root3.pendingLanes;
      if (0 === pendingLanes) return 0;
      var nextLanes = 0, suspendedLanes = root3.suspendedLanes, pingedLanes = root3.pingedLanes;
      root3 = root3.warmLanes;
      var nonIdlePendingLanes = pendingLanes & 134217727;
      0 !== nonIdlePendingLanes ? (pendingLanes = nonIdlePendingLanes & ~suspendedLanes, 0 !== pendingLanes ? nextLanes = getHighestPriorityLanes(pendingLanes) : (pingedLanes &= nonIdlePendingLanes, 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = nonIdlePendingLanes & ~root3, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))))) : (nonIdlePendingLanes = pendingLanes & ~suspendedLanes, 0 !== nonIdlePendingLanes ? nextLanes = getHighestPriorityLanes(nonIdlePendingLanes) : 0 !== pingedLanes ? nextLanes = getHighestPriorityLanes(pingedLanes) : rootHasPendingCommit || (rootHasPendingCommit = pendingLanes & ~root3, 0 !== rootHasPendingCommit && (nextLanes = getHighestPriorityLanes(rootHasPendingCommit))));
      return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && (suspendedLanes = nextLanes & -nextLanes, rootHasPendingCommit = wipLanes & -wipLanes, suspendedLanes >= rootHasPendingCommit || 32 === suspendedLanes && 0 !== (rootHasPendingCommit & 4194048)) ? wipLanes : nextLanes;
    }
    __name(getNextLanes, "getNextLanes");
    function checkIfRootIsPrerendering(root3, renderLanes2) {
      return 0 === (root3.pendingLanes & ~(root3.suspendedLanes & ~root3.pingedLanes) & renderLanes2);
    }
    __name(checkIfRootIsPrerendering, "checkIfRootIsPrerendering");
    function computeExpirationTime(lane, currentTime) {
      switch (lane) {
        case 1:
        case 2:
        case 4:
        case 8:
        case 64:
          return currentTime + 250;
        case 16:
        case 32:
        case 128:
        case 256:
        case 512:
        case 1024:
        case 2048:
        case 4096:
        case 8192:
        case 16384:
        case 32768:
        case 65536:
        case 131072:
        case 262144:
        case 524288:
        case 1048576:
        case 2097152:
          return currentTime + 5e3;
        case 4194304:
        case 8388608:
        case 16777216:
        case 33554432:
          return -1;
        case 67108864:
        case 134217728:
        case 268435456:
        case 536870912:
        case 1073741824:
          return -1;
        default:
          return -1;
      }
    }
    __name(computeExpirationTime, "computeExpirationTime");
    function claimNextTransitionLane() {
      var lane = nextTransitionLane;
      nextTransitionLane <<= 1;
      0 === (nextTransitionLane & 4194048) && (nextTransitionLane = 256);
      return lane;
    }
    __name(claimNextTransitionLane, "claimNextTransitionLane");
    function claimNextRetryLane() {
      var lane = nextRetryLane;
      nextRetryLane <<= 1;
      0 === (nextRetryLane & 62914560) && (nextRetryLane = 4194304);
      return lane;
    }
    __name(claimNextRetryLane, "claimNextRetryLane");
    function createLaneMap(initial) {
      for (var laneMap = [], i2 = 0; 31 > i2; i2++) laneMap.push(initial);
      return laneMap;
    }
    __name(createLaneMap, "createLaneMap");
    function markRootUpdated$1(root3, updateLane) {
      root3.pendingLanes |= updateLane;
      268435456 !== updateLane && (root3.suspendedLanes = 0, root3.pingedLanes = 0, root3.warmLanes = 0);
    }
    __name(markRootUpdated$1, "markRootUpdated$1");
    function markRootFinished(root3, finishedLanes, remainingLanes, spawnedLane, updatedLanes, suspendedRetryLanes) {
      var previouslyPendingLanes = root3.pendingLanes;
      root3.pendingLanes = remainingLanes;
      root3.suspendedLanes = 0;
      root3.pingedLanes = 0;
      root3.warmLanes = 0;
      root3.expiredLanes &= remainingLanes;
      root3.entangledLanes &= remainingLanes;
      root3.errorRecoveryDisabledLanes &= remainingLanes;
      root3.shellSuspendCounter = 0;
      var entanglements = root3.entanglements, expirationTimes = root3.expirationTimes, hiddenUpdates = root3.hiddenUpdates;
      for (remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) {
        var index$5 = 31 - clz32(remainingLanes), lane = 1 << index$5;
        entanglements[index$5] = 0;
        expirationTimes[index$5] = -1;
        var hiddenUpdatesForLane = hiddenUpdates[index$5];
        if (null !== hiddenUpdatesForLane)
          for (hiddenUpdates[index$5] = null, index$5 = 0; index$5 < hiddenUpdatesForLane.length; index$5++) {
            var update = hiddenUpdatesForLane[index$5];
            null !== update && (update.lane &= -536870913);
          }
        remainingLanes &= ~lane;
      }
      0 !== spawnedLane && markSpawnedDeferredLane(root3, spawnedLane, 0);
      0 !== suspendedRetryLanes && 0 === updatedLanes && 0 !== root3.tag && (root3.suspendedLanes |= suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes));
    }
    __name(markRootFinished, "markRootFinished");
    function markSpawnedDeferredLane(root3, spawnedLane, entangledLanes) {
      root3.pendingLanes |= spawnedLane;
      root3.suspendedLanes &= ~spawnedLane;
      var spawnedLaneIndex = 31 - clz32(spawnedLane);
      root3.entangledLanes |= spawnedLane;
      root3.entanglements[spawnedLaneIndex] = root3.entanglements[spawnedLaneIndex] | 1073741824 | entangledLanes & 4194090;
    }
    __name(markSpawnedDeferredLane, "markSpawnedDeferredLane");
    function markRootEntangled(root3, entangledLanes) {
      var rootEntangledLanes = root3.entangledLanes |= entangledLanes;
      for (root3 = root3.entanglements; rootEntangledLanes; ) {
        var index$6 = 31 - clz32(rootEntangledLanes), lane = 1 << index$6;
        lane & entangledLanes | root3[index$6] & entangledLanes && (root3[index$6] |= entangledLanes);
        rootEntangledLanes &= ~lane;
      }
    }
    __name(markRootEntangled, "markRootEntangled");
    function getBumpedLaneForHydrationByLane(lane) {
      switch (lane) {
        case 2:
          lane = 1;
          break;
        case 8:
          lane = 4;
          break;
        case 32:
          lane = 16;
          break;
        case 256:
        case 512:
        case 1024:
        case 2048:
        case 4096:
        case 8192:
        case 16384:
        case 32768:
        case 65536:
        case 131072:
        case 262144:
        case 524288:
        case 1048576:
        case 2097152:
        case 4194304:
        case 8388608:
        case 16777216:
        case 33554432:
          lane = 128;
          break;
        case 268435456:
          lane = 134217728;
          break;
        default:
          lane = 0;
      }
      return lane;
    }
    __name(getBumpedLaneForHydrationByLane, "getBumpedLaneForHydrationByLane");
    function lanesToEventPriority(lanes) {
      lanes &= -lanes;
      return 2 < lanes ? 8 < lanes ? 0 !== (lanes & 134217727) ? 32 : 268435456 : 8 : 2;
    }
    __name(lanesToEventPriority, "lanesToEventPriority");
    function resolveUpdatePriority() {
      var updatePriority = ReactDOMSharedInternals.p;
      if (0 !== updatePriority) return updatePriority;
      updatePriority = window.event;
      return void 0 === updatePriority ? 32 : getEventPriority(updatePriority.type);
    }
    __name(resolveUpdatePriority, "resolveUpdatePriority");
    function runWithPriority(priority, fn) {
      var previousPriority = ReactDOMSharedInternals.p;
      try {
        return ReactDOMSharedInternals.p = priority, fn();
      } finally {
        ReactDOMSharedInternals.p = previousPriority;
      }
    }
    __name(runWithPriority, "runWithPriority");
    var randomKey = Math.random().toString(36).slice(2), internalInstanceKey = "__reactFiber$" + randomKey, internalPropsKey = "__reactProps$" + randomKey, internalContainerInstanceKey = "__reactContainer$" + randomKey, internalEventHandlersKey = "__reactEvents$" + randomKey, internalEventHandlerListenersKey = "__reactListeners$" + randomKey, internalEventHandlesSetKey = "__reactHandles$" + randomKey, internalRootNodeResourcesKey = "__reactResources$" + randomKey, internalHoistableMarker = "__reactMarker$" + randomKey;
    function detachDeletedInstance(node) {
      delete node[internalInstanceKey];
      delete node[internalPropsKey];
      delete node[internalEventHandlersKey];
      delete node[internalEventHandlerListenersKey];
      delete node[internalEventHandlesSetKey];
    }
    __name(detachDeletedInstance, "detachDeletedInstance");
    function getClosestInstanceFromNode(targetNode) {
      var targetInst = targetNode[internalInstanceKey];
      if (targetInst) return targetInst;
      for (var parentNode = targetNode.parentNode; parentNode; ) {
        if (targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey]) {
          parentNode = targetInst.alternate;
          if (null !== targetInst.child || null !== parentNode && null !== parentNode.child)
            for (targetNode = getParentSuspenseInstance(targetNode); null !== targetNode; ) {
              if (parentNode = targetNode[internalInstanceKey]) return parentNode;
              targetNode = getParentSuspenseInstance(targetNode);
            }
          return targetInst;
        }
        targetNode = parentNode;
        parentNode = targetNode.parentNode;
      }
      return null;
    }
    __name(getClosestInstanceFromNode, "getClosestInstanceFromNode");
    function getInstanceFromNode(node) {
      if (node = node[internalInstanceKey] || node[internalContainerInstanceKey]) {
        var tag = node.tag;
        if (5 === tag || 6 === tag || 13 === tag || 26 === tag || 27 === tag || 3 === tag)
          return node;
      }
      return null;
    }
    __name(getInstanceFromNode, "getInstanceFromNode");
    function getNodeFromInstance(inst) {
      var tag = inst.tag;
      if (5 === tag || 26 === tag || 27 === tag || 6 === tag) return inst.stateNode;
      throw Error(formatProdErrorMessage(33));
    }
    __name(getNodeFromInstance, "getNodeFromInstance");
    function getResourcesFromRoot(root3) {
      var resources = root3[internalRootNodeResourcesKey];
      resources || (resources = root3[internalRootNodeResourcesKey] = { hoistableStyles: /* @__PURE__ */ new Map(), hoistableScripts: /* @__PURE__ */ new Map() });
      return resources;
    }
    __name(getResourcesFromRoot, "getResourcesFromRoot");
    function markNodeAsHoistable(node) {
      node[internalHoistableMarker] = true;
    }
    __name(markNodeAsHoistable, "markNodeAsHoistable");
    var allNativeEvents = /* @__PURE__ */ new Set(), registrationNameDependencies = {};
    function registerTwoPhaseEvent(registrationName, dependencies) {
      registerDirectEvent(registrationName, dependencies);
      registerDirectEvent(registrationName + "Capture", dependencies);
    }
    __name(registerTwoPhaseEvent, "registerTwoPhaseEvent");
    function registerDirectEvent(registrationName, dependencies) {
      registrationNameDependencies[registrationName] = dependencies;
      for (registrationName = 0; registrationName < dependencies.length; registrationName++)
        allNativeEvents.add(dependencies[registrationName]);
    }
    __name(registerDirectEvent, "registerDirectEvent");
    var VALID_ATTRIBUTE_NAME_REGEX = RegExp(
      "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
    ), illegalAttributeNameCache = {}, validatedAttributeNameCache = {};
    function isAttributeNameSafe(attributeName) {
      if (hasOwnProperty2.call(validatedAttributeNameCache, attributeName))
        return true;
      if (hasOwnProperty2.call(illegalAttributeNameCache, attributeName)) return false;
      if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName))
        return validatedAttributeNameCache[attributeName] = true;
      illegalAttributeNameCache[attributeName] = true;
      return false;
    }
    __name(isAttributeNameSafe, "isAttributeNameSafe");
    function setValueForAttribute(node, name, value) {
      if (isAttributeNameSafe(name))
        if (null === value) node.removeAttribute(name);
        else {
          switch (typeof value) {
            case "undefined":
            case "function":
            case "symbol":
              node.removeAttribute(name);
              return;
            case "boolean":
              var prefix$8 = name.toLowerCase().slice(0, 5);
              if ("data-" !== prefix$8 && "aria-" !== prefix$8) {
                node.removeAttribute(name);
                return;
              }
          }
          node.setAttribute(name, "" + value);
        }
    }
    __name(setValueForAttribute, "setValueForAttribute");
    function setValueForKnownAttribute(node, name, value) {
      if (null === value) node.removeAttribute(name);
      else {
        switch (typeof value) {
          case "undefined":
          case "function":
          case "symbol":
          case "boolean":
            node.removeAttribute(name);
            return;
        }
        node.setAttribute(name, "" + value);
      }
    }
    __name(setValueForKnownAttribute, "setValueForKnownAttribute");
    function setValueForNamespacedAttribute(node, namespace, name, value) {
      if (null === value) node.removeAttribute(name);
      else {
        switch (typeof value) {
          case "undefined":
          case "function":
          case "symbol":
          case "boolean":
            node.removeAttribute(name);
            return;
        }
        node.setAttributeNS(namespace, name, "" + value);
      }
    }
    __name(setValueForNamespacedAttribute, "setValueForNamespacedAttribute");
    var prefix2, suffix;
    function describeBuiltInComponentFrame(name) {
      if (void 0 === prefix2)
        try {
          throw Error();
        } catch (x2) {
          var match = x2.stack.trim().match(/\n( *(at )?)/);
          prefix2 = match && match[1] || "";
          suffix = -1 < x2.stack.indexOf("\n    at") ? " (<anonymous>)" : -1 < x2.stack.indexOf("@") ? "@unknown:0:0" : "";
        }
      return "\n" + prefix2 + name + suffix;
    }
    __name(describeBuiltInComponentFrame, "describeBuiltInComponentFrame");
    var reentry = false;
    function describeNativeComponentFrame(fn, construct) {
      if (!fn || reentry) return "";
      reentry = true;
      var previousPrepareStackTrace = Error.prepareStackTrace;
      Error.prepareStackTrace = void 0;
      try {
        var RunInRootFrame = {
          DetermineComponentFrameRoot: /* @__PURE__ */ __name(function() {
            try {
              if (construct) {
                var Fake = /* @__PURE__ */ __name(function() {
                  throw Error();
                }, "Fake");
                Object.defineProperty(Fake.prototype, "props", {
                  set: /* @__PURE__ */ __name(function() {
                    throw Error();
                  }, "set")
                });
                if ("object" === typeof Reflect && Reflect.construct) {
                  try {
                    Reflect.construct(Fake, []);
                  } catch (x2) {
                    var control = x2;
                  }
                  Reflect.construct(fn, [], Fake);
                } else {
                  try {
                    Fake.call();
                  } catch (x$9) {
                    control = x$9;
                  }
                  fn.call(Fake.prototype);
                }
              } else {
                try {
                  throw Error();
                } catch (x$10) {
                  control = x$10;
                }
                (Fake = fn()) && "function" === typeof Fake.catch && Fake.catch(function() {
                });
              }
            } catch (sample) {
              if (sample && control && "string" === typeof sample.stack)
                return [sample.stack, control.stack];
            }
            return [null, null];
          }, "DetermineComponentFrameRoot")
        };
        RunInRootFrame.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
        var namePropDescriptor = Object.getOwnPropertyDescriptor(
          RunInRootFrame.DetermineComponentFrameRoot,
          "name"
        );
        namePropDescriptor && namePropDescriptor.configurable && Object.defineProperty(
          RunInRootFrame.DetermineComponentFrameRoot,
          "name",
          { value: "DetermineComponentFrameRoot" }
        );
        var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], controlStack = _RunInRootFrame$Deter[1];
        if (sampleStack && controlStack) {
          var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n");
          for (namePropDescriptor = RunInRootFrame = 0; RunInRootFrame < sampleLines.length && !sampleLines[RunInRootFrame].includes("DetermineComponentFrameRoot"); )
            RunInRootFrame++;
          for (; namePropDescriptor < controlLines.length && !controlLines[namePropDescriptor].includes(
            "DetermineComponentFrameRoot"
          ); )
            namePropDescriptor++;
          if (RunInRootFrame === sampleLines.length || namePropDescriptor === controlLines.length)
            for (RunInRootFrame = sampleLines.length - 1, namePropDescriptor = controlLines.length - 1; 1 <= RunInRootFrame && 0 <= namePropDescriptor && sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]; )
              namePropDescriptor--;
          for (; 1 <= RunInRootFrame && 0 <= namePropDescriptor; RunInRootFrame--, namePropDescriptor--)
            if (sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) {
              if (1 !== RunInRootFrame || 1 !== namePropDescriptor) {
                do
                  if (RunInRootFrame--, namePropDescriptor--, 0 > namePropDescriptor || sampleLines[RunInRootFrame] !== controlLines[namePropDescriptor]) {
                    var frame = "\n" + sampleLines[RunInRootFrame].replace(" at new ", " at ");
                    fn.displayName && frame.includes("<anonymous>") && (frame = frame.replace("<anonymous>", fn.displayName));
                    return frame;
                  }
                while (1 <= RunInRootFrame && 0 <= namePropDescriptor);
              }
              break;
            }
        }
      } finally {
        reentry = false, Error.prepareStackTrace = previousPrepareStackTrace;
      }
      return (previousPrepareStackTrace = fn ? fn.displayName || fn.name : "") ? describeBuiltInComponentFrame(previousPrepareStackTrace) : "";
    }
    __name(describeNativeComponentFrame, "describeNativeComponentFrame");
    function describeFiber(fiber) {
      switch (fiber.tag) {
        case 26:
        case 27:
        case 5:
          return describeBuiltInComponentFrame(fiber.type);
        case 16:
          return describeBuiltInComponentFrame("Lazy");
        case 13:
          return describeBuiltInComponentFrame("Suspense");
        case 19:
          return describeBuiltInComponentFrame("SuspenseList");
        case 0:
        case 15:
          return describeNativeComponentFrame(fiber.type, false);
        case 11:
          return describeNativeComponentFrame(fiber.type.render, false);
        case 1:
          return describeNativeComponentFrame(fiber.type, true);
        case 31:
          return describeBuiltInComponentFrame("Activity");
        default:
          return "";
      }
    }
    __name(describeFiber, "describeFiber");
    function getStackByFiberInDevAndProd(workInProgress2) {
      try {
        var info = "";
        do
          info += describeFiber(workInProgress2), workInProgress2 = workInProgress2.return;
        while (workInProgress2);
        return info;
      } catch (x2) {
        return "\nError generating stack: " + x2.message + "\n" + x2.stack;
      }
    }
    __name(getStackByFiberInDevAndProd, "getStackByFiberInDevAndProd");
    function getToStringValue(value) {
      switch (typeof value) {
        case "bigint":
        case "boolean":
        case "number":
        case "string":
        case "undefined":
          return value;
        case "object":
          return value;
        default:
          return "";
      }
    }
    __name(getToStringValue, "getToStringValue");
    function isCheckable(elem) {
      var type = elem.type;
      return (elem = elem.nodeName) && "input" === elem.toLowerCase() && ("checkbox" === type || "radio" === type);
    }
    __name(isCheckable, "isCheckable");
    function trackValueOnNode(node) {
      var valueField = isCheckable(node) ? "checked" : "value", descriptor = Object.getOwnPropertyDescriptor(
        node.constructor.prototype,
        valueField
      ), currentValue = "" + node[valueField];
      if (!node.hasOwnProperty(valueField) && "undefined" !== typeof descriptor && "function" === typeof descriptor.get && "function" === typeof descriptor.set) {
        var get2 = descriptor.get, set2 = descriptor.set;
        Object.defineProperty(node, valueField, {
          configurable: true,
          get: /* @__PURE__ */ __name(function() {
            return get2.call(this);
          }, "get"),
          set: /* @__PURE__ */ __name(function(value) {
            currentValue = "" + value;
            set2.call(this, value);
          }, "set")
        });
        Object.defineProperty(node, valueField, {
          enumerable: descriptor.enumerable
        });
        return {
          getValue: /* @__PURE__ */ __name(function() {
            return currentValue;
          }, "getValue"),
          setValue: /* @__PURE__ */ __name(function(value) {
            currentValue = "" + value;
          }, "setValue"),
          stopTracking: /* @__PURE__ */ __name(function() {
            node._valueTracker = null;
            delete node[valueField];
          }, "stopTracking")
        };
      }
    }
    __name(trackValueOnNode, "trackValueOnNode");
    function track(node) {
      node._valueTracker || (node._valueTracker = trackValueOnNode(node));
    }
    __name(track, "track");
    function updateValueIfChanged(node) {
      if (!node) return false;
      var tracker = node._valueTracker;
      if (!tracker) return true;
      var lastValue = tracker.getValue();
      var value = "";
      node && (value = isCheckable(node) ? node.checked ? "true" : "false" : node.value);
      node = value;
      return node !== lastValue ? (tracker.setValue(node), true) : false;
    }
    __name(updateValueIfChanged, "updateValueIfChanged");
    function getActiveElement(doc) {
      doc = doc || ("undefined" !== typeof document ? document : void 0);
      if ("undefined" === typeof doc) return null;
      try {
        return doc.activeElement || doc.body;
      } catch (e) {
        return doc.body;
      }
    }
    __name(getActiveElement, "getActiveElement");
    var escapeSelectorAttributeValueInsideDoubleQuotesRegex = /[\n"\\]/g;
    function escapeSelectorAttributeValueInsideDoubleQuotes(value) {
      return value.replace(
        escapeSelectorAttributeValueInsideDoubleQuotesRegex,
        function(ch) {
          return "\\" + ch.charCodeAt(0).toString(16) + " ";
        }
      );
    }
    __name(escapeSelectorAttributeValueInsideDoubleQuotes, "escapeSelectorAttributeValueInsideDoubleQuotes");
    function updateInput(element, value, defaultValue, lastDefaultValue, checked, defaultChecked, type, name) {
      element.name = "";
      null != type && "function" !== typeof type && "symbol" !== typeof type && "boolean" !== typeof type ? element.type = type : element.removeAttribute("type");
      if (null != value)
        if ("number" === type) {
          if (0 === value && "" === element.value || element.value != value)
            element.value = "" + getToStringValue(value);
        } else
          element.value !== "" + getToStringValue(value) && (element.value = "" + getToStringValue(value));
      else
        "submit" !== type && "reset" !== type || element.removeAttribute("value");
      null != value ? setDefaultValue(element, type, getToStringValue(value)) : null != defaultValue ? setDefaultValue(element, type, getToStringValue(defaultValue)) : null != lastDefaultValue && element.removeAttribute("value");
      null == checked && null != defaultChecked && (element.defaultChecked = !!defaultChecked);
      null != checked && (element.checked = checked && "function" !== typeof checked && "symbol" !== typeof checked);
      null != name && "function" !== typeof name && "symbol" !== typeof name && "boolean" !== typeof name ? element.name = "" + getToStringValue(name) : element.removeAttribute("name");
    }
    __name(updateInput, "updateInput");
    function initInput(element, value, defaultValue, checked, defaultChecked, type, name, isHydrating2) {
      null != type && "function" !== typeof type && "symbol" !== typeof type && "boolean" !== typeof type && (element.type = type);
      if (null != value || null != defaultValue) {
        if (!("submit" !== type && "reset" !== type || void 0 !== value && null !== value))
          return;
        defaultValue = null != defaultValue ? "" + getToStringValue(defaultValue) : "";
        value = null != value ? "" + getToStringValue(value) : defaultValue;
        isHydrating2 || value === element.value || (element.value = value);
        element.defaultValue = value;
      }
      checked = null != checked ? checked : defaultChecked;
      checked = "function" !== typeof checked && "symbol" !== typeof checked && !!checked;
      element.checked = isHydrating2 ? element.checked : !!checked;
      element.defaultChecked = !!checked;
      null != name && "function" !== typeof name && "symbol" !== typeof name && "boolean" !== typeof name && (element.name = name);
    }
    __name(initInput, "initInput");
    function setDefaultValue(node, type, value) {
      "number" === type && getActiveElement(node.ownerDocument) === node || node.defaultValue === "" + value || (node.defaultValue = "" + value);
    }
    __name(setDefaultValue, "setDefaultValue");
    function updateOptions(node, multiple, propValue, setDefaultSelected) {
      node = node.options;
      if (multiple) {
        multiple = {};
        for (var i2 = 0; i2 < propValue.length; i2++)
          multiple["$" + propValue[i2]] = true;
        for (propValue = 0; propValue < node.length; propValue++)
          i2 = multiple.hasOwnProperty("$" + node[propValue].value), node[propValue].selected !== i2 && (node[propValue].selected = i2), i2 && setDefaultSelected && (node[propValue].defaultSelected = true);
      } else {
        propValue = "" + getToStringValue(propValue);
        multiple = null;
        for (i2 = 0; i2 < node.length; i2++) {
          if (node[i2].value === propValue) {
            node[i2].selected = true;
            setDefaultSelected && (node[i2].defaultSelected = true);
            return;
          }
          null !== multiple || node[i2].disabled || (multiple = node[i2]);
        }
        null !== multiple && (multiple.selected = true);
      }
    }
    __name(updateOptions, "updateOptions");
    function updateTextarea(element, value, defaultValue) {
      if (null != value && (value = "" + getToStringValue(value), value !== element.value && (element.value = value), null == defaultValue)) {
        element.defaultValue !== value && (element.defaultValue = value);
        return;
      }
      element.defaultValue = null != defaultValue ? "" + getToStringValue(defaultValue) : "";
    }
    __name(updateTextarea, "updateTextarea");
    function initTextarea(element, value, defaultValue, children) {
      if (null == value) {
        if (null != children) {
          if (null != defaultValue) throw Error(formatProdErrorMessage(92));
          if (isArrayImpl(children)) {
            if (1 < children.length) throw Error(formatProdErrorMessage(93));
            children = children[0];
          }
          defaultValue = children;
        }
        null == defaultValue && (defaultValue = "");
        value = defaultValue;
      }
      defaultValue = getToStringValue(value);
      element.defaultValue = defaultValue;
      children = element.textContent;
      children === defaultValue && "" !== children && null !== children && (element.value = children);
    }
    __name(initTextarea, "initTextarea");
    function setTextContent(node, text) {
      if (text) {
        var firstChild = node.firstChild;
        if (firstChild && firstChild === node.lastChild && 3 === firstChild.nodeType) {
          firstChild.nodeValue = text;
          return;
        }
      }
      node.textContent = text;
    }
    __name(setTextContent, "setTextContent");
    var unitlessNumbers = new Set(
      "animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(
        " "
      )
    );
    function setValueForStyle(style2, styleName, value) {
      var isCustomProperty = 0 === styleName.indexOf("--");
      null == value || "boolean" === typeof value || "" === value ? isCustomProperty ? style2.setProperty(styleName, "") : "float" === styleName ? style2.cssFloat = "" : style2[styleName] = "" : isCustomProperty ? style2.setProperty(styleName, value) : "number" !== typeof value || 0 === value || unitlessNumbers.has(styleName) ? "float" === styleName ? style2.cssFloat = value : style2[styleName] = ("" + value).trim() : style2[styleName] = value + "px";
    }
    __name(setValueForStyle, "setValueForStyle");
    function setValueForStyles(node, styles, prevStyles) {
      if (null != styles && "object" !== typeof styles)
        throw Error(formatProdErrorMessage(62));
      node = node.style;
      if (null != prevStyles) {
        for (var styleName in prevStyles)
          !prevStyles.hasOwnProperty(styleName) || null != styles && styles.hasOwnProperty(styleName) || (0 === styleName.indexOf("--") ? node.setProperty(styleName, "") : "float" === styleName ? node.cssFloat = "" : node[styleName] = "");
        for (var styleName$16 in styles)
          styleName = styles[styleName$16], styles.hasOwnProperty(styleName$16) && prevStyles[styleName$16] !== styleName && setValueForStyle(node, styleName$16, styleName);
      } else
        for (var styleName$17 in styles)
          styles.hasOwnProperty(styleName$17) && setValueForStyle(node, styleName$17, styles[styleName$17]);
    }
    __name(setValueForStyles, "setValueForStyles");
    function isCustomElement(tagName) {
      if (-1 === tagName.indexOf("-")) return false;
      switch (tagName) {
        case "annotation-xml":
        case "color-profile":
        case "font-face":
        case "font-face-src":
        case "font-face-uri":
        case "font-face-format":
        case "font-face-name":
        case "missing-glyph":
          return false;
        default:
          return true;
      }
    }
    __name(isCustomElement, "isCustomElement");
    var aliases = /* @__PURE__ */ new Map([
      ["acceptCharset", "accept-charset"],
      ["htmlFor", "for"],
      ["httpEquiv", "http-equiv"],
      ["crossOrigin", "crossorigin"],
      ["accentHeight", "accent-height"],
      ["alignmentBaseline", "alignment-baseline"],
      ["arabicForm", "arabic-form"],
      ["baselineShift", "baseline-shift"],
      ["capHeight", "cap-height"],
      ["clipPath", "clip-path"],
      ["clipRule", "clip-rule"],
      ["colorInterpolation", "color-interpolation"],
      ["colorInterpolationFilters", "color-interpolation-filters"],
      ["colorProfile", "color-profile"],
      ["colorRendering", "color-rendering"],
      ["dominantBaseline", "dominant-baseline"],
      ["enableBackground", "enable-background"],
      ["fillOpacity", "fill-opacity"],
      ["fillRule", "fill-rule"],
      ["floodColor", "flood-color"],
      ["floodOpacity", "flood-opacity"],
      ["fontFamily", "font-family"],
      ["fontSize", "font-size"],
      ["fontSizeAdjust", "font-size-adjust"],
      ["fontStretch", "font-stretch"],
      ["fontStyle", "font-style"],
      ["fontVariant", "font-variant"],
      ["fontWeight", "font-weight"],
      ["glyphName", "glyph-name"],
      ["glyphOrientationHorizontal", "glyph-orientation-horizontal"],
      ["glyphOrientationVertical", "glyph-orientation-vertical"],
      ["horizAdvX", "horiz-adv-x"],
      ["horizOriginX", "horiz-origin-x"],
      ["imageRendering", "image-rendering"],
      ["letterSpacing", "letter-spacing"],
      ["lightingColor", "lighting-color"],
      ["markerEnd", "marker-end"],
      ["markerMid", "marker-mid"],
      ["markerStart", "marker-start"],
      ["overlinePosition", "overline-position"],
      ["overlineThickness", "overline-thickness"],
      ["paintOrder", "paint-order"],
      ["panose-1", "panose-1"],
      ["pointerEvents", "pointer-events"],
      ["renderingIntent", "rendering-intent"],
      ["shapeRendering", "shape-rendering"],
      ["stopColor", "stop-color"],
      ["stopOpacity", "stop-opacity"],
      ["strikethroughPosition", "strikethrough-position"],
      ["strikethroughThickness", "strikethrough-thickness"],
      ["strokeDasharray", "stroke-dasharray"],
      ["strokeDashoffset", "stroke-dashoffset"],
      ["strokeLinecap", "stroke-linecap"],
      ["strokeLinejoin", "stroke-linejoin"],
      ["strokeMiterlimit", "stroke-miterlimit"],
      ["strokeOpacity", "stroke-opacity"],
      ["strokeWidth", "stroke-width"],
      ["textAnchor", "text-anchor"],
      ["textDecoration", "text-decoration"],
      ["textRendering", "text-rendering"],
      ["transformOrigin", "transform-origin"],
      ["underlinePosition", "underline-position"],
      ["underlineThickness", "underline-thickness"],
      ["unicodeBidi", "unicode-bidi"],
      ["unicodeRange", "unicode-range"],
      ["unitsPerEm", "units-per-em"],
      ["vAlphabetic", "v-alphabetic"],
      ["vHanging", "v-hanging"],
      ["vIdeographic", "v-ideographic"],
      ["vMathematical", "v-mathematical"],
      ["vectorEffect", "vector-effect"],
      ["vertAdvY", "vert-adv-y"],
      ["vertOriginX", "vert-origin-x"],
      ["vertOriginY", "vert-origin-y"],
      ["wordSpacing", "word-spacing"],
      ["writingMode", "writing-mode"],
      ["xmlnsXlink", "xmlns:xlink"],
      ["xHeight", "x-height"]
    ]), isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;
    function sanitizeURL(url) {
      return isJavaScriptProtocol.test("" + url) ? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')" : url;
    }
    __name(sanitizeURL, "sanitizeURL");
    var currentReplayingEvent = null;
    function getEventTarget(nativeEvent) {
      nativeEvent = nativeEvent.target || nativeEvent.srcElement || window;
      nativeEvent.correspondingUseElement && (nativeEvent = nativeEvent.correspondingUseElement);
      return 3 === nativeEvent.nodeType ? nativeEvent.parentNode : nativeEvent;
    }
    __name(getEventTarget, "getEventTarget");
    var restoreTarget = null, restoreQueue = null;
    function restoreStateOfTarget(target) {
      var internalInstance = getInstanceFromNode(target);
      if (internalInstance && (target = internalInstance.stateNode)) {
        var props = target[internalPropsKey] || null;
        a: switch (target = internalInstance.stateNode, internalInstance.type) {
          case "input":
            updateInput(
              target,
              props.value,
              props.defaultValue,
              props.defaultValue,
              props.checked,
              props.defaultChecked,
              props.type,
              props.name
            );
            internalInstance = props.name;
            if ("radio" === props.type && null != internalInstance) {
              for (props = target; props.parentNode; ) props = props.parentNode;
              props = props.querySelectorAll(
                'input[name="' + escapeSelectorAttributeValueInsideDoubleQuotes(
                  "" + internalInstance
                ) + '"][type="radio"]'
              );
              for (internalInstance = 0; internalInstance < props.length; internalInstance++) {
                var otherNode = props[internalInstance];
                if (otherNode !== target && otherNode.form === target.form) {
                  var otherProps = otherNode[internalPropsKey] || null;
                  if (!otherProps) throw Error(formatProdErrorMessage(90));
                  updateInput(
                    otherNode,
                    otherProps.value,
                    otherProps.defaultValue,
                    otherProps.defaultValue,
                    otherProps.checked,
                    otherProps.defaultChecked,
                    otherProps.type,
                    otherProps.name
                  );
                }
              }
              for (internalInstance = 0; internalInstance < props.length; internalInstance++)
                otherNode = props[internalInstance], otherNode.form === target.form && updateValueIfChanged(otherNode);
            }
            break a;
          case "textarea":
            updateTextarea(target, props.value, props.defaultValue);
            break a;
          case "select":
            internalInstance = props.value, null != internalInstance && updateOptions(target, !!props.multiple, internalInstance, false);
        }
      }
    }
    __name(restoreStateOfTarget, "restoreStateOfTarget");
    var isInsideEventHandler = false;
    function batchedUpdates$1(fn, a2, b) {
      if (isInsideEventHandler) return fn(a2, b);
      isInsideEventHandler = true;
      try {
        var JSCompiler_inline_result = fn(a2);
        return JSCompiler_inline_result;
      } finally {
        if (isInsideEventHandler = false, null !== restoreTarget || null !== restoreQueue) {
          if (flushSyncWork$1(), restoreTarget && (a2 = restoreTarget, fn = restoreQueue, restoreQueue = restoreTarget = null, restoreStateOfTarget(a2), fn))
            for (a2 = 0; a2 < fn.length; a2++) restoreStateOfTarget(fn[a2]);
        }
      }
    }
    __name(batchedUpdates$1, "batchedUpdates$1");
    function getListener(inst, registrationName) {
      var stateNode = inst.stateNode;
      if (null === stateNode) return null;
      var props = stateNode[internalPropsKey] || null;
      if (null === props) return null;
      stateNode = props[registrationName];
      a: switch (registrationName) {
        case "onClick":
        case "onClickCapture":
        case "onDoubleClick":
        case "onDoubleClickCapture":
        case "onMouseDown":
        case "onMouseDownCapture":
        case "onMouseMove":
        case "onMouseMoveCapture":
        case "onMouseUp":
        case "onMouseUpCapture":
        case "onMouseEnter":
          (props = !props.disabled) || (inst = inst.type, props = !("button" === inst || "input" === inst || "select" === inst || "textarea" === inst));
          inst = !props;
          break a;
        default:
          inst = false;
      }
      if (inst) return null;
      if (stateNode && "function" !== typeof stateNode)
        throw Error(
          formatProdErrorMessage(231, registrationName, typeof stateNode)
        );
      return stateNode;
    }
    __name(getListener, "getListener");
    var canUseDOM = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement), passiveBrowserEventsSupported = false;
    if (canUseDOM)
      try {
        var options2 = {};
        Object.defineProperty(options2, "passive", {
          get: /* @__PURE__ */ __name(function() {
            passiveBrowserEventsSupported = true;
          }, "get")
        });
        window.addEventListener("test", options2, options2);
        window.removeEventListener("test", options2, options2);
      } catch (e) {
        passiveBrowserEventsSupported = false;
      }
    var root2 = null, startText = null, fallbackText = null;
    function getData() {
      if (fallbackText) return fallbackText;
      var start, startValue = startText, startLength = startValue.length, end, endValue = "value" in root2 ? root2.value : root2.textContent, endLength = endValue.length;
      for (start = 0; start < startLength && startValue[start] === endValue[start]; start++) ;
      var minEnd = startLength - start;
      for (end = 1; end <= minEnd && startValue[startLength - end] === endValue[endLength - end]; end++) ;
      return fallbackText = endValue.slice(start, 1 < end ? 1 - end : void 0);
    }
    __name(getData, "getData");
    function getEventCharCode(nativeEvent) {
      var keyCode = nativeEvent.keyCode;
      "charCode" in nativeEvent ? (nativeEvent = nativeEvent.charCode, 0 === nativeEvent && 13 === keyCode && (nativeEvent = 13)) : nativeEvent = keyCode;
      10 === nativeEvent && (nativeEvent = 13);
      return 32 <= nativeEvent || 13 === nativeEvent ? nativeEvent : 0;
    }
    __name(getEventCharCode, "getEventCharCode");
    function functionThatReturnsTrue() {
      return true;
    }
    __name(functionThatReturnsTrue, "functionThatReturnsTrue");
    function functionThatReturnsFalse() {
      return false;
    }
    __name(functionThatReturnsFalse, "functionThatReturnsFalse");
    function createSyntheticEvent(Interface) {
      function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {
        this._reactName = reactName;
        this._targetInst = targetInst;
        this.type = reactEventType;
        this.nativeEvent = nativeEvent;
        this.target = nativeEventTarget;
        this.currentTarget = null;
        for (var propName in Interface)
          Interface.hasOwnProperty(propName) && (reactName = Interface[propName], this[propName] = reactName ? reactName(nativeEvent) : nativeEvent[propName]);
        this.isDefaultPrevented = (null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : false === nativeEvent.returnValue) ? functionThatReturnsTrue : functionThatReturnsFalse;
        this.isPropagationStopped = functionThatReturnsFalse;
        return this;
      }
      __name(SyntheticBaseEvent, "SyntheticBaseEvent");
      assign(SyntheticBaseEvent.prototype, {
        preventDefault: /* @__PURE__ */ __name(function() {
          this.defaultPrevented = true;
          var event = this.nativeEvent;
          event && (event.preventDefault ? event.preventDefault() : "unknown" !== typeof event.returnValue && (event.returnValue = false), this.isDefaultPrevented = functionThatReturnsTrue);
        }, "preventDefault"),
        stopPropagation: /* @__PURE__ */ __name(function() {
          var event = this.nativeEvent;
          event && (event.stopPropagation ? event.stopPropagation() : "unknown" !== typeof event.cancelBubble && (event.cancelBubble = true), this.isPropagationStopped = functionThatReturnsTrue);
        }, "stopPropagation"),
        persist: /* @__PURE__ */ __name(function() {
        }, "persist"),
        isPersistent: functionThatReturnsTrue
      });
      return SyntheticBaseEvent;
    }
    __name(createSyntheticEvent, "createSyntheticEvent");
    var EventInterface = {
      eventPhase: 0,
      bubbles: 0,
      cancelable: 0,
      timeStamp: /* @__PURE__ */ __name(function(event) {
        return event.timeStamp || Date.now();
      }, "timeStamp"),
      defaultPrevented: 0,
      isTrusted: 0
    }, SyntheticEvent = createSyntheticEvent(EventInterface), UIEventInterface = assign({}, EventInterface, { view: 0, detail: 0 }), SyntheticUIEvent = createSyntheticEvent(UIEventInterface), lastMovementX, lastMovementY, lastMouseEvent, MouseEventInterface = assign({}, UIEventInterface, {
      screenX: 0,
      screenY: 0,
      clientX: 0,
      clientY: 0,
      pageX: 0,
      pageY: 0,
      ctrlKey: 0,
      shiftKey: 0,
      altKey: 0,
      metaKey: 0,
      getModifierState: getEventModifierState,
      button: 0,
      buttons: 0,
      relatedTarget: /* @__PURE__ */ __name(function(event) {
        return void 0 === event.relatedTarget ? event.fromElement === event.srcElement ? event.toElement : event.fromElement : event.relatedTarget;
      }, "relatedTarget"),
      movementX: /* @__PURE__ */ __name(function(event) {
        if ("movementX" in event) return event.movementX;
        event !== lastMouseEvent && (lastMouseEvent && "mousemove" === event.type ? (lastMovementX = event.screenX - lastMouseEvent.screenX, lastMovementY = event.screenY - lastMouseEvent.screenY) : lastMovementY = lastMovementX = 0, lastMouseEvent = event);
        return lastMovementX;
      }, "movementX"),
      movementY: /* @__PURE__ */ __name(function(event) {
        return "movementY" in event ? event.movementY : lastMovementY;
      }, "movementY")
    }), SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface), DragEventInterface = assign({}, MouseEventInterface, { dataTransfer: 0 }), SyntheticDragEvent = createSyntheticEvent(DragEventInterface), FocusEventInterface = assign({}, UIEventInterface, { relatedTarget: 0 }), SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface), AnimationEventInterface = assign({}, EventInterface, {
      animationName: 0,
      elapsedTime: 0,
      pseudoElement: 0
    }), SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface), ClipboardEventInterface = assign({}, EventInterface, {
      clipboardData: /* @__PURE__ */ __name(function(event) {
        return "clipboardData" in event ? event.clipboardData : window.clipboardData;
      }, "clipboardData")
    }), SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface), CompositionEventInterface = assign({}, EventInterface, { data: 0 }), SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface), normalizeKey = {
      Esc: "Escape",
      Spacebar: " ",
      Left: "ArrowLeft",
      Up: "ArrowUp",
      Right: "ArrowRight",
      Down: "ArrowDown",
      Del: "Delete",
      Win: "OS",
      Menu: "ContextMenu",
      Apps: "ContextMenu",
      Scroll: "ScrollLock",
      MozPrintableKey: "Unidentified"
    }, translateToKey = {
      8: "Backspace",
      9: "Tab",
      12: "Clear",
      13: "Enter",
      16: "Shift",
      17: "Control",
      18: "Alt",
      19: "Pause",
      20: "CapsLock",
      27: "Escape",
      32: " ",
      33: "PageUp",
      34: "PageDown",
      35: "End",
      36: "Home",
      37: "ArrowLeft",
      38: "ArrowUp",
      39: "ArrowRight",
      40: "ArrowDown",
      45: "Insert",
      46: "Delete",
      112: "F1",
      113: "F2",
      114: "F3",
      115: "F4",
      116: "F5",
      117: "F6",
      118: "F7",
      119: "F8",
      120: "F9",
      121: "F10",
      122: "F11",
      123: "F12",
      144: "NumLock",
      145: "ScrollLock",
      224: "Meta"
    }, modifierKeyToProp = {
      Alt: "altKey",
      Control: "ctrlKey",
      Meta: "metaKey",
      Shift: "shiftKey"
    };
    function modifierStateGetter(keyArg) {
      var nativeEvent = this.nativeEvent;
      return nativeEvent.getModifierState ? nativeEvent.getModifierState(keyArg) : (keyArg = modifierKeyToProp[keyArg]) ? !!nativeEvent[keyArg] : false;
    }
    __name(modifierStateGetter, "modifierStateGetter");
    function getEventModifierState() {
      return modifierStateGetter;
    }
    __name(getEventModifierState, "getEventModifierState");
    var KeyboardEventInterface = assign({}, UIEventInterface, {
      key: /* @__PURE__ */ __name(function(nativeEvent) {
        if (nativeEvent.key) {
          var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
          if ("Unidentified" !== key) return key;
        }
        return "keypress" === nativeEvent.type ? (nativeEvent = getEventCharCode(nativeEvent), 13 === nativeEvent ? "Enter" : String.fromCharCode(nativeEvent)) : "keydown" === nativeEvent.type || "keyup" === nativeEvent.type ? translateToKey[nativeEvent.keyCode] || "Unidentified" : "";
      }, "key"),
      code: 0,
      location: 0,
      ctrlKey: 0,
      shiftKey: 0,
      altKey: 0,
      metaKey: 0,
      repeat: 0,
      locale: 0,
      getModifierState: getEventModifierState,
      charCode: /* @__PURE__ */ __name(function(event) {
        return "keypress" === event.type ? getEventCharCode(event) : 0;
      }, "charCode"),
      keyCode: /* @__PURE__ */ __name(function(event) {
        return "keydown" === event.type || "keyup" === event.type ? event.keyCode : 0;
      }, "keyCode"),
      which: /* @__PURE__ */ __name(function(event) {
        return "keypress" === event.type ? getEventCharCode(event) : "keydown" === event.type || "keyup" === event.type ? event.keyCode : 0;
      }, "which")
    }), SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface), PointerEventInterface = assign({}, MouseEventInterface, {
      pointerId: 0,
      width: 0,
      height: 0,
      pressure: 0,
      tangentialPressure: 0,
      tiltX: 0,
      tiltY: 0,
      twist: 0,
      pointerType: 0,
      isPrimary: 0
    }), SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface), TouchEventInterface = assign({}, UIEventInterface, {
      touches: 0,
      targetTouches: 0,
      changedTouches: 0,
      altKey: 0,
      metaKey: 0,
      ctrlKey: 0,
      shiftKey: 0,
      getModifierState: getEventModifierState
    }), SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface), TransitionEventInterface = assign({}, EventInterface, {
      propertyName: 0,
      elapsedTime: 0,
      pseudoElement: 0
    }), SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface), WheelEventInterface = assign({}, MouseEventInterface, {
      deltaX: /* @__PURE__ */ __name(function(event) {
        return "deltaX" in event ? event.deltaX : "wheelDeltaX" in event ? -event.wheelDeltaX : 0;
      }, "deltaX"),
      deltaY: /* @__PURE__ */ __name(function(event) {
        return "deltaY" in event ? event.deltaY : "wheelDeltaY" in event ? -event.wheelDeltaY : "wheelDelta" in event ? -event.wheelDelta : 0;
      }, "deltaY"),
      deltaZ: 0,
      deltaMode: 0
    }), SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface), ToggleEventInterface = assign({}, EventInterface, {
      newState: 0,
      oldState: 0
    }), SyntheticToggleEvent = createSyntheticEvent(ToggleEventInterface), END_KEYCODES = [9, 13, 27, 32], canUseCompositionEvent = canUseDOM && "CompositionEvent" in window, documentMode = null;
    canUseDOM && "documentMode" in document && (documentMode = document.documentMode);
    var canUseTextInputEvent = canUseDOM && "TextEvent" in window && !documentMode, useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && 8 < documentMode && 11 >= documentMode), SPACEBAR_CHAR = String.fromCharCode(32), hasSpaceKeypress = false;
    function isFallbackCompositionEnd(domEventName, nativeEvent) {
      switch (domEventName) {
        case "keyup":
          return -1 !== END_KEYCODES.indexOf(nativeEvent.keyCode);
        case "keydown":
          return 229 !== nativeEvent.keyCode;
        case "keypress":
        case "mousedown":
        case "focusout":
          return true;
        default:
          return false;
      }
    }
    __name(isFallbackCompositionEnd, "isFallbackCompositionEnd");
    function getDataFromCustomEvent(nativeEvent) {
      nativeEvent = nativeEvent.detail;
      return "object" === typeof nativeEvent && "data" in nativeEvent ? nativeEvent.data : null;
    }
    __name(getDataFromCustomEvent, "getDataFromCustomEvent");
    var isComposing = false;
    function getNativeBeforeInputChars(domEventName, nativeEvent) {
      switch (domEventName) {
        case "compositionend":
          return getDataFromCustomEvent(nativeEvent);
        case "keypress":
          if (32 !== nativeEvent.which) return null;
          hasSpaceKeypress = true;
          return SPACEBAR_CHAR;
        case "textInput":
          return domEventName = nativeEvent.data, domEventName === SPACEBAR_CHAR && hasSpaceKeypress ? null : domEventName;
        default:
          return null;
      }
    }
    __name(getNativeBeforeInputChars, "getNativeBeforeInputChars");
    function getFallbackBeforeInputChars(domEventName, nativeEvent) {
      if (isComposing)
        return "compositionend" === domEventName || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent) ? (domEventName = getData(), fallbackText = startText = root2 = null, isComposing = false, domEventName) : null;
      switch (domEventName) {
        case "paste":
          return null;
        case "keypress":
          if (!(nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) || nativeEvent.ctrlKey && nativeEvent.altKey) {
            if (nativeEvent.char && 1 < nativeEvent.char.length)
              return nativeEvent.char;
            if (nativeEvent.which) return String.fromCharCode(nativeEvent.which);
          }
          return null;
        case "compositionend":
          return useFallbackCompositionData && "ko" !== nativeEvent.locale ? null : nativeEvent.data;
        default:
          return null;
      }
    }
    __name(getFallbackBeforeInputChars, "getFallbackBeforeInputChars");
    var supportedInputTypes = {
      color: true,
      date: true,
      datetime: true,
      "datetime-local": true,
      email: true,
      month: true,
      number: true,
      password: true,
      range: true,
      search: true,
      tel: true,
      text: true,
      time: true,
      url: true,
      week: true
    };
    function isTextInputElement(elem) {
      var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
      return "input" === nodeName ? !!supportedInputTypes[elem.type] : "textarea" === nodeName ? true : false;
    }
    __name(isTextInputElement, "isTextInputElement");
    function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {
      restoreTarget ? restoreQueue ? restoreQueue.push(target) : restoreQueue = [target] : restoreTarget = target;
      inst = accumulateTwoPhaseListeners(inst, "onChange");
      0 < inst.length && (nativeEvent = new SyntheticEvent(
        "onChange",
        "change",
        null,
        nativeEvent,
        target
      ), dispatchQueue.push({ event: nativeEvent, listeners: inst }));
    }
    __name(createAndAccumulateChangeEvent, "createAndAccumulateChangeEvent");
    var activeElement$1 = null, activeElementInst$1 = null;
    function runEventInBatch(dispatchQueue) {
      processDispatchQueue(dispatchQueue, 0);
    }
    __name(runEventInBatch, "runEventInBatch");
    function getInstIfValueChanged(targetInst) {
      var targetNode = getNodeFromInstance(targetInst);
      if (updateValueIfChanged(targetNode)) return targetInst;
    }
    __name(getInstIfValueChanged, "getInstIfValueChanged");
    function getTargetInstForChangeEvent(domEventName, targetInst) {
      if ("change" === domEventName) return targetInst;
    }
    __name(getTargetInstForChangeEvent, "getTargetInstForChangeEvent");
    var isInputEventSupported = false;
    if (canUseDOM) {
      var JSCompiler_inline_result$jscomp$282;
      if (canUseDOM) {
        var isSupported$jscomp$inline_417 = "oninput" in document;
        if (!isSupported$jscomp$inline_417) {
          var element$jscomp$inline_418 = document.createElement("div");
          element$jscomp$inline_418.setAttribute("oninput", "return;");
          isSupported$jscomp$inline_417 = "function" === typeof element$jscomp$inline_418.oninput;
        }
        JSCompiler_inline_result$jscomp$282 = isSupported$jscomp$inline_417;
      } else JSCompiler_inline_result$jscomp$282 = false;
      isInputEventSupported = JSCompiler_inline_result$jscomp$282 && (!document.documentMode || 9 < document.documentMode);
    }
    function stopWatchingForValueChange() {
      activeElement$1 && (activeElement$1.detachEvent("onpropertychange", handlePropertyChange), activeElementInst$1 = activeElement$1 = null);
    }
    __name(stopWatchingForValueChange, "stopWatchingForValueChange");
    function handlePropertyChange(nativeEvent) {
      if ("value" === nativeEvent.propertyName && getInstIfValueChanged(activeElementInst$1)) {
        var dispatchQueue = [];
        createAndAccumulateChangeEvent(
          dispatchQueue,
          activeElementInst$1,
          nativeEvent,
          getEventTarget(nativeEvent)
        );
        batchedUpdates$1(runEventInBatch, dispatchQueue);
      }
    }
    __name(handlePropertyChange, "handlePropertyChange");
    function handleEventsForInputEventPolyfill(domEventName, target, targetInst) {
      "focusin" === domEventName ? (stopWatchingForValueChange(), activeElement$1 = target, activeElementInst$1 = targetInst, activeElement$1.attachEvent("onpropertychange", handlePropertyChange)) : "focusout" === domEventName && stopWatchingForValueChange();
    }
    __name(handleEventsForInputEventPolyfill, "handleEventsForInputEventPolyfill");
    function getTargetInstForInputEventPolyfill(domEventName) {
      if ("selectionchange" === domEventName || "keyup" === domEventName || "keydown" === domEventName)
        return getInstIfValueChanged(activeElementInst$1);
    }
    __name(getTargetInstForInputEventPolyfill, "getTargetInstForInputEventPolyfill");
    function getTargetInstForClickEvent(domEventName, targetInst) {
      if ("click" === domEventName) return getInstIfValueChanged(targetInst);
    }
    __name(getTargetInstForClickEvent, "getTargetInstForClickEvent");
    function getTargetInstForInputOrChangeEvent(domEventName, targetInst) {
      if ("input" === domEventName || "change" === domEventName)
        return getInstIfValueChanged(targetInst);
    }
    __name(getTargetInstForInputOrChangeEvent, "getTargetInstForInputOrChangeEvent");
    function is(x2, y2) {
      return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
    }
    __name(is, "is");
    var objectIs = "function" === typeof Object.is ? Object.is : is;
    function shallowEqual2(objA, objB) {
      if (objectIs(objA, objB)) return true;
      if ("object" !== typeof objA || null === objA || "object" !== typeof objB || null === objB)
        return false;
      var keysA = Object.keys(objA), keysB = Object.keys(objB);
      if (keysA.length !== keysB.length) return false;
      for (keysB = 0; keysB < keysA.length; keysB++) {
        var currentKey = keysA[keysB];
        if (!hasOwnProperty2.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey]))
          return false;
      }
      return true;
    }
    __name(shallowEqual2, "shallowEqual");
    function getLeafNode(node) {
      for (; node && node.firstChild; ) node = node.firstChild;
      return node;
    }
    __name(getLeafNode, "getLeafNode");
    function getNodeForCharacterOffset(root3, offset2) {
      var node = getLeafNode(root3);
      root3 = 0;
      for (var nodeEnd; node; ) {
        if (3 === node.nodeType) {
          nodeEnd = root3 + node.textContent.length;
          if (root3 <= offset2 && nodeEnd >= offset2)
            return { node, offset: offset2 - root3 };
          root3 = nodeEnd;
        }
        a: {
          for (; node; ) {
            if (node.nextSibling) {
              node = node.nextSibling;
              break a;
            }
            node = node.parentNode;
          }
          node = void 0;
        }
        node = getLeafNode(node);
      }
    }
    __name(getNodeForCharacterOffset, "getNodeForCharacterOffset");
    function containsNode(outerNode, innerNode) {
      return outerNode && innerNode ? outerNode === innerNode ? true : outerNode && 3 === outerNode.nodeType ? false : innerNode && 3 === innerNode.nodeType ? containsNode(outerNode, innerNode.parentNode) : "contains" in outerNode ? outerNode.contains(innerNode) : outerNode.compareDocumentPosition ? !!(outerNode.compareDocumentPosition(innerNode) & 16) : false : false;
    }
    __name(containsNode, "containsNode");
    function getActiveElementDeep(containerInfo) {
      containerInfo = null != containerInfo && null != containerInfo.ownerDocument && null != containerInfo.ownerDocument.defaultView ? containerInfo.ownerDocument.defaultView : window;
      for (var element = getActiveElement(containerInfo.document); element instanceof containerInfo.HTMLIFrameElement; ) {
        try {
          var JSCompiler_inline_result = "string" === typeof element.contentWindow.location.href;
        } catch (err) {
          JSCompiler_inline_result = false;
        }
        if (JSCompiler_inline_result) containerInfo = element.contentWindow;
        else break;
        element = getActiveElement(containerInfo.document);
      }
      return element;
    }
    __name(getActiveElementDeep, "getActiveElementDeep");
    function hasSelectionCapabilities(elem) {
      var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
      return nodeName && ("input" === nodeName && ("text" === elem.type || "search" === elem.type || "tel" === elem.type || "url" === elem.type || "password" === elem.type) || "textarea" === nodeName || "true" === elem.contentEditable);
    }
    __name(hasSelectionCapabilities, "hasSelectionCapabilities");
    var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && 11 >= document.documentMode, activeElement = null, activeElementInst = null, lastSelection = null, mouseDown = false;
    function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
      var doc = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget.document : 9 === nativeEventTarget.nodeType ? nativeEventTarget : nativeEventTarget.ownerDocument;
      mouseDown || null == activeElement || activeElement !== getActiveElement(doc) || (doc = activeElement, "selectionStart" in doc && hasSelectionCapabilities(doc) ? doc = { start: doc.selectionStart, end: doc.selectionEnd } : (doc = (doc.ownerDocument && doc.ownerDocument.defaultView || window).getSelection(), doc = {
        anchorNode: doc.anchorNode,
        anchorOffset: doc.anchorOffset,
        focusNode: doc.focusNode,
        focusOffset: doc.focusOffset
      }), lastSelection && shallowEqual2(lastSelection, doc) || (lastSelection = doc, doc = accumulateTwoPhaseListeners(activeElementInst, "onSelect"), 0 < doc.length && (nativeEvent = new SyntheticEvent(
        "onSelect",
        "select",
        null,
        nativeEvent,
        nativeEventTarget
      ), dispatchQueue.push({ event: nativeEvent, listeners: doc }), nativeEvent.target = activeElement)));
    }
    __name(constructSelectEvent, "constructSelectEvent");
    function makePrefixMap(styleProp, eventName) {
      var prefixes2 = {};
      prefixes2[styleProp.toLowerCase()] = eventName.toLowerCase();
      prefixes2["Webkit" + styleProp] = "webkit" + eventName;
      prefixes2["Moz" + styleProp] = "moz" + eventName;
      return prefixes2;
    }
    __name(makePrefixMap, "makePrefixMap");
    var vendorPrefixes = {
      animationend: makePrefixMap("Animation", "AnimationEnd"),
      animationiteration: makePrefixMap("Animation", "AnimationIteration"),
      animationstart: makePrefixMap("Animation", "AnimationStart"),
      transitionrun: makePrefixMap("Transition", "TransitionRun"),
      transitionstart: makePrefixMap("Transition", "TransitionStart"),
      transitioncancel: makePrefixMap("Transition", "TransitionCancel"),
      transitionend: makePrefixMap("Transition", "TransitionEnd")
    }, prefixedEventNames = {}, style = {};
    canUseDOM && (style = document.createElement("div").style, "AnimationEvent" in window || (delete vendorPrefixes.animationend.animation, delete vendorPrefixes.animationiteration.animation, delete vendorPrefixes.animationstart.animation), "TransitionEvent" in window || delete vendorPrefixes.transitionend.transition);
    function getVendorPrefixedEventName(eventName) {
      if (prefixedEventNames[eventName]) return prefixedEventNames[eventName];
      if (!vendorPrefixes[eventName]) return eventName;
      var prefixMap = vendorPrefixes[eventName], styleProp;
      for (styleProp in prefixMap)
        if (prefixMap.hasOwnProperty(styleProp) && styleProp in style)
          return prefixedEventNames[eventName] = prefixMap[styleProp];
      return eventName;
    }
    __name(getVendorPrefixedEventName, "getVendorPrefixedEventName");
    var ANIMATION_END = getVendorPrefixedEventName("animationend"), ANIMATION_ITERATION = getVendorPrefixedEventName("animationiteration"), ANIMATION_START = getVendorPrefixedEventName("animationstart"), TRANSITION_RUN = getVendorPrefixedEventName("transitionrun"), TRANSITION_START = getVendorPrefixedEventName("transitionstart"), TRANSITION_CANCEL = getVendorPrefixedEventName("transitioncancel"), TRANSITION_END = getVendorPrefixedEventName("transitionend"), topLevelEventsToReactNames = /* @__PURE__ */ new Map(), simpleEventPluginEvents = "abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(
      " "
    );
    simpleEventPluginEvents.push("scrollEnd");
    function registerSimpleEvent(domEventName, reactName) {
      topLevelEventsToReactNames.set(domEventName, reactName);
      registerTwoPhaseEvent(reactName, [domEventName]);
    }
    __name(registerSimpleEvent, "registerSimpleEvent");
    var CapturedStacks = /* @__PURE__ */ new WeakMap();
    function createCapturedValueAtFiber(value, source) {
      if ("object" === typeof value && null !== value) {
        var existing = CapturedStacks.get(value);
        if (void 0 !== existing) return existing;
        source = {
          value,
          source,
          stack: getStackByFiberInDevAndProd(source)
        };
        CapturedStacks.set(value, source);
        return source;
      }
      return {
        value,
        source,
        stack: getStackByFiberInDevAndProd(source)
      };
    }
    __name(createCapturedValueAtFiber, "createCapturedValueAtFiber");
    var concurrentQueues = [], concurrentQueuesIndex = 0, concurrentlyUpdatedLanes = 0;
    function finishQueueingConcurrentUpdates() {
      for (var endIndex = concurrentQueuesIndex, i2 = concurrentlyUpdatedLanes = concurrentQueuesIndex = 0; i2 < endIndex; ) {
        var fiber = concurrentQueues[i2];
        concurrentQueues[i2++] = null;
        var queue = concurrentQueues[i2];
        concurrentQueues[i2++] = null;
        var update = concurrentQueues[i2];
        concurrentQueues[i2++] = null;
        var lane = concurrentQueues[i2];
        concurrentQueues[i2++] = null;
        if (null !== queue && null !== update) {
          var pending = queue.pending;
          null === pending ? update.next = update : (update.next = pending.next, pending.next = update);
          queue.pending = update;
        }
        0 !== lane && markUpdateLaneFromFiberToRoot(fiber, update, lane);
      }
    }
    __name(finishQueueingConcurrentUpdates, "finishQueueingConcurrentUpdates");
    function enqueueUpdate$1(fiber, queue, update, lane) {
      concurrentQueues[concurrentQueuesIndex++] = fiber;
      concurrentQueues[concurrentQueuesIndex++] = queue;
      concurrentQueues[concurrentQueuesIndex++] = update;
      concurrentQueues[concurrentQueuesIndex++] = lane;
      concurrentlyUpdatedLanes |= lane;
      fiber.lanes |= lane;
      fiber = fiber.alternate;
      null !== fiber && (fiber.lanes |= lane);
    }
    __name(enqueueUpdate$1, "enqueueUpdate$1");
    function enqueueConcurrentHookUpdate(fiber, queue, update, lane) {
      enqueueUpdate$1(fiber, queue, update, lane);
      return getRootForUpdatedFiber(fiber);
    }
    __name(enqueueConcurrentHookUpdate, "enqueueConcurrentHookUpdate");
    function enqueueConcurrentRenderForLane(fiber, lane) {
      enqueueUpdate$1(fiber, null, null, lane);
      return getRootForUpdatedFiber(fiber);
    }
    __name(enqueueConcurrentRenderForLane, "enqueueConcurrentRenderForLane");
    function markUpdateLaneFromFiberToRoot(sourceFiber, update, lane) {
      sourceFiber.lanes |= lane;
      var alternate = sourceFiber.alternate;
      null !== alternate && (alternate.lanes |= lane);
      for (var isHidden2 = false, parent = sourceFiber.return; null !== parent; )
        parent.childLanes |= lane, alternate = parent.alternate, null !== alternate && (alternate.childLanes |= lane), 22 === parent.tag && (sourceFiber = parent.stateNode, null === sourceFiber || sourceFiber._visibility & 1 || (isHidden2 = true)), sourceFiber = parent, parent = parent.return;
      return 3 === sourceFiber.tag ? (parent = sourceFiber.stateNode, isHidden2 && null !== update && (isHidden2 = 31 - clz32(lane), sourceFiber = parent.hiddenUpdates, alternate = sourceFiber[isHidden2], null === alternate ? sourceFiber[isHidden2] = [update] : alternate.push(update), update.lane = lane | 536870912), parent) : null;
    }
    __name(markUpdateLaneFromFiberToRoot, "markUpdateLaneFromFiberToRoot");
    function getRootForUpdatedFiber(sourceFiber) {
      if (50 < nestedUpdateCount)
        throw nestedUpdateCount = 0, rootWithNestedUpdates = null, Error(formatProdErrorMessage(185));
      for (var parent = sourceFiber.return; null !== parent; )
        sourceFiber = parent, parent = sourceFiber.return;
      return 3 === sourceFiber.tag ? sourceFiber.stateNode : null;
    }
    __name(getRootForUpdatedFiber, "getRootForUpdatedFiber");
    var emptyContextObject = {};
    function FiberNode(tag, pendingProps, key, mode) {
      this.tag = tag;
      this.key = key;
      this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null;
      this.index = 0;
      this.refCleanup = this.ref = null;
      this.pendingProps = pendingProps;
      this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;
      this.mode = mode;
      this.subtreeFlags = this.flags = 0;
      this.deletions = null;
      this.childLanes = this.lanes = 0;
      this.alternate = null;
    }
    __name(FiberNode, "FiberNode");
    function createFiberImplClass(tag, pendingProps, key, mode) {
      return new FiberNode(tag, pendingProps, key, mode);
    }
    __name(createFiberImplClass, "createFiberImplClass");
    function shouldConstruct(Component) {
      Component = Component.prototype;
      return !(!Component || !Component.isReactComponent);
    }
    __name(shouldConstruct, "shouldConstruct");
    function createWorkInProgress(current, pendingProps) {
      var workInProgress2 = current.alternate;
      null === workInProgress2 ? (workInProgress2 = createFiberImplClass(
        current.tag,
        pendingProps,
        current.key,
        current.mode
      ), workInProgress2.elementType = current.elementType, workInProgress2.type = current.type, workInProgress2.stateNode = current.stateNode, workInProgress2.alternate = current, current.alternate = workInProgress2) : (workInProgress2.pendingProps = pendingProps, workInProgress2.type = current.type, workInProgress2.flags = 0, workInProgress2.subtreeFlags = 0, workInProgress2.deletions = null);
      workInProgress2.flags = current.flags & 65011712;
      workInProgress2.childLanes = current.childLanes;
      workInProgress2.lanes = current.lanes;
      workInProgress2.child = current.child;
      workInProgress2.memoizedProps = current.memoizedProps;
      workInProgress2.memoizedState = current.memoizedState;
      workInProgress2.updateQueue = current.updateQueue;
      pendingProps = current.dependencies;
      workInProgress2.dependencies = null === pendingProps ? null : { lanes: pendingProps.lanes, firstContext: pendingProps.firstContext };
      workInProgress2.sibling = current.sibling;
      workInProgress2.index = current.index;
      workInProgress2.ref = current.ref;
      workInProgress2.refCleanup = current.refCleanup;
      return workInProgress2;
    }
    __name(createWorkInProgress, "createWorkInProgress");
    function resetWorkInProgress(workInProgress2, renderLanes2) {
      workInProgress2.flags &= 65011714;
      var current = workInProgress2.alternate;
      null === current ? (workInProgress2.childLanes = 0, workInProgress2.lanes = renderLanes2, workInProgress2.child = null, workInProgress2.subtreeFlags = 0, workInProgress2.memoizedProps = null, workInProgress2.memoizedState = null, workInProgress2.updateQueue = null, workInProgress2.dependencies = null, workInProgress2.stateNode = null) : (workInProgress2.childLanes = current.childLanes, workInProgress2.lanes = current.lanes, workInProgress2.child = current.child, workInProgress2.subtreeFlags = 0, workInProgress2.deletions = null, workInProgress2.memoizedProps = current.memoizedProps, workInProgress2.memoizedState = current.memoizedState, workInProgress2.updateQueue = current.updateQueue, workInProgress2.type = current.type, renderLanes2 = current.dependencies, workInProgress2.dependencies = null === renderLanes2 ? null : {
        lanes: renderLanes2.lanes,
        firstContext: renderLanes2.firstContext
      });
      return workInProgress2;
    }
    __name(resetWorkInProgress, "resetWorkInProgress");
    function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes) {
      var fiberTag = 0;
      owner = type;
      if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1);
      else if ("string" === typeof type)
        fiberTag = isHostHoistableType(
          type,
          pendingProps,
          contextStackCursor.current
        ) ? 26 : "html" === type || "head" === type || "body" === type ? 27 : 5;
      else
        a: switch (type) {
          case REACT_ACTIVITY_TYPE:
            return type = createFiberImplClass(31, pendingProps, key, mode), type.elementType = REACT_ACTIVITY_TYPE, type.lanes = lanes, type;
          case REACT_FRAGMENT_TYPE:
            return createFiberFromFragment(pendingProps.children, mode, lanes, key);
          case REACT_STRICT_MODE_TYPE:
            fiberTag = 8;
            mode |= 24;
            break;
          case REACT_PROFILER_TYPE:
            return type = createFiberImplClass(12, pendingProps, key, mode | 2), type.elementType = REACT_PROFILER_TYPE, type.lanes = lanes, type;
          case REACT_SUSPENSE_TYPE:
            return type = createFiberImplClass(13, pendingProps, key, mode), type.elementType = REACT_SUSPENSE_TYPE, type.lanes = lanes, type;
          case REACT_SUSPENSE_LIST_TYPE:
            return type = createFiberImplClass(19, pendingProps, key, mode), type.elementType = REACT_SUSPENSE_LIST_TYPE, type.lanes = lanes, type;
          default:
            if ("object" === typeof type && null !== type)
              switch (type.$$typeof) {
                case REACT_PROVIDER_TYPE:
                case REACT_CONTEXT_TYPE:
                  fiberTag = 10;
                  break a;
                case REACT_CONSUMER_TYPE:
                  fiberTag = 9;
                  break a;
                case REACT_FORWARD_REF_TYPE:
                  fiberTag = 11;
                  break a;
                case REACT_MEMO_TYPE:
                  fiberTag = 14;
                  break a;
                case REACT_LAZY_TYPE2:
                  fiberTag = 16;
                  owner = null;
                  break a;
              }
            fiberTag = 29;
            pendingProps = Error(
              formatProdErrorMessage(130, null === type ? "null" : typeof type, "")
            );
            owner = null;
        }
      key = createFiberImplClass(fiberTag, pendingProps, key, mode);
      key.elementType = type;
      key.type = owner;
      key.lanes = lanes;
      return key;
    }
    __name(createFiberFromTypeAndProps, "createFiberFromTypeAndProps");
    function createFiberFromFragment(elements, mode, lanes, key) {
      elements = createFiberImplClass(7, elements, key, mode);
      elements.lanes = lanes;
      return elements;
    }
    __name(createFiberFromFragment, "createFiberFromFragment");
    function createFiberFromText(content, mode, lanes) {
      content = createFiberImplClass(6, content, null, mode);
      content.lanes = lanes;
      return content;
    }
    __name(createFiberFromText, "createFiberFromText");
    function createFiberFromPortal(portal, mode, lanes) {
      mode = createFiberImplClass(
        4,
        null !== portal.children ? portal.children : [],
        portal.key,
        mode
      );
      mode.lanes = lanes;
      mode.stateNode = {
        containerInfo: portal.containerInfo,
        pendingChildren: null,
        implementation: portal.implementation
      };
      return mode;
    }
    __name(createFiberFromPortal, "createFiberFromPortal");
    var forkStack = [], forkStackIndex = 0, treeForkProvider = null, treeForkCount = 0, idStack = [], idStackIndex = 0, treeContextProvider = null, treeContextId = 1, treeContextOverflow = "";
    function pushTreeFork(workInProgress2, totalChildren) {
      forkStack[forkStackIndex++] = treeForkCount;
      forkStack[forkStackIndex++] = treeForkProvider;
      treeForkProvider = workInProgress2;
      treeForkCount = totalChildren;
    }
    __name(pushTreeFork, "pushTreeFork");
    function pushTreeId(workInProgress2, totalChildren, index3) {
      idStack[idStackIndex++] = treeContextId;
      idStack[idStackIndex++] = treeContextOverflow;
      idStack[idStackIndex++] = treeContextProvider;
      treeContextProvider = workInProgress2;
      var baseIdWithLeadingBit = treeContextId;
      workInProgress2 = treeContextOverflow;
      var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1;
      baseIdWithLeadingBit &= ~(1 << baseLength);
      index3 += 1;
      var length = 32 - clz32(totalChildren) + baseLength;
      if (30 < length) {
        var numberOfOverflowBits = baseLength - baseLength % 5;
        length = (baseIdWithLeadingBit & (1 << numberOfOverflowBits) - 1).toString(32);
        baseIdWithLeadingBit >>= numberOfOverflowBits;
        baseLength -= numberOfOverflowBits;
        treeContextId = 1 << 32 - clz32(totalChildren) + baseLength | index3 << baseLength | baseIdWithLeadingBit;
        treeContextOverflow = length + workInProgress2;
      } else
        treeContextId = 1 << length | index3 << baseLength | baseIdWithLeadingBit, treeContextOverflow = workInProgress2;
    }
    __name(pushTreeId, "pushTreeId");
    function pushMaterializedTreeId(workInProgress2) {
      null !== workInProgress2.return && (pushTreeFork(workInProgress2, 1), pushTreeId(workInProgress2, 1, 0));
    }
    __name(pushMaterializedTreeId, "pushMaterializedTreeId");
    function popTreeContext(workInProgress2) {
      for (; workInProgress2 === treeForkProvider; )
        treeForkProvider = forkStack[--forkStackIndex], forkStack[forkStackIndex] = null, treeForkCount = forkStack[--forkStackIndex], forkStack[forkStackIndex] = null;
      for (; workInProgress2 === treeContextProvider; )
        treeContextProvider = idStack[--idStackIndex], idStack[idStackIndex] = null, treeContextOverflow = idStack[--idStackIndex], idStack[idStackIndex] = null, treeContextId = idStack[--idStackIndex], idStack[idStackIndex] = null;
    }
    __name(popTreeContext, "popTreeContext");
    var hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = false, hydrationErrors = null, rootOrSingletonContext = false, HydrationMismatchException = Error(formatProdErrorMessage(519));
    function throwOnHydrationMismatch(fiber) {
      var error = Error(formatProdErrorMessage(418, ""));
      queueHydrationError(createCapturedValueAtFiber(error, fiber));
      throw HydrationMismatchException;
    }
    __name(throwOnHydrationMismatch, "throwOnHydrationMismatch");
    function prepareToHydrateHostInstance(fiber) {
      var instance = fiber.stateNode, type = fiber.type, props = fiber.memoizedProps;
      instance[internalInstanceKey] = fiber;
      instance[internalPropsKey] = props;
      switch (type) {
        case "dialog":
          listenToNonDelegatedEvent("cancel", instance);
          listenToNonDelegatedEvent("close", instance);
          break;
        case "iframe":
        case "object":
        case "embed":
          listenToNonDelegatedEvent("load", instance);
          break;
        case "video":
        case "audio":
          for (type = 0; type < mediaEventTypes.length; type++)
            listenToNonDelegatedEvent(mediaEventTypes[type], instance);
          break;
        case "source":
          listenToNonDelegatedEvent("error", instance);
          break;
        case "img":
        case "image":
        case "link":
          listenToNonDelegatedEvent("error", instance);
          listenToNonDelegatedEvent("load", instance);
          break;
        case "details":
          listenToNonDelegatedEvent("toggle", instance);
          break;
        case "input":
          listenToNonDelegatedEvent("invalid", instance);
          initInput(
            instance,
            props.value,
            props.defaultValue,
            props.checked,
            props.defaultChecked,
            props.type,
            props.name,
            true
          );
          track(instance);
          break;
        case "select":
          listenToNonDelegatedEvent("invalid", instance);
          break;
        case "textarea":
          listenToNonDelegatedEvent("invalid", instance), initTextarea(instance, props.value, props.defaultValue, props.children), track(instance);
      }
      type = props.children;
      "string" !== typeof type && "number" !== typeof type && "bigint" !== typeof type || instance.textContent === "" + type || true === props.suppressHydrationWarning || checkForUnmatchedText(instance.textContent, type) ? (null != props.popover && (listenToNonDelegatedEvent("beforetoggle", instance), listenToNonDelegatedEvent("toggle", instance)), null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), null != props.onScrollEnd && listenToNonDelegatedEvent("scrollend", instance), null != props.onClick && (instance.onclick = noop$12), instance = true) : instance = false;
      instance || throwOnHydrationMismatch(fiber);
    }
    __name(prepareToHydrateHostInstance, "prepareToHydrateHostInstance");
    function popToNextHostParent(fiber) {
      for (hydrationParentFiber = fiber.return; hydrationParentFiber; )
        switch (hydrationParentFiber.tag) {
          case 5:
          case 13:
            rootOrSingletonContext = false;
            return;
          case 27:
          case 3:
            rootOrSingletonContext = true;
            return;
          default:
            hydrationParentFiber = hydrationParentFiber.return;
        }
    }
    __name(popToNextHostParent, "popToNextHostParent");
    function popHydrationState(fiber) {
      if (fiber !== hydrationParentFiber) return false;
      if (!isHydrating) return popToNextHostParent(fiber), isHydrating = true, false;
      var tag = fiber.tag, JSCompiler_temp;
      if (JSCompiler_temp = 3 !== tag && 27 !== tag) {
        if (JSCompiler_temp = 5 === tag)
          JSCompiler_temp = fiber.type, JSCompiler_temp = !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || shouldSetTextContent(fiber.type, fiber.memoizedProps);
        JSCompiler_temp = !JSCompiler_temp;
      }
      JSCompiler_temp && nextHydratableInstance && throwOnHydrationMismatch(fiber);
      popToNextHostParent(fiber);
      if (13 === tag) {
        fiber = fiber.memoizedState;
        fiber = null !== fiber ? fiber.dehydrated : null;
        if (!fiber) throw Error(formatProdErrorMessage(317));
        a: {
          fiber = fiber.nextSibling;
          for (tag = 0; fiber; ) {
            if (8 === fiber.nodeType)
              if (JSCompiler_temp = fiber.data, "/$" === JSCompiler_temp) {
                if (0 === tag) {
                  nextHydratableInstance = getNextHydratable(fiber.nextSibling);
                  break a;
                }
                tag--;
              } else
                "$" !== JSCompiler_temp && "$!" !== JSCompiler_temp && "$?" !== JSCompiler_temp || tag++;
            fiber = fiber.nextSibling;
          }
          nextHydratableInstance = null;
        }
      } else
        27 === tag ? (tag = nextHydratableInstance, isSingletonScope(fiber.type) ? (fiber = previousHydratableOnEnteringScopedSingleton, previousHydratableOnEnteringScopedSingleton = null, nextHydratableInstance = fiber) : nextHydratableInstance = tag) : nextHydratableInstance = hydrationParentFiber ? getNextHydratable(fiber.stateNode.nextSibling) : null;
      return true;
    }
    __name(popHydrationState, "popHydrationState");
    function resetHydrationState() {
      nextHydratableInstance = hydrationParentFiber = null;
      isHydrating = false;
    }
    __name(resetHydrationState, "resetHydrationState");
    function upgradeHydrationErrorsToRecoverable() {
      var queuedErrors = hydrationErrors;
      null !== queuedErrors && (null === workInProgressRootRecoverableErrors ? workInProgressRootRecoverableErrors = queuedErrors : workInProgressRootRecoverableErrors.push.apply(
        workInProgressRootRecoverableErrors,
        queuedErrors
      ), hydrationErrors = null);
      return queuedErrors;
    }
    __name(upgradeHydrationErrorsToRecoverable, "upgradeHydrationErrorsToRecoverable");
    function queueHydrationError(error) {
      null === hydrationErrors ? hydrationErrors = [error] : hydrationErrors.push(error);
    }
    __name(queueHydrationError, "queueHydrationError");
    var valueCursor = createCursor(null), currentlyRenderingFiber$1 = null, lastContextDependency = null;
    function pushProvider(providerFiber, context, nextValue) {
      push(valueCursor, context._currentValue);
      context._currentValue = nextValue;
    }
    __name(pushProvider, "pushProvider");
    function popProvider(context) {
      context._currentValue = valueCursor.current;
      pop(valueCursor);
    }
    __name(popProvider, "popProvider");
    function scheduleContextWorkOnParentPath(parent, renderLanes2, propagationRoot) {
      for (; null !== parent; ) {
        var alternate = parent.alternate;
        (parent.childLanes & renderLanes2) !== renderLanes2 ? (parent.childLanes |= renderLanes2, null !== alternate && (alternate.childLanes |= renderLanes2)) : null !== alternate && (alternate.childLanes & renderLanes2) !== renderLanes2 && (alternate.childLanes |= renderLanes2);
        if (parent === propagationRoot) break;
        parent = parent.return;
      }
    }
    __name(scheduleContextWorkOnParentPath, "scheduleContextWorkOnParentPath");
    function propagateContextChanges(workInProgress2, contexts, renderLanes2, forcePropagateEntireTree) {
      var fiber = workInProgress2.child;
      null !== fiber && (fiber.return = workInProgress2);
      for (; null !== fiber; ) {
        var list = fiber.dependencies;
        if (null !== list) {
          var nextFiber = fiber.child;
          list = list.firstContext;
          a: for (; null !== list; ) {
            var dependency = list;
            list = fiber;
            for (var i2 = 0; i2 < contexts.length; i2++)
              if (dependency.context === contexts[i2]) {
                list.lanes |= renderLanes2;
                dependency = list.alternate;
                null !== dependency && (dependency.lanes |= renderLanes2);
                scheduleContextWorkOnParentPath(
                  list.return,
                  renderLanes2,
                  workInProgress2
                );
                forcePropagateEntireTree || (nextFiber = null);
                break a;
              }
            list = dependency.next;
          }
        } else if (18 === fiber.tag) {
          nextFiber = fiber.return;
          if (null === nextFiber) throw Error(formatProdErrorMessage(341));
          nextFiber.lanes |= renderLanes2;
          list = nextFiber.alternate;
          null !== list && (list.lanes |= renderLanes2);
          scheduleContextWorkOnParentPath(nextFiber, renderLanes2, workInProgress2);
          nextFiber = null;
        } else nextFiber = fiber.child;
        if (null !== nextFiber) nextFiber.return = fiber;
        else
          for (nextFiber = fiber; null !== nextFiber; ) {
            if (nextFiber === workInProgress2) {
              nextFiber = null;
              break;
            }
            fiber = nextFiber.sibling;
            if (null !== fiber) {
              fiber.return = nextFiber.return;
              nextFiber = fiber;
              break;
            }
            nextFiber = nextFiber.return;
          }
        fiber = nextFiber;
      }
    }
    __name(propagateContextChanges, "propagateContextChanges");
    function propagateParentContextChanges(current, workInProgress2, renderLanes2, forcePropagateEntireTree) {
      current = null;
      for (var parent = workInProgress2, isInsidePropagationBailout = false; null !== parent; ) {
        if (!isInsidePropagationBailout) {
          if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = true;
          else if (0 !== (parent.flags & 262144)) break;
        }
        if (10 === parent.tag) {
          var currentParent = parent.alternate;
          if (null === currentParent) throw Error(formatProdErrorMessage(387));
          currentParent = currentParent.memoizedProps;
          if (null !== currentParent) {
            var context = parent.type;
            objectIs(parent.pendingProps.value, currentParent.value) || (null !== current ? current.push(context) : current = [context]);
          }
        } else if (parent === hostTransitionProviderCursor.current) {
          currentParent = parent.alternate;
          if (null === currentParent) throw Error(formatProdErrorMessage(387));
          currentParent.memoizedState.memoizedState !== parent.memoizedState.memoizedState && (null !== current ? current.push(HostTransitionContext) : current = [HostTransitionContext]);
        }
        parent = parent.return;
      }
      null !== current && propagateContextChanges(
        workInProgress2,
        current,
        renderLanes2,
        forcePropagateEntireTree
      );
      workInProgress2.flags |= 262144;
    }
    __name(propagateParentContextChanges, "propagateParentContextChanges");
    function checkIfContextChanged(currentDependencies) {
      for (currentDependencies = currentDependencies.firstContext; null !== currentDependencies; ) {
        if (!objectIs(
          currentDependencies.context._currentValue,
          currentDependencies.memoizedValue
        ))
          return true;
        currentDependencies = currentDependencies.next;
      }
      return false;
    }
    __name(checkIfContextChanged, "checkIfContextChanged");
    function prepareToReadContext(workInProgress2) {
      currentlyRenderingFiber$1 = workInProgress2;
      lastContextDependency = null;
      workInProgress2 = workInProgress2.dependencies;
      null !== workInProgress2 && (workInProgress2.firstContext = null);
    }
    __name(prepareToReadContext, "prepareToReadContext");
    function readContext(context) {
      return readContextForConsumer(currentlyRenderingFiber$1, context);
    }
    __name(readContext, "readContext");
    function readContextDuringReconciliation(consumer, context) {
      null === currentlyRenderingFiber$1 && prepareToReadContext(consumer);
      return readContextForConsumer(consumer, context);
    }
    __name(readContextDuringReconciliation, "readContextDuringReconciliation");
    function readContextForConsumer(consumer, context) {
      var value = context._currentValue;
      context = { context, memoizedValue: value, next: null };
      if (null === lastContextDependency) {
        if (null === consumer) throw Error(formatProdErrorMessage(308));
        lastContextDependency = context;
        consumer.dependencies = { lanes: 0, firstContext: context };
        consumer.flags |= 524288;
      } else lastContextDependency = lastContextDependency.next = context;
      return value;
    }
    __name(readContextForConsumer, "readContextForConsumer");
    var AbortControllerLocal = "undefined" !== typeof AbortController ? AbortController : function() {
      var listeners = [], signal = this.signal = {
        aborted: false,
        addEventListener: /* @__PURE__ */ __name(function(type, listener) {
          listeners.push(listener);
        }, "addEventListener")
      };
      this.abort = function() {
        signal.aborted = true;
        listeners.forEach(function(listener) {
          return listener();
        });
      };
    }, scheduleCallback$2 = Scheduler.unstable_scheduleCallback, NormalPriority = Scheduler.unstable_NormalPriority, CacheContext = {
      $$typeof: REACT_CONTEXT_TYPE,
      Consumer: null,
      Provider: null,
      _currentValue: null,
      _currentValue2: null,
      _threadCount: 0
    };
    function createCache() {
      return {
        controller: new AbortControllerLocal(),
        data: /* @__PURE__ */ new Map(),
        refCount: 0
      };
    }
    __name(createCache, "createCache");
    function releaseCache(cache) {
      cache.refCount--;
      0 === cache.refCount && scheduleCallback$2(NormalPriority, function() {
        cache.controller.abort();
      });
    }
    __name(releaseCache, "releaseCache");
    var currentEntangledListeners = null, currentEntangledPendingCount = 0, currentEntangledLane = 0, currentEntangledActionThenable = null;
    function entangleAsyncAction(transition, thenable) {
      if (null === currentEntangledListeners) {
        var entangledListeners = currentEntangledListeners = [];
        currentEntangledPendingCount = 0;
        currentEntangledLane = requestTransitionLane();
        currentEntangledActionThenable = {
          status: "pending",
          value: void 0,
          then: /* @__PURE__ */ __name(function(resolve) {
            entangledListeners.push(resolve);
          }, "then")
        };
      }
      currentEntangledPendingCount++;
      thenable.then(pingEngtangledActionScope, pingEngtangledActionScope);
      return thenable;
    }
    __name(entangleAsyncAction, "entangleAsyncAction");
    function pingEngtangledActionScope() {
      if (0 === --currentEntangledPendingCount && null !== currentEntangledListeners) {
        null !== currentEntangledActionThenable && (currentEntangledActionThenable.status = "fulfilled");
        var listeners = currentEntangledListeners;
        currentEntangledListeners = null;
        currentEntangledLane = 0;
        currentEntangledActionThenable = null;
        for (var i2 = 0; i2 < listeners.length; i2++) (0, listeners[i2])();
      }
    }
    __name(pingEngtangledActionScope, "pingEngtangledActionScope");
    function chainThenableValue(thenable, result) {
      var listeners = [], thenableWithOverride = {
        status: "pending",
        value: null,
        reason: null,
        then: /* @__PURE__ */ __name(function(resolve) {
          listeners.push(resolve);
        }, "then")
      };
      thenable.then(
        function() {
          thenableWithOverride.status = "fulfilled";
          thenableWithOverride.value = result;
          for (var i2 = 0; i2 < listeners.length; i2++) (0, listeners[i2])(result);
        },
        function(error) {
          thenableWithOverride.status = "rejected";
          thenableWithOverride.reason = error;
          for (error = 0; error < listeners.length; error++)
            (0, listeners[error])(void 0);
        }
      );
      return thenableWithOverride;
    }
    __name(chainThenableValue, "chainThenableValue");
    var prevOnStartTransitionFinish = ReactSharedInternals.S;
    ReactSharedInternals.S = function(transition, returnValue) {
      "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && entangleAsyncAction(transition, returnValue);
      null !== prevOnStartTransitionFinish && prevOnStartTransitionFinish(transition, returnValue);
    };
    var resumedCache = createCursor(null);
    function peekCacheFromPool() {
      var cacheResumedFromPreviousRender = resumedCache.current;
      return null !== cacheResumedFromPreviousRender ? cacheResumedFromPreviousRender : workInProgressRoot.pooledCache;
    }
    __name(peekCacheFromPool, "peekCacheFromPool");
    function pushTransition(offscreenWorkInProgress, prevCachePool) {
      null === prevCachePool ? push(resumedCache, resumedCache.current) : push(resumedCache, prevCachePool.pool);
    }
    __name(pushTransition, "pushTransition");
    function getSuspendedCache() {
      var cacheFromPool = peekCacheFromPool();
      return null === cacheFromPool ? null : { parent: CacheContext._currentValue, pool: cacheFromPool };
    }
    __name(getSuspendedCache, "getSuspendedCache");
    var SuspenseException = Error(formatProdErrorMessage(460)), SuspenseyCommitException = Error(formatProdErrorMessage(474)), SuspenseActionException = Error(formatProdErrorMessage(542)), noopSuspenseyCommitThenable = { then: /* @__PURE__ */ __name(function() {
    }, "then") };
    function isThenableResolved(thenable) {
      thenable = thenable.status;
      return "fulfilled" === thenable || "rejected" === thenable;
    }
    __name(isThenableResolved, "isThenableResolved");
    function noop$3() {
    }
    __name(noop$3, "noop$3");
    function trackUsedThenable(thenableState2, thenable, index3) {
      index3 = thenableState2[index3];
      void 0 === index3 ? thenableState2.push(thenable) : index3 !== thenable && (thenable.then(noop$3, noop$3), thenable = index3);
      switch (thenable.status) {
        case "fulfilled":
          return thenable.value;
        case "rejected":
          throw thenableState2 = thenable.reason, checkIfUseWrappedInAsyncCatch(thenableState2), thenableState2;
        default:
          if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3);
          else {
            thenableState2 = workInProgressRoot;
            if (null !== thenableState2 && 100 < thenableState2.shellSuspendCounter)
              throw Error(formatProdErrorMessage(482));
            thenableState2 = thenable;
            thenableState2.status = "pending";
            thenableState2.then(
              function(fulfilledValue) {
                if ("pending" === thenable.status) {
                  var fulfilledThenable = thenable;
                  fulfilledThenable.status = "fulfilled";
                  fulfilledThenable.value = fulfilledValue;
                }
              },
              function(error) {
                if ("pending" === thenable.status) {
                  var rejectedThenable = thenable;
                  rejectedThenable.status = "rejected";
                  rejectedThenable.reason = error;
                }
              }
            );
          }
          switch (thenable.status) {
            case "fulfilled":
              return thenable.value;
            case "rejected":
              throw thenableState2 = thenable.reason, checkIfUseWrappedInAsyncCatch(thenableState2), thenableState2;
          }
          suspendedThenable = thenable;
          throw SuspenseException;
      }
    }
    __name(trackUsedThenable, "trackUsedThenable");
    var suspendedThenable = null;
    function getSuspendedThenable() {
      if (null === suspendedThenable) throw Error(formatProdErrorMessage(459));
      var thenable = suspendedThenable;
      suspendedThenable = null;
      return thenable;
    }
    __name(getSuspendedThenable, "getSuspendedThenable");
    function checkIfUseWrappedInAsyncCatch(rejectedReason) {
      if (rejectedReason === SuspenseException || rejectedReason === SuspenseActionException)
        throw Error(formatProdErrorMessage(483));
    }
    __name(checkIfUseWrappedInAsyncCatch, "checkIfUseWrappedInAsyncCatch");
    var hasForceUpdate = false;
    function initializeUpdateQueue(fiber) {
      fiber.updateQueue = {
        baseState: fiber.memoizedState,
        firstBaseUpdate: null,
        lastBaseUpdate: null,
        shared: { pending: null, lanes: 0, hiddenCallbacks: null },
        callbacks: null
      };
    }
    __name(initializeUpdateQueue, "initializeUpdateQueue");
    function cloneUpdateQueue(current, workInProgress2) {
      current = current.updateQueue;
      workInProgress2.updateQueue === current && (workInProgress2.updateQueue = {
        baseState: current.baseState,
        firstBaseUpdate: current.firstBaseUpdate,
        lastBaseUpdate: current.lastBaseUpdate,
        shared: current.shared,
        callbacks: null
      });
    }
    __name(cloneUpdateQueue, "cloneUpdateQueue");
    function createUpdate(lane) {
      return { lane, tag: 0, payload: null, callback: null, next: null };
    }
    __name(createUpdate, "createUpdate");
    function enqueueUpdate(fiber, update, lane) {
      var updateQueue = fiber.updateQueue;
      if (null === updateQueue) return null;
      updateQueue = updateQueue.shared;
      if (0 !== (executionContext & 2)) {
        var pending = updateQueue.pending;
        null === pending ? update.next = update : (update.next = pending.next, pending.next = update);
        updateQueue.pending = update;
        update = getRootForUpdatedFiber(fiber);
        markUpdateLaneFromFiberToRoot(fiber, null, lane);
        return update;
      }
      enqueueUpdate$1(fiber, updateQueue, update, lane);
      return getRootForUpdatedFiber(fiber);
    }
    __name(enqueueUpdate, "enqueueUpdate");
    function entangleTransitions(root3, fiber, lane) {
      fiber = fiber.updateQueue;
      if (null !== fiber && (fiber = fiber.shared, 0 !== (lane & 4194048))) {
        var queueLanes = fiber.lanes;
        queueLanes &= root3.pendingLanes;
        lane |= queueLanes;
        fiber.lanes = lane;
        markRootEntangled(root3, lane);
      }
    }
    __name(entangleTransitions, "entangleTransitions");
    function enqueueCapturedUpdate(workInProgress2, capturedUpdate) {
      var queue = workInProgress2.updateQueue, current = workInProgress2.alternate;
      if (null !== current && (current = current.updateQueue, queue === current)) {
        var newFirst = null, newLast = null;
        queue = queue.firstBaseUpdate;
        if (null !== queue) {
          do {
            var clone2 = {
              lane: queue.lane,
              tag: queue.tag,
              payload: queue.payload,
              callback: null,
              next: null
            };
            null === newLast ? newFirst = newLast = clone2 : newLast = newLast.next = clone2;
            queue = queue.next;
          } while (null !== queue);
          null === newLast ? newFirst = newLast = capturedUpdate : newLast = newLast.next = capturedUpdate;
        } else newFirst = newLast = capturedUpdate;
        queue = {
          baseState: current.baseState,
          firstBaseUpdate: newFirst,
          lastBaseUpdate: newLast,
          shared: current.shared,
          callbacks: current.callbacks
        };
        workInProgress2.updateQueue = queue;
        return;
      }
      workInProgress2 = queue.lastBaseUpdate;
      null === workInProgress2 ? queue.firstBaseUpdate = capturedUpdate : workInProgress2.next = capturedUpdate;
      queue.lastBaseUpdate = capturedUpdate;
    }
    __name(enqueueCapturedUpdate, "enqueueCapturedUpdate");
    var didReadFromEntangledAsyncAction = false;
    function suspendIfUpdateReadFromEntangledAsyncAction() {
      if (didReadFromEntangledAsyncAction) {
        var entangledActionThenable = currentEntangledActionThenable;
        if (null !== entangledActionThenable) throw entangledActionThenable;
      }
    }
    __name(suspendIfUpdateReadFromEntangledAsyncAction, "suspendIfUpdateReadFromEntangledAsyncAction");
    function processUpdateQueue(workInProgress$jscomp$0, props, instance$jscomp$0, renderLanes2) {
      didReadFromEntangledAsyncAction = false;
      var queue = workInProgress$jscomp$0.updateQueue;
      hasForceUpdate = false;
      var firstBaseUpdate = queue.firstBaseUpdate, lastBaseUpdate = queue.lastBaseUpdate, pendingQueue = queue.shared.pending;
      if (null !== pendingQueue) {
        queue.shared.pending = null;
        var lastPendingUpdate = pendingQueue, firstPendingUpdate = lastPendingUpdate.next;
        lastPendingUpdate.next = null;
        null === lastBaseUpdate ? firstBaseUpdate = firstPendingUpdate : lastBaseUpdate.next = firstPendingUpdate;
        lastBaseUpdate = lastPendingUpdate;
        var current = workInProgress$jscomp$0.alternate;
        null !== current && (current = current.updateQueue, pendingQueue = current.lastBaseUpdate, pendingQueue !== lastBaseUpdate && (null === pendingQueue ? current.firstBaseUpdate = firstPendingUpdate : pendingQueue.next = firstPendingUpdate, current.lastBaseUpdate = lastPendingUpdate));
      }
      if (null !== firstBaseUpdate) {
        var newState = queue.baseState;
        lastBaseUpdate = 0;
        current = firstPendingUpdate = lastPendingUpdate = null;
        pendingQueue = firstBaseUpdate;
        do {
          var updateLane = pendingQueue.lane & -536870913, isHiddenUpdate = updateLane !== pendingQueue.lane;
          if (isHiddenUpdate ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes2 & updateLane) === updateLane) {
            0 !== updateLane && updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction = true);
            null !== current && (current = current.next = {
              lane: 0,
              tag: pendingQueue.tag,
              payload: pendingQueue.payload,
              callback: null,
              next: null
            });
            a: {
              var workInProgress2 = workInProgress$jscomp$0, update = pendingQueue;
              updateLane = props;
              var instance = instance$jscomp$0;
              switch (update.tag) {
                case 1:
                  workInProgress2 = update.payload;
                  if ("function" === typeof workInProgress2) {
                    newState = workInProgress2.call(instance, newState, updateLane);
                    break a;
                  }
                  newState = workInProgress2;
                  break a;
                case 3:
                  workInProgress2.flags = workInProgress2.flags & -65537 | 128;
                case 0:
                  workInProgress2 = update.payload;
                  updateLane = "function" === typeof workInProgress2 ? workInProgress2.call(instance, newState, updateLane) : workInProgress2;
                  if (null === updateLane || void 0 === updateLane) break a;
                  newState = assign({}, newState, updateLane);
                  break a;
                case 2:
                  hasForceUpdate = true;
              }
            }
            updateLane = pendingQueue.callback;
            null !== updateLane && (workInProgress$jscomp$0.flags |= 64, isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), isHiddenUpdate = queue.callbacks, null === isHiddenUpdate ? queue.callbacks = [updateLane] : isHiddenUpdate.push(updateLane));
          } else
            isHiddenUpdate = {
              lane: updateLane,
              tag: pendingQueue.tag,
              payload: pendingQueue.payload,
              callback: pendingQueue.callback,
              next: null
            }, null === current ? (firstPendingUpdate = current = isHiddenUpdate, lastPendingUpdate = newState) : current = current.next = isHiddenUpdate, lastBaseUpdate |= updateLane;
          pendingQueue = pendingQueue.next;
          if (null === pendingQueue)
            if (pendingQueue = queue.shared.pending, null === pendingQueue)
              break;
            else
              isHiddenUpdate = pendingQueue, pendingQueue = isHiddenUpdate.next, isHiddenUpdate.next = null, queue.lastBaseUpdate = isHiddenUpdate, queue.shared.pending = null;
        } while (1);
        null === current && (lastPendingUpdate = newState);
        queue.baseState = lastPendingUpdate;
        queue.firstBaseUpdate = firstPendingUpdate;
        queue.lastBaseUpdate = current;
        null === firstBaseUpdate && (queue.shared.lanes = 0);
        workInProgressRootSkippedLanes |= lastBaseUpdate;
        workInProgress$jscomp$0.lanes = lastBaseUpdate;
        workInProgress$jscomp$0.memoizedState = newState;
      }
    }
    __name(processUpdateQueue, "processUpdateQueue");
    function callCallback(callback, context) {
      if ("function" !== typeof callback)
        throw Error(formatProdErrorMessage(191, callback));
      callback.call(context);
    }
    __name(callCallback, "callCallback");
    function commitCallbacks(updateQueue, context) {
      var callbacks = updateQueue.callbacks;
      if (null !== callbacks)
        for (updateQueue.callbacks = null, updateQueue = 0; updateQueue < callbacks.length; updateQueue++)
          callCallback(callbacks[updateQueue], context);
    }
    __name(commitCallbacks, "commitCallbacks");
    var currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0);
    function pushHiddenContext(fiber, context) {
      fiber = entangledRenderLanes;
      push(prevEntangledRenderLanesCursor, fiber);
      push(currentTreeHiddenStackCursor, context);
      entangledRenderLanes = fiber | context.baseLanes;
    }
    __name(pushHiddenContext, "pushHiddenContext");
    function reuseHiddenContextOnStack() {
      push(prevEntangledRenderLanesCursor, entangledRenderLanes);
      push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current);
    }
    __name(reuseHiddenContextOnStack, "reuseHiddenContextOnStack");
    function popHiddenContext() {
      entangledRenderLanes = prevEntangledRenderLanesCursor.current;
      pop(currentTreeHiddenStackCursor);
      pop(prevEntangledRenderLanesCursor);
    }
    __name(popHiddenContext, "popHiddenContext");
    var renderLanes = 0, currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = false, didScheduleRenderPhaseUpdateDuringThisPass = false, shouldDoubleInvokeUserFnsInHooksDEV = false, localIdCounter = 0, thenableIndexCounter$1 = 0, thenableState$1 = null, globalClientIdCounter = 0;
    function throwInvalidHookError() {
      throw Error(formatProdErrorMessage(321));
    }
    __name(throwInvalidHookError, "throwInvalidHookError");
    function areHookInputsEqual(nextDeps, prevDeps) {
      if (null === prevDeps) return false;
      for (var i2 = 0; i2 < prevDeps.length && i2 < nextDeps.length; i2++)
        if (!objectIs(nextDeps[i2], prevDeps[i2])) return false;
      return true;
    }
    __name(areHookInputsEqual, "areHookInputsEqual");
    function renderWithHooks(current, workInProgress2, Component, props, secondArg, nextRenderLanes) {
      renderLanes = nextRenderLanes;
      currentlyRenderingFiber = workInProgress2;
      workInProgress2.memoizedState = null;
      workInProgress2.updateQueue = null;
      workInProgress2.lanes = 0;
      ReactSharedInternals.H = null === current || null === current.memoizedState ? HooksDispatcherOnMount : HooksDispatcherOnUpdate;
      shouldDoubleInvokeUserFnsInHooksDEV = false;
      nextRenderLanes = Component(props, secondArg);
      shouldDoubleInvokeUserFnsInHooksDEV = false;
      didScheduleRenderPhaseUpdateDuringThisPass && (nextRenderLanes = renderWithHooksAgain(
        workInProgress2,
        Component,
        props,
        secondArg
      ));
      finishRenderingHooks(current);
      return nextRenderLanes;
    }
    __name(renderWithHooks, "renderWithHooks");
    function finishRenderingHooks(current) {
      ReactSharedInternals.H = ContextOnlyDispatcher;
      var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next;
      renderLanes = 0;
      workInProgressHook = currentHook = currentlyRenderingFiber = null;
      didScheduleRenderPhaseUpdate = false;
      thenableIndexCounter$1 = 0;
      thenableState$1 = null;
      if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300));
      null === current || didReceiveUpdate || (current = current.dependencies, null !== current && checkIfContextChanged(current) && (didReceiveUpdate = true));
    }
    __name(finishRenderingHooks, "finishRenderingHooks");
    function renderWithHooksAgain(workInProgress2, Component, props, secondArg) {
      currentlyRenderingFiber = workInProgress2;
      var numberOfReRenders = 0;
      do {
        didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null);
        thenableIndexCounter$1 = 0;
        didScheduleRenderPhaseUpdateDuringThisPass = false;
        if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301));
        numberOfReRenders += 1;
        workInProgressHook = currentHook = null;
        if (null != workInProgress2.updateQueue) {
          var children = workInProgress2.updateQueue;
          children.lastEffect = null;
          children.events = null;
          children.stores = null;
          null != children.memoCache && (children.memoCache.index = 0);
        }
        ReactSharedInternals.H = HooksDispatcherOnRerender;
        children = Component(props, secondArg);
      } while (didScheduleRenderPhaseUpdateDuringThisPass);
      return children;
    }
    __name(renderWithHooksAgain, "renderWithHooksAgain");
    function TransitionAwareHostComponent() {
      var dispatcher = ReactSharedInternals.H, maybeThenable = dispatcher.useState()[0];
      maybeThenable = "function" === typeof maybeThenable.then ? useThenable(maybeThenable) : maybeThenable;
      dispatcher = dispatcher.useState()[0];
      (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && (currentlyRenderingFiber.flags |= 1024);
      return maybeThenable;
    }
    __name(TransitionAwareHostComponent, "TransitionAwareHostComponent");
    function checkDidRenderIdHook() {
      var didRenderIdHook = 0 !== localIdCounter;
      localIdCounter = 0;
      return didRenderIdHook;
    }
    __name(checkDidRenderIdHook, "checkDidRenderIdHook");
    function bailoutHooks(current, workInProgress2, lanes) {
      workInProgress2.updateQueue = current.updateQueue;
      workInProgress2.flags &= -2053;
      current.lanes &= ~lanes;
    }
    __name(bailoutHooks, "bailoutHooks");
    function resetHooksOnUnwind(workInProgress2) {
      if (didScheduleRenderPhaseUpdate) {
        for (workInProgress2 = workInProgress2.memoizedState; null !== workInProgress2; ) {
          var queue = workInProgress2.queue;
          null !== queue && (queue.pending = null);
          workInProgress2 = workInProgress2.next;
        }
        didScheduleRenderPhaseUpdate = false;
      }
      renderLanes = 0;
      workInProgressHook = currentHook = currentlyRenderingFiber = null;
      didScheduleRenderPhaseUpdateDuringThisPass = false;
      thenableIndexCounter$1 = localIdCounter = 0;
      thenableState$1 = null;
    }
    __name(resetHooksOnUnwind, "resetHooksOnUnwind");
    function mountWorkInProgressHook() {
      var hook = {
        memoizedState: null,
        baseState: null,
        baseQueue: null,
        queue: null,
        next: null
      };
      null === workInProgressHook ? currentlyRenderingFiber.memoizedState = workInProgressHook = hook : workInProgressHook = workInProgressHook.next = hook;
      return workInProgressHook;
    }
    __name(mountWorkInProgressHook, "mountWorkInProgressHook");
    function updateWorkInProgressHook() {
      if (null === currentHook) {
        var nextCurrentHook = currentlyRenderingFiber.alternate;
        nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
      } else nextCurrentHook = currentHook.next;
      var nextWorkInProgressHook = null === workInProgressHook ? currentlyRenderingFiber.memoizedState : workInProgressHook.next;
      if (null !== nextWorkInProgressHook)
        workInProgressHook = nextWorkInProgressHook, currentHook = nextCurrentHook;
      else {
        if (null === nextCurrentHook) {
          if (null === currentlyRenderingFiber.alternate)
            throw Error(formatProdErrorMessage(467));
          throw Error(formatProdErrorMessage(310));
        }
        currentHook = nextCurrentHook;
        nextCurrentHook = {
          memoizedState: currentHook.memoizedState,
          baseState: currentHook.baseState,
          baseQueue: currentHook.baseQueue,
          queue: currentHook.queue,
          next: null
        };
        null === workInProgressHook ? currentlyRenderingFiber.memoizedState = workInProgressHook = nextCurrentHook : workInProgressHook = workInProgressHook.next = nextCurrentHook;
      }
      return workInProgressHook;
    }
    __name(updateWorkInProgressHook, "updateWorkInProgressHook");
    function createFunctionComponentUpdateQueue() {
      return { lastEffect: null, events: null, stores: null, memoCache: null };
    }
    __name(createFunctionComponentUpdateQueue, "createFunctionComponentUpdateQueue");
    function useThenable(thenable) {
      var index3 = thenableIndexCounter$1;
      thenableIndexCounter$1 += 1;
      null === thenableState$1 && (thenableState$1 = []);
      thenable = trackUsedThenable(thenableState$1, thenable, index3);
      index3 = currentlyRenderingFiber;
      null === (null === workInProgressHook ? index3.memoizedState : workInProgressHook.next) && (index3 = index3.alternate, ReactSharedInternals.H = null === index3 || null === index3.memoizedState ? HooksDispatcherOnMount : HooksDispatcherOnUpdate);
      return thenable;
    }
    __name(useThenable, "useThenable");
    function use2(usable) {
      if (null !== usable && "object" === typeof usable) {
        if ("function" === typeof usable.then) return useThenable(usable);
        if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
      }
      throw Error(formatProdErrorMessage(438, String(usable)));
    }
    __name(use2, "use");
    function useMemoCache(size2) {
      var memoCache = null, updateQueue = currentlyRenderingFiber.updateQueue;
      null !== updateQueue && (memoCache = updateQueue.memoCache);
      if (null == memoCache) {
        var current = currentlyRenderingFiber.alternate;
        null !== current && (current = current.updateQueue, null !== current && (current = current.memoCache, null != current && (memoCache = {
          data: current.data.map(function(array2) {
            return array2.slice();
          }),
          index: 0
        })));
      }
      null == memoCache && (memoCache = { data: [], index: 0 });
      null === updateQueue && (updateQueue = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = updateQueue);
      updateQueue.memoCache = memoCache;
      updateQueue = memoCache.data[memoCache.index];
      if (void 0 === updateQueue)
        for (updateQueue = memoCache.data[memoCache.index] = Array(size2), current = 0; current < size2; current++)
          updateQueue[current] = REACT_MEMO_CACHE_SENTINEL;
      memoCache.index++;
      return updateQueue;
    }
    __name(useMemoCache, "useMemoCache");
    function basicStateReducer(state, action) {
      return "function" === typeof action ? action(state) : action;
    }
    __name(basicStateReducer, "basicStateReducer");
    function updateReducer(reducer) {
      var hook = updateWorkInProgressHook();
      return updateReducerImpl(hook, currentHook, reducer);
    }
    __name(updateReducer, "updateReducer");
    function updateReducerImpl(hook, current, reducer) {
      var queue = hook.queue;
      if (null === queue) throw Error(formatProdErrorMessage(311));
      queue.lastRenderedReducer = reducer;
      var baseQueue = hook.baseQueue, pendingQueue = queue.pending;
      if (null !== pendingQueue) {
        if (null !== baseQueue) {
          var baseFirst = baseQueue.next;
          baseQueue.next = pendingQueue.next;
          pendingQueue.next = baseFirst;
        }
        current.baseQueue = baseQueue = pendingQueue;
        queue.pending = null;
      }
      pendingQueue = hook.baseState;
      if (null === baseQueue) hook.memoizedState = pendingQueue;
      else {
        current = baseQueue.next;
        var newBaseQueueFirst = baseFirst = null, newBaseQueueLast = null, update = current, didReadFromEntangledAsyncAction$32 = false;
        do {
          var updateLane = update.lane & -536870913;
          if (updateLane !== update.lane ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes & updateLane) === updateLane) {
            var revertLane = update.revertLane;
            if (0 === revertLane)
              null !== newBaseQueueLast && (newBaseQueueLast = newBaseQueueLast.next = {
                lane: 0,
                revertLane: 0,
                action: update.action,
                hasEagerState: update.hasEagerState,
                eagerState: update.eagerState,
                next: null
              }), updateLane === currentEntangledLane && (didReadFromEntangledAsyncAction$32 = true);
            else if ((renderLanes & revertLane) === revertLane) {
              update = update.next;
              revertLane === currentEntangledLane && (didReadFromEntangledAsyncAction$32 = true);
              continue;
            } else
              updateLane = {
                lane: 0,
                revertLane: update.revertLane,
                action: update.action,
                hasEagerState: update.hasEagerState,
                eagerState: update.eagerState,
                next: null
              }, null === newBaseQueueLast ? (newBaseQueueFirst = newBaseQueueLast = updateLane, baseFirst = pendingQueue) : newBaseQueueLast = newBaseQueueLast.next = updateLane, currentlyRenderingFiber.lanes |= revertLane, workInProgressRootSkippedLanes |= revertLane;
            updateLane = update.action;
            shouldDoubleInvokeUserFnsInHooksDEV && reducer(pendingQueue, updateLane);
            pendingQueue = update.hasEagerState ? update.eagerState : reducer(pendingQueue, updateLane);
          } else
            revertLane = {
              lane: updateLane,
              revertLane: update.revertLane,
              action: update.action,
              hasEagerState: update.hasEagerState,
              eagerState: update.eagerState,
              next: null
            }, null === newBaseQueueLast ? (newBaseQueueFirst = newBaseQueueLast = revertLane, baseFirst = pendingQueue) : newBaseQueueLast = newBaseQueueLast.next = revertLane, currentlyRenderingFiber.lanes |= updateLane, workInProgressRootSkippedLanes |= updateLane;
          update = update.next;
        } while (null !== update && update !== current);
        null === newBaseQueueLast ? baseFirst = pendingQueue : newBaseQueueLast.next = newBaseQueueFirst;
        if (!objectIs(pendingQueue, hook.memoizedState) && (didReceiveUpdate = true, didReadFromEntangledAsyncAction$32 && (reducer = currentEntangledActionThenable, null !== reducer)))
          throw reducer;
        hook.memoizedState = pendingQueue;
        hook.baseState = baseFirst;
        hook.baseQueue = newBaseQueueLast;
        queue.lastRenderedState = pendingQueue;
      }
      null === baseQueue && (queue.lanes = 0);
      return [hook.memoizedState, queue.dispatch];
    }
    __name(updateReducerImpl, "updateReducerImpl");
    function rerenderReducer(reducer) {
      var hook = updateWorkInProgressHook(), queue = hook.queue;
      if (null === queue) throw Error(formatProdErrorMessage(311));
      queue.lastRenderedReducer = reducer;
      var dispatch = queue.dispatch, lastRenderPhaseUpdate = queue.pending, newState = hook.memoizedState;
      if (null !== lastRenderPhaseUpdate) {
        queue.pending = null;
        var update = lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
        do
          newState = reducer(newState, update.action), update = update.next;
        while (update !== lastRenderPhaseUpdate);
        objectIs(newState, hook.memoizedState) || (didReceiveUpdate = true);
        hook.memoizedState = newState;
        null === hook.baseQueue && (hook.baseState = newState);
        queue.lastRenderedState = newState;
      }
      return [newState, dispatch];
    }
    __name(rerenderReducer, "rerenderReducer");
    function updateSyncExternalStore(subscribe2, getSnapshot, getServerSnapshot) {
      var fiber = currentlyRenderingFiber, hook = updateWorkInProgressHook(), isHydrating$jscomp$0 = isHydrating;
      if (isHydrating$jscomp$0) {
        if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407));
        getServerSnapshot = getServerSnapshot();
      } else getServerSnapshot = getSnapshot();
      var snapshotChanged = !objectIs(
        (currentHook || hook).memoizedState,
        getServerSnapshot
      );
      snapshotChanged && (hook.memoizedState = getServerSnapshot, didReceiveUpdate = true);
      hook = hook.queue;
      var create2 = subscribeToStore.bind(null, fiber, hook, subscribe2);
      updateEffectImpl(2048, 8, create2, [subscribe2]);
      if (hook.getSnapshot !== getSnapshot || snapshotChanged || null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) {
        fiber.flags |= 2048;
        pushSimpleEffect(
          9,
          createEffectInstance(),
          updateStoreInstance.bind(
            null,
            fiber,
            hook,
            getServerSnapshot,
            getSnapshot
          ),
          null
        );
        if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349));
        isHydrating$jscomp$0 || 0 !== (renderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
      }
      return getServerSnapshot;
    }
    __name(updateSyncExternalStore, "updateSyncExternalStore");
    function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
      fiber.flags |= 16384;
      fiber = { getSnapshot, value: renderedSnapshot };
      getSnapshot = currentlyRenderingFiber.updateQueue;
      null === getSnapshot ? (getSnapshot = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = getSnapshot, getSnapshot.stores = [fiber]) : (renderedSnapshot = getSnapshot.stores, null === renderedSnapshot ? getSnapshot.stores = [fiber] : renderedSnapshot.push(fiber));
    }
    __name(pushStoreConsistencyCheck, "pushStoreConsistencyCheck");
    function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
      inst.value = nextSnapshot;
      inst.getSnapshot = getSnapshot;
      checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
    }
    __name(updateStoreInstance, "updateStoreInstance");
    function subscribeToStore(fiber, inst, subscribe2) {
      return subscribe2(function() {
        checkIfSnapshotChanged(inst) && forceStoreRerender(fiber);
      });
    }
    __name(subscribeToStore, "subscribeToStore");
    function checkIfSnapshotChanged(inst) {
      var latestGetSnapshot = inst.getSnapshot;
      inst = inst.value;
      try {
        var nextValue = latestGetSnapshot();
        return !objectIs(inst, nextValue);
      } catch (error) {
        return true;
      }
    }
    __name(checkIfSnapshotChanged, "checkIfSnapshotChanged");
    function forceStoreRerender(fiber) {
      var root3 = enqueueConcurrentRenderForLane(fiber, 2);
      null !== root3 && scheduleUpdateOnFiber(root3, fiber, 2);
    }
    __name(forceStoreRerender, "forceStoreRerender");
    function mountStateImpl(initialState) {
      var hook = mountWorkInProgressHook();
      if ("function" === typeof initialState) {
        var initialStateInitializer = initialState;
        initialState = initialStateInitializer();
        if (shouldDoubleInvokeUserFnsInHooksDEV) {
          setIsStrictModeForDevtools(true);
          try {
            initialStateInitializer();
          } finally {
            setIsStrictModeForDevtools(false);
          }
        }
      }
      hook.memoizedState = hook.baseState = initialState;
      hook.queue = {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: basicStateReducer,
        lastRenderedState: initialState
      };
      return hook;
    }
    __name(mountStateImpl, "mountStateImpl");
    function updateOptimisticImpl(hook, current, passthrough, reducer) {
      hook.baseState = passthrough;
      return updateReducerImpl(
        hook,
        currentHook,
        "function" === typeof reducer ? reducer : basicStateReducer
      );
    }
    __name(updateOptimisticImpl, "updateOptimisticImpl");
    function dispatchActionState(fiber, actionQueue, setPendingState, setState, payload) {
      if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485));
      fiber = actionQueue.action;
      if (null !== fiber) {
        var actionNode = {
          payload,
          action: fiber,
          next: null,
          isTransition: true,
          status: "pending",
          value: null,
          reason: null,
          listeners: [],
          then: /* @__PURE__ */ __name(function(listener) {
            actionNode.listeners.push(listener);
          }, "then")
        };
        null !== ReactSharedInternals.T ? setPendingState(true) : actionNode.isTransition = false;
        setState(actionNode);
        setPendingState = actionQueue.pending;
        null === setPendingState ? (actionNode.next = actionQueue.pending = actionNode, runActionStateAction(actionQueue, actionNode)) : (actionNode.next = setPendingState.next, actionQueue.pending = setPendingState.next = actionNode);
      }
    }
    __name(dispatchActionState, "dispatchActionState");
    function runActionStateAction(actionQueue, node) {
      var action = node.action, payload = node.payload, prevState = actionQueue.state;
      if (node.isTransition) {
        var prevTransition = ReactSharedInternals.T, currentTransition = {};
        ReactSharedInternals.T = currentTransition;
        try {
          var returnValue = action(prevState, payload), onStartTransitionFinish = ReactSharedInternals.S;
          null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
          handleActionReturnValue(actionQueue, node, returnValue);
        } catch (error) {
          onActionError(actionQueue, node, error);
        } finally {
          ReactSharedInternals.T = prevTransition;
        }
      } else
        try {
          prevTransition = action(prevState, payload), handleActionReturnValue(actionQueue, node, prevTransition);
        } catch (error$38) {
          onActionError(actionQueue, node, error$38);
        }
    }
    __name(runActionStateAction, "runActionStateAction");
    function handleActionReturnValue(actionQueue, node, returnValue) {
      null !== returnValue && "object" === typeof returnValue && "function" === typeof returnValue.then ? returnValue.then(
        function(nextState) {
          onActionSuccess(actionQueue, node, nextState);
        },
        function(error) {
          return onActionError(actionQueue, node, error);
        }
      ) : onActionSuccess(actionQueue, node, returnValue);
    }
    __name(handleActionReturnValue, "handleActionReturnValue");
    function onActionSuccess(actionQueue, actionNode, nextState) {
      actionNode.status = "fulfilled";
      actionNode.value = nextState;
      notifyActionListeners(actionNode);
      actionQueue.state = nextState;
      actionNode = actionQueue.pending;
      null !== actionNode && (nextState = actionNode.next, nextState === actionNode ? actionQueue.pending = null : (nextState = nextState.next, actionNode.next = nextState, runActionStateAction(actionQueue, nextState)));
    }
    __name(onActionSuccess, "onActionSuccess");
    function onActionError(actionQueue, actionNode, error) {
      var last2 = actionQueue.pending;
      actionQueue.pending = null;
      if (null !== last2) {
        last2 = last2.next;
        do
          actionNode.status = "rejected", actionNode.reason = error, notifyActionListeners(actionNode), actionNode = actionNode.next;
        while (actionNode !== last2);
      }
      actionQueue.action = null;
    }
    __name(onActionError, "onActionError");
    function notifyActionListeners(actionNode) {
      actionNode = actionNode.listeners;
      for (var i2 = 0; i2 < actionNode.length; i2++) (0, actionNode[i2])();
    }
    __name(notifyActionListeners, "notifyActionListeners");
    function actionStateReducer(oldState, newState) {
      return newState;
    }
    __name(actionStateReducer, "actionStateReducer");
    function mountActionState(action, initialStateProp) {
      if (isHydrating) {
        var ssrFormState = workInProgressRoot.formState;
        if (null !== ssrFormState) {
          a: {
            var JSCompiler_inline_result = currentlyRenderingFiber;
            if (isHydrating) {
              if (nextHydratableInstance) {
                b: {
                  var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance;
                  for (var inRootOrSingleton = rootOrSingletonContext; 8 !== JSCompiler_inline_result$jscomp$0.nodeType; ) {
                    if (!inRootOrSingleton) {
                      JSCompiler_inline_result$jscomp$0 = null;
                      break b;
                    }
                    JSCompiler_inline_result$jscomp$0 = getNextHydratable(
                      JSCompiler_inline_result$jscomp$0.nextSibling
                    );
                    if (null === JSCompiler_inline_result$jscomp$0) {
                      JSCompiler_inline_result$jscomp$0 = null;
                      break b;
                    }
                  }
                  inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data;
                  JSCompiler_inline_result$jscomp$0 = "F!" === inRootOrSingleton || "F" === inRootOrSingleton ? JSCompiler_inline_result$jscomp$0 : null;
                }
                if (JSCompiler_inline_result$jscomp$0) {
                  nextHydratableInstance = getNextHydratable(
                    JSCompiler_inline_result$jscomp$0.nextSibling
                  );
                  JSCompiler_inline_result = "F!" === JSCompiler_inline_result$jscomp$0.data;
                  break a;
                }
              }
              throwOnHydrationMismatch(JSCompiler_inline_result);
            }
            JSCompiler_inline_result = false;
          }
          JSCompiler_inline_result && (initialStateProp = ssrFormState[0]);
        }
      }
      ssrFormState = mountWorkInProgressHook();
      ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp;
      JSCompiler_inline_result = {
        pending: null,
        lanes: 0,
        dispatch: null,
        lastRenderedReducer: actionStateReducer,
        lastRenderedState: initialStateProp
      };
      ssrFormState.queue = JSCompiler_inline_result;
      ssrFormState = dispatchSetState.bind(
        null,
        currentlyRenderingFiber,
        JSCompiler_inline_result
      );
      JSCompiler_inline_result.dispatch = ssrFormState;
      JSCompiler_inline_result = mountStateImpl(false);
      inRootOrSingleton = dispatchOptimisticSetState.bind(
        null,
        currentlyRenderingFiber,
        false,
        JSCompiler_inline_result.queue
      );
      JSCompiler_inline_result = mountWorkInProgressHook();
      JSCompiler_inline_result$jscomp$0 = {
        state: initialStateProp,
        dispatch: null,
        action,
        pending: null
      };
      JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0;
      ssrFormState = dispatchActionState.bind(
        null,
        currentlyRenderingFiber,
        JSCompiler_inline_result$jscomp$0,
        inRootOrSingleton,
        ssrFormState
      );
      JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState;
      JSCompiler_inline_result.memoizedState = action;
      return [initialStateProp, ssrFormState, false];
    }
    __name(mountActionState, "mountActionState");
    function updateActionState(action) {
      var stateHook = updateWorkInProgressHook();
      return updateActionStateImpl(stateHook, currentHook, action);
    }
    __name(updateActionState, "updateActionState");
    function updateActionStateImpl(stateHook, currentStateHook, action) {
      currentStateHook = updateReducerImpl(
        stateHook,
        currentStateHook,
        actionStateReducer
      )[0];
      stateHook = updateReducer(basicStateReducer)[0];
      if ("object" === typeof currentStateHook && null !== currentStateHook && "function" === typeof currentStateHook.then)
        try {
          var state = useThenable(currentStateHook);
        } catch (x2) {
          if (x2 === SuspenseException) throw SuspenseActionException;
          throw x2;
        }
      else state = currentStateHook;
      currentStateHook = updateWorkInProgressHook();
      var actionQueue = currentStateHook.queue, dispatch = actionQueue.dispatch;
      action !== currentStateHook.memoizedState && (currentlyRenderingFiber.flags |= 2048, pushSimpleEffect(
        9,
        createEffectInstance(),
        actionStateActionEffect.bind(null, actionQueue, action),
        null
      ));
      return [state, dispatch, stateHook];
    }
    __name(updateActionStateImpl, "updateActionStateImpl");
    function actionStateActionEffect(actionQueue, action) {
      actionQueue.action = action;
    }
    __name(actionStateActionEffect, "actionStateActionEffect");
    function rerenderActionState(action) {
      var stateHook = updateWorkInProgressHook(), currentStateHook = currentHook;
      if (null !== currentStateHook)
        return updateActionStateImpl(stateHook, currentStateHook, action);
      updateWorkInProgressHook();
      stateHook = stateHook.memoizedState;
      currentStateHook = updateWorkInProgressHook();
      var dispatch = currentStateHook.queue.dispatch;
      currentStateHook.memoizedState = action;
      return [stateHook, dispatch, false];
    }
    __name(rerenderActionState, "rerenderActionState");
    function pushSimpleEffect(tag, inst, create2, createDeps) {
      tag = { tag, create: create2, deps: createDeps, inst, next: null };
      inst = currentlyRenderingFiber.updateQueue;
      null === inst && (inst = createFunctionComponentUpdateQueue(), currentlyRenderingFiber.updateQueue = inst);
      create2 = inst.lastEffect;
      null === create2 ? inst.lastEffect = tag.next = tag : (createDeps = create2.next, create2.next = tag, tag.next = createDeps, inst.lastEffect = tag);
      return tag;
    }
    __name(pushSimpleEffect, "pushSimpleEffect");
    function createEffectInstance() {
      return { destroy: void 0, resource: void 0 };
    }
    __name(createEffectInstance, "createEffectInstance");
    function updateRef() {
      return updateWorkInProgressHook().memoizedState;
    }
    __name(updateRef, "updateRef");
    function mountEffectImpl(fiberFlags, hookFlags, create2, createDeps) {
      var hook = mountWorkInProgressHook();
      createDeps = void 0 === createDeps ? null : createDeps;
      currentlyRenderingFiber.flags |= fiberFlags;
      hook.memoizedState = pushSimpleEffect(
        1 | hookFlags,
        createEffectInstance(),
        create2,
        createDeps
      );
    }
    __name(mountEffectImpl, "mountEffectImpl");
    function updateEffectImpl(fiberFlags, hookFlags, create2, deps) {
      var hook = updateWorkInProgressHook();
      deps = void 0 === deps ? null : deps;
      var inst = hook.memoizedState.inst;
      null !== currentHook && null !== deps && areHookInputsEqual(deps, currentHook.memoizedState.deps) ? hook.memoizedState = pushSimpleEffect(hookFlags, inst, create2, deps) : (currentlyRenderingFiber.flags |= fiberFlags, hook.memoizedState = pushSimpleEffect(
        1 | hookFlags,
        inst,
        create2,
        deps
      ));
    }
    __name(updateEffectImpl, "updateEffectImpl");
    function mountEffect(create2, createDeps) {
      mountEffectImpl(8390656, 8, create2, createDeps);
    }
    __name(mountEffect, "mountEffect");
    function updateEffect(create2, createDeps) {
      updateEffectImpl(2048, 8, create2, createDeps);
    }
    __name(updateEffect, "updateEffect");
    function updateInsertionEffect(create2, deps) {
      return updateEffectImpl(4, 2, create2, deps);
    }
    __name(updateInsertionEffect, "updateInsertionEffect");
    function updateLayoutEffect(create2, deps) {
      return updateEffectImpl(4, 4, create2, deps);
    }
    __name(updateLayoutEffect, "updateLayoutEffect");
    function imperativeHandleEffect(create2, ref) {
      if ("function" === typeof ref) {
        create2 = create2();
        var refCleanup = ref(create2);
        return function() {
          "function" === typeof refCleanup ? refCleanup() : ref(null);
        };
      }
      if (null !== ref && void 0 !== ref)
        return create2 = create2(), ref.current = create2, function() {
          ref.current = null;
        };
    }
    __name(imperativeHandleEffect, "imperativeHandleEffect");
    function updateImperativeHandle(ref, create2, deps) {
      deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
      updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create2, ref), deps);
    }
    __name(updateImperativeHandle, "updateImperativeHandle");
    function mountDebugValue() {
    }
    __name(mountDebugValue, "mountDebugValue");
    function updateCallback(callback, deps) {
      var hook = updateWorkInProgressHook();
      deps = void 0 === deps ? null : deps;
      var prevState = hook.memoizedState;
      if (null !== deps && areHookInputsEqual(deps, prevState[1]))
        return prevState[0];
      hook.memoizedState = [callback, deps];
      return callback;
    }
    __name(updateCallback, "updateCallback");
    function updateMemo(nextCreate, deps) {
      var hook = updateWorkInProgressHook();
      deps = void 0 === deps ? null : deps;
      var prevState = hook.memoizedState;
      if (null !== deps && areHookInputsEqual(deps, prevState[1]))
        return prevState[0];
      prevState = nextCreate();
      if (shouldDoubleInvokeUserFnsInHooksDEV) {
        setIsStrictModeForDevtools(true);
        try {
          nextCreate();
        } finally {
          setIsStrictModeForDevtools(false);
        }
      }
      hook.memoizedState = [prevState, deps];
      return prevState;
    }
    __name(updateMemo, "updateMemo");
    function mountDeferredValueImpl(hook, value, initialValue) {
      if (void 0 === initialValue || 0 !== (renderLanes & 1073741824))
        return hook.memoizedState = value;
      hook.memoizedState = initialValue;
      hook = requestDeferredLane();
      currentlyRenderingFiber.lanes |= hook;
      workInProgressRootSkippedLanes |= hook;
      return initialValue;
    }
    __name(mountDeferredValueImpl, "mountDeferredValueImpl");
    function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
      if (objectIs(value, prevValue)) return value;
      if (null !== currentTreeHiddenStackCursor.current)
        return hook = mountDeferredValueImpl(hook, value, initialValue), objectIs(hook, prevValue) || (didReceiveUpdate = true), hook;
      if (0 === (renderLanes & 42))
        return didReceiveUpdate = true, hook.memoizedState = value;
      hook = requestDeferredLane();
      currentlyRenderingFiber.lanes |= hook;
      workInProgressRootSkippedLanes |= hook;
      return prevValue;
    }
    __name(updateDeferredValueImpl, "updateDeferredValueImpl");
    function startTransition(fiber, queue, pendingState, finishedState, callback) {
      var previousPriority = ReactDOMSharedInternals.p;
      ReactDOMSharedInternals.p = 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8;
      var prevTransition = ReactSharedInternals.T, currentTransition = {};
      ReactSharedInternals.T = currentTransition;
      dispatchOptimisticSetState(fiber, false, queue, pendingState);
      try {
        var returnValue = callback(), onStartTransitionFinish = ReactSharedInternals.S;
        null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
        if (null !== returnValue && "object" === typeof returnValue && "function" === typeof returnValue.then) {
          var thenableForFinishedState = chainThenableValue(
            returnValue,
            finishedState
          );
          dispatchSetStateInternal(
            fiber,
            queue,
            thenableForFinishedState,
            requestUpdateLane(fiber)
          );
        } else
          dispatchSetStateInternal(
            fiber,
            queue,
            finishedState,
            requestUpdateLane(fiber)
          );
      } catch (error) {
        dispatchSetStateInternal(
          fiber,
          queue,
          { then: /* @__PURE__ */ __name(function() {
          }, "then"), status: "rejected", reason: error },
          requestUpdateLane()
        );
      } finally {
        ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition;
      }
    }
    __name(startTransition, "startTransition");
    function noop$2() {
    }
    __name(noop$2, "noop$2");
    function startHostTransition(formFiber, pendingState, action, formData) {
      if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476));
      var queue = ensureFormComponentIsStateful(formFiber).queue;
      startTransition(
        formFiber,
        queue,
        pendingState,
        sharedNotPendingObject,
        null === action ? noop$2 : function() {
          requestFormReset$1(formFiber);
          return action(formData);
        }
      );
    }
    __name(startHostTransition, "startHostTransition");
    function ensureFormComponentIsStateful(formFiber) {
      var existingStateHook = formFiber.memoizedState;
      if (null !== existingStateHook) return existingStateHook;
      existingStateHook = {
        memoizedState: sharedNotPendingObject,
        baseState: sharedNotPendingObject,
        baseQueue: null,
        queue: {
          pending: null,
          lanes: 0,
          dispatch: null,
          lastRenderedReducer: basicStateReducer,
          lastRenderedState: sharedNotPendingObject
        },
        next: null
      };
      var initialResetState = {};
      existingStateHook.next = {
        memoizedState: initialResetState,
        baseState: initialResetState,
        baseQueue: null,
        queue: {
          pending: null,
          lanes: 0,
          dispatch: null,
          lastRenderedReducer: basicStateReducer,
          lastRenderedState: initialResetState
        },
        next: null
      };
      formFiber.memoizedState = existingStateHook;
      formFiber = formFiber.alternate;
      null !== formFiber && (formFiber.memoizedState = existingStateHook);
      return existingStateHook;
    }
    __name(ensureFormComponentIsStateful, "ensureFormComponentIsStateful");
    function requestFormReset$1(formFiber) {
      var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue;
      dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane());
    }
    __name(requestFormReset$1, "requestFormReset$1");
    function useHostTransitionStatus() {
      return readContext(HostTransitionContext);
    }
    __name(useHostTransitionStatus, "useHostTransitionStatus");
    function updateId() {
      return updateWorkInProgressHook().memoizedState;
    }
    __name(updateId, "updateId");
    function updateRefresh() {
      return updateWorkInProgressHook().memoizedState;
    }
    __name(updateRefresh, "updateRefresh");
    function refreshCache(fiber) {
      for (var provider = fiber.return; null !== provider; ) {
        switch (provider.tag) {
          case 24:
          case 3:
            var lane = requestUpdateLane();
            fiber = createUpdate(lane);
            var root$41 = enqueueUpdate(provider, fiber, lane);
            null !== root$41 && (scheduleUpdateOnFiber(root$41, provider, lane), entangleTransitions(root$41, provider, lane));
            provider = { cache: createCache() };
            fiber.payload = provider;
            return;
        }
        provider = provider.return;
      }
    }
    __name(refreshCache, "refreshCache");
    function dispatchReducerAction(fiber, queue, action) {
      var lane = requestUpdateLane();
      action = {
        lane,
        revertLane: 0,
        action,
        hasEagerState: false,
        eagerState: null,
        next: null
      };
      isRenderPhaseUpdate(fiber) ? enqueueRenderPhaseUpdate(queue, action) : (action = enqueueConcurrentHookUpdate(fiber, queue, action, lane), null !== action && (scheduleUpdateOnFiber(action, fiber, lane), entangleTransitionUpdate(action, queue, lane)));
    }
    __name(dispatchReducerAction, "dispatchReducerAction");
    function dispatchSetState(fiber, queue, action) {
      var lane = requestUpdateLane();
      dispatchSetStateInternal(fiber, queue, action, lane);
    }
    __name(dispatchSetState, "dispatchSetState");
    function dispatchSetStateInternal(fiber, queue, action, lane) {
      var update = {
        lane,
        revertLane: 0,
        action,
        hasEagerState: false,
        eagerState: null,
        next: null
      };
      if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update);
      else {
        var alternate = fiber.alternate;
        if (0 === fiber.lanes && (null === alternate || 0 === alternate.lanes) && (alternate = queue.lastRenderedReducer, null !== alternate))
          try {
            var currentState = queue.lastRenderedState, eagerState = alternate(currentState, action);
            update.hasEagerState = true;
            update.eagerState = eagerState;
            if (objectIs(eagerState, currentState))
              return enqueueUpdate$1(fiber, queue, update, 0), null === workInProgressRoot && finishQueueingConcurrentUpdates(), false;
          } catch (error) {
          } finally {
          }
        action = enqueueConcurrentHookUpdate(fiber, queue, update, lane);
        if (null !== action)
          return scheduleUpdateOnFiber(action, fiber, lane), entangleTransitionUpdate(action, queue, lane), true;
      }
      return false;
    }
    __name(dispatchSetStateInternal, "dispatchSetStateInternal");
    function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) {
      action = {
        lane: 2,
        revertLane: requestTransitionLane(),
        action,
        hasEagerState: false,
        eagerState: null,
        next: null
      };
      if (isRenderPhaseUpdate(fiber)) {
        if (throwIfDuringRender) throw Error(formatProdErrorMessage(479));
      } else
        throwIfDuringRender = enqueueConcurrentHookUpdate(
          fiber,
          queue,
          action,
          2
        ), null !== throwIfDuringRender && scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2);
    }
    __name(dispatchOptimisticSetState, "dispatchOptimisticSetState");
    function isRenderPhaseUpdate(fiber) {
      var alternate = fiber.alternate;
      return fiber === currentlyRenderingFiber || null !== alternate && alternate === currentlyRenderingFiber;
    }
    __name(isRenderPhaseUpdate, "isRenderPhaseUpdate");
    function enqueueRenderPhaseUpdate(queue, update) {
      didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
      var pending = queue.pending;
      null === pending ? update.next = update : (update.next = pending.next, pending.next = update);
      queue.pending = update;
    }
    __name(enqueueRenderPhaseUpdate, "enqueueRenderPhaseUpdate");
    function entangleTransitionUpdate(root3, queue, lane) {
      if (0 !== (lane & 4194048)) {
        var queueLanes = queue.lanes;
        queueLanes &= root3.pendingLanes;
        lane |= queueLanes;
        queue.lanes = lane;
        markRootEntangled(root3, lane);
      }
    }
    __name(entangleTransitionUpdate, "entangleTransitionUpdate");
    var ContextOnlyDispatcher = {
      readContext,
      use: use2,
      useCallback: throwInvalidHookError,
      useContext: throwInvalidHookError,
      useEffect: throwInvalidHookError,
      useImperativeHandle: throwInvalidHookError,
      useLayoutEffect: throwInvalidHookError,
      useInsertionEffect: throwInvalidHookError,
      useMemo: throwInvalidHookError,
      useReducer: throwInvalidHookError,
      useRef: throwInvalidHookError,
      useState: throwInvalidHookError,
      useDebugValue: throwInvalidHookError,
      useDeferredValue: throwInvalidHookError,
      useTransition: throwInvalidHookError,
      useSyncExternalStore: throwInvalidHookError,
      useId: throwInvalidHookError,
      useHostTransitionStatus: throwInvalidHookError,
      useFormState: throwInvalidHookError,
      useActionState: throwInvalidHookError,
      useOptimistic: throwInvalidHookError,
      useMemoCache: throwInvalidHookError,
      useCacheRefresh: throwInvalidHookError
    }, HooksDispatcherOnMount = {
      readContext,
      use: use2,
      useCallback: /* @__PURE__ */ __name(function(callback, deps) {
        mountWorkInProgressHook().memoizedState = [
          callback,
          void 0 === deps ? null : deps
        ];
        return callback;
      }, "useCallback"),
      useContext: readContext,
      useEffect: mountEffect,
      useImperativeHandle: /* @__PURE__ */ __name(function(ref, create2, deps) {
        deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
        mountEffectImpl(
          4194308,
          4,
          imperativeHandleEffect.bind(null, create2, ref),
          deps
        );
      }, "useImperativeHandle"),
      useLayoutEffect: /* @__PURE__ */ __name(function(create2, deps) {
        return mountEffectImpl(4194308, 4, create2, deps);
      }, "useLayoutEffect"),
      useInsertionEffect: /* @__PURE__ */ __name(function(create2, deps) {
        mountEffectImpl(4, 2, create2, deps);
      }, "useInsertionEffect"),
      useMemo: /* @__PURE__ */ __name(function(nextCreate, deps) {
        var hook = mountWorkInProgressHook();
        deps = void 0 === deps ? null : deps;
        var nextValue = nextCreate();
        if (shouldDoubleInvokeUserFnsInHooksDEV) {
          setIsStrictModeForDevtools(true);
          try {
            nextCreate();
          } finally {
            setIsStrictModeForDevtools(false);
          }
        }
        hook.memoizedState = [nextValue, deps];
        return nextValue;
      }, "useMemo"),
      useReducer: /* @__PURE__ */ __name(function(reducer, initialArg, init) {
        var hook = mountWorkInProgressHook();
        if (void 0 !== init) {
          var initialState = init(initialArg);
          if (shouldDoubleInvokeUserFnsInHooksDEV) {
            setIsStrictModeForDevtools(true);
            try {
              init(initialArg);
            } finally {
              setIsStrictModeForDevtools(false);
            }
          }
        } else initialState = initialArg;
        hook.memoizedState = hook.baseState = initialState;
        reducer = {
          pending: null,
          lanes: 0,
          dispatch: null,
          lastRenderedReducer: reducer,
          lastRenderedState: initialState
        };
        hook.queue = reducer;
        reducer = reducer.dispatch = dispatchReducerAction.bind(
          null,
          currentlyRenderingFiber,
          reducer
        );
        return [hook.memoizedState, reducer];
      }, "useReducer"),
      useRef: /* @__PURE__ */ __name(function(initialValue) {
        var hook = mountWorkInProgressHook();
        initialValue = { current: initialValue };
        return hook.memoizedState = initialValue;
      }, "useRef"),
      useState: /* @__PURE__ */ __name(function(initialState) {
        initialState = mountStateImpl(initialState);
        var queue = initialState.queue, dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue);
        queue.dispatch = dispatch;
        return [initialState.memoizedState, dispatch];
      }, "useState"),
      useDebugValue: mountDebugValue,
      useDeferredValue: /* @__PURE__ */ __name(function(value, initialValue) {
        var hook = mountWorkInProgressHook();
        return mountDeferredValueImpl(hook, value, initialValue);
      }, "useDeferredValue"),
      useTransition: /* @__PURE__ */ __name(function() {
        var stateHook = mountStateImpl(false);
        stateHook = startTransition.bind(
          null,
          currentlyRenderingFiber,
          stateHook.queue,
          true,
          false
        );
        mountWorkInProgressHook().memoizedState = stateHook;
        return [false, stateHook];
      }, "useTransition"),
      useSyncExternalStore: /* @__PURE__ */ __name(function(subscribe2, getSnapshot, getServerSnapshot) {
        var fiber = currentlyRenderingFiber, hook = mountWorkInProgressHook();
        if (isHydrating) {
          if (void 0 === getServerSnapshot)
            throw Error(formatProdErrorMessage(407));
          getServerSnapshot = getServerSnapshot();
        } else {
          getServerSnapshot = getSnapshot();
          if (null === workInProgressRoot)
            throw Error(formatProdErrorMessage(349));
          0 !== (workInProgressRootRenderLanes & 124) || pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot);
        }
        hook.memoizedState = getServerSnapshot;
        var inst = { value: getServerSnapshot, getSnapshot };
        hook.queue = inst;
        mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe2), [
          subscribe2
        ]);
        fiber.flags |= 2048;
        pushSimpleEffect(
          9,
          createEffectInstance(),
          updateStoreInstance.bind(
            null,
            fiber,
            inst,
            getServerSnapshot,
            getSnapshot
          ),
          null
        );
        return getServerSnapshot;
      }, "useSyncExternalStore"),
      useId: /* @__PURE__ */ __name(function() {
        var hook = mountWorkInProgressHook(), identifierPrefix = workInProgressRoot.identifierPrefix;
        if (isHydrating) {
          var JSCompiler_inline_result = treeContextOverflow;
          var idWithLeadingBit = treeContextId;
          JSCompiler_inline_result = (idWithLeadingBit & ~(1 << 32 - clz32(idWithLeadingBit) - 1)).toString(32) + JSCompiler_inline_result;
          identifierPrefix = "«" + identifierPrefix + "R" + JSCompiler_inline_result;
          JSCompiler_inline_result = localIdCounter++;
          0 < JSCompiler_inline_result && (identifierPrefix += "H" + JSCompiler_inline_result.toString(32));
          identifierPrefix += "»";
        } else
          JSCompiler_inline_result = globalClientIdCounter++, identifierPrefix = "«" + identifierPrefix + "r" + JSCompiler_inline_result.toString(32) + "»";
        return hook.memoizedState = identifierPrefix;
      }, "useId"),
      useHostTransitionStatus,
      useFormState: mountActionState,
      useActionState: mountActionState,
      useOptimistic: /* @__PURE__ */ __name(function(passthrough) {
        var hook = mountWorkInProgressHook();
        hook.memoizedState = hook.baseState = passthrough;
        var queue = {
          pending: null,
          lanes: 0,
          dispatch: null,
          lastRenderedReducer: null,
          lastRenderedState: null
        };
        hook.queue = queue;
        hook = dispatchOptimisticSetState.bind(
          null,
          currentlyRenderingFiber,
          true,
          queue
        );
        queue.dispatch = hook;
        return [passthrough, hook];
      }, "useOptimistic"),
      useMemoCache,
      useCacheRefresh: /* @__PURE__ */ __name(function() {
        return mountWorkInProgressHook().memoizedState = refreshCache.bind(
          null,
          currentlyRenderingFiber
        );
      }, "useCacheRefresh")
    }, HooksDispatcherOnUpdate = {
      readContext,
      use: use2,
      useCallback: updateCallback,
      useContext: readContext,
      useEffect: updateEffect,
      useImperativeHandle: updateImperativeHandle,
      useInsertionEffect: updateInsertionEffect,
      useLayoutEffect: updateLayoutEffect,
      useMemo: updateMemo,
      useReducer: updateReducer,
      useRef: updateRef,
      useState: /* @__PURE__ */ __name(function() {
        return updateReducer(basicStateReducer);
      }, "useState"),
      useDebugValue: mountDebugValue,
      useDeferredValue: /* @__PURE__ */ __name(function(value, initialValue) {
        var hook = updateWorkInProgressHook();
        return updateDeferredValueImpl(
          hook,
          currentHook.memoizedState,
          value,
          initialValue
        );
      }, "useDeferredValue"),
      useTransition: /* @__PURE__ */ __name(function() {
        var booleanOrThenable = updateReducer(basicStateReducer)[0], start = updateWorkInProgressHook().memoizedState;
        return [
          "boolean" === typeof booleanOrThenable ? booleanOrThenable : useThenable(booleanOrThenable),
          start
        ];
      }, "useTransition"),
      useSyncExternalStore: updateSyncExternalStore,
      useId: updateId,
      useHostTransitionStatus,
      useFormState: updateActionState,
      useActionState: updateActionState,
      useOptimistic: /* @__PURE__ */ __name(function(passthrough, reducer) {
        var hook = updateWorkInProgressHook();
        return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
      }, "useOptimistic"),
      useMemoCache,
      useCacheRefresh: updateRefresh
    }, HooksDispatcherOnRerender = {
      readContext,
      use: use2,
      useCallback: updateCallback,
      useContext: readContext,
      useEffect: updateEffect,
      useImperativeHandle: updateImperativeHandle,
      useInsertionEffect: updateInsertionEffect,
      useLayoutEffect: updateLayoutEffect,
      useMemo: updateMemo,
      useReducer: rerenderReducer,
      useRef: updateRef,
      useState: /* @__PURE__ */ __name(function() {
        return rerenderReducer(basicStateReducer);
      }, "useState"),
      useDebugValue: mountDebugValue,
      useDeferredValue: /* @__PURE__ */ __name(function(value, initialValue) {
        var hook = updateWorkInProgressHook();
        return null === currentHook ? mountDeferredValueImpl(hook, value, initialValue) : updateDeferredValueImpl(
          hook,
          currentHook.memoizedState,
          value,
          initialValue
        );
      }, "useDeferredValue"),
      useTransition: /* @__PURE__ */ __name(function() {
        var booleanOrThenable = rerenderReducer(basicStateReducer)[0], start = updateWorkInProgressHook().memoizedState;
        return [
          "boolean" === typeof booleanOrThenable ? booleanOrThenable : useThenable(booleanOrThenable),
          start
        ];
      }, "useTransition"),
      useSyncExternalStore: updateSyncExternalStore,
      useId: updateId,
      useHostTransitionStatus,
      useFormState: rerenderActionState,
      useActionState: rerenderActionState,
      useOptimistic: /* @__PURE__ */ __name(function(passthrough, reducer) {
        var hook = updateWorkInProgressHook();
        if (null !== currentHook)
          return updateOptimisticImpl(hook, currentHook, passthrough, reducer);
        hook.baseState = passthrough;
        return [passthrough, hook.queue.dispatch];
      }, "useOptimistic"),
      useMemoCache,
      useCacheRefresh: updateRefresh
    }, thenableState = null, thenableIndexCounter = 0;
    function unwrapThenable(thenable) {
      var index3 = thenableIndexCounter;
      thenableIndexCounter += 1;
      null === thenableState && (thenableState = []);
      return trackUsedThenable(thenableState, thenable, index3);
    }
    __name(unwrapThenable, "unwrapThenable");
    function coerceRef(workInProgress2, element) {
      element = element.props.ref;
      workInProgress2.ref = void 0 !== element ? element : null;
    }
    __name(coerceRef, "coerceRef");
    function throwOnInvalidObjectType(returnFiber, newChild) {
      if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE)
        throw Error(formatProdErrorMessage(525));
      returnFiber = Object.prototype.toString.call(newChild);
      throw Error(
        formatProdErrorMessage(
          31,
          "[object Object]" === returnFiber ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : returnFiber
        )
      );
    }
    __name(throwOnInvalidObjectType, "throwOnInvalidObjectType");
    function resolveLazy(lazyType) {
      var init = lazyType._init;
      return init(lazyType._payload);
    }
    __name(resolveLazy, "resolveLazy");
    function createChildReconciler(shouldTrackSideEffects) {
      function deleteChild(returnFiber, childToDelete) {
        if (shouldTrackSideEffects) {
          var deletions = returnFiber.deletions;
          null === deletions ? (returnFiber.deletions = [childToDelete], returnFiber.flags |= 16) : deletions.push(childToDelete);
        }
      }
      __name(deleteChild, "deleteChild");
      function deleteRemainingChildren(returnFiber, currentFirstChild) {
        if (!shouldTrackSideEffects) return null;
        for (; null !== currentFirstChild; )
          deleteChild(returnFiber, currentFirstChild), currentFirstChild = currentFirstChild.sibling;
        return null;
      }
      __name(deleteRemainingChildren, "deleteRemainingChildren");
      function mapRemainingChildren(currentFirstChild) {
        for (var existingChildren = /* @__PURE__ */ new Map(); null !== currentFirstChild; )
          null !== currentFirstChild.key ? existingChildren.set(currentFirstChild.key, currentFirstChild) : existingChildren.set(currentFirstChild.index, currentFirstChild), currentFirstChild = currentFirstChild.sibling;
        return existingChildren;
      }
      __name(mapRemainingChildren, "mapRemainingChildren");
      function useFiber(fiber, pendingProps) {
        fiber = createWorkInProgress(fiber, pendingProps);
        fiber.index = 0;
        fiber.sibling = null;
        return fiber;
      }
      __name(useFiber, "useFiber");
      function placeChild(newFiber, lastPlacedIndex, newIndex) {
        newFiber.index = newIndex;
        if (!shouldTrackSideEffects)
          return newFiber.flags |= 1048576, lastPlacedIndex;
        newIndex = newFiber.alternate;
        if (null !== newIndex)
          return newIndex = newIndex.index, newIndex < lastPlacedIndex ? (newFiber.flags |= 67108866, lastPlacedIndex) : newIndex;
        newFiber.flags |= 67108866;
        return lastPlacedIndex;
      }
      __name(placeChild, "placeChild");
      function placeSingleChild(newFiber) {
        shouldTrackSideEffects && null === newFiber.alternate && (newFiber.flags |= 67108866);
        return newFiber;
      }
      __name(placeSingleChild, "placeSingleChild");
      function updateTextNode(returnFiber, current, textContent, lanes) {
        if (null === current || 6 !== current.tag)
          return current = createFiberFromText(textContent, returnFiber.mode, lanes), current.return = returnFiber, current;
        current = useFiber(current, textContent);
        current.return = returnFiber;
        return current;
      }
      __name(updateTextNode, "updateTextNode");
      function updateElement(returnFiber, current, element, lanes) {
        var elementType = element.type;
        if (elementType === REACT_FRAGMENT_TYPE)
          return updateFragment(
            returnFiber,
            current,
            element.props.children,
            lanes,
            element.key
          );
        if (null !== current && (current.elementType === elementType || "object" === typeof elementType && null !== elementType && elementType.$$typeof === REACT_LAZY_TYPE2 && resolveLazy(elementType) === current.type))
          return current = useFiber(current, element.props), coerceRef(current, element), current.return = returnFiber, current;
        current = createFiberFromTypeAndProps(
          element.type,
          element.key,
          element.props,
          null,
          returnFiber.mode,
          lanes
        );
        coerceRef(current, element);
        current.return = returnFiber;
        return current;
      }
      __name(updateElement, "updateElement");
      function updatePortal(returnFiber, current, portal, lanes) {
        if (null === current || 4 !== current.tag || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation)
          return current = createFiberFromPortal(portal, returnFiber.mode, lanes), current.return = returnFiber, current;
        current = useFiber(current, portal.children || []);
        current.return = returnFiber;
        return current;
      }
      __name(updatePortal, "updatePortal");
      function updateFragment(returnFiber, current, fragment, lanes, key) {
        if (null === current || 7 !== current.tag)
          return current = createFiberFromFragment(
            fragment,
            returnFiber.mode,
            lanes,
            key
          ), current.return = returnFiber, current;
        current = useFiber(current, fragment);
        current.return = returnFiber;
        return current;
      }
      __name(updateFragment, "updateFragment");
      function createChild(returnFiber, newChild, lanes) {
        if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
          return newChild = createFiberFromText(
            "" + newChild,
            returnFiber.mode,
            lanes
          ), newChild.return = returnFiber, newChild;
        if ("object" === typeof newChild && null !== newChild) {
          switch (newChild.$$typeof) {
            case REACT_ELEMENT_TYPE:
              return lanes = createFiberFromTypeAndProps(
                newChild.type,
                newChild.key,
                newChild.props,
                null,
                returnFiber.mode,
                lanes
              ), coerceRef(lanes, newChild), lanes.return = returnFiber, lanes;
            case REACT_PORTAL_TYPE:
              return newChild = createFiberFromPortal(
                newChild,
                returnFiber.mode,
                lanes
              ), newChild.return = returnFiber, newChild;
            case REACT_LAZY_TYPE2:
              var init = newChild._init;
              newChild = init(newChild._payload);
              return createChild(returnFiber, newChild, lanes);
          }
          if (isArrayImpl(newChild) || getIteratorFn(newChild))
            return newChild = createFiberFromFragment(
              newChild,
              returnFiber.mode,
              lanes,
              null
            ), newChild.return = returnFiber, newChild;
          if ("function" === typeof newChild.then)
            return createChild(returnFiber, unwrapThenable(newChild), lanes);
          if (newChild.$$typeof === REACT_CONTEXT_TYPE)
            return createChild(
              returnFiber,
              readContextDuringReconciliation(returnFiber, newChild),
              lanes
            );
          throwOnInvalidObjectType(returnFiber, newChild);
        }
        return null;
      }
      __name(createChild, "createChild");
      function updateSlot(returnFiber, oldFiber, newChild, lanes) {
        var key = null !== oldFiber ? oldFiber.key : null;
        if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
          return null !== key ? null : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes);
        if ("object" === typeof newChild && null !== newChild) {
          switch (newChild.$$typeof) {
            case REACT_ELEMENT_TYPE:
              return newChild.key === key ? updateElement(returnFiber, oldFiber, newChild, lanes) : null;
            case REACT_PORTAL_TYPE:
              return newChild.key === key ? updatePortal(returnFiber, oldFiber, newChild, lanes) : null;
            case REACT_LAZY_TYPE2:
              return key = newChild._init, newChild = key(newChild._payload), updateSlot(returnFiber, oldFiber, newChild, lanes);
          }
          if (isArrayImpl(newChild) || getIteratorFn(newChild))
            return null !== key ? null : updateFragment(returnFiber, oldFiber, newChild, lanes, null);
          if ("function" === typeof newChild.then)
            return updateSlot(
              returnFiber,
              oldFiber,
              unwrapThenable(newChild),
              lanes
            );
          if (newChild.$$typeof === REACT_CONTEXT_TYPE)
            return updateSlot(
              returnFiber,
              oldFiber,
              readContextDuringReconciliation(returnFiber, newChild),
              lanes
            );
          throwOnInvalidObjectType(returnFiber, newChild);
        }
        return null;
      }
      __name(updateSlot, "updateSlot");
      function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {
        if ("string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild)
          return existingChildren = existingChildren.get(newIdx) || null, updateTextNode(returnFiber, existingChildren, "" + newChild, lanes);
        if ("object" === typeof newChild && null !== newChild) {
          switch (newChild.$$typeof) {
            case REACT_ELEMENT_TYPE:
              return existingChildren = existingChildren.get(
                null === newChild.key ? newIdx : newChild.key
              ) || null, updateElement(returnFiber, existingChildren, newChild, lanes);
            case REACT_PORTAL_TYPE:
              return existingChildren = existingChildren.get(
                null === newChild.key ? newIdx : newChild.key
              ) || null, updatePortal(returnFiber, existingChildren, newChild, lanes);
            case REACT_LAZY_TYPE2:
              var init = newChild._init;
              newChild = init(newChild._payload);
              return updateFromMap(
                existingChildren,
                returnFiber,
                newIdx,
                newChild,
                lanes
              );
          }
          if (isArrayImpl(newChild) || getIteratorFn(newChild))
            return existingChildren = existingChildren.get(newIdx) || null, updateFragment(returnFiber, existingChildren, newChild, lanes, null);
          if ("function" === typeof newChild.then)
            return updateFromMap(
              existingChildren,
              returnFiber,
              newIdx,
              unwrapThenable(newChild),
              lanes
            );
          if (newChild.$$typeof === REACT_CONTEXT_TYPE)
            return updateFromMap(
              existingChildren,
              returnFiber,
              newIdx,
              readContextDuringReconciliation(returnFiber, newChild),
              lanes
            );
          throwOnInvalidObjectType(returnFiber, newChild);
        }
        return null;
      }
      __name(updateFromMap, "updateFromMap");
      function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {
        for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, newIdx = currentFirstChild = 0, nextOldFiber = null; null !== oldFiber && newIdx < newChildren.length; newIdx++) {
          oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling;
          var newFiber = updateSlot(
            returnFiber,
            oldFiber,
            newChildren[newIdx],
            lanes
          );
          if (null === newFiber) {
            null === oldFiber && (oldFiber = nextOldFiber);
            break;
          }
          shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber);
          currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
          null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber;
          previousNewFiber = newFiber;
          oldFiber = nextOldFiber;
        }
        if (newIdx === newChildren.length)
          return deleteRemainingChildren(returnFiber, oldFiber), isHydrating && pushTreeFork(returnFiber, newIdx), resultingFirstChild;
        if (null === oldFiber) {
          for (; newIdx < newChildren.length; newIdx++)
            oldFiber = createChild(returnFiber, newChildren[newIdx], lanes), null !== oldFiber && (currentFirstChild = placeChild(
              oldFiber,
              currentFirstChild,
              newIdx
            ), null === previousNewFiber ? resultingFirstChild = oldFiber : previousNewFiber.sibling = oldFiber, previousNewFiber = oldFiber);
          isHydrating && pushTreeFork(returnFiber, newIdx);
          return resultingFirstChild;
        }
        for (oldFiber = mapRemainingChildren(oldFiber); newIdx < newChildren.length; newIdx++)
          nextOldFiber = updateFromMap(
            oldFiber,
            returnFiber,
            newIdx,
            newChildren[newIdx],
            lanes
          ), null !== nextOldFiber && (shouldTrackSideEffects && null !== nextOldFiber.alternate && oldFiber.delete(
            null === nextOldFiber.key ? newIdx : nextOldFiber.key
          ), currentFirstChild = placeChild(
            nextOldFiber,
            currentFirstChild,
            newIdx
          ), null === previousNewFiber ? resultingFirstChild = nextOldFiber : previousNewFiber.sibling = nextOldFiber, previousNewFiber = nextOldFiber);
        shouldTrackSideEffects && oldFiber.forEach(function(child) {
          return deleteChild(returnFiber, child);
        });
        isHydrating && pushTreeFork(returnFiber, newIdx);
        return resultingFirstChild;
      }
      __name(reconcileChildrenArray, "reconcileChildrenArray");
      function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildren, lanes) {
        if (null == newChildren) throw Error(formatProdErrorMessage(151));
        for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, newIdx = currentFirstChild = 0, nextOldFiber = null, step = newChildren.next(); null !== oldFiber && !step.done; newIdx++, step = newChildren.next()) {
          oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling;
          var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);
          if (null === newFiber) {
            null === oldFiber && (oldFiber = nextOldFiber);
            break;
          }
          shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber);
          currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
          null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber;
          previousNewFiber = newFiber;
          oldFiber = nextOldFiber;
        }
        if (step.done)
          return deleteRemainingChildren(returnFiber, oldFiber), isHydrating && pushTreeFork(returnFiber, newIdx), resultingFirstChild;
        if (null === oldFiber) {
          for (; !step.done; newIdx++, step = newChildren.next())
            step = createChild(returnFiber, step.value, lanes), null !== step && (currentFirstChild = placeChild(step, currentFirstChild, newIdx), null === previousNewFiber ? resultingFirstChild = step : previousNewFiber.sibling = step, previousNewFiber = step);
          isHydrating && pushTreeFork(returnFiber, newIdx);
          return resultingFirstChild;
        }
        for (oldFiber = mapRemainingChildren(oldFiber); !step.done; newIdx++, step = newChildren.next())
          step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes), null !== step && (shouldTrackSideEffects && null !== step.alternate && oldFiber.delete(null === step.key ? newIdx : step.key), currentFirstChild = placeChild(step, currentFirstChild, newIdx), null === previousNewFiber ? resultingFirstChild = step : previousNewFiber.sibling = step, previousNewFiber = step);
        shouldTrackSideEffects && oldFiber.forEach(function(child) {
          return deleteChild(returnFiber, child);
        });
        isHydrating && pushTreeFork(returnFiber, newIdx);
        return resultingFirstChild;
      }
      __name(reconcileChildrenIterator, "reconcileChildrenIterator");
      function reconcileChildFibersImpl(returnFiber, currentFirstChild, newChild, lanes) {
        "object" === typeof newChild && null !== newChild && newChild.type === REACT_FRAGMENT_TYPE && null === newChild.key && (newChild = newChild.props.children);
        if ("object" === typeof newChild && null !== newChild) {
          switch (newChild.$$typeof) {
            case REACT_ELEMENT_TYPE:
              a: {
                for (var key = newChild.key; null !== currentFirstChild; ) {
                  if (currentFirstChild.key === key) {
                    key = newChild.type;
                    if (key === REACT_FRAGMENT_TYPE) {
                      if (7 === currentFirstChild.tag) {
                        deleteRemainingChildren(
                          returnFiber,
                          currentFirstChild.sibling
                        );
                        lanes = useFiber(
                          currentFirstChild,
                          newChild.props.children
                        );
                        lanes.return = returnFiber;
                        returnFiber = lanes;
                        break a;
                      }
                    } else if (currentFirstChild.elementType === key || "object" === typeof key && null !== key && key.$$typeof === REACT_LAZY_TYPE2 && resolveLazy(key) === currentFirstChild.type) {
                      deleteRemainingChildren(
                        returnFiber,
                        currentFirstChild.sibling
                      );
                      lanes = useFiber(currentFirstChild, newChild.props);
                      coerceRef(lanes, newChild);
                      lanes.return = returnFiber;
                      returnFiber = lanes;
                      break a;
                    }
                    deleteRemainingChildren(returnFiber, currentFirstChild);
                    break;
                  } else deleteChild(returnFiber, currentFirstChild);
                  currentFirstChild = currentFirstChild.sibling;
                }
                newChild.type === REACT_FRAGMENT_TYPE ? (lanes = createFiberFromFragment(
                  newChild.props.children,
                  returnFiber.mode,
                  lanes,
                  newChild.key
                ), lanes.return = returnFiber, returnFiber = lanes) : (lanes = createFiberFromTypeAndProps(
                  newChild.type,
                  newChild.key,
                  newChild.props,
                  null,
                  returnFiber.mode,
                  lanes
                ), coerceRef(lanes, newChild), lanes.return = returnFiber, returnFiber = lanes);
              }
              return placeSingleChild(returnFiber);
            case REACT_PORTAL_TYPE:
              a: {
                for (key = newChild.key; null !== currentFirstChild; ) {
                  if (currentFirstChild.key === key)
                    if (4 === currentFirstChild.tag && currentFirstChild.stateNode.containerInfo === newChild.containerInfo && currentFirstChild.stateNode.implementation === newChild.implementation) {
                      deleteRemainingChildren(
                        returnFiber,
                        currentFirstChild.sibling
                      );
                      lanes = useFiber(currentFirstChild, newChild.children || []);
                      lanes.return = returnFiber;
                      returnFiber = lanes;
                      break a;
                    } else {
                      deleteRemainingChildren(returnFiber, currentFirstChild);
                      break;
                    }
                  else deleteChild(returnFiber, currentFirstChild);
                  currentFirstChild = currentFirstChild.sibling;
                }
                lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes);
                lanes.return = returnFiber;
                returnFiber = lanes;
              }
              return placeSingleChild(returnFiber);
            case REACT_LAZY_TYPE2:
              return key = newChild._init, newChild = key(newChild._payload), reconcileChildFibersImpl(
                returnFiber,
                currentFirstChild,
                newChild,
                lanes
              );
          }
          if (isArrayImpl(newChild))
            return reconcileChildrenArray(
              returnFiber,
              currentFirstChild,
              newChild,
              lanes
            );
          if (getIteratorFn(newChild)) {
            key = getIteratorFn(newChild);
            if ("function" !== typeof key) throw Error(formatProdErrorMessage(150));
            newChild = key.call(newChild);
            return reconcileChildrenIterator(
              returnFiber,
              currentFirstChild,
              newChild,
              lanes
            );
          }
          if ("function" === typeof newChild.then)
            return reconcileChildFibersImpl(
              returnFiber,
              currentFirstChild,
              unwrapThenable(newChild),
              lanes
            );
          if (newChild.$$typeof === REACT_CONTEXT_TYPE)
            return reconcileChildFibersImpl(
              returnFiber,
              currentFirstChild,
              readContextDuringReconciliation(returnFiber, newChild),
              lanes
            );
          throwOnInvalidObjectType(returnFiber, newChild);
        }
        return "string" === typeof newChild && "" !== newChild || "number" === typeof newChild || "bigint" === typeof newChild ? (newChild = "" + newChild, null !== currentFirstChild && 6 === currentFirstChild.tag ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), lanes = useFiber(currentFirstChild, newChild), lanes.return = returnFiber, returnFiber = lanes) : (deleteRemainingChildren(returnFiber, currentFirstChild), lanes = createFiberFromText(newChild, returnFiber.mode, lanes), lanes.return = returnFiber, returnFiber = lanes), placeSingleChild(returnFiber)) : deleteRemainingChildren(returnFiber, currentFirstChild);
      }
      __name(reconcileChildFibersImpl, "reconcileChildFibersImpl");
      return function(returnFiber, currentFirstChild, newChild, lanes) {
        try {
          thenableIndexCounter = 0;
          var firstChildFiber = reconcileChildFibersImpl(
            returnFiber,
            currentFirstChild,
            newChild,
            lanes
          );
          thenableState = null;
          return firstChildFiber;
        } catch (x2) {
          if (x2 === SuspenseException || x2 === SuspenseActionException) throw x2;
          var fiber = createFiberImplClass(29, x2, null, returnFiber.mode);
          fiber.lanes = lanes;
          fiber.return = returnFiber;
          return fiber;
        } finally {
        }
      };
    }
    __name(createChildReconciler, "createChildReconciler");
    var reconcileChildFibers = createChildReconciler(true), mountChildFibers = createChildReconciler(false), suspenseHandlerStackCursor = createCursor(null), shellBoundary = null;
    function pushPrimaryTreeSuspenseHandler(handler) {
      var current = handler.alternate;
      push(suspenseStackCursor, suspenseStackCursor.current & 1);
      push(suspenseHandlerStackCursor, handler);
      null === shellBoundary && (null === current || null !== currentTreeHiddenStackCursor.current ? shellBoundary = handler : null !== current.memoizedState && (shellBoundary = handler));
    }
    __name(pushPrimaryTreeSuspenseHandler, "pushPrimaryTreeSuspenseHandler");
    function pushOffscreenSuspenseHandler(fiber) {
      if (22 === fiber.tag) {
        if (push(suspenseStackCursor, suspenseStackCursor.current), push(suspenseHandlerStackCursor, fiber), null === shellBoundary) {
          var current = fiber.alternate;
          null !== current && null !== current.memoizedState && (shellBoundary = fiber);
        }
      } else reuseSuspenseHandlerOnStack();
    }
    __name(pushOffscreenSuspenseHandler, "pushOffscreenSuspenseHandler");
    function reuseSuspenseHandlerOnStack() {
      push(suspenseStackCursor, suspenseStackCursor.current);
      push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current);
    }
    __name(reuseSuspenseHandlerOnStack, "reuseSuspenseHandlerOnStack");
    function popSuspenseHandler(fiber) {
      pop(suspenseHandlerStackCursor);
      shellBoundary === fiber && (shellBoundary = null);
      pop(suspenseStackCursor);
    }
    __name(popSuspenseHandler, "popSuspenseHandler");
    var suspenseStackCursor = createCursor(0);
    function findFirstSuspended(row) {
      for (var node = row; null !== node; ) {
        if (13 === node.tag) {
          var state = node.memoizedState;
          if (null !== state && (state = state.dehydrated, null === state || "$?" === state.data || isSuspenseInstanceFallback(state)))
            return node;
        } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) {
          if (0 !== (node.flags & 128)) return node;
        } else if (null !== node.child) {
          node.child.return = node;
          node = node.child;
          continue;
        }
        if (node === row) break;
        for (; null === node.sibling; ) {
          if (null === node.return || node.return === row) return null;
          node = node.return;
        }
        node.sibling.return = node.return;
        node = node.sibling;
      }
      return null;
    }
    __name(findFirstSuspended, "findFirstSuspended");
    function applyDerivedStateFromProps(workInProgress2, ctor, getDerivedStateFromProps, nextProps) {
      ctor = workInProgress2.memoizedState;
      getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);
      getDerivedStateFromProps = null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps ? ctor : assign({}, ctor, getDerivedStateFromProps);
      workInProgress2.memoizedState = getDerivedStateFromProps;
      0 === workInProgress2.lanes && (workInProgress2.updateQueue.baseState = getDerivedStateFromProps);
    }
    __name(applyDerivedStateFromProps, "applyDerivedStateFromProps");
    var classComponentUpdater = {
      enqueueSetState: /* @__PURE__ */ __name(function(inst, payload, callback) {
        inst = inst._reactInternals;
        var lane = requestUpdateLane(), update = createUpdate(lane);
        update.payload = payload;
        void 0 !== callback && null !== callback && (update.callback = callback);
        payload = enqueueUpdate(inst, update, lane);
        null !== payload && (scheduleUpdateOnFiber(payload, inst, lane), entangleTransitions(payload, inst, lane));
      }, "enqueueSetState"),
      enqueueReplaceState: /* @__PURE__ */ __name(function(inst, payload, callback) {
        inst = inst._reactInternals;
        var lane = requestUpdateLane(), update = createUpdate(lane);
        update.tag = 1;
        update.payload = payload;
        void 0 !== callback && null !== callback && (update.callback = callback);
        payload = enqueueUpdate(inst, update, lane);
        null !== payload && (scheduleUpdateOnFiber(payload, inst, lane), entangleTransitions(payload, inst, lane));
      }, "enqueueReplaceState"),
      enqueueForceUpdate: /* @__PURE__ */ __name(function(inst, callback) {
        inst = inst._reactInternals;
        var lane = requestUpdateLane(), update = createUpdate(lane);
        update.tag = 2;
        void 0 !== callback && null !== callback && (update.callback = callback);
        callback = enqueueUpdate(inst, update, lane);
        null !== callback && (scheduleUpdateOnFiber(callback, inst, lane), entangleTransitions(callback, inst, lane));
      }, "enqueueForceUpdate")
    };
    function checkShouldComponentUpdate(workInProgress2, ctor, oldProps, newProps, oldState, newState, nextContext) {
      workInProgress2 = workInProgress2.stateNode;
      return "function" === typeof workInProgress2.shouldComponentUpdate ? workInProgress2.shouldComponentUpdate(newProps, newState, nextContext) : ctor.prototype && ctor.prototype.isPureReactComponent ? !shallowEqual2(oldProps, newProps) || !shallowEqual2(oldState, newState) : true;
    }
    __name(checkShouldComponentUpdate, "checkShouldComponentUpdate");
    function callComponentWillReceiveProps(workInProgress2, instance, newProps, nextContext) {
      workInProgress2 = instance.state;
      "function" === typeof instance.componentWillReceiveProps && instance.componentWillReceiveProps(newProps, nextContext);
      "function" === typeof instance.UNSAFE_componentWillReceiveProps && instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
      instance.state !== workInProgress2 && classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
    }
    __name(callComponentWillReceiveProps, "callComponentWillReceiveProps");
    function resolveClassComponentProps(Component, baseProps) {
      var newProps = baseProps;
      if ("ref" in baseProps) {
        newProps = {};
        for (var propName in baseProps)
          "ref" !== propName && (newProps[propName] = baseProps[propName]);
      }
      if (Component = Component.defaultProps) {
        newProps === baseProps && (newProps = assign({}, newProps));
        for (var propName$73 in Component)
          void 0 === newProps[propName$73] && (newProps[propName$73] = Component[propName$73]);
      }
      return newProps;
    }
    __name(resolveClassComponentProps, "resolveClassComponentProps");
    var reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
      if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
        var event = new window.ErrorEvent("error", {
          bubbles: true,
          cancelable: true,
          message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
          error
        });
        if (!window.dispatchEvent(event)) return;
      } else if ("object" === typeof process && "function" === typeof process.emit) {
        process.emit("uncaughtException", error);
        return;
      }
      console.error(error);
    };
    function defaultOnUncaughtError(error) {
      reportGlobalError(error);
    }
    __name(defaultOnUncaughtError, "defaultOnUncaughtError");
    function defaultOnCaughtError(error) {
      console.error(error);
    }
    __name(defaultOnCaughtError, "defaultOnCaughtError");
    function defaultOnRecoverableError(error) {
      reportGlobalError(error);
    }
    __name(defaultOnRecoverableError, "defaultOnRecoverableError");
    function logUncaughtError(root3, errorInfo) {
      try {
        var onUncaughtError = root3.onUncaughtError;
        onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack });
      } catch (e$74) {
        setTimeout(function() {
          throw e$74;
        });
      }
    }
    __name(logUncaughtError, "logUncaughtError");
    function logCaughtError(root3, boundary, errorInfo) {
      try {
        var onCaughtError = root3.onCaughtError;
        onCaughtError(errorInfo.value, {
          componentStack: errorInfo.stack,
          errorBoundary: 1 === boundary.tag ? boundary.stateNode : null
        });
      } catch (e$75) {
        setTimeout(function() {
          throw e$75;
        });
      }
    }
    __name(logCaughtError, "logCaughtError");
    function createRootErrorUpdate(root3, errorInfo, lane) {
      lane = createUpdate(lane);
      lane.tag = 3;
      lane.payload = { element: null };
      lane.callback = function() {
        logUncaughtError(root3, errorInfo);
      };
      return lane;
    }
    __name(createRootErrorUpdate, "createRootErrorUpdate");
    function createClassErrorUpdate(lane) {
      lane = createUpdate(lane);
      lane.tag = 3;
      return lane;
    }
    __name(createClassErrorUpdate, "createClassErrorUpdate");
    function initializeClassErrorUpdate(update, root3, fiber, errorInfo) {
      var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
      if ("function" === typeof getDerivedStateFromError) {
        var error = errorInfo.value;
        update.payload = function() {
          return getDerivedStateFromError(error);
        };
        update.callback = function() {
          logCaughtError(root3, fiber, errorInfo);
        };
      }
      var inst = fiber.stateNode;
      null !== inst && "function" === typeof inst.componentDidCatch && (update.callback = function() {
        logCaughtError(root3, fiber, errorInfo);
        "function" !== typeof getDerivedStateFromError && (null === legacyErrorBoundariesThatAlreadyFailed ? legacyErrorBoundariesThatAlreadyFailed = /* @__PURE__ */ new Set([this]) : legacyErrorBoundariesThatAlreadyFailed.add(this));
        var stack = errorInfo.stack;
        this.componentDidCatch(errorInfo.value, {
          componentStack: null !== stack ? stack : ""
        });
      });
    }
    __name(initializeClassErrorUpdate, "initializeClassErrorUpdate");
    function throwException(root3, returnFiber, sourceFiber, value, rootRenderLanes) {
      sourceFiber.flags |= 32768;
      if (null !== value && "object" === typeof value && "function" === typeof value.then) {
        returnFiber = sourceFiber.alternate;
        null !== returnFiber && propagateParentContextChanges(
          returnFiber,
          sourceFiber,
          rootRenderLanes,
          true
        );
        sourceFiber = suspenseHandlerStackCursor.current;
        if (null !== sourceFiber) {
          switch (sourceFiber.tag) {
            case 13:
              return null === shellBoundary ? renderDidSuspendDelayIfPossible() : null === sourceFiber.alternate && 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3), sourceFiber.flags &= -257, sourceFiber.flags |= 65536, sourceFiber.lanes = rootRenderLanes, value === noopSuspenseyCommitThenable ? sourceFiber.flags |= 16384 : (returnFiber = sourceFiber.updateQueue, null === returnFiber ? sourceFiber.updateQueue = /* @__PURE__ */ new Set([value]) : returnFiber.add(value), attachPingListener(root3, value, rootRenderLanes)), false;
            case 22:
              return sourceFiber.flags |= 65536, value === noopSuspenseyCommitThenable ? sourceFiber.flags |= 16384 : (returnFiber = sourceFiber.updateQueue, null === returnFiber ? (returnFiber = {
                transitions: null,
                markerInstances: null,
                retryQueue: /* @__PURE__ */ new Set([value])
              }, sourceFiber.updateQueue = returnFiber) : (sourceFiber = returnFiber.retryQueue, null === sourceFiber ? returnFiber.retryQueue = /* @__PURE__ */ new Set([value]) : sourceFiber.add(value)), attachPingListener(root3, value, rootRenderLanes)), false;
          }
          throw Error(formatProdErrorMessage(435, sourceFiber.tag));
        }
        attachPingListener(root3, value, rootRenderLanes);
        renderDidSuspendDelayIfPossible();
        return false;
      }
      if (isHydrating)
        return returnFiber = suspenseHandlerStackCursor.current, null !== returnFiber ? (0 === (returnFiber.flags & 65536) && (returnFiber.flags |= 256), returnFiber.flags |= 65536, returnFiber.lanes = rootRenderLanes, value !== HydrationMismatchException && (root3 = Error(formatProdErrorMessage(422), { cause: value }), queueHydrationError(createCapturedValueAtFiber(root3, sourceFiber)))) : (value !== HydrationMismatchException && (returnFiber = Error(formatProdErrorMessage(423), {
          cause: value
        }), queueHydrationError(
          createCapturedValueAtFiber(returnFiber, sourceFiber)
        )), root3 = root3.current.alternate, root3.flags |= 65536, rootRenderLanes &= -rootRenderLanes, root3.lanes |= rootRenderLanes, value = createCapturedValueAtFiber(value, sourceFiber), rootRenderLanes = createRootErrorUpdate(
          root3.stateNode,
          value,
          rootRenderLanes
        ), enqueueCapturedUpdate(root3, rootRenderLanes), 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2)), false;
      var wrapperError = Error(formatProdErrorMessage(520), { cause: value });
      wrapperError = createCapturedValueAtFiber(wrapperError, sourceFiber);
      null === workInProgressRootConcurrentErrors ? workInProgressRootConcurrentErrors = [wrapperError] : workInProgressRootConcurrentErrors.push(wrapperError);
      4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2);
      if (null === returnFiber) return true;
      value = createCapturedValueAtFiber(value, sourceFiber);
      sourceFiber = returnFiber;
      do {
        switch (sourceFiber.tag) {
          case 3:
            return sourceFiber.flags |= 65536, root3 = rootRenderLanes & -rootRenderLanes, sourceFiber.lanes |= root3, root3 = createRootErrorUpdate(sourceFiber.stateNode, value, root3), enqueueCapturedUpdate(sourceFiber, root3), false;
          case 1:
            if (returnFiber = sourceFiber.type, wrapperError = sourceFiber.stateNode, 0 === (sourceFiber.flags & 128) && ("function" === typeof returnFiber.getDerivedStateFromError || null !== wrapperError && "function" === typeof wrapperError.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(wrapperError))))
              return sourceFiber.flags |= 65536, rootRenderLanes &= -rootRenderLanes, sourceFiber.lanes |= rootRenderLanes, rootRenderLanes = createClassErrorUpdate(rootRenderLanes), initializeClassErrorUpdate(
                rootRenderLanes,
                root3,
                sourceFiber,
                value
              ), enqueueCapturedUpdate(sourceFiber, rootRenderLanes), false;
        }
        sourceFiber = sourceFiber.return;
      } while (null !== sourceFiber);
      return false;
    }
    __name(throwException, "throwException");
    var SelectiveHydrationException = Error(formatProdErrorMessage(461)), didReceiveUpdate = false;
    function reconcileChildren(current, workInProgress2, nextChildren, renderLanes2) {
      workInProgress2.child = null === current ? mountChildFibers(workInProgress2, null, nextChildren, renderLanes2) : reconcileChildFibers(
        workInProgress2,
        current.child,
        nextChildren,
        renderLanes2
      );
    }
    __name(reconcileChildren, "reconcileChildren");
    function updateForwardRef(current, workInProgress2, Component, nextProps, renderLanes2) {
      Component = Component.render;
      var ref = workInProgress2.ref;
      if ("ref" in nextProps) {
        var propsWithoutRef = {};
        for (var key in nextProps)
          "ref" !== key && (propsWithoutRef[key] = nextProps[key]);
      } else propsWithoutRef = nextProps;
      prepareToReadContext(workInProgress2);
      nextProps = renderWithHooks(
        current,
        workInProgress2,
        Component,
        propsWithoutRef,
        ref,
        renderLanes2
      );
      key = checkDidRenderIdHook();
      if (null !== current && !didReceiveUpdate)
        return bailoutHooks(current, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
      isHydrating && key && pushMaterializedTreeId(workInProgress2);
      workInProgress2.flags |= 1;
      reconcileChildren(current, workInProgress2, nextProps, renderLanes2);
      return workInProgress2.child;
    }
    __name(updateForwardRef, "updateForwardRef");
    function updateMemoComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
      if (null === current) {
        var type = Component.type;
        if ("function" === typeof type && !shouldConstruct(type) && void 0 === type.defaultProps && null === Component.compare)
          return workInProgress2.tag = 15, workInProgress2.type = type, updateSimpleMemoComponent(
            current,
            workInProgress2,
            type,
            nextProps,
            renderLanes2
          );
        current = createFiberFromTypeAndProps(
          Component.type,
          null,
          nextProps,
          workInProgress2,
          workInProgress2.mode,
          renderLanes2
        );
        current.ref = workInProgress2.ref;
        current.return = workInProgress2;
        return workInProgress2.child = current;
      }
      type = current.child;
      if (!checkScheduledUpdateOrContext(current, renderLanes2)) {
        var prevProps = type.memoizedProps;
        Component = Component.compare;
        Component = null !== Component ? Component : shallowEqual2;
        if (Component(prevProps, nextProps) && current.ref === workInProgress2.ref)
          return bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
      }
      workInProgress2.flags |= 1;
      current = createWorkInProgress(type, nextProps);
      current.ref = workInProgress2.ref;
      current.return = workInProgress2;
      return workInProgress2.child = current;
    }
    __name(updateMemoComponent, "updateMemoComponent");
    function updateSimpleMemoComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
      if (null !== current) {
        var prevProps = current.memoizedProps;
        if (shallowEqual2(prevProps, nextProps) && current.ref === workInProgress2.ref)
          if (didReceiveUpdate = false, workInProgress2.pendingProps = nextProps = prevProps, checkScheduledUpdateOrContext(current, renderLanes2))
            0 !== (current.flags & 131072) && (didReceiveUpdate = true);
          else
            return workInProgress2.lanes = current.lanes, bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
      }
      return updateFunctionComponent(
        current,
        workInProgress2,
        Component,
        nextProps,
        renderLanes2
      );
    }
    __name(updateSimpleMemoComponent, "updateSimpleMemoComponent");
    function updateOffscreenComponent(current, workInProgress2, renderLanes2) {
      var nextProps = workInProgress2.pendingProps, nextChildren = nextProps.children, prevState = null !== current ? current.memoizedState : null;
      if ("hidden" === nextProps.mode) {
        if (0 !== (workInProgress2.flags & 128)) {
          nextProps = null !== prevState ? prevState.baseLanes | renderLanes2 : renderLanes2;
          if (null !== current) {
            nextChildren = workInProgress2.child = current.child;
            for (prevState = 0; null !== nextChildren; )
              prevState = prevState | nextChildren.lanes | nextChildren.childLanes, nextChildren = nextChildren.sibling;
            workInProgress2.childLanes = prevState & ~nextProps;
          } else workInProgress2.childLanes = 0, workInProgress2.child = null;
          return deferHiddenOffscreenComponent(
            current,
            workInProgress2,
            nextProps,
            renderLanes2
          );
        }
        if (0 !== (renderLanes2 & 536870912))
          workInProgress2.memoizedState = { baseLanes: 0, cachePool: null }, null !== current && pushTransition(
            workInProgress2,
            null !== prevState ? prevState.cachePool : null
          ), null !== prevState ? pushHiddenContext(workInProgress2, prevState) : reuseHiddenContextOnStack(), pushOffscreenSuspenseHandler(workInProgress2);
        else
          return workInProgress2.lanes = workInProgress2.childLanes = 536870912, deferHiddenOffscreenComponent(
            current,
            workInProgress2,
            null !== prevState ? prevState.baseLanes | renderLanes2 : renderLanes2,
            renderLanes2
          );
      } else
        null !== prevState ? (pushTransition(workInProgress2, prevState.cachePool), pushHiddenContext(workInProgress2, prevState), reuseSuspenseHandlerOnStack(), workInProgress2.memoizedState = null) : (null !== current && pushTransition(workInProgress2, null), reuseHiddenContextOnStack(), reuseSuspenseHandlerOnStack());
      reconcileChildren(current, workInProgress2, nextChildren, renderLanes2);
      return workInProgress2.child;
    }
    __name(updateOffscreenComponent, "updateOffscreenComponent");
    function deferHiddenOffscreenComponent(current, workInProgress2, nextBaseLanes, renderLanes2) {
      var JSCompiler_inline_result = peekCacheFromPool();
      JSCompiler_inline_result = null === JSCompiler_inline_result ? null : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result };
      workInProgress2.memoizedState = {
        baseLanes: nextBaseLanes,
        cachePool: JSCompiler_inline_result
      };
      null !== current && pushTransition(workInProgress2, null);
      reuseHiddenContextOnStack();
      pushOffscreenSuspenseHandler(workInProgress2);
      null !== current && propagateParentContextChanges(current, workInProgress2, renderLanes2, true);
      return null;
    }
    __name(deferHiddenOffscreenComponent, "deferHiddenOffscreenComponent");
    function markRef(current, workInProgress2) {
      var ref = workInProgress2.ref;
      if (null === ref)
        null !== current && null !== current.ref && (workInProgress2.flags |= 4194816);
      else {
        if ("function" !== typeof ref && "object" !== typeof ref)
          throw Error(formatProdErrorMessage(284));
        if (null === current || current.ref !== ref)
          workInProgress2.flags |= 4194816;
      }
    }
    __name(markRef, "markRef");
    function updateFunctionComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
      prepareToReadContext(workInProgress2);
      Component = renderWithHooks(
        current,
        workInProgress2,
        Component,
        nextProps,
        void 0,
        renderLanes2
      );
      nextProps = checkDidRenderIdHook();
      if (null !== current && !didReceiveUpdate)
        return bailoutHooks(current, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
      isHydrating && nextProps && pushMaterializedTreeId(workInProgress2);
      workInProgress2.flags |= 1;
      reconcileChildren(current, workInProgress2, Component, renderLanes2);
      return workInProgress2.child;
    }
    __name(updateFunctionComponent, "updateFunctionComponent");
    function replayFunctionComponent(current, workInProgress2, nextProps, Component, secondArg, renderLanes2) {
      prepareToReadContext(workInProgress2);
      workInProgress2.updateQueue = null;
      nextProps = renderWithHooksAgain(
        workInProgress2,
        Component,
        nextProps,
        secondArg
      );
      finishRenderingHooks(current);
      Component = checkDidRenderIdHook();
      if (null !== current && !didReceiveUpdate)
        return bailoutHooks(current, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
      isHydrating && Component && pushMaterializedTreeId(workInProgress2);
      workInProgress2.flags |= 1;
      reconcileChildren(current, workInProgress2, nextProps, renderLanes2);
      return workInProgress2.child;
    }
    __name(replayFunctionComponent, "replayFunctionComponent");
    function updateClassComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
      prepareToReadContext(workInProgress2);
      if (null === workInProgress2.stateNode) {
        var context = emptyContextObject, contextType = Component.contextType;
        "object" === typeof contextType && null !== contextType && (context = readContext(contextType));
        context = new Component(nextProps, context);
        workInProgress2.memoizedState = null !== context.state && void 0 !== context.state ? context.state : null;
        context.updater = classComponentUpdater;
        workInProgress2.stateNode = context;
        context._reactInternals = workInProgress2;
        context = workInProgress2.stateNode;
        context.props = nextProps;
        context.state = workInProgress2.memoizedState;
        context.refs = {};
        initializeUpdateQueue(workInProgress2);
        contextType = Component.contextType;
        context.context = "object" === typeof contextType && null !== contextType ? readContext(contextType) : emptyContextObject;
        context.state = workInProgress2.memoizedState;
        contextType = Component.getDerivedStateFromProps;
        "function" === typeof contextType && (applyDerivedStateFromProps(
          workInProgress2,
          Component,
          contextType,
          nextProps
        ), context.state = workInProgress2.memoizedState);
        "function" === typeof Component.getDerivedStateFromProps || "function" === typeof context.getSnapshotBeforeUpdate || "function" !== typeof context.UNSAFE_componentWillMount && "function" !== typeof context.componentWillMount || (contextType = context.state, "function" === typeof context.componentWillMount && context.componentWillMount(), "function" === typeof context.UNSAFE_componentWillMount && context.UNSAFE_componentWillMount(), contextType !== context.state && classComponentUpdater.enqueueReplaceState(context, context.state, null), processUpdateQueue(workInProgress2, nextProps, context, renderLanes2), suspendIfUpdateReadFromEntangledAsyncAction(), context.state = workInProgress2.memoizedState);
        "function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308);
        nextProps = true;
      } else if (null === current) {
        context = workInProgress2.stateNode;
        var unresolvedOldProps = workInProgress2.memoizedProps, oldProps = resolveClassComponentProps(Component, unresolvedOldProps);
        context.props = oldProps;
        var oldContext = context.context, contextType$jscomp$0 = Component.contextType;
        contextType = emptyContextObject;
        "object" === typeof contextType$jscomp$0 && null !== contextType$jscomp$0 && (contextType = readContext(contextType$jscomp$0));
        var getDerivedStateFromProps = Component.getDerivedStateFromProps;
        contextType$jscomp$0 = "function" === typeof getDerivedStateFromProps || "function" === typeof context.getSnapshotBeforeUpdate;
        unresolvedOldProps = workInProgress2.pendingProps !== unresolvedOldProps;
        contextType$jscomp$0 || "function" !== typeof context.UNSAFE_componentWillReceiveProps && "function" !== typeof context.componentWillReceiveProps || (unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps(
          workInProgress2,
          context,
          nextProps,
          contextType
        );
        hasForceUpdate = false;
        var oldState = workInProgress2.memoizedState;
        context.state = oldState;
        processUpdateQueue(workInProgress2, nextProps, context, renderLanes2);
        suspendIfUpdateReadFromEntangledAsyncAction();
        oldContext = workInProgress2.memoizedState;
        unresolvedOldProps || oldState !== oldContext || hasForceUpdate ? ("function" === typeof getDerivedStateFromProps && (applyDerivedStateFromProps(
          workInProgress2,
          Component,
          getDerivedStateFromProps,
          nextProps
        ), oldContext = workInProgress2.memoizedState), (oldProps = hasForceUpdate || checkShouldComponentUpdate(
          workInProgress2,
          Component,
          oldProps,
          nextProps,
          oldState,
          oldContext,
          contextType
        )) ? (contextType$jscomp$0 || "function" !== typeof context.UNSAFE_componentWillMount && "function" !== typeof context.componentWillMount || ("function" === typeof context.componentWillMount && context.componentWillMount(), "function" === typeof context.UNSAFE_componentWillMount && context.UNSAFE_componentWillMount()), "function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308)) : ("function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308), workInProgress2.memoizedProps = nextProps, workInProgress2.memoizedState = oldContext), context.props = nextProps, context.state = oldContext, context.context = contextType, nextProps = oldProps) : ("function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308), nextProps = false);
      } else {
        context = workInProgress2.stateNode;
        cloneUpdateQueue(current, workInProgress2);
        contextType = workInProgress2.memoizedProps;
        contextType$jscomp$0 = resolveClassComponentProps(Component, contextType);
        context.props = contextType$jscomp$0;
        getDerivedStateFromProps = workInProgress2.pendingProps;
        oldState = context.context;
        oldContext = Component.contextType;
        oldProps = emptyContextObject;
        "object" === typeof oldContext && null !== oldContext && (oldProps = readContext(oldContext));
        unresolvedOldProps = Component.getDerivedStateFromProps;
        (oldContext = "function" === typeof unresolvedOldProps || "function" === typeof context.getSnapshotBeforeUpdate) || "function" !== typeof context.UNSAFE_componentWillReceiveProps && "function" !== typeof context.componentWillReceiveProps || (contextType !== getDerivedStateFromProps || oldState !== oldProps) && callComponentWillReceiveProps(
          workInProgress2,
          context,
          nextProps,
          oldProps
        );
        hasForceUpdate = false;
        oldState = workInProgress2.memoizedState;
        context.state = oldState;
        processUpdateQueue(workInProgress2, nextProps, context, renderLanes2);
        suspendIfUpdateReadFromEntangledAsyncAction();
        var newState = workInProgress2.memoizedState;
        contextType !== getDerivedStateFromProps || oldState !== newState || hasForceUpdate || null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies) ? ("function" === typeof unresolvedOldProps && (applyDerivedStateFromProps(
          workInProgress2,
          Component,
          unresolvedOldProps,
          nextProps
        ), newState = workInProgress2.memoizedState), (contextType$jscomp$0 = hasForceUpdate || checkShouldComponentUpdate(
          workInProgress2,
          Component,
          contextType$jscomp$0,
          nextProps,
          oldState,
          newState,
          oldProps
        ) || null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies)) ? (oldContext || "function" !== typeof context.UNSAFE_componentWillUpdate && "function" !== typeof context.componentWillUpdate || ("function" === typeof context.componentWillUpdate && context.componentWillUpdate(nextProps, newState, oldProps), "function" === typeof context.UNSAFE_componentWillUpdate && context.UNSAFE_componentWillUpdate(
          nextProps,
          newState,
          oldProps
        )), "function" === typeof context.componentDidUpdate && (workInProgress2.flags |= 4), "function" === typeof context.getSnapshotBeforeUpdate && (workInProgress2.flags |= 1024)) : ("function" !== typeof context.componentDidUpdate || contextType === current.memoizedProps && oldState === current.memoizedState || (workInProgress2.flags |= 4), "function" !== typeof context.getSnapshotBeforeUpdate || contextType === current.memoizedProps && oldState === current.memoizedState || (workInProgress2.flags |= 1024), workInProgress2.memoizedProps = nextProps, workInProgress2.memoizedState = newState), context.props = nextProps, context.state = newState, context.context = oldProps, nextProps = contextType$jscomp$0) : ("function" !== typeof context.componentDidUpdate || contextType === current.memoizedProps && oldState === current.memoizedState || (workInProgress2.flags |= 4), "function" !== typeof context.getSnapshotBeforeUpdate || contextType === current.memoizedProps && oldState === current.memoizedState || (workInProgress2.flags |= 1024), nextProps = false);
      }
      context = nextProps;
      markRef(current, workInProgress2);
      nextProps = 0 !== (workInProgress2.flags & 128);
      context || nextProps ? (context = workInProgress2.stateNode, Component = nextProps && "function" !== typeof Component.getDerivedStateFromError ? null : context.render(), workInProgress2.flags |= 1, null !== current && nextProps ? (workInProgress2.child = reconcileChildFibers(
        workInProgress2,
        current.child,
        null,
        renderLanes2
      ), workInProgress2.child = reconcileChildFibers(
        workInProgress2,
        null,
        Component,
        renderLanes2
      )) : reconcileChildren(current, workInProgress2, Component, renderLanes2), workInProgress2.memoizedState = context.state, current = workInProgress2.child) : current = bailoutOnAlreadyFinishedWork(
        current,
        workInProgress2,
        renderLanes2
      );
      return current;
    }
    __name(updateClassComponent, "updateClassComponent");
    function mountHostRootWithoutHydrating(current, workInProgress2, nextChildren, renderLanes2) {
      resetHydrationState();
      workInProgress2.flags |= 256;
      reconcileChildren(current, workInProgress2, nextChildren, renderLanes2);
      return workInProgress2.child;
    }
    __name(mountHostRootWithoutHydrating, "mountHostRootWithoutHydrating");
    var SUSPENDED_MARKER = {
      dehydrated: null,
      treeContext: null,
      retryLane: 0,
      hydrationErrors: null
    };
    function mountSuspenseOffscreenState(renderLanes2) {
      return { baseLanes: renderLanes2, cachePool: getSuspendedCache() };
    }
    __name(mountSuspenseOffscreenState, "mountSuspenseOffscreenState");
    function getRemainingWorkInPrimaryTree(current, primaryTreeDidDefer, renderLanes2) {
      current = null !== current ? current.childLanes & ~renderLanes2 : 0;
      primaryTreeDidDefer && (current |= workInProgressDeferredLane);
      return current;
    }
    __name(getRemainingWorkInPrimaryTree, "getRemainingWorkInPrimaryTree");
    function updateSuspenseComponent(current, workInProgress2, renderLanes2) {
      var nextProps = workInProgress2.pendingProps, showFallback = false, didSuspend = 0 !== (workInProgress2.flags & 128), JSCompiler_temp;
      (JSCompiler_temp = didSuspend) || (JSCompiler_temp = null !== current && null === current.memoizedState ? false : 0 !== (suspenseStackCursor.current & 2));
      JSCompiler_temp && (showFallback = true, workInProgress2.flags &= -129);
      JSCompiler_temp = 0 !== (workInProgress2.flags & 32);
      workInProgress2.flags &= -33;
      if (null === current) {
        if (isHydrating) {
          showFallback ? pushPrimaryTreeSuspenseHandler(workInProgress2) : reuseSuspenseHandlerOnStack();
          if (isHydrating) {
            var nextInstance = nextHydratableInstance, JSCompiler_temp$jscomp$0;
            if (JSCompiler_temp$jscomp$0 = nextInstance) {
              c: {
                JSCompiler_temp$jscomp$0 = nextInstance;
                for (nextInstance = rootOrSingletonContext; 8 !== JSCompiler_temp$jscomp$0.nodeType; ) {
                  if (!nextInstance) {
                    nextInstance = null;
                    break c;
                  }
                  JSCompiler_temp$jscomp$0 = getNextHydratable(
                    JSCompiler_temp$jscomp$0.nextSibling
                  );
                  if (null === JSCompiler_temp$jscomp$0) {
                    nextInstance = null;
                    break c;
                  }
                }
                nextInstance = JSCompiler_temp$jscomp$0;
              }
              null !== nextInstance ? (workInProgress2.memoizedState = {
                dehydrated: nextInstance,
                treeContext: null !== treeContextProvider ? { id: treeContextId, overflow: treeContextOverflow } : null,
                retryLane: 536870912,
                hydrationErrors: null
              }, JSCompiler_temp$jscomp$0 = createFiberImplClass(
                18,
                null,
                null,
                0
              ), JSCompiler_temp$jscomp$0.stateNode = nextInstance, JSCompiler_temp$jscomp$0.return = workInProgress2, workInProgress2.child = JSCompiler_temp$jscomp$0, hydrationParentFiber = workInProgress2, nextHydratableInstance = null, JSCompiler_temp$jscomp$0 = true) : JSCompiler_temp$jscomp$0 = false;
            }
            JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress2);
          }
          nextInstance = workInProgress2.memoizedState;
          if (null !== nextInstance && (nextInstance = nextInstance.dehydrated, null !== nextInstance))
            return isSuspenseInstanceFallback(nextInstance) ? workInProgress2.lanes = 32 : workInProgress2.lanes = 536870912, null;
          popSuspenseHandler(workInProgress2);
        }
        nextInstance = nextProps.children;
        nextProps = nextProps.fallback;
        if (showFallback)
          return reuseSuspenseHandlerOnStack(), showFallback = workInProgress2.mode, nextInstance = mountWorkInProgressOffscreenFiber(
            { mode: "hidden", children: nextInstance },
            showFallback
          ), nextProps = createFiberFromFragment(
            nextProps,
            showFallback,
            renderLanes2,
            null
          ), nextInstance.return = workInProgress2, nextProps.return = workInProgress2, nextInstance.sibling = nextProps, workInProgress2.child = nextInstance, showFallback = workInProgress2.child, showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes2), showFallback.childLanes = getRemainingWorkInPrimaryTree(
            current,
            JSCompiler_temp,
            renderLanes2
          ), workInProgress2.memoizedState = SUSPENDED_MARKER, nextProps;
        pushPrimaryTreeSuspenseHandler(workInProgress2);
        return mountSuspensePrimaryChildren(workInProgress2, nextInstance);
      }
      JSCompiler_temp$jscomp$0 = current.memoizedState;
      if (null !== JSCompiler_temp$jscomp$0 && (nextInstance = JSCompiler_temp$jscomp$0.dehydrated, null !== nextInstance)) {
        if (didSuspend)
          workInProgress2.flags & 256 ? (pushPrimaryTreeSuspenseHandler(workInProgress2), workInProgress2.flags &= -257, workInProgress2 = retrySuspenseComponentWithoutHydrating(
            current,
            workInProgress2,
            renderLanes2
          )) : null !== workInProgress2.memoizedState ? (reuseSuspenseHandlerOnStack(), workInProgress2.child = current.child, workInProgress2.flags |= 128, workInProgress2 = null) : (reuseSuspenseHandlerOnStack(), showFallback = nextProps.fallback, nextInstance = workInProgress2.mode, nextProps = mountWorkInProgressOffscreenFiber(
            { mode: "visible", children: nextProps.children },
            nextInstance
          ), showFallback = createFiberFromFragment(
            showFallback,
            nextInstance,
            renderLanes2,
            null
          ), showFallback.flags |= 2, nextProps.return = workInProgress2, showFallback.return = workInProgress2, nextProps.sibling = showFallback, workInProgress2.child = nextProps, reconcileChildFibers(
            workInProgress2,
            current.child,
            null,
            renderLanes2
          ), nextProps = workInProgress2.child, nextProps.memoizedState = mountSuspenseOffscreenState(renderLanes2), nextProps.childLanes = getRemainingWorkInPrimaryTree(
            current,
            JSCompiler_temp,
            renderLanes2
          ), workInProgress2.memoizedState = SUSPENDED_MARKER, workInProgress2 = showFallback);
        else if (pushPrimaryTreeSuspenseHandler(workInProgress2), isSuspenseInstanceFallback(nextInstance)) {
          JSCompiler_temp = nextInstance.nextSibling && nextInstance.nextSibling.dataset;
          if (JSCompiler_temp) var digest = JSCompiler_temp.dgst;
          JSCompiler_temp = digest;
          nextProps = Error(formatProdErrorMessage(419));
          nextProps.stack = "";
          nextProps.digest = JSCompiler_temp;
          queueHydrationError({ value: nextProps, source: null, stack: null });
          workInProgress2 = retrySuspenseComponentWithoutHydrating(
            current,
            workInProgress2,
            renderLanes2
          );
        } else if (didReceiveUpdate || propagateParentContextChanges(current, workInProgress2, renderLanes2, false), JSCompiler_temp = 0 !== (renderLanes2 & current.childLanes), didReceiveUpdate || JSCompiler_temp) {
          JSCompiler_temp = workInProgressRoot;
          if (null !== JSCompiler_temp && (nextProps = renderLanes2 & -renderLanes2, nextProps = 0 !== (nextProps & 42) ? 1 : getBumpedLaneForHydrationByLane(nextProps), nextProps = 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes2)) ? 0 : nextProps, 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane))
            throw JSCompiler_temp$jscomp$0.retryLane = nextProps, enqueueConcurrentRenderForLane(current, nextProps), scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), SelectiveHydrationException;
          "$?" === nextInstance.data || renderDidSuspendDelayIfPossible();
          workInProgress2 = retrySuspenseComponentWithoutHydrating(
            current,
            workInProgress2,
            renderLanes2
          );
        } else
          "$?" === nextInstance.data ? (workInProgress2.flags |= 192, workInProgress2.child = current.child, workInProgress2 = null) : (current = JSCompiler_temp$jscomp$0.treeContext, nextHydratableInstance = getNextHydratable(
            nextInstance.nextSibling
          ), hydrationParentFiber = workInProgress2, isHydrating = true, hydrationErrors = null, rootOrSingletonContext = false, null !== current && (idStack[idStackIndex++] = treeContextId, idStack[idStackIndex++] = treeContextOverflow, idStack[idStackIndex++] = treeContextProvider, treeContextId = current.id, treeContextOverflow = current.overflow, treeContextProvider = workInProgress2), workInProgress2 = mountSuspensePrimaryChildren(
            workInProgress2,
            nextProps.children
          ), workInProgress2.flags |= 4096);
        return workInProgress2;
      }
      if (showFallback)
        return reuseSuspenseHandlerOnStack(), showFallback = nextProps.fallback, nextInstance = workInProgress2.mode, JSCompiler_temp$jscomp$0 = current.child, digest = JSCompiler_temp$jscomp$0.sibling, nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, {
          mode: "hidden",
          children: nextProps.children
        }), nextProps.subtreeFlags = JSCompiler_temp$jscomp$0.subtreeFlags & 65011712, null !== digest ? showFallback = createWorkInProgress(digest, showFallback) : (showFallback = createFiberFromFragment(
          showFallback,
          nextInstance,
          renderLanes2,
          null
        ), showFallback.flags |= 2), showFallback.return = workInProgress2, nextProps.return = workInProgress2, nextProps.sibling = showFallback, workInProgress2.child = nextProps, nextProps = showFallback, showFallback = workInProgress2.child, nextInstance = current.child.memoizedState, null === nextInstance ? nextInstance = mountSuspenseOffscreenState(renderLanes2) : (JSCompiler_temp$jscomp$0 = nextInstance.cachePool, null !== JSCompiler_temp$jscomp$0 ? (digest = CacheContext._currentValue, JSCompiler_temp$jscomp$0 = JSCompiler_temp$jscomp$0.parent !== digest ? { parent: digest, pool: digest } : JSCompiler_temp$jscomp$0) : JSCompiler_temp$jscomp$0 = getSuspendedCache(), nextInstance = {
          baseLanes: nextInstance.baseLanes | renderLanes2,
          cachePool: JSCompiler_temp$jscomp$0
        }), showFallback.memoizedState = nextInstance, showFallback.childLanes = getRemainingWorkInPrimaryTree(
          current,
          JSCompiler_temp,
          renderLanes2
        ), workInProgress2.memoizedState = SUSPENDED_MARKER, nextProps;
      pushPrimaryTreeSuspenseHandler(workInProgress2);
      renderLanes2 = current.child;
      current = renderLanes2.sibling;
      renderLanes2 = createWorkInProgress(renderLanes2, {
        mode: "visible",
        children: nextProps.children
      });
      renderLanes2.return = workInProgress2;
      renderLanes2.sibling = null;
      null !== current && (JSCompiler_temp = workInProgress2.deletions, null === JSCompiler_temp ? (workInProgress2.deletions = [current], workInProgress2.flags |= 16) : JSCompiler_temp.push(current));
      workInProgress2.child = renderLanes2;
      workInProgress2.memoizedState = null;
      return renderLanes2;
    }
    __name(updateSuspenseComponent, "updateSuspenseComponent");
    function mountSuspensePrimaryChildren(workInProgress2, primaryChildren) {
      primaryChildren = mountWorkInProgressOffscreenFiber(
        { mode: "visible", children: primaryChildren },
        workInProgress2.mode
      );
      primaryChildren.return = workInProgress2;
      return workInProgress2.child = primaryChildren;
    }
    __name(mountSuspensePrimaryChildren, "mountSuspensePrimaryChildren");
    function mountWorkInProgressOffscreenFiber(offscreenProps, mode) {
      offscreenProps = createFiberImplClass(22, offscreenProps, null, mode);
      offscreenProps.lanes = 0;
      offscreenProps.stateNode = {
        _visibility: 1,
        _pendingMarkers: null,
        _retryCache: null,
        _transitions: null
      };
      return offscreenProps;
    }
    __name(mountWorkInProgressOffscreenFiber, "mountWorkInProgressOffscreenFiber");
    function retrySuspenseComponentWithoutHydrating(current, workInProgress2, renderLanes2) {
      reconcileChildFibers(workInProgress2, current.child, null, renderLanes2);
      current = mountSuspensePrimaryChildren(
        workInProgress2,
        workInProgress2.pendingProps.children
      );
      current.flags |= 2;
      workInProgress2.memoizedState = null;
      return current;
    }
    __name(retrySuspenseComponentWithoutHydrating, "retrySuspenseComponentWithoutHydrating");
    function scheduleSuspenseWorkOnFiber(fiber, renderLanes2, propagationRoot) {
      fiber.lanes |= renderLanes2;
      var alternate = fiber.alternate;
      null !== alternate && (alternate.lanes |= renderLanes2);
      scheduleContextWorkOnParentPath(fiber.return, renderLanes2, propagationRoot);
    }
    __name(scheduleSuspenseWorkOnFiber, "scheduleSuspenseWorkOnFiber");
    function initSuspenseListRenderState(workInProgress2, isBackwards, tail, lastContentRow, tailMode) {
      var renderState = workInProgress2.memoizedState;
      null === renderState ? workInProgress2.memoizedState = {
        isBackwards,
        rendering: null,
        renderingStartTime: 0,
        last: lastContentRow,
        tail,
        tailMode
      } : (renderState.isBackwards = isBackwards, renderState.rendering = null, renderState.renderingStartTime = 0, renderState.last = lastContentRow, renderState.tail = tail, renderState.tailMode = tailMode);
    }
    __name(initSuspenseListRenderState, "initSuspenseListRenderState");
    function updateSuspenseListComponent(current, workInProgress2, renderLanes2) {
      var nextProps = workInProgress2.pendingProps, revealOrder = nextProps.revealOrder, tailMode = nextProps.tail;
      reconcileChildren(current, workInProgress2, nextProps.children, renderLanes2);
      nextProps = suspenseStackCursor.current;
      if (0 !== (nextProps & 2))
        nextProps = nextProps & 1 | 2, workInProgress2.flags |= 128;
      else {
        if (null !== current && 0 !== (current.flags & 128))
          a: for (current = workInProgress2.child; null !== current; ) {
            if (13 === current.tag)
              null !== current.memoizedState && scheduleSuspenseWorkOnFiber(current, renderLanes2, workInProgress2);
            else if (19 === current.tag)
              scheduleSuspenseWorkOnFiber(current, renderLanes2, workInProgress2);
            else if (null !== current.child) {
              current.child.return = current;
              current = current.child;
              continue;
            }
            if (current === workInProgress2) break a;
            for (; null === current.sibling; ) {
              if (null === current.return || current.return === workInProgress2)
                break a;
              current = current.return;
            }
            current.sibling.return = current.return;
            current = current.sibling;
          }
        nextProps &= 1;
      }
      push(suspenseStackCursor, nextProps);
      switch (revealOrder) {
        case "forwards":
          renderLanes2 = workInProgress2.child;
          for (revealOrder = null; null !== renderLanes2; )
            current = renderLanes2.alternate, null !== current && null === findFirstSuspended(current) && (revealOrder = renderLanes2), renderLanes2 = renderLanes2.sibling;
          renderLanes2 = revealOrder;
          null === renderLanes2 ? (revealOrder = workInProgress2.child, workInProgress2.child = null) : (revealOrder = renderLanes2.sibling, renderLanes2.sibling = null);
          initSuspenseListRenderState(
            workInProgress2,
            false,
            revealOrder,
            renderLanes2,
            tailMode
          );
          break;
        case "backwards":
          renderLanes2 = null;
          revealOrder = workInProgress2.child;
          for (workInProgress2.child = null; null !== revealOrder; ) {
            current = revealOrder.alternate;
            if (null !== current && null === findFirstSuspended(current)) {
              workInProgress2.child = revealOrder;
              break;
            }
            current = revealOrder.sibling;
            revealOrder.sibling = renderLanes2;
            renderLanes2 = revealOrder;
            revealOrder = current;
          }
          initSuspenseListRenderState(
            workInProgress2,
            true,
            renderLanes2,
            null,
            tailMode
          );
          break;
        case "together":
          initSuspenseListRenderState(workInProgress2, false, null, null, void 0);
          break;
        default:
          workInProgress2.memoizedState = null;
      }
      return workInProgress2.child;
    }
    __name(updateSuspenseListComponent, "updateSuspenseListComponent");
    function bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2) {
      null !== current && (workInProgress2.dependencies = current.dependencies);
      workInProgressRootSkippedLanes |= workInProgress2.lanes;
      if (0 === (renderLanes2 & workInProgress2.childLanes))
        if (null !== current) {
          if (propagateParentContextChanges(
            current,
            workInProgress2,
            renderLanes2,
            false
          ), 0 === (renderLanes2 & workInProgress2.childLanes))
            return null;
        } else return null;
      if (null !== current && workInProgress2.child !== current.child)
        throw Error(formatProdErrorMessage(153));
      if (null !== workInProgress2.child) {
        current = workInProgress2.child;
        renderLanes2 = createWorkInProgress(current, current.pendingProps);
        workInProgress2.child = renderLanes2;
        for (renderLanes2.return = workInProgress2; null !== current.sibling; )
          current = current.sibling, renderLanes2 = renderLanes2.sibling = createWorkInProgress(current, current.pendingProps), renderLanes2.return = workInProgress2;
        renderLanes2.sibling = null;
      }
      return workInProgress2.child;
    }
    __name(bailoutOnAlreadyFinishedWork, "bailoutOnAlreadyFinishedWork");
    function checkScheduledUpdateOrContext(current, renderLanes2) {
      if (0 !== (current.lanes & renderLanes2)) return true;
      current = current.dependencies;
      return null !== current && checkIfContextChanged(current) ? true : false;
    }
    __name(checkScheduledUpdateOrContext, "checkScheduledUpdateOrContext");
    function attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress2, renderLanes2) {
      switch (workInProgress2.tag) {
        case 3:
          pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
          pushProvider(workInProgress2, CacheContext, current.memoizedState.cache);
          resetHydrationState();
          break;
        case 27:
        case 5:
          pushHostContext(workInProgress2);
          break;
        case 4:
          pushHostContainer(workInProgress2, workInProgress2.stateNode.containerInfo);
          break;
        case 10:
          pushProvider(
            workInProgress2,
            workInProgress2.type,
            workInProgress2.memoizedProps.value
          );
          break;
        case 13:
          var state = workInProgress2.memoizedState;
          if (null !== state) {
            if (null !== state.dehydrated)
              return pushPrimaryTreeSuspenseHandler(workInProgress2), workInProgress2.flags |= 128, null;
            if (0 !== (renderLanes2 & workInProgress2.child.childLanes))
              return updateSuspenseComponent(current, workInProgress2, renderLanes2);
            pushPrimaryTreeSuspenseHandler(workInProgress2);
            current = bailoutOnAlreadyFinishedWork(
              current,
              workInProgress2,
              renderLanes2
            );
            return null !== current ? current.sibling : null;
          }
          pushPrimaryTreeSuspenseHandler(workInProgress2);
          break;
        case 19:
          var didSuspendBefore = 0 !== (current.flags & 128);
          state = 0 !== (renderLanes2 & workInProgress2.childLanes);
          state || (propagateParentContextChanges(
            current,
            workInProgress2,
            renderLanes2,
            false
          ), state = 0 !== (renderLanes2 & workInProgress2.childLanes));
          if (didSuspendBefore) {
            if (state)
              return updateSuspenseListComponent(
                current,
                workInProgress2,
                renderLanes2
              );
            workInProgress2.flags |= 128;
          }
          didSuspendBefore = workInProgress2.memoizedState;
          null !== didSuspendBefore && (didSuspendBefore.rendering = null, didSuspendBefore.tail = null, didSuspendBefore.lastEffect = null);
          push(suspenseStackCursor, suspenseStackCursor.current);
          if (state) break;
          else return null;
        case 22:
        case 23:
          return workInProgress2.lanes = 0, updateOffscreenComponent(current, workInProgress2, renderLanes2);
        case 24:
          pushProvider(workInProgress2, CacheContext, current.memoizedState.cache);
      }
      return bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
    }
    __name(attemptEarlyBailoutIfNoScheduledUpdate, "attemptEarlyBailoutIfNoScheduledUpdate");
    function beginWork(current, workInProgress2, renderLanes2) {
      if (null !== current)
        if (current.memoizedProps !== workInProgress2.pendingProps)
          didReceiveUpdate = true;
        else {
          if (!checkScheduledUpdateOrContext(current, renderLanes2) && 0 === (workInProgress2.flags & 128))
            return didReceiveUpdate = false, attemptEarlyBailoutIfNoScheduledUpdate(
              current,
              workInProgress2,
              renderLanes2
            );
          didReceiveUpdate = 0 !== (current.flags & 131072) ? true : false;
        }
      else
        didReceiveUpdate = false, isHydrating && 0 !== (workInProgress2.flags & 1048576) && pushTreeId(workInProgress2, treeForkCount, workInProgress2.index);
      workInProgress2.lanes = 0;
      switch (workInProgress2.tag) {
        case 16:
          a: {
            current = workInProgress2.pendingProps;
            var lazyComponent = workInProgress2.elementType, init = lazyComponent._init;
            lazyComponent = init(lazyComponent._payload);
            workInProgress2.type = lazyComponent;
            if ("function" === typeof lazyComponent)
              shouldConstruct(lazyComponent) ? (current = resolveClassComponentProps(lazyComponent, current), workInProgress2.tag = 1, workInProgress2 = updateClassComponent(
                null,
                workInProgress2,
                lazyComponent,
                current,
                renderLanes2
              )) : (workInProgress2.tag = 0, workInProgress2 = updateFunctionComponent(
                null,
                workInProgress2,
                lazyComponent,
                current,
                renderLanes2
              ));
            else {
              if (void 0 !== lazyComponent && null !== lazyComponent) {
                if (init = lazyComponent.$$typeof, init === REACT_FORWARD_REF_TYPE) {
                  workInProgress2.tag = 11;
                  workInProgress2 = updateForwardRef(
                    null,
                    workInProgress2,
                    lazyComponent,
                    current,
                    renderLanes2
                  );
                  break a;
                } else if (init === REACT_MEMO_TYPE) {
                  workInProgress2.tag = 14;
                  workInProgress2 = updateMemoComponent(
                    null,
                    workInProgress2,
                    lazyComponent,
                    current,
                    renderLanes2
                  );
                  break a;
                }
              }
              workInProgress2 = getComponentNameFromType(lazyComponent) || lazyComponent;
              throw Error(formatProdErrorMessage(306, workInProgress2, ""));
            }
          }
          return workInProgress2;
        case 0:
          return updateFunctionComponent(
            current,
            workInProgress2,
            workInProgress2.type,
            workInProgress2.pendingProps,
            renderLanes2
          );
        case 1:
          return lazyComponent = workInProgress2.type, init = resolveClassComponentProps(
            lazyComponent,
            workInProgress2.pendingProps
          ), updateClassComponent(
            current,
            workInProgress2,
            lazyComponent,
            init,
            renderLanes2
          );
        case 3:
          a: {
            pushHostContainer(
              workInProgress2,
              workInProgress2.stateNode.containerInfo
            );
            if (null === current) throw Error(formatProdErrorMessage(387));
            lazyComponent = workInProgress2.pendingProps;
            var prevState = workInProgress2.memoizedState;
            init = prevState.element;
            cloneUpdateQueue(current, workInProgress2);
            processUpdateQueue(workInProgress2, lazyComponent, null, renderLanes2);
            var nextState = workInProgress2.memoizedState;
            lazyComponent = nextState.cache;
            pushProvider(workInProgress2, CacheContext, lazyComponent);
            lazyComponent !== prevState.cache && propagateContextChanges(
              workInProgress2,
              [CacheContext],
              renderLanes2,
              true
            );
            suspendIfUpdateReadFromEntangledAsyncAction();
            lazyComponent = nextState.element;
            if (prevState.isDehydrated)
              if (prevState = {
                element: lazyComponent,
                isDehydrated: false,
                cache: nextState.cache
              }, workInProgress2.updateQueue.baseState = prevState, workInProgress2.memoizedState = prevState, workInProgress2.flags & 256) {
                workInProgress2 = mountHostRootWithoutHydrating(
                  current,
                  workInProgress2,
                  lazyComponent,
                  renderLanes2
                );
                break a;
              } else if (lazyComponent !== init) {
                init = createCapturedValueAtFiber(
                  Error(formatProdErrorMessage(424)),
                  workInProgress2
                );
                queueHydrationError(init);
                workInProgress2 = mountHostRootWithoutHydrating(
                  current,
                  workInProgress2,
                  lazyComponent,
                  renderLanes2
                );
                break a;
              } else {
                current = workInProgress2.stateNode.containerInfo;
                switch (current.nodeType) {
                  case 9:
                    current = current.body;
                    break;
                  default:
                    current = "HTML" === current.nodeName ? current.ownerDocument.body : current;
                }
                nextHydratableInstance = getNextHydratable(current.firstChild);
                hydrationParentFiber = workInProgress2;
                isHydrating = true;
                hydrationErrors = null;
                rootOrSingletonContext = true;
                renderLanes2 = mountChildFibers(
                  workInProgress2,
                  null,
                  lazyComponent,
                  renderLanes2
                );
                for (workInProgress2.child = renderLanes2; renderLanes2; )
                  renderLanes2.flags = renderLanes2.flags & -3 | 4096, renderLanes2 = renderLanes2.sibling;
              }
            else {
              resetHydrationState();
              if (lazyComponent === init) {
                workInProgress2 = bailoutOnAlreadyFinishedWork(
                  current,
                  workInProgress2,
                  renderLanes2
                );
                break a;
              }
              reconcileChildren(
                current,
                workInProgress2,
                lazyComponent,
                renderLanes2
              );
            }
            workInProgress2 = workInProgress2.child;
          }
          return workInProgress2;
        case 26:
          return markRef(current, workInProgress2), null === current ? (renderLanes2 = getResource(
            workInProgress2.type,
            null,
            workInProgress2.pendingProps,
            null
          )) ? workInProgress2.memoizedState = renderLanes2 : isHydrating || (renderLanes2 = workInProgress2.type, current = workInProgress2.pendingProps, lazyComponent = getOwnerDocumentFromRootContainer(
            rootInstanceStackCursor.current
          ).createElement(renderLanes2), lazyComponent[internalInstanceKey] = workInProgress2, lazyComponent[internalPropsKey] = current, setInitialProperties(lazyComponent, renderLanes2, current), markNodeAsHoistable(lazyComponent), workInProgress2.stateNode = lazyComponent) : workInProgress2.memoizedState = getResource(
            workInProgress2.type,
            current.memoizedProps,
            workInProgress2.pendingProps,
            current.memoizedState
          ), null;
        case 27:
          return pushHostContext(workInProgress2), null === current && isHydrating && (lazyComponent = workInProgress2.stateNode = resolveSingletonInstance(
            workInProgress2.type,
            workInProgress2.pendingProps,
            rootInstanceStackCursor.current
          ), hydrationParentFiber = workInProgress2, rootOrSingletonContext = true, init = nextHydratableInstance, isSingletonScope(workInProgress2.type) ? (previousHydratableOnEnteringScopedSingleton = init, nextHydratableInstance = getNextHydratable(
            lazyComponent.firstChild
          )) : nextHydratableInstance = init), reconcileChildren(
            current,
            workInProgress2,
            workInProgress2.pendingProps.children,
            renderLanes2
          ), markRef(current, workInProgress2), null === current && (workInProgress2.flags |= 4194304), workInProgress2.child;
        case 5:
          if (null === current && isHydrating) {
            if (init = lazyComponent = nextHydratableInstance)
              lazyComponent = canHydrateInstance(
                lazyComponent,
                workInProgress2.type,
                workInProgress2.pendingProps,
                rootOrSingletonContext
              ), null !== lazyComponent ? (workInProgress2.stateNode = lazyComponent, hydrationParentFiber = workInProgress2, nextHydratableInstance = getNextHydratable(
                lazyComponent.firstChild
              ), rootOrSingletonContext = false, init = true) : init = false;
            init || throwOnHydrationMismatch(workInProgress2);
          }
          pushHostContext(workInProgress2);
          init = workInProgress2.type;
          prevState = workInProgress2.pendingProps;
          nextState = null !== current ? current.memoizedProps : null;
          lazyComponent = prevState.children;
          shouldSetTextContent(init, prevState) ? lazyComponent = null : null !== nextState && shouldSetTextContent(init, nextState) && (workInProgress2.flags |= 32);
          null !== workInProgress2.memoizedState && (init = renderWithHooks(
            current,
            workInProgress2,
            TransitionAwareHostComponent,
            null,
            null,
            renderLanes2
          ), HostTransitionContext._currentValue = init);
          markRef(current, workInProgress2);
          reconcileChildren(current, workInProgress2, lazyComponent, renderLanes2);
          return workInProgress2.child;
        case 6:
          if (null === current && isHydrating) {
            if (current = renderLanes2 = nextHydratableInstance)
              renderLanes2 = canHydrateTextInstance(
                renderLanes2,
                workInProgress2.pendingProps,
                rootOrSingletonContext
              ), null !== renderLanes2 ? (workInProgress2.stateNode = renderLanes2, hydrationParentFiber = workInProgress2, nextHydratableInstance = null, current = true) : current = false;
            current || throwOnHydrationMismatch(workInProgress2);
          }
          return null;
        case 13:
          return updateSuspenseComponent(current, workInProgress2, renderLanes2);
        case 4:
          return pushHostContainer(
            workInProgress2,
            workInProgress2.stateNode.containerInfo
          ), lazyComponent = workInProgress2.pendingProps, null === current ? workInProgress2.child = reconcileChildFibers(
            workInProgress2,
            null,
            lazyComponent,
            renderLanes2
          ) : reconcileChildren(
            current,
            workInProgress2,
            lazyComponent,
            renderLanes2
          ), workInProgress2.child;
        case 11:
          return updateForwardRef(
            current,
            workInProgress2,
            workInProgress2.type,
            workInProgress2.pendingProps,
            renderLanes2
          );
        case 7:
          return reconcileChildren(
            current,
            workInProgress2,
            workInProgress2.pendingProps,
            renderLanes2
          ), workInProgress2.child;
        case 8:
          return reconcileChildren(
            current,
            workInProgress2,
            workInProgress2.pendingProps.children,
            renderLanes2
          ), workInProgress2.child;
        case 12:
          return reconcileChildren(
            current,
            workInProgress2,
            workInProgress2.pendingProps.children,
            renderLanes2
          ), workInProgress2.child;
        case 10:
          return lazyComponent = workInProgress2.pendingProps, pushProvider(workInProgress2, workInProgress2.type, lazyComponent.value), reconcileChildren(
            current,
            workInProgress2,
            lazyComponent.children,
            renderLanes2
          ), workInProgress2.child;
        case 9:
          return init = workInProgress2.type._context, lazyComponent = workInProgress2.pendingProps.children, prepareToReadContext(workInProgress2), init = readContext(init), lazyComponent = lazyComponent(init), workInProgress2.flags |= 1, reconcileChildren(current, workInProgress2, lazyComponent, renderLanes2), workInProgress2.child;
        case 14:
          return updateMemoComponent(
            current,
            workInProgress2,
            workInProgress2.type,
            workInProgress2.pendingProps,
            renderLanes2
          );
        case 15:
          return updateSimpleMemoComponent(
            current,
            workInProgress2,
            workInProgress2.type,
            workInProgress2.pendingProps,
            renderLanes2
          );
        case 19:
          return updateSuspenseListComponent(current, workInProgress2, renderLanes2);
        case 31:
          return lazyComponent = workInProgress2.pendingProps, renderLanes2 = workInProgress2.mode, lazyComponent = {
            mode: lazyComponent.mode,
            children: lazyComponent.children
          }, null === current ? (renderLanes2 = mountWorkInProgressOffscreenFiber(
            lazyComponent,
            renderLanes2
          ), renderLanes2.ref = workInProgress2.ref, workInProgress2.child = renderLanes2, renderLanes2.return = workInProgress2, workInProgress2 = renderLanes2) : (renderLanes2 = createWorkInProgress(current.child, lazyComponent), renderLanes2.ref = workInProgress2.ref, workInProgress2.child = renderLanes2, renderLanes2.return = workInProgress2, workInProgress2 = renderLanes2), workInProgress2;
        case 22:
          return updateOffscreenComponent(current, workInProgress2, renderLanes2);
        case 24:
          return prepareToReadContext(workInProgress2), lazyComponent = readContext(CacheContext), null === current ? (init = peekCacheFromPool(), null === init && (init = workInProgressRoot, prevState = createCache(), init.pooledCache = prevState, prevState.refCount++, null !== prevState && (init.pooledCacheLanes |= renderLanes2), init = prevState), workInProgress2.memoizedState = {
            parent: lazyComponent,
            cache: init
          }, initializeUpdateQueue(workInProgress2), pushProvider(workInProgress2, CacheContext, init)) : (0 !== (current.lanes & renderLanes2) && (cloneUpdateQueue(current, workInProgress2), processUpdateQueue(workInProgress2, null, null, renderLanes2), suspendIfUpdateReadFromEntangledAsyncAction()), init = current.memoizedState, prevState = workInProgress2.memoizedState, init.parent !== lazyComponent ? (init = { parent: lazyComponent, cache: lazyComponent }, workInProgress2.memoizedState = init, 0 === workInProgress2.lanes && (workInProgress2.memoizedState = workInProgress2.updateQueue.baseState = init), pushProvider(workInProgress2, CacheContext, lazyComponent)) : (lazyComponent = prevState.cache, pushProvider(workInProgress2, CacheContext, lazyComponent), lazyComponent !== init.cache && propagateContextChanges(
            workInProgress2,
            [CacheContext],
            renderLanes2,
            true
          ))), reconcileChildren(
            current,
            workInProgress2,
            workInProgress2.pendingProps.children,
            renderLanes2
          ), workInProgress2.child;
        case 29:
          throw workInProgress2.pendingProps;
      }
      throw Error(formatProdErrorMessage(156, workInProgress2.tag));
    }
    __name(beginWork, "beginWork");
    function markUpdate(workInProgress2) {
      workInProgress2.flags |= 4;
    }
    __name(markUpdate, "markUpdate");
    function preloadResourceAndSuspendIfNeeded(workInProgress2, resource) {
      if ("stylesheet" !== resource.type || 0 !== (resource.state.loading & 4))
        workInProgress2.flags &= -16777217;
      else if (workInProgress2.flags |= 16777216, !preloadResource(resource)) {
        resource = suspenseHandlerStackCursor.current;
        if (null !== resource && ((workInProgressRootRenderLanes & 4194048) === workInProgressRootRenderLanes ? null !== shellBoundary : (workInProgressRootRenderLanes & 62914560) !== workInProgressRootRenderLanes && 0 === (workInProgressRootRenderLanes & 536870912) || resource !== shellBoundary))
          throw suspendedThenable = noopSuspenseyCommitThenable, SuspenseyCommitException;
        workInProgress2.flags |= 8192;
      }
    }
    __name(preloadResourceAndSuspendIfNeeded, "preloadResourceAndSuspendIfNeeded");
    function scheduleRetryEffect(workInProgress2, retryQueue) {
      null !== retryQueue && (workInProgress2.flags |= 4);
      workInProgress2.flags & 16384 && (retryQueue = 22 !== workInProgress2.tag ? claimNextRetryLane() : 536870912, workInProgress2.lanes |= retryQueue, workInProgressSuspendedRetryLanes |= retryQueue);
    }
    __name(scheduleRetryEffect, "scheduleRetryEffect");
    function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
      if (!isHydrating)
        switch (renderState.tailMode) {
          case "hidden":
            hasRenderedATailFallback = renderState.tail;
            for (var lastTailNode = null; null !== hasRenderedATailFallback; )
              null !== hasRenderedATailFallback.alternate && (lastTailNode = hasRenderedATailFallback), hasRenderedATailFallback = hasRenderedATailFallback.sibling;
            null === lastTailNode ? renderState.tail = null : lastTailNode.sibling = null;
            break;
          case "collapsed":
            lastTailNode = renderState.tail;
            for (var lastTailNode$113 = null; null !== lastTailNode; )
              null !== lastTailNode.alternate && (lastTailNode$113 = lastTailNode), lastTailNode = lastTailNode.sibling;
            null === lastTailNode$113 ? hasRenderedATailFallback || null === renderState.tail ? renderState.tail = null : renderState.tail.sibling = null : lastTailNode$113.sibling = null;
        }
    }
    __name(cutOffTailIfNeeded, "cutOffTailIfNeeded");
    function bubbleProperties(completedWork) {
      var didBailout = null !== completedWork.alternate && completedWork.alternate.child === completedWork.child, newChildLanes = 0, subtreeFlags = 0;
      if (didBailout)
        for (var child$114 = completedWork.child; null !== child$114; )
          newChildLanes |= child$114.lanes | child$114.childLanes, subtreeFlags |= child$114.subtreeFlags & 65011712, subtreeFlags |= child$114.flags & 65011712, child$114.return = completedWork, child$114 = child$114.sibling;
      else
        for (child$114 = completedWork.child; null !== child$114; )
          newChildLanes |= child$114.lanes | child$114.childLanes, subtreeFlags |= child$114.subtreeFlags, subtreeFlags |= child$114.flags, child$114.return = completedWork, child$114 = child$114.sibling;
      completedWork.subtreeFlags |= subtreeFlags;
      completedWork.childLanes = newChildLanes;
      return didBailout;
    }
    __name(bubbleProperties, "bubbleProperties");
    function completeWork(current, workInProgress2, renderLanes2) {
      var newProps = workInProgress2.pendingProps;
      popTreeContext(workInProgress2);
      switch (workInProgress2.tag) {
        case 31:
        case 16:
        case 15:
        case 0:
        case 11:
        case 7:
        case 8:
        case 12:
        case 9:
        case 14:
          return bubbleProperties(workInProgress2), null;
        case 1:
          return bubbleProperties(workInProgress2), null;
        case 3:
          renderLanes2 = workInProgress2.stateNode;
          newProps = null;
          null !== current && (newProps = current.memoizedState.cache);
          workInProgress2.memoizedState.cache !== newProps && (workInProgress2.flags |= 2048);
          popProvider(CacheContext);
          popHostContainer();
          renderLanes2.pendingContext && (renderLanes2.context = renderLanes2.pendingContext, renderLanes2.pendingContext = null);
          if (null === current || null === current.child)
            popHydrationState(workInProgress2) ? markUpdate(workInProgress2) : null === current || current.memoizedState.isDehydrated && 0 === (workInProgress2.flags & 256) || (workInProgress2.flags |= 1024, upgradeHydrationErrorsToRecoverable());
          bubbleProperties(workInProgress2);
          return null;
        case 26:
          return renderLanes2 = workInProgress2.memoizedState, null === current ? (markUpdate(workInProgress2), null !== renderLanes2 ? (bubbleProperties(workInProgress2), preloadResourceAndSuspendIfNeeded(workInProgress2, renderLanes2)) : (bubbleProperties(workInProgress2), workInProgress2.flags &= -16777217)) : renderLanes2 ? renderLanes2 !== current.memoizedState ? (markUpdate(workInProgress2), bubbleProperties(workInProgress2), preloadResourceAndSuspendIfNeeded(workInProgress2, renderLanes2)) : (bubbleProperties(workInProgress2), workInProgress2.flags &= -16777217) : (current.memoizedProps !== newProps && markUpdate(workInProgress2), bubbleProperties(workInProgress2), workInProgress2.flags &= -16777217), null;
        case 27:
          popHostContext(workInProgress2);
          renderLanes2 = rootInstanceStackCursor.current;
          var type = workInProgress2.type;
          if (null !== current && null != workInProgress2.stateNode)
            current.memoizedProps !== newProps && markUpdate(workInProgress2);
          else {
            if (!newProps) {
              if (null === workInProgress2.stateNode)
                throw Error(formatProdErrorMessage(166));
              bubbleProperties(workInProgress2);
              return null;
            }
            current = contextStackCursor.current;
            popHydrationState(workInProgress2) ? prepareToHydrateHostInstance(workInProgress2) : (current = resolveSingletonInstance(type, newProps, renderLanes2), workInProgress2.stateNode = current, markUpdate(workInProgress2));
          }
          bubbleProperties(workInProgress2);
          return null;
        case 5:
          popHostContext(workInProgress2);
          renderLanes2 = workInProgress2.type;
          if (null !== current && null != workInProgress2.stateNode)
            current.memoizedProps !== newProps && markUpdate(workInProgress2);
          else {
            if (!newProps) {
              if (null === workInProgress2.stateNode)
                throw Error(formatProdErrorMessage(166));
              bubbleProperties(workInProgress2);
              return null;
            }
            current = contextStackCursor.current;
            if (popHydrationState(workInProgress2))
              prepareToHydrateHostInstance(workInProgress2);
            else {
              type = getOwnerDocumentFromRootContainer(
                rootInstanceStackCursor.current
              );
              switch (current) {
                case 1:
                  current = type.createElementNS(
                    "http://www.w3.org/2000/svg",
                    renderLanes2
                  );
                  break;
                case 2:
                  current = type.createElementNS(
                    "http://www.w3.org/1998/Math/MathML",
                    renderLanes2
                  );
                  break;
                default:
                  switch (renderLanes2) {
                    case "svg":
                      current = type.createElementNS(
                        "http://www.w3.org/2000/svg",
                        renderLanes2
                      );
                      break;
                    case "math":
                      current = type.createElementNS(
                        "http://www.w3.org/1998/Math/MathML",
                        renderLanes2
                      );
                      break;
                    case "script":
                      current = type.createElement("div");
                      current.innerHTML = "<script><\/script>";
                      current = current.removeChild(current.firstChild);
                      break;
                    case "select":
                      current = "string" === typeof newProps.is ? type.createElement("select", { is: newProps.is }) : type.createElement("select");
                      newProps.multiple ? current.multiple = true : newProps.size && (current.size = newProps.size);
                      break;
                    default:
                      current = "string" === typeof newProps.is ? type.createElement(renderLanes2, { is: newProps.is }) : type.createElement(renderLanes2);
                  }
              }
              current[internalInstanceKey] = workInProgress2;
              current[internalPropsKey] = newProps;
              a: for (type = workInProgress2.child; null !== type; ) {
                if (5 === type.tag || 6 === type.tag)
                  current.appendChild(type.stateNode);
                else if (4 !== type.tag && 27 !== type.tag && null !== type.child) {
                  type.child.return = type;
                  type = type.child;
                  continue;
                }
                if (type === workInProgress2) break a;
                for (; null === type.sibling; ) {
                  if (null === type.return || type.return === workInProgress2)
                    break a;
                  type = type.return;
                }
                type.sibling.return = type.return;
                type = type.sibling;
              }
              workInProgress2.stateNode = current;
              a: switch (setInitialProperties(current, renderLanes2, newProps), renderLanes2) {
                case "button":
                case "input":
                case "select":
                case "textarea":
                  current = !!newProps.autoFocus;
                  break a;
                case "img":
                  current = true;
                  break a;
                default:
                  current = false;
              }
              current && markUpdate(workInProgress2);
            }
          }
          bubbleProperties(workInProgress2);
          workInProgress2.flags &= -16777217;
          return null;
        case 6:
          if (current && null != workInProgress2.stateNode)
            current.memoizedProps !== newProps && markUpdate(workInProgress2);
          else {
            if ("string" !== typeof newProps && null === workInProgress2.stateNode)
              throw Error(formatProdErrorMessage(166));
            current = rootInstanceStackCursor.current;
            if (popHydrationState(workInProgress2)) {
              current = workInProgress2.stateNode;
              renderLanes2 = workInProgress2.memoizedProps;
              newProps = null;
              type = hydrationParentFiber;
              if (null !== type)
                switch (type.tag) {
                  case 27:
                  case 5:
                    newProps = type.memoizedProps;
                }
              current[internalInstanceKey] = workInProgress2;
              current = current.nodeValue === renderLanes2 || null !== newProps && true === newProps.suppressHydrationWarning || checkForUnmatchedText(current.nodeValue, renderLanes2) ? true : false;
              current || throwOnHydrationMismatch(workInProgress2);
            } else
              current = getOwnerDocumentFromRootContainer(current).createTextNode(
                newProps
              ), current[internalInstanceKey] = workInProgress2, workInProgress2.stateNode = current;
          }
          bubbleProperties(workInProgress2);
          return null;
        case 13:
          newProps = workInProgress2.memoizedState;
          if (null === current || null !== current.memoizedState && null !== current.memoizedState.dehydrated) {
            type = popHydrationState(workInProgress2);
            if (null !== newProps && null !== newProps.dehydrated) {
              if (null === current) {
                if (!type) throw Error(formatProdErrorMessage(318));
                type = workInProgress2.memoizedState;
                type = null !== type ? type.dehydrated : null;
                if (!type) throw Error(formatProdErrorMessage(317));
                type[internalInstanceKey] = workInProgress2;
              } else
                resetHydrationState(), 0 === (workInProgress2.flags & 128) && (workInProgress2.memoizedState = null), workInProgress2.flags |= 4;
              bubbleProperties(workInProgress2);
              type = false;
            } else
              type = upgradeHydrationErrorsToRecoverable(), null !== current && null !== current.memoizedState && (current.memoizedState.hydrationErrors = type), type = true;
            if (!type) {
              if (workInProgress2.flags & 256)
                return popSuspenseHandler(workInProgress2), workInProgress2;
              popSuspenseHandler(workInProgress2);
              return null;
            }
          }
          popSuspenseHandler(workInProgress2);
          if (0 !== (workInProgress2.flags & 128))
            return workInProgress2.lanes = renderLanes2, workInProgress2;
          renderLanes2 = null !== newProps;
          current = null !== current && null !== current.memoizedState;
          if (renderLanes2) {
            newProps = workInProgress2.child;
            type = null;
            null !== newProps.alternate && null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool);
            var cache$127 = null;
            null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && (cache$127 = newProps.memoizedState.cachePool.pool);
            cache$127 !== type && (newProps.flags |= 2048);
          }
          renderLanes2 !== current && renderLanes2 && (workInProgress2.child.flags |= 8192);
          scheduleRetryEffect(workInProgress2, workInProgress2.updateQueue);
          bubbleProperties(workInProgress2);
          return null;
        case 4:
          return popHostContainer(), null === current && listenToAllSupportedEvents(workInProgress2.stateNode.containerInfo), bubbleProperties(workInProgress2), null;
        case 10:
          return popProvider(workInProgress2.type), bubbleProperties(workInProgress2), null;
        case 19:
          pop(suspenseStackCursor);
          type = workInProgress2.memoizedState;
          if (null === type) return bubbleProperties(workInProgress2), null;
          newProps = 0 !== (workInProgress2.flags & 128);
          cache$127 = type.rendering;
          if (null === cache$127)
            if (newProps) cutOffTailIfNeeded(type, false);
            else {
              if (0 !== workInProgressRootExitStatus || null !== current && 0 !== (current.flags & 128))
                for (current = workInProgress2.child; null !== current; ) {
                  cache$127 = findFirstSuspended(current);
                  if (null !== cache$127) {
                    workInProgress2.flags |= 128;
                    cutOffTailIfNeeded(type, false);
                    current = cache$127.updateQueue;
                    workInProgress2.updateQueue = current;
                    scheduleRetryEffect(workInProgress2, current);
                    workInProgress2.subtreeFlags = 0;
                    current = renderLanes2;
                    for (renderLanes2 = workInProgress2.child; null !== renderLanes2; )
                      resetWorkInProgress(renderLanes2, current), renderLanes2 = renderLanes2.sibling;
                    push(
                      suspenseStackCursor,
                      suspenseStackCursor.current & 1 | 2
                    );
                    return workInProgress2.child;
                  }
                  current = current.sibling;
                }
              null !== type.tail && now() > workInProgressRootRenderTargetTime && (workInProgress2.flags |= 128, newProps = true, cutOffTailIfNeeded(type, false), workInProgress2.lanes = 4194304);
            }
          else {
            if (!newProps)
              if (current = findFirstSuspended(cache$127), null !== current) {
                if (workInProgress2.flags |= 128, newProps = true, current = current.updateQueue, workInProgress2.updateQueue = current, scheduleRetryEffect(workInProgress2, current), cutOffTailIfNeeded(type, true), null === type.tail && "hidden" === type.tailMode && !cache$127.alternate && !isHydrating)
                  return bubbleProperties(workInProgress2), null;
              } else
                2 * now() - type.renderingStartTime > workInProgressRootRenderTargetTime && 536870912 !== renderLanes2 && (workInProgress2.flags |= 128, newProps = true, cutOffTailIfNeeded(type, false), workInProgress2.lanes = 4194304);
            type.isBackwards ? (cache$127.sibling = workInProgress2.child, workInProgress2.child = cache$127) : (current = type.last, null !== current ? current.sibling = cache$127 : workInProgress2.child = cache$127, type.last = cache$127);
          }
          if (null !== type.tail)
            return workInProgress2 = type.tail, type.rendering = workInProgress2, type.tail = workInProgress2.sibling, type.renderingStartTime = now(), workInProgress2.sibling = null, current = suspenseStackCursor.current, push(suspenseStackCursor, newProps ? current & 1 | 2 : current & 1), workInProgress2;
          bubbleProperties(workInProgress2);
          return null;
        case 22:
        case 23:
          return popSuspenseHandler(workInProgress2), popHiddenContext(), newProps = null !== workInProgress2.memoizedState, null !== current ? null !== current.memoizedState !== newProps && (workInProgress2.flags |= 8192) : newProps && (workInProgress2.flags |= 8192), newProps ? 0 !== (renderLanes2 & 536870912) && 0 === (workInProgress2.flags & 128) && (bubbleProperties(workInProgress2), workInProgress2.subtreeFlags & 6 && (workInProgress2.flags |= 8192)) : bubbleProperties(workInProgress2), renderLanes2 = workInProgress2.updateQueue, null !== renderLanes2 && scheduleRetryEffect(workInProgress2, renderLanes2.retryQueue), renderLanes2 = null, null !== current && null !== current.memoizedState && null !== current.memoizedState.cachePool && (renderLanes2 = current.memoizedState.cachePool.pool), newProps = null, null !== workInProgress2.memoizedState && null !== workInProgress2.memoizedState.cachePool && (newProps = workInProgress2.memoizedState.cachePool.pool), newProps !== renderLanes2 && (workInProgress2.flags |= 2048), null !== current && pop(resumedCache), null;
        case 24:
          return renderLanes2 = null, null !== current && (renderLanes2 = current.memoizedState.cache), workInProgress2.memoizedState.cache !== renderLanes2 && (workInProgress2.flags |= 2048), popProvider(CacheContext), bubbleProperties(workInProgress2), null;
        case 25:
          return null;
        case 30:
          return null;
      }
      throw Error(formatProdErrorMessage(156, workInProgress2.tag));
    }
    __name(completeWork, "completeWork");
    function unwindWork(current, workInProgress2) {
      popTreeContext(workInProgress2);
      switch (workInProgress2.tag) {
        case 1:
          return current = workInProgress2.flags, current & 65536 ? (workInProgress2.flags = current & -65537 | 128, workInProgress2) : null;
        case 3:
          return popProvider(CacheContext), popHostContainer(), current = workInProgress2.flags, 0 !== (current & 65536) && 0 === (current & 128) ? (workInProgress2.flags = current & -65537 | 128, workInProgress2) : null;
        case 26:
        case 27:
        case 5:
          return popHostContext(workInProgress2), null;
        case 13:
          popSuspenseHandler(workInProgress2);
          current = workInProgress2.memoizedState;
          if (null !== current && null !== current.dehydrated) {
            if (null === workInProgress2.alternate)
              throw Error(formatProdErrorMessage(340));
            resetHydrationState();
          }
          current = workInProgress2.flags;
          return current & 65536 ? (workInProgress2.flags = current & -65537 | 128, workInProgress2) : null;
        case 19:
          return pop(suspenseStackCursor), null;
        case 4:
          return popHostContainer(), null;
        case 10:
          return popProvider(workInProgress2.type), null;
        case 22:
        case 23:
          return popSuspenseHandler(workInProgress2), popHiddenContext(), null !== current && pop(resumedCache), current = workInProgress2.flags, current & 65536 ? (workInProgress2.flags = current & -65537 | 128, workInProgress2) : null;
        case 24:
          return popProvider(CacheContext), null;
        case 25:
          return null;
        default:
          return null;
      }
    }
    __name(unwindWork, "unwindWork");
    function unwindInterruptedWork(current, interruptedWork) {
      popTreeContext(interruptedWork);
      switch (interruptedWork.tag) {
        case 3:
          popProvider(CacheContext);
          popHostContainer();
          break;
        case 26:
        case 27:
        case 5:
          popHostContext(interruptedWork);
          break;
        case 4:
          popHostContainer();
          break;
        case 13:
          popSuspenseHandler(interruptedWork);
          break;
        case 19:
          pop(suspenseStackCursor);
          break;
        case 10:
          popProvider(interruptedWork.type);
          break;
        case 22:
        case 23:
          popSuspenseHandler(interruptedWork);
          popHiddenContext();
          null !== current && pop(resumedCache);
          break;
        case 24:
          popProvider(CacheContext);
      }
    }
    __name(unwindInterruptedWork, "unwindInterruptedWork");
    function commitHookEffectListMount(flags, finishedWork) {
      try {
        var updateQueue = finishedWork.updateQueue, lastEffect = null !== updateQueue ? updateQueue.lastEffect : null;
        if (null !== lastEffect) {
          var firstEffect = lastEffect.next;
          updateQueue = firstEffect;
          do {
            if ((updateQueue.tag & flags) === flags) {
              lastEffect = void 0;
              var create2 = updateQueue.create, inst = updateQueue.inst;
              lastEffect = create2();
              inst.destroy = lastEffect;
            }
            updateQueue = updateQueue.next;
          } while (updateQueue !== firstEffect);
        }
      } catch (error) {
        captureCommitPhaseError(finishedWork, finishedWork.return, error);
      }
    }
    __name(commitHookEffectListMount, "commitHookEffectListMount");
    function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor$jscomp$0) {
      try {
        var updateQueue = finishedWork.updateQueue, lastEffect = null !== updateQueue ? updateQueue.lastEffect : null;
        if (null !== lastEffect) {
          var firstEffect = lastEffect.next;
          updateQueue = firstEffect;
          do {
            if ((updateQueue.tag & flags) === flags) {
              var inst = updateQueue.inst, destroy = inst.destroy;
              if (void 0 !== destroy) {
                inst.destroy = void 0;
                lastEffect = finishedWork;
                var nearestMountedAncestor = nearestMountedAncestor$jscomp$0, destroy_ = destroy;
                try {
                  destroy_();
                } catch (error) {
                  captureCommitPhaseError(
                    lastEffect,
                    nearestMountedAncestor,
                    error
                  );
                }
              }
            }
            updateQueue = updateQueue.next;
          } while (updateQueue !== firstEffect);
        }
      } catch (error) {
        captureCommitPhaseError(finishedWork, finishedWork.return, error);
      }
    }
    __name(commitHookEffectListUnmount, "commitHookEffectListUnmount");
    function commitClassCallbacks(finishedWork) {
      var updateQueue = finishedWork.updateQueue;
      if (null !== updateQueue) {
        var instance = finishedWork.stateNode;
        try {
          commitCallbacks(updateQueue, instance);
        } catch (error) {
          captureCommitPhaseError(finishedWork, finishedWork.return, error);
        }
      }
    }
    __name(commitClassCallbacks, "commitClassCallbacks");
    function safelyCallComponentWillUnmount(current, nearestMountedAncestor, instance) {
      instance.props = resolveClassComponentProps(
        current.type,
        current.memoizedProps
      );
      instance.state = current.memoizedState;
      try {
        instance.componentWillUnmount();
      } catch (error) {
        captureCommitPhaseError(current, nearestMountedAncestor, error);
      }
    }
    __name(safelyCallComponentWillUnmount, "safelyCallComponentWillUnmount");
    function safelyAttachRef(current, nearestMountedAncestor) {
      try {
        var ref = current.ref;
        if (null !== ref) {
          switch (current.tag) {
            case 26:
            case 27:
            case 5:
              var instanceToUse = current.stateNode;
              break;
            case 30:
              instanceToUse = current.stateNode;
              break;
            default:
              instanceToUse = current.stateNode;
          }
          "function" === typeof ref ? current.refCleanup = ref(instanceToUse) : ref.current = instanceToUse;
        }
      } catch (error) {
        captureCommitPhaseError(current, nearestMountedAncestor, error);
      }
    }
    __name(safelyAttachRef, "safelyAttachRef");
    function safelyDetachRef(current, nearestMountedAncestor) {
      var ref = current.ref, refCleanup = current.refCleanup;
      if (null !== ref)
        if ("function" === typeof refCleanup)
          try {
            refCleanup();
          } catch (error) {
            captureCommitPhaseError(current, nearestMountedAncestor, error);
          } finally {
            current.refCleanup = null, current = current.alternate, null != current && (current.refCleanup = null);
          }
        else if ("function" === typeof ref)
          try {
            ref(null);
          } catch (error$143) {
            captureCommitPhaseError(current, nearestMountedAncestor, error$143);
          }
        else ref.current = null;
    }
    __name(safelyDetachRef, "safelyDetachRef");
    function commitHostMount(finishedWork) {
      var type = finishedWork.type, props = finishedWork.memoizedProps, instance = finishedWork.stateNode;
      try {
        a: switch (type) {
          case "button":
          case "input":
          case "select":
          case "textarea":
            props.autoFocus && instance.focus();
            break a;
          case "img":
            props.src ? instance.src = props.src : props.srcSet && (instance.srcset = props.srcSet);
        }
      } catch (error) {
        captureCommitPhaseError(finishedWork, finishedWork.return, error);
      }
    }
    __name(commitHostMount, "commitHostMount");
    function commitHostUpdate(finishedWork, newProps, oldProps) {
      try {
        var domElement = finishedWork.stateNode;
        updateProperties(domElement, finishedWork.type, oldProps, newProps);
        domElement[internalPropsKey] = newProps;
      } catch (error) {
        captureCommitPhaseError(finishedWork, finishedWork.return, error);
      }
    }
    __name(commitHostUpdate, "commitHostUpdate");
    function isHostParent(fiber) {
      return 5 === fiber.tag || 3 === fiber.tag || 26 === fiber.tag || 27 === fiber.tag && isSingletonScope(fiber.type) || 4 === fiber.tag;
    }
    __name(isHostParent, "isHostParent");
    function getHostSibling(fiber) {
      a: for (; ; ) {
        for (; null === fiber.sibling; ) {
          if (null === fiber.return || isHostParent(fiber.return)) return null;
          fiber = fiber.return;
        }
        fiber.sibling.return = fiber.return;
        for (fiber = fiber.sibling; 5 !== fiber.tag && 6 !== fiber.tag && 18 !== fiber.tag; ) {
          if (27 === fiber.tag && isSingletonScope(fiber.type)) continue a;
          if (fiber.flags & 2) continue a;
          if (null === fiber.child || 4 === fiber.tag) continue a;
          else fiber.child.return = fiber, fiber = fiber.child;
        }
        if (!(fiber.flags & 2)) return fiber.stateNode;
      }
    }
    __name(getHostSibling, "getHostSibling");
    function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
      var tag = node.tag;
      if (5 === tag || 6 === tag)
        node = node.stateNode, before ? (9 === parent.nodeType ? parent.body : "HTML" === parent.nodeName ? parent.ownerDocument.body : parent).insertBefore(node, before) : (before = 9 === parent.nodeType ? parent.body : "HTML" === parent.nodeName ? parent.ownerDocument.body : parent, before.appendChild(node), parent = parent._reactRootContainer, null !== parent && void 0 !== parent || null !== before.onclick || (before.onclick = noop$12));
      else if (4 !== tag && (27 === tag && isSingletonScope(node.type) && (parent = node.stateNode, before = null), node = node.child, null !== node))
        for (insertOrAppendPlacementNodeIntoContainer(node, before, parent), node = node.sibling; null !== node; )
          insertOrAppendPlacementNodeIntoContainer(node, before, parent), node = node.sibling;
    }
    __name(insertOrAppendPlacementNodeIntoContainer, "insertOrAppendPlacementNodeIntoContainer");
    function insertOrAppendPlacementNode(node, before, parent) {
      var tag = node.tag;
      if (5 === tag || 6 === tag)
        node = node.stateNode, before ? parent.insertBefore(node, before) : parent.appendChild(node);
      else if (4 !== tag && (27 === tag && isSingletonScope(node.type) && (parent = node.stateNode), node = node.child, null !== node))
        for (insertOrAppendPlacementNode(node, before, parent), node = node.sibling; null !== node; )
          insertOrAppendPlacementNode(node, before, parent), node = node.sibling;
    }
    __name(insertOrAppendPlacementNode, "insertOrAppendPlacementNode");
    function commitHostSingletonAcquisition(finishedWork) {
      var singleton = finishedWork.stateNode, props = finishedWork.memoizedProps;
      try {
        for (var type = finishedWork.type, attributes = singleton.attributes; attributes.length; )
          singleton.removeAttributeNode(attributes[0]);
        setInitialProperties(singleton, type, props);
        singleton[internalInstanceKey] = finishedWork;
        singleton[internalPropsKey] = props;
      } catch (error) {
        captureCommitPhaseError(finishedWork, finishedWork.return, error);
      }
    }
    __name(commitHostSingletonAcquisition, "commitHostSingletonAcquisition");
    var offscreenSubtreeIsHidden = false, offscreenSubtreeWasHidden = false, needsFormReset = false, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, nextEffect = null;
    function commitBeforeMutationEffects(root3, firstChild) {
      root3 = root3.containerInfo;
      eventsEnabled = _enabled;
      root3 = getActiveElementDeep(root3);
      if (hasSelectionCapabilities(root3)) {
        if ("selectionStart" in root3)
          var JSCompiler_temp = {
            start: root3.selectionStart,
            end: root3.selectionEnd
          };
        else
          a: {
            JSCompiler_temp = (JSCompiler_temp = root3.ownerDocument) && JSCompiler_temp.defaultView || window;
            var selection = JSCompiler_temp.getSelection && JSCompiler_temp.getSelection();
            if (selection && 0 !== selection.rangeCount) {
              JSCompiler_temp = selection.anchorNode;
              var anchorOffset = selection.anchorOffset, focusNode = selection.focusNode;
              selection = selection.focusOffset;
              try {
                JSCompiler_temp.nodeType, focusNode.nodeType;
              } catch (e$20) {
                JSCompiler_temp = null;
                break a;
              }
              var length = 0, start = -1, end = -1, indexWithinAnchor = 0, indexWithinFocus = 0, node = root3, parentNode = null;
              b: for (; ; ) {
                for (var next; ; ) {
                  node !== JSCompiler_temp || 0 !== anchorOffset && 3 !== node.nodeType || (start = length + anchorOffset);
                  node !== focusNode || 0 !== selection && 3 !== node.nodeType || (end = length + selection);
                  3 === node.nodeType && (length += node.nodeValue.length);
                  if (null === (next = node.firstChild)) break;
                  parentNode = node;
                  node = next;
                }
                for (; ; ) {
                  if (node === root3) break b;
                  parentNode === JSCompiler_temp && ++indexWithinAnchor === anchorOffset && (start = length);
                  parentNode === focusNode && ++indexWithinFocus === selection && (end = length);
                  if (null !== (next = node.nextSibling)) break;
                  node = parentNode;
                  parentNode = node.parentNode;
                }
                node = next;
              }
              JSCompiler_temp = -1 === start || -1 === end ? null : { start, end };
            } else JSCompiler_temp = null;
          }
        JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 };
      } else JSCompiler_temp = null;
      selectionInformation = { focusedElem: root3, selectionRange: JSCompiler_temp };
      _enabled = false;
      for (nextEffect = firstChild; null !== nextEffect; )
        if (firstChild = nextEffect, root3 = firstChild.child, 0 !== (firstChild.subtreeFlags & 1024) && null !== root3)
          root3.return = firstChild, nextEffect = root3;
        else
          for (; null !== nextEffect; ) {
            firstChild = nextEffect;
            focusNode = firstChild.alternate;
            root3 = firstChild.flags;
            switch (firstChild.tag) {
              case 0:
                break;
              case 11:
              case 15:
                break;
              case 1:
                if (0 !== (root3 & 1024) && null !== focusNode) {
                  root3 = void 0;
                  JSCompiler_temp = firstChild;
                  anchorOffset = focusNode.memoizedProps;
                  focusNode = focusNode.memoizedState;
                  selection = JSCompiler_temp.stateNode;
                  try {
                    var resolvedPrevProps = resolveClassComponentProps(
                      JSCompiler_temp.type,
                      anchorOffset,
                      JSCompiler_temp.elementType === JSCompiler_temp.type
                    );
                    root3 = selection.getSnapshotBeforeUpdate(
                      resolvedPrevProps,
                      focusNode
                    );
                    selection.__reactInternalSnapshotBeforeUpdate = root3;
                  } catch (error) {
                    captureCommitPhaseError(
                      JSCompiler_temp,
                      JSCompiler_temp.return,
                      error
                    );
                  }
                }
                break;
              case 3:
                if (0 !== (root3 & 1024)) {
                  if (root3 = firstChild.stateNode.containerInfo, JSCompiler_temp = root3.nodeType, 9 === JSCompiler_temp)
                    clearContainerSparingly(root3);
                  else if (1 === JSCompiler_temp)
                    switch (root3.nodeName) {
                      case "HEAD":
                      case "HTML":
                      case "BODY":
                        clearContainerSparingly(root3);
                        break;
                      default:
                        root3.textContent = "";
                    }
                }
                break;
              case 5:
              case 26:
              case 27:
              case 6:
              case 4:
              case 17:
                break;
              default:
                if (0 !== (root3 & 1024)) throw Error(formatProdErrorMessage(163));
            }
            root3 = firstChild.sibling;
            if (null !== root3) {
              root3.return = firstChild.return;
              nextEffect = root3;
              break;
            }
            nextEffect = firstChild.return;
          }
    }
    __name(commitBeforeMutationEffects, "commitBeforeMutationEffects");
    function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) {
      var flags = finishedWork.flags;
      switch (finishedWork.tag) {
        case 0:
        case 11:
        case 15:
          recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
          flags & 4 && commitHookEffectListMount(5, finishedWork);
          break;
        case 1:
          recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
          if (flags & 4)
            if (finishedRoot = finishedWork.stateNode, null === current)
              try {
                finishedRoot.componentDidMount();
              } catch (error) {
                captureCommitPhaseError(finishedWork, finishedWork.return, error);
              }
            else {
              var prevProps = resolveClassComponentProps(
                finishedWork.type,
                current.memoizedProps
              );
              current = current.memoizedState;
              try {
                finishedRoot.componentDidUpdate(
                  prevProps,
                  current,
                  finishedRoot.__reactInternalSnapshotBeforeUpdate
                );
              } catch (error$142) {
                captureCommitPhaseError(
                  finishedWork,
                  finishedWork.return,
                  error$142
                );
              }
            }
          flags & 64 && commitClassCallbacks(finishedWork);
          flags & 512 && safelyAttachRef(finishedWork, finishedWork.return);
          break;
        case 3:
          recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
          if (flags & 64 && (finishedRoot = finishedWork.updateQueue, null !== finishedRoot)) {
            current = null;
            if (null !== finishedWork.child)
              switch (finishedWork.child.tag) {
                case 27:
                case 5:
                  current = finishedWork.child.stateNode;
                  break;
                case 1:
                  current = finishedWork.child.stateNode;
              }
            try {
              commitCallbacks(finishedRoot, current);
            } catch (error) {
              captureCommitPhaseError(finishedWork, finishedWork.return, error);
            }
          }
          break;
        case 27:
          null === current && flags & 4 && commitHostSingletonAcquisition(finishedWork);
        case 26:
        case 5:
          recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
          null === current && flags & 4 && commitHostMount(finishedWork);
          flags & 512 && safelyAttachRef(finishedWork, finishedWork.return);
          break;
        case 12:
          recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
          break;
        case 13:
          recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
          flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
          flags & 64 && (finishedRoot = finishedWork.memoizedState, null !== finishedRoot && (finishedRoot = finishedRoot.dehydrated, null !== finishedRoot && (finishedWork = retryDehydratedSuspenseBoundary.bind(
            null,
            finishedWork
          ), registerSuspenseInstanceRetry(finishedRoot, finishedWork))));
          break;
        case 22:
          flags = null !== finishedWork.memoizedState || offscreenSubtreeIsHidden;
          if (!flags) {
            current = null !== current && null !== current.memoizedState || offscreenSubtreeWasHidden;
            prevProps = offscreenSubtreeIsHidden;
            var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
            offscreenSubtreeIsHidden = flags;
            (offscreenSubtreeWasHidden = current) && !prevOffscreenSubtreeWasHidden ? recursivelyTraverseReappearLayoutEffects(
              finishedRoot,
              finishedWork,
              0 !== (finishedWork.subtreeFlags & 8772)
            ) : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
            offscreenSubtreeIsHidden = prevProps;
            offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
          }
          break;
        case 30:
          break;
        default:
          recursivelyTraverseLayoutEffects(finishedRoot, finishedWork);
      }
    }
    __name(commitLayoutEffectOnFiber, "commitLayoutEffectOnFiber");
    function detachFiberAfterEffects(fiber) {
      var alternate = fiber.alternate;
      null !== alternate && (fiber.alternate = null, detachFiberAfterEffects(alternate));
      fiber.child = null;
      fiber.deletions = null;
      fiber.sibling = null;
      5 === fiber.tag && (alternate = fiber.stateNode, null !== alternate && detachDeletedInstance(alternate));
      fiber.stateNode = null;
      fiber.return = null;
      fiber.dependencies = null;
      fiber.memoizedProps = null;
      fiber.memoizedState = null;
      fiber.pendingProps = null;
      fiber.stateNode = null;
      fiber.updateQueue = null;
    }
    __name(detachFiberAfterEffects, "detachFiberAfterEffects");
    var hostParent = null, hostParentIsContainer = false;
    function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) {
      for (parent = parent.child; null !== parent; )
        commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, parent), parent = parent.sibling;
    }
    __name(recursivelyTraverseDeletionEffects, "recursivelyTraverseDeletionEffects");
    function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) {
      if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount)
        try {
          injectedHook.onCommitFiberUnmount(rendererID, deletedFiber);
        } catch (err) {
        }
      switch (deletedFiber.tag) {
        case 26:
          offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
          recursivelyTraverseDeletionEffects(
            finishedRoot,
            nearestMountedAncestor,
            deletedFiber
          );
          deletedFiber.memoizedState ? deletedFiber.memoizedState.count-- : deletedFiber.stateNode && (deletedFiber = deletedFiber.stateNode, deletedFiber.parentNode.removeChild(deletedFiber));
          break;
        case 27:
          offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
          var prevHostParent = hostParent, prevHostParentIsContainer = hostParentIsContainer;
          isSingletonScope(deletedFiber.type) && (hostParent = deletedFiber.stateNode, hostParentIsContainer = false);
          recursivelyTraverseDeletionEffects(
            finishedRoot,
            nearestMountedAncestor,
            deletedFiber
          );
          releaseSingletonInstance(deletedFiber.stateNode);
          hostParent = prevHostParent;
          hostParentIsContainer = prevHostParentIsContainer;
          break;
        case 5:
          offscreenSubtreeWasHidden || safelyDetachRef(deletedFiber, nearestMountedAncestor);
        case 6:
          prevHostParent = hostParent;
          prevHostParentIsContainer = hostParentIsContainer;
          hostParent = null;
          recursivelyTraverseDeletionEffects(
            finishedRoot,
            nearestMountedAncestor,
            deletedFiber
          );
          hostParent = prevHostParent;
          hostParentIsContainer = prevHostParentIsContainer;
          if (null !== hostParent)
            if (hostParentIsContainer)
              try {
                (9 === hostParent.nodeType ? hostParent.body : "HTML" === hostParent.nodeName ? hostParent.ownerDocument.body : hostParent).removeChild(deletedFiber.stateNode);
              } catch (error) {
                captureCommitPhaseError(
                  deletedFiber,
                  nearestMountedAncestor,
                  error
                );
              }
            else
              try {
                hostParent.removeChild(deletedFiber.stateNode);
              } catch (error) {
                captureCommitPhaseError(
                  deletedFiber,
                  nearestMountedAncestor,
                  error
                );
              }
          break;
        case 18:
          null !== hostParent && (hostParentIsContainer ? (finishedRoot = hostParent, clearSuspenseBoundary(
            9 === finishedRoot.nodeType ? finishedRoot.body : "HTML" === finishedRoot.nodeName ? finishedRoot.ownerDocument.body : finishedRoot,
            deletedFiber.stateNode
          ), retryIfBlockedOn(finishedRoot)) : clearSuspenseBoundary(hostParent, deletedFiber.stateNode));
          break;
        case 4:
          prevHostParent = hostParent;
          prevHostParentIsContainer = hostParentIsContainer;
          hostParent = deletedFiber.stateNode.containerInfo;
          hostParentIsContainer = true;
          recursivelyTraverseDeletionEffects(
            finishedRoot,
            nearestMountedAncestor,
            deletedFiber
          );
          hostParent = prevHostParent;
          hostParentIsContainer = prevHostParentIsContainer;
          break;
        case 0:
        case 11:
        case 14:
        case 15:
          offscreenSubtreeWasHidden || commitHookEffectListUnmount(2, deletedFiber, nearestMountedAncestor);
          offscreenSubtreeWasHidden || commitHookEffectListUnmount(4, deletedFiber, nearestMountedAncestor);
          recursivelyTraverseDeletionEffects(
            finishedRoot,
            nearestMountedAncestor,
            deletedFiber
          );
          break;
        case 1:
          offscreenSubtreeWasHidden || (safelyDetachRef(deletedFiber, nearestMountedAncestor), prevHostParent = deletedFiber.stateNode, "function" === typeof prevHostParent.componentWillUnmount && safelyCallComponentWillUnmount(
            deletedFiber,
            nearestMountedAncestor,
            prevHostParent
          ));
          recursivelyTraverseDeletionEffects(
            finishedRoot,
            nearestMountedAncestor,
            deletedFiber
          );
          break;
        case 21:
          recursivelyTraverseDeletionEffects(
            finishedRoot,
            nearestMountedAncestor,
            deletedFiber
          );
          break;
        case 22:
          offscreenSubtreeWasHidden = (prevHostParent = offscreenSubtreeWasHidden) || null !== deletedFiber.memoizedState;
          recursivelyTraverseDeletionEffects(
            finishedRoot,
            nearestMountedAncestor,
            deletedFiber
          );
          offscreenSubtreeWasHidden = prevHostParent;
          break;
        default:
          recursivelyTraverseDeletionEffects(
            finishedRoot,
            nearestMountedAncestor,
            deletedFiber
          );
      }
    }
    __name(commitDeletionEffectsOnFiber, "commitDeletionEffectsOnFiber");
    function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
      if (null === finishedWork.memoizedState && (finishedRoot = finishedWork.alternate, null !== finishedRoot && (finishedRoot = finishedRoot.memoizedState, null !== finishedRoot && (finishedRoot = finishedRoot.dehydrated, null !== finishedRoot))))
        try {
          retryIfBlockedOn(finishedRoot);
        } catch (error) {
          captureCommitPhaseError(finishedWork, finishedWork.return, error);
        }
    }
    __name(commitSuspenseHydrationCallbacks, "commitSuspenseHydrationCallbacks");
    function getRetryCache(finishedWork) {
      switch (finishedWork.tag) {
        case 13:
        case 19:
          var retryCache = finishedWork.stateNode;
          null === retryCache && (retryCache = finishedWork.stateNode = new PossiblyWeakSet());
          return retryCache;
        case 22:
          return finishedWork = finishedWork.stateNode, retryCache = finishedWork._retryCache, null === retryCache && (retryCache = finishedWork._retryCache = new PossiblyWeakSet()), retryCache;
        default:
          throw Error(formatProdErrorMessage(435, finishedWork.tag));
      }
    }
    __name(getRetryCache, "getRetryCache");
    function attachSuspenseRetryListeners(finishedWork, wakeables) {
      var retryCache = getRetryCache(finishedWork);
      wakeables.forEach(function(wakeable) {
        var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);
        retryCache.has(wakeable) || (retryCache.add(wakeable), wakeable.then(retry, retry));
      });
    }
    __name(attachSuspenseRetryListeners, "attachSuspenseRetryListeners");
    function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
      var deletions = parentFiber.deletions;
      if (null !== deletions)
        for (var i2 = 0; i2 < deletions.length; i2++) {
          var childToDelete = deletions[i2], root3 = root$jscomp$0, returnFiber = parentFiber, parent = returnFiber;
          a: for (; null !== parent; ) {
            switch (parent.tag) {
              case 27:
                if (isSingletonScope(parent.type)) {
                  hostParent = parent.stateNode;
                  hostParentIsContainer = false;
                  break a;
                }
                break;
              case 5:
                hostParent = parent.stateNode;
                hostParentIsContainer = false;
                break a;
              case 3:
              case 4:
                hostParent = parent.stateNode.containerInfo;
                hostParentIsContainer = true;
                break a;
            }
            parent = parent.return;
          }
          if (null === hostParent) throw Error(formatProdErrorMessage(160));
          commitDeletionEffectsOnFiber(root3, returnFiber, childToDelete);
          hostParent = null;
          hostParentIsContainer = false;
          root3 = childToDelete.alternate;
          null !== root3 && (root3.return = null);
          childToDelete.return = null;
        }
      if (parentFiber.subtreeFlags & 13878)
        for (parentFiber = parentFiber.child; null !== parentFiber; )
          commitMutationEffectsOnFiber(parentFiber, root$jscomp$0), parentFiber = parentFiber.sibling;
    }
    __name(recursivelyTraverseMutationEffects, "recursivelyTraverseMutationEffects");
    var currentHoistableRoot = null;
    function commitMutationEffectsOnFiber(finishedWork, root3) {
      var current = finishedWork.alternate, flags = finishedWork.flags;
      switch (finishedWork.tag) {
        case 0:
        case 11:
        case 14:
        case 15:
          recursivelyTraverseMutationEffects(root3, finishedWork);
          commitReconciliationEffects(finishedWork);
          flags & 4 && (commitHookEffectListUnmount(3, finishedWork, finishedWork.return), commitHookEffectListMount(3, finishedWork), commitHookEffectListUnmount(5, finishedWork, finishedWork.return));
          break;
        case 1:
          recursivelyTraverseMutationEffects(root3, finishedWork);
          commitReconciliationEffects(finishedWork);
          flags & 512 && (offscreenSubtreeWasHidden || null === current || safelyDetachRef(current, current.return));
          flags & 64 && offscreenSubtreeIsHidden && (finishedWork = finishedWork.updateQueue, null !== finishedWork && (flags = finishedWork.callbacks, null !== flags && (current = finishedWork.shared.hiddenCallbacks, finishedWork.shared.hiddenCallbacks = null === current ? flags : current.concat(flags))));
          break;
        case 26:
          var hoistableRoot = currentHoistableRoot;
          recursivelyTraverseMutationEffects(root3, finishedWork);
          commitReconciliationEffects(finishedWork);
          flags & 512 && (offscreenSubtreeWasHidden || null === current || safelyDetachRef(current, current.return));
          if (flags & 4) {
            var currentResource = null !== current ? current.memoizedState : null;
            flags = finishedWork.memoizedState;
            if (null === current)
              if (null === flags)
                if (null === finishedWork.stateNode) {
                  a: {
                    flags = finishedWork.type;
                    current = finishedWork.memoizedProps;
                    hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
                    b: switch (flags) {
                      case "title":
                        currentResource = hoistableRoot.getElementsByTagName("title")[0];
                        if (!currentResource || currentResource[internalHoistableMarker] || currentResource[internalInstanceKey] || "http://www.w3.org/2000/svg" === currentResource.namespaceURI || currentResource.hasAttribute("itemprop"))
                          currentResource = hoistableRoot.createElement(flags), hoistableRoot.head.insertBefore(
                            currentResource,
                            hoistableRoot.querySelector("head > title")
                          );
                        setInitialProperties(currentResource, flags, current);
                        currentResource[internalInstanceKey] = finishedWork;
                        markNodeAsHoistable(currentResource);
                        flags = currentResource;
                        break a;
                      case "link":
                        var maybeNodes = getHydratableHoistableCache(
                          "link",
                          "href",
                          hoistableRoot
                        ).get(flags + (current.href || ""));
                        if (maybeNodes) {
                          for (var i2 = 0; i2 < maybeNodes.length; i2++)
                            if (currentResource = maybeNodes[i2], currentResource.getAttribute("href") === (null == current.href || "" === current.href ? null : current.href) && currentResource.getAttribute("rel") === (null == current.rel ? null : current.rel) && currentResource.getAttribute("title") === (null == current.title ? null : current.title) && currentResource.getAttribute("crossorigin") === (null == current.crossOrigin ? null : current.crossOrigin)) {
                              maybeNodes.splice(i2, 1);
                              break b;
                            }
                        }
                        currentResource = hoistableRoot.createElement(flags);
                        setInitialProperties(currentResource, flags, current);
                        hoistableRoot.head.appendChild(currentResource);
                        break;
                      case "meta":
                        if (maybeNodes = getHydratableHoistableCache(
                          "meta",
                          "content",
                          hoistableRoot
                        ).get(flags + (current.content || ""))) {
                          for (i2 = 0; i2 < maybeNodes.length; i2++)
                            if (currentResource = maybeNodes[i2], currentResource.getAttribute("content") === (null == current.content ? null : "" + current.content) && currentResource.getAttribute("name") === (null == current.name ? null : current.name) && currentResource.getAttribute("property") === (null == current.property ? null : current.property) && currentResource.getAttribute("http-equiv") === (null == current.httpEquiv ? null : current.httpEquiv) && currentResource.getAttribute("charset") === (null == current.charSet ? null : current.charSet)) {
                              maybeNodes.splice(i2, 1);
                              break b;
                            }
                        }
                        currentResource = hoistableRoot.createElement(flags);
                        setInitialProperties(currentResource, flags, current);
                        hoistableRoot.head.appendChild(currentResource);
                        break;
                      default:
                        throw Error(formatProdErrorMessage(468, flags));
                    }
                    currentResource[internalInstanceKey] = finishedWork;
                    markNodeAsHoistable(currentResource);
                    flags = currentResource;
                  }
                  finishedWork.stateNode = flags;
                } else
                  mountHoistable(
                    hoistableRoot,
                    finishedWork.type,
                    finishedWork.stateNode
                  );
              else
                finishedWork.stateNode = acquireResource(
                  hoistableRoot,
                  flags,
                  finishedWork.memoizedProps
                );
            else
              currentResource !== flags ? (null === currentResource ? null !== current.stateNode && (current = current.stateNode, current.parentNode.removeChild(current)) : currentResource.count--, null === flags ? mountHoistable(
                hoistableRoot,
                finishedWork.type,
                finishedWork.stateNode
              ) : acquireResource(
                hoistableRoot,
                flags,
                finishedWork.memoizedProps
              )) : null === flags && null !== finishedWork.stateNode && commitHostUpdate(
                finishedWork,
                finishedWork.memoizedProps,
                current.memoizedProps
              );
          }
          break;
        case 27:
          recursivelyTraverseMutationEffects(root3, finishedWork);
          commitReconciliationEffects(finishedWork);
          flags & 512 && (offscreenSubtreeWasHidden || null === current || safelyDetachRef(current, current.return));
          null !== current && flags & 4 && commitHostUpdate(
            finishedWork,
            finishedWork.memoizedProps,
            current.memoizedProps
          );
          break;
        case 5:
          recursivelyTraverseMutationEffects(root3, finishedWork);
          commitReconciliationEffects(finishedWork);
          flags & 512 && (offscreenSubtreeWasHidden || null === current || safelyDetachRef(current, current.return));
          if (finishedWork.flags & 32) {
            hoistableRoot = finishedWork.stateNode;
            try {
              setTextContent(hoistableRoot, "");
            } catch (error) {
              captureCommitPhaseError(finishedWork, finishedWork.return, error);
            }
          }
          flags & 4 && null != finishedWork.stateNode && (hoistableRoot = finishedWork.memoizedProps, commitHostUpdate(
            finishedWork,
            hoistableRoot,
            null !== current ? current.memoizedProps : hoistableRoot
          ));
          flags & 1024 && (needsFormReset = true);
          break;
        case 6:
          recursivelyTraverseMutationEffects(root3, finishedWork);
          commitReconciliationEffects(finishedWork);
          if (flags & 4) {
            if (null === finishedWork.stateNode)
              throw Error(formatProdErrorMessage(162));
            flags = finishedWork.memoizedProps;
            current = finishedWork.stateNode;
            try {
              current.nodeValue = flags;
            } catch (error) {
              captureCommitPhaseError(finishedWork, finishedWork.return, error);
            }
          }
          break;
        case 3:
          tagCaches = null;
          hoistableRoot = currentHoistableRoot;
          currentHoistableRoot = getHoistableRoot(root3.containerInfo);
          recursivelyTraverseMutationEffects(root3, finishedWork);
          currentHoistableRoot = hoistableRoot;
          commitReconciliationEffects(finishedWork);
          if (flags & 4 && null !== current && current.memoizedState.isDehydrated)
            try {
              retryIfBlockedOn(root3.containerInfo);
            } catch (error) {
              captureCommitPhaseError(finishedWork, finishedWork.return, error);
            }
          needsFormReset && (needsFormReset = false, recursivelyResetForms(finishedWork));
          break;
        case 4:
          flags = currentHoistableRoot;
          currentHoistableRoot = getHoistableRoot(
            finishedWork.stateNode.containerInfo
          );
          recursivelyTraverseMutationEffects(root3, finishedWork);
          commitReconciliationEffects(finishedWork);
          currentHoistableRoot = flags;
          break;
        case 12:
          recursivelyTraverseMutationEffects(root3, finishedWork);
          commitReconciliationEffects(finishedWork);
          break;
        case 13:
          recursivelyTraverseMutationEffects(root3, finishedWork);
          commitReconciliationEffects(finishedWork);
          finishedWork.child.flags & 8192 && null !== finishedWork.memoizedState !== (null !== current && null !== current.memoizedState) && (globalMostRecentFallbackTime = now());
          flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
          break;
        case 22:
          hoistableRoot = null !== finishedWork.memoizedState;
          var wasHidden = null !== current && null !== current.memoizedState, prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden, prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden;
          offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden || hoistableRoot;
          offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || wasHidden;
          recursivelyTraverseMutationEffects(root3, finishedWork);
          offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden;
          offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
          commitReconciliationEffects(finishedWork);
          if (flags & 8192)
            a: for (root3 = finishedWork.stateNode, root3._visibility = hoistableRoot ? root3._visibility & -2 : root3._visibility | 1, hoistableRoot && (null === current || wasHidden || offscreenSubtreeIsHidden || offscreenSubtreeWasHidden || recursivelyTraverseDisappearLayoutEffects(finishedWork)), current = null, root3 = finishedWork; ; ) {
              if (5 === root3.tag || 26 === root3.tag) {
                if (null === current) {
                  wasHidden = current = root3;
                  try {
                    if (currentResource = wasHidden.stateNode, hoistableRoot)
                      maybeNodes = currentResource.style, "function" === typeof maybeNodes.setProperty ? maybeNodes.setProperty("display", "none", "important") : maybeNodes.display = "none";
                    else {
                      i2 = wasHidden.stateNode;
                      var styleProp = wasHidden.memoizedProps.style, display = void 0 !== styleProp && null !== styleProp && styleProp.hasOwnProperty("display") ? styleProp.display : null;
                      i2.style.display = null == display || "boolean" === typeof display ? "" : ("" + display).trim();
                    }
                  } catch (error) {
                    captureCommitPhaseError(wasHidden, wasHidden.return, error);
                  }
                }
              } else if (6 === root3.tag) {
                if (null === current) {
                  wasHidden = root3;
                  try {
                    wasHidden.stateNode.nodeValue = hoistableRoot ? "" : wasHidden.memoizedProps;
                  } catch (error) {
                    captureCommitPhaseError(wasHidden, wasHidden.return, error);
                  }
                }
              } else if ((22 !== root3.tag && 23 !== root3.tag || null === root3.memoizedState || root3 === finishedWork) && null !== root3.child) {
                root3.child.return = root3;
                root3 = root3.child;
                continue;
              }
              if (root3 === finishedWork) break a;
              for (; null === root3.sibling; ) {
                if (null === root3.return || root3.return === finishedWork) break a;
                current === root3 && (current = null);
                root3 = root3.return;
              }
              current === root3 && (current = null);
              root3.sibling.return = root3.return;
              root3 = root3.sibling;
            }
          flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (current = flags.retryQueue, null !== current && (flags.retryQueue = null, attachSuspenseRetryListeners(finishedWork, current))));
          break;
        case 19:
          recursivelyTraverseMutationEffects(root3, finishedWork);
          commitReconciliationEffects(finishedWork);
          flags & 4 && (flags = finishedWork.updateQueue, null !== flags && (finishedWork.updateQueue = null, attachSuspenseRetryListeners(finishedWork, flags)));
          break;
        case 30:
          break;
        case 21:
          break;
        default:
          recursivelyTraverseMutationEffects(root3, finishedWork), commitReconciliationEffects(finishedWork);
      }
    }
    __name(commitMutationEffectsOnFiber, "commitMutationEffectsOnFiber");
    function commitReconciliationEffects(finishedWork) {
      var flags = finishedWork.flags;
      if (flags & 2) {
        try {
          for (var hostParentFiber, parentFiber = finishedWork.return; null !== parentFiber; ) {
            if (isHostParent(parentFiber)) {
              hostParentFiber = parentFiber;
              break;
            }
            parentFiber = parentFiber.return;
          }
          if (null == hostParentFiber) throw Error(formatProdErrorMessage(160));
          switch (hostParentFiber.tag) {
            case 27:
              var parent = hostParentFiber.stateNode, before = getHostSibling(finishedWork);
              insertOrAppendPlacementNode(finishedWork, before, parent);
              break;
            case 5:
              var parent$144 = hostParentFiber.stateNode;
              hostParentFiber.flags & 32 && (setTextContent(parent$144, ""), hostParentFiber.flags &= -33);
              var before$145 = getHostSibling(finishedWork);
              insertOrAppendPlacementNode(finishedWork, before$145, parent$144);
              break;
            case 3:
            case 4:
              var parent$146 = hostParentFiber.stateNode.containerInfo, before$147 = getHostSibling(finishedWork);
              insertOrAppendPlacementNodeIntoContainer(
                finishedWork,
                before$147,
                parent$146
              );
              break;
            default:
              throw Error(formatProdErrorMessage(161));
          }
        } catch (error) {
          captureCommitPhaseError(finishedWork, finishedWork.return, error);
        }
        finishedWork.flags &= -3;
      }
      flags & 4096 && (finishedWork.flags &= -4097);
    }
    __name(commitReconciliationEffects, "commitReconciliationEffects");
    function recursivelyResetForms(parentFiber) {
      if (parentFiber.subtreeFlags & 1024)
        for (parentFiber = parentFiber.child; null !== parentFiber; ) {
          var fiber = parentFiber;
          recursivelyResetForms(fiber);
          5 === fiber.tag && fiber.flags & 1024 && fiber.stateNode.reset();
          parentFiber = parentFiber.sibling;
        }
    }
    __name(recursivelyResetForms, "recursivelyResetForms");
    function recursivelyTraverseLayoutEffects(root3, parentFiber) {
      if (parentFiber.subtreeFlags & 8772)
        for (parentFiber = parentFiber.child; null !== parentFiber; )
          commitLayoutEffectOnFiber(root3, parentFiber.alternate, parentFiber), parentFiber = parentFiber.sibling;
    }
    __name(recursivelyTraverseLayoutEffects, "recursivelyTraverseLayoutEffects");
    function recursivelyTraverseDisappearLayoutEffects(parentFiber) {
      for (parentFiber = parentFiber.child; null !== parentFiber; ) {
        var finishedWork = parentFiber;
        switch (finishedWork.tag) {
          case 0:
          case 11:
          case 14:
          case 15:
            commitHookEffectListUnmount(4, finishedWork, finishedWork.return);
            recursivelyTraverseDisappearLayoutEffects(finishedWork);
            break;
          case 1:
            safelyDetachRef(finishedWork, finishedWork.return);
            var instance = finishedWork.stateNode;
            "function" === typeof instance.componentWillUnmount && safelyCallComponentWillUnmount(
              finishedWork,
              finishedWork.return,
              instance
            );
            recursivelyTraverseDisappearLayoutEffects(finishedWork);
            break;
          case 27:
            releaseSingletonInstance(finishedWork.stateNode);
          case 26:
          case 5:
            safelyDetachRef(finishedWork, finishedWork.return);
            recursivelyTraverseDisappearLayoutEffects(finishedWork);
            break;
          case 22:
            null === finishedWork.memoizedState && recursivelyTraverseDisappearLayoutEffects(finishedWork);
            break;
          case 30:
            recursivelyTraverseDisappearLayoutEffects(finishedWork);
            break;
          default:
            recursivelyTraverseDisappearLayoutEffects(finishedWork);
        }
        parentFiber = parentFiber.sibling;
      }
    }
    __name(recursivelyTraverseDisappearLayoutEffects, "recursivelyTraverseDisappearLayoutEffects");
    function recursivelyTraverseReappearLayoutEffects(finishedRoot$jscomp$0, parentFiber, includeWorkInProgressEffects) {
      includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 8772);
      for (parentFiber = parentFiber.child; null !== parentFiber; ) {
        var current = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags;
        switch (finishedWork.tag) {
          case 0:
          case 11:
          case 15:
            recursivelyTraverseReappearLayoutEffects(
              finishedRoot,
              finishedWork,
              includeWorkInProgressEffects
            );
            commitHookEffectListMount(4, finishedWork);
            break;
          case 1:
            recursivelyTraverseReappearLayoutEffects(
              finishedRoot,
              finishedWork,
              includeWorkInProgressEffects
            );
            current = finishedWork;
            finishedRoot = current.stateNode;
            if ("function" === typeof finishedRoot.componentDidMount)
              try {
                finishedRoot.componentDidMount();
              } catch (error) {
                captureCommitPhaseError(current, current.return, error);
              }
            current = finishedWork;
            finishedRoot = current.updateQueue;
            if (null !== finishedRoot) {
              var instance = current.stateNode;
              try {
                var hiddenCallbacks = finishedRoot.shared.hiddenCallbacks;
                if (null !== hiddenCallbacks)
                  for (finishedRoot.shared.hiddenCallbacks = null, finishedRoot = 0; finishedRoot < hiddenCallbacks.length; finishedRoot++)
                    callCallback(hiddenCallbacks[finishedRoot], instance);
              } catch (error) {
                captureCommitPhaseError(current, current.return, error);
              }
            }
            includeWorkInProgressEffects && flags & 64 && commitClassCallbacks(finishedWork);
            safelyAttachRef(finishedWork, finishedWork.return);
            break;
          case 27:
            commitHostSingletonAcquisition(finishedWork);
          case 26:
          case 5:
            recursivelyTraverseReappearLayoutEffects(
              finishedRoot,
              finishedWork,
              includeWorkInProgressEffects
            );
            includeWorkInProgressEffects && null === current && flags & 4 && commitHostMount(finishedWork);
            safelyAttachRef(finishedWork, finishedWork.return);
            break;
          case 12:
            recursivelyTraverseReappearLayoutEffects(
              finishedRoot,
              finishedWork,
              includeWorkInProgressEffects
            );
            break;
          case 13:
            recursivelyTraverseReappearLayoutEffects(
              finishedRoot,
              finishedWork,
              includeWorkInProgressEffects
            );
            includeWorkInProgressEffects && flags & 4 && commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
            break;
          case 22:
            null === finishedWork.memoizedState && recursivelyTraverseReappearLayoutEffects(
              finishedRoot,
              finishedWork,
              includeWorkInProgressEffects
            );
            safelyAttachRef(finishedWork, finishedWork.return);
            break;
          case 30:
            break;
          default:
            recursivelyTraverseReappearLayoutEffects(
              finishedRoot,
              finishedWork,
              includeWorkInProgressEffects
            );
        }
        parentFiber = parentFiber.sibling;
      }
    }
    __name(recursivelyTraverseReappearLayoutEffects, "recursivelyTraverseReappearLayoutEffects");
    function commitOffscreenPassiveMountEffects(current, finishedWork) {
      var previousCache = null;
      null !== current && null !== current.memoizedState && null !== current.memoizedState.cachePool && (previousCache = current.memoizedState.cachePool.pool);
      current = null;
      null !== finishedWork.memoizedState && null !== finishedWork.memoizedState.cachePool && (current = finishedWork.memoizedState.cachePool.pool);
      current !== previousCache && (null != current && current.refCount++, null != previousCache && releaseCache(previousCache));
    }
    __name(commitOffscreenPassiveMountEffects, "commitOffscreenPassiveMountEffects");
    function commitCachePassiveMountEffect(current, finishedWork) {
      current = null;
      null !== finishedWork.alternate && (current = finishedWork.alternate.memoizedState.cache);
      finishedWork = finishedWork.memoizedState.cache;
      finishedWork !== current && (finishedWork.refCount++, null != current && releaseCache(current));
    }
    __name(commitCachePassiveMountEffect, "commitCachePassiveMountEffect");
    function recursivelyTraversePassiveMountEffects(root3, parentFiber, committedLanes, committedTransitions) {
      if (parentFiber.subtreeFlags & 10256)
        for (parentFiber = parentFiber.child; null !== parentFiber; )
          commitPassiveMountOnFiber(
            root3,
            parentFiber,
            committedLanes,
            committedTransitions
          ), parentFiber = parentFiber.sibling;
    }
    __name(recursivelyTraversePassiveMountEffects, "recursivelyTraversePassiveMountEffects");
    function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) {
      var flags = finishedWork.flags;
      switch (finishedWork.tag) {
        case 0:
        case 11:
        case 15:
          recursivelyTraversePassiveMountEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions
          );
          flags & 2048 && commitHookEffectListMount(9, finishedWork);
          break;
        case 1:
          recursivelyTraversePassiveMountEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions
          );
          break;
        case 3:
          recursivelyTraversePassiveMountEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions
          );
          flags & 2048 && (finishedRoot = null, null !== finishedWork.alternate && (finishedRoot = finishedWork.alternate.memoizedState.cache), finishedWork = finishedWork.memoizedState.cache, finishedWork !== finishedRoot && (finishedWork.refCount++, null != finishedRoot && releaseCache(finishedRoot)));
          break;
        case 12:
          if (flags & 2048) {
            recursivelyTraversePassiveMountEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions
            );
            finishedRoot = finishedWork.stateNode;
            try {
              var _finishedWork$memoize2 = finishedWork.memoizedProps, id = _finishedWork$memoize2.id, onPostCommit = _finishedWork$memoize2.onPostCommit;
              "function" === typeof onPostCommit && onPostCommit(
                id,
                null === finishedWork.alternate ? "mount" : "update",
                finishedRoot.passiveEffectDuration,
                -0
              );
            } catch (error) {
              captureCommitPhaseError(finishedWork, finishedWork.return, error);
            }
          } else
            recursivelyTraversePassiveMountEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions
            );
          break;
        case 13:
          recursivelyTraversePassiveMountEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions
          );
          break;
        case 23:
          break;
        case 22:
          _finishedWork$memoize2 = finishedWork.stateNode;
          id = finishedWork.alternate;
          null !== finishedWork.memoizedState ? _finishedWork$memoize2._visibility & 2 ? recursivelyTraversePassiveMountEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions
          ) : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) : _finishedWork$memoize2._visibility & 2 ? recursivelyTraversePassiveMountEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions
          ) : (_finishedWork$memoize2._visibility |= 2, recursivelyTraverseReconnectPassiveEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions,
            0 !== (finishedWork.subtreeFlags & 10256)
          ));
          flags & 2048 && commitOffscreenPassiveMountEffects(id, finishedWork);
          break;
        case 24:
          recursivelyTraversePassiveMountEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions
          );
          flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
          break;
        default:
          recursivelyTraversePassiveMountEffects(
            finishedRoot,
            finishedWork,
            committedLanes,
            committedTransitions
          );
      }
    }
    __name(commitPassiveMountOnFiber, "commitPassiveMountOnFiber");
    function recursivelyTraverseReconnectPassiveEffects(finishedRoot$jscomp$0, parentFiber, committedLanes$jscomp$0, committedTransitions$jscomp$0, includeWorkInProgressEffects) {
      includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256);
      for (parentFiber = parentFiber.child; null !== parentFiber; ) {
        var finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, committedLanes = committedLanes$jscomp$0, committedTransitions = committedTransitions$jscomp$0, flags = finishedWork.flags;
        switch (finishedWork.tag) {
          case 0:
          case 11:
          case 15:
            recursivelyTraverseReconnectPassiveEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions,
              includeWorkInProgressEffects
            );
            commitHookEffectListMount(8, finishedWork);
            break;
          case 23:
            break;
          case 22:
            var instance = finishedWork.stateNode;
            null !== finishedWork.memoizedState ? instance._visibility & 2 ? recursivelyTraverseReconnectPassiveEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions,
              includeWorkInProgressEffects
            ) : recursivelyTraverseAtomicPassiveEffects(
              finishedRoot,
              finishedWork
            ) : (instance._visibility |= 2, recursivelyTraverseReconnectPassiveEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions,
              includeWorkInProgressEffects
            ));
            includeWorkInProgressEffects && flags & 2048 && commitOffscreenPassiveMountEffects(
              finishedWork.alternate,
              finishedWork
            );
            break;
          case 24:
            recursivelyTraverseReconnectPassiveEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions,
              includeWorkInProgressEffects
            );
            includeWorkInProgressEffects && flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
            break;
          default:
            recursivelyTraverseReconnectPassiveEffects(
              finishedRoot,
              finishedWork,
              committedLanes,
              committedTransitions,
              includeWorkInProgressEffects
            );
        }
        parentFiber = parentFiber.sibling;
      }
    }
    __name(recursivelyTraverseReconnectPassiveEffects, "recursivelyTraverseReconnectPassiveEffects");
    function recursivelyTraverseAtomicPassiveEffects(finishedRoot$jscomp$0, parentFiber) {
      if (parentFiber.subtreeFlags & 10256)
        for (parentFiber = parentFiber.child; null !== parentFiber; ) {
          var finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, flags = finishedWork.flags;
          switch (finishedWork.tag) {
            case 22:
              recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
              flags & 2048 && commitOffscreenPassiveMountEffects(
                finishedWork.alternate,
                finishedWork
              );
              break;
            case 24:
              recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
              flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork);
              break;
            default:
              recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork);
          }
          parentFiber = parentFiber.sibling;
        }
    }
    __name(recursivelyTraverseAtomicPassiveEffects, "recursivelyTraverseAtomicPassiveEffects");
    var suspenseyCommitFlag = 8192;
    function recursivelyAccumulateSuspenseyCommit(parentFiber) {
      if (parentFiber.subtreeFlags & suspenseyCommitFlag)
        for (parentFiber = parentFiber.child; null !== parentFiber; )
          accumulateSuspenseyCommitOnFiber(parentFiber), parentFiber = parentFiber.sibling;
    }
    __name(recursivelyAccumulateSuspenseyCommit, "recursivelyAccumulateSuspenseyCommit");
    function accumulateSuspenseyCommitOnFiber(fiber) {
      switch (fiber.tag) {
        case 26:
          recursivelyAccumulateSuspenseyCommit(fiber);
          fiber.flags & suspenseyCommitFlag && null !== fiber.memoizedState && suspendResource(
            currentHoistableRoot,
            fiber.memoizedState,
            fiber.memoizedProps
          );
          break;
        case 5:
          recursivelyAccumulateSuspenseyCommit(fiber);
          break;
        case 3:
        case 4:
          var previousHoistableRoot = currentHoistableRoot;
          currentHoistableRoot = getHoistableRoot(fiber.stateNode.containerInfo);
          recursivelyAccumulateSuspenseyCommit(fiber);
          currentHoistableRoot = previousHoistableRoot;
          break;
        case 22:
          null === fiber.memoizedState && (previousHoistableRoot = fiber.alternate, null !== previousHoistableRoot && null !== previousHoistableRoot.memoizedState ? (previousHoistableRoot = suspenseyCommitFlag, suspenseyCommitFlag = 16777216, recursivelyAccumulateSuspenseyCommit(fiber), suspenseyCommitFlag = previousHoistableRoot) : recursivelyAccumulateSuspenseyCommit(fiber));
          break;
        default:
          recursivelyAccumulateSuspenseyCommit(fiber);
      }
    }
    __name(accumulateSuspenseyCommitOnFiber, "accumulateSuspenseyCommitOnFiber");
    function detachAlternateSiblings(parentFiber) {
      var previousFiber = parentFiber.alternate;
      if (null !== previousFiber && (parentFiber = previousFiber.child, null !== parentFiber)) {
        previousFiber.child = null;
        do
          previousFiber = parentFiber.sibling, parentFiber.sibling = null, parentFiber = previousFiber;
        while (null !== parentFiber);
      }
    }
    __name(detachAlternateSiblings, "detachAlternateSiblings");
    function recursivelyTraversePassiveUnmountEffects(parentFiber) {
      var deletions = parentFiber.deletions;
      if (0 !== (parentFiber.flags & 16)) {
        if (null !== deletions)
          for (var i2 = 0; i2 < deletions.length; i2++) {
            var childToDelete = deletions[i2];
            nextEffect = childToDelete;
            commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
              childToDelete,
              parentFiber
            );
          }
        detachAlternateSiblings(parentFiber);
      }
      if (parentFiber.subtreeFlags & 10256)
        for (parentFiber = parentFiber.child; null !== parentFiber; )
          commitPassiveUnmountOnFiber(parentFiber), parentFiber = parentFiber.sibling;
    }
    __name(recursivelyTraversePassiveUnmountEffects, "recursivelyTraversePassiveUnmountEffects");
    function commitPassiveUnmountOnFiber(finishedWork) {
      switch (finishedWork.tag) {
        case 0:
        case 11:
        case 15:
          recursivelyTraversePassiveUnmountEffects(finishedWork);
          finishedWork.flags & 2048 && commitHookEffectListUnmount(9, finishedWork, finishedWork.return);
          break;
        case 3:
          recursivelyTraversePassiveUnmountEffects(finishedWork);
          break;
        case 12:
          recursivelyTraversePassiveUnmountEffects(finishedWork);
          break;
        case 22:
          var instance = finishedWork.stateNode;
          null !== finishedWork.memoizedState && instance._visibility & 2 && (null === finishedWork.return || 13 !== finishedWork.return.tag) ? (instance._visibility &= -3, recursivelyTraverseDisconnectPassiveEffects(finishedWork)) : recursivelyTraversePassiveUnmountEffects(finishedWork);
          break;
        default:
          recursivelyTraversePassiveUnmountEffects(finishedWork);
      }
    }
    __name(commitPassiveUnmountOnFiber, "commitPassiveUnmountOnFiber");
    function recursivelyTraverseDisconnectPassiveEffects(parentFiber) {
      var deletions = parentFiber.deletions;
      if (0 !== (parentFiber.flags & 16)) {
        if (null !== deletions)
          for (var i2 = 0; i2 < deletions.length; i2++) {
            var childToDelete = deletions[i2];
            nextEffect = childToDelete;
            commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
              childToDelete,
              parentFiber
            );
          }
        detachAlternateSiblings(parentFiber);
      }
      for (parentFiber = parentFiber.child; null !== parentFiber; ) {
        deletions = parentFiber;
        switch (deletions.tag) {
          case 0:
          case 11:
          case 15:
            commitHookEffectListUnmount(8, deletions, deletions.return);
            recursivelyTraverseDisconnectPassiveEffects(deletions);
            break;
          case 22:
            i2 = deletions.stateNode;
            i2._visibility & 2 && (i2._visibility &= -3, recursivelyTraverseDisconnectPassiveEffects(deletions));
            break;
          default:
            recursivelyTraverseDisconnectPassiveEffects(deletions);
        }
        parentFiber = parentFiber.sibling;
      }
    }
    __name(recursivelyTraverseDisconnectPassiveEffects, "recursivelyTraverseDisconnectPassiveEffects");
    function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) {
      for (; null !== nextEffect; ) {
        var fiber = nextEffect;
        switch (fiber.tag) {
          case 0:
          case 11:
          case 15:
            commitHookEffectListUnmount(8, fiber, nearestMountedAncestor);
            break;
          case 23:
          case 22:
            if (null !== fiber.memoizedState && null !== fiber.memoizedState.cachePool) {
              var cache = fiber.memoizedState.cachePool.pool;
              null != cache && cache.refCount++;
            }
            break;
          case 24:
            releaseCache(fiber.memoizedState.cache);
        }
        cache = fiber.child;
        if (null !== cache) cache.return = fiber, nextEffect = cache;
        else
          a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) {
            cache = nextEffect;
            var sibling = cache.sibling, returnFiber = cache.return;
            detachFiberAfterEffects(cache);
            if (cache === fiber) {
              nextEffect = null;
              break a;
            }
            if (null !== sibling) {
              sibling.return = returnFiber;
              nextEffect = sibling;
              break a;
            }
            nextEffect = returnFiber;
          }
      }
    }
    __name(commitPassiveUnmountEffectsInsideOfDeletedTree_begin, "commitPassiveUnmountEffectsInsideOfDeletedTree_begin");
    var DefaultAsyncDispatcher = {
      getCacheForType: /* @__PURE__ */ __name(function(resourceType) {
        var cache = readContext(CacheContext), cacheForType = cache.data.get(resourceType);
        void 0 === cacheForType && (cacheForType = resourceType(), cache.data.set(resourceType, cacheForType));
        return cacheForType;
      }, "getCacheForType")
    }, PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map, executionContext = 0, workInProgressRoot = null, workInProgress = null, workInProgressRootRenderLanes = 0, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, workInProgressRootDidSkipSuspendedSiblings = false, workInProgressRootIsPrerendering = false, workInProgressRootDidAttachPingListener = false, entangledRenderLanes = 0, workInProgressRootExitStatus = 0, workInProgressRootSkippedLanes = 0, workInProgressRootInterleavedUpdatedLanes = 0, workInProgressRootPingedLanes = 0, workInProgressDeferredLane = 0, workInProgressSuspendedRetryLanes = 0, workInProgressRootConcurrentErrors = null, workInProgressRootRecoverableErrors = null, workInProgressRootDidIncludeRecursiveRenderUpdate = false, globalMostRecentFallbackTime = 0, workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, pendingEffectsStatus = 0, pendingEffectsRoot = null, pendingFinishedWork = null, pendingEffectsLanes = 0, pendingEffectsRemainingLanes = 0, pendingPassiveTransitions = null, pendingRecoverableErrors = null, nestedUpdateCount = 0, rootWithNestedUpdates = null;
    function requestUpdateLane() {
      if (0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes)
        return workInProgressRootRenderLanes & -workInProgressRootRenderLanes;
      if (null !== ReactSharedInternals.T) {
        var actionScopeLane = currentEntangledLane;
        return 0 !== actionScopeLane ? actionScopeLane : requestTransitionLane();
      }
      return resolveUpdatePriority();
    }
    __name(requestUpdateLane, "requestUpdateLane");
    function requestDeferredLane() {
      0 === workInProgressDeferredLane && (workInProgressDeferredLane = 0 === (workInProgressRootRenderLanes & 536870912) || isHydrating ? claimNextTransitionLane() : 536870912);
      var suspenseHandler = suspenseHandlerStackCursor.current;
      null !== suspenseHandler && (suspenseHandler.flags |= 32);
      return workInProgressDeferredLane;
    }
    __name(requestDeferredLane, "requestDeferredLane");
    function scheduleUpdateOnFiber(root3, fiber, lane) {
      if (root3 === workInProgressRoot && (2 === workInProgressSuspendedReason || 9 === workInProgressSuspendedReason) || null !== root3.cancelPendingCommit)
        prepareFreshStack(root3, 0), markRootSuspended(
          root3,
          workInProgressRootRenderLanes,
          workInProgressDeferredLane,
          false
        );
      markRootUpdated$1(root3, lane);
      if (0 === (executionContext & 2) || root3 !== workInProgressRoot)
        root3 === workInProgressRoot && (0 === (executionContext & 2) && (workInProgressRootInterleavedUpdatedLanes |= lane), 4 === workInProgressRootExitStatus && markRootSuspended(
          root3,
          workInProgressRootRenderLanes,
          workInProgressDeferredLane,
          false
        )), ensureRootIsScheduled(root3);
    }
    __name(scheduleUpdateOnFiber, "scheduleUpdateOnFiber");
    function performWorkOnRoot(root$jscomp$0, lanes, forceSync) {
      if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327));
      var shouldTimeSlice = !forceSync && 0 === (lanes & 124) && 0 === (lanes & root$jscomp$0.expiredLanes) || checkIfRootIsPrerendering(root$jscomp$0, lanes), exitStatus = shouldTimeSlice ? renderRootConcurrent(root$jscomp$0, lanes) : renderRootSync(root$jscomp$0, lanes, true), renderWasConcurrent = shouldTimeSlice;
      do {
        if (0 === exitStatus) {
          workInProgressRootIsPrerendering && !shouldTimeSlice && markRootSuspended(root$jscomp$0, lanes, 0, false);
          break;
        } else {
          forceSync = root$jscomp$0.current.alternate;
          if (renderWasConcurrent && !isRenderConsistentWithExternalStores(forceSync)) {
            exitStatus = renderRootSync(root$jscomp$0, lanes, false);
            renderWasConcurrent = false;
            continue;
          }
          if (2 === exitStatus) {
            renderWasConcurrent = lanes;
            if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent)
              var JSCompiler_inline_result = 0;
            else
              JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913, JSCompiler_inline_result = 0 !== JSCompiler_inline_result ? JSCompiler_inline_result : JSCompiler_inline_result & 536870912 ? 536870912 : 0;
            if (0 !== JSCompiler_inline_result) {
              lanes = JSCompiler_inline_result;
              a: {
                var root3 = root$jscomp$0;
                exitStatus = workInProgressRootConcurrentErrors;
                var wasRootDehydrated = root3.current.memoizedState.isDehydrated;
                wasRootDehydrated && (prepareFreshStack(root3, JSCompiler_inline_result).flags |= 256);
                JSCompiler_inline_result = renderRootSync(
                  root3,
                  JSCompiler_inline_result,
                  false
                );
                if (2 !== JSCompiler_inline_result) {
                  if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) {
                    root3.errorRecoveryDisabledLanes |= renderWasConcurrent;
                    workInProgressRootInterleavedUpdatedLanes |= renderWasConcurrent;
                    exitStatus = 4;
                    break a;
                  }
                  renderWasConcurrent = workInProgressRootRecoverableErrors;
                  workInProgressRootRecoverableErrors = exitStatus;
                  null !== renderWasConcurrent && (null === workInProgressRootRecoverableErrors ? workInProgressRootRecoverableErrors = renderWasConcurrent : workInProgressRootRecoverableErrors.push.apply(
                    workInProgressRootRecoverableErrors,
                    renderWasConcurrent
                  ));
                }
                exitStatus = JSCompiler_inline_result;
              }
              renderWasConcurrent = false;
              if (2 !== exitStatus) continue;
            }
          }
          if (1 === exitStatus) {
            prepareFreshStack(root$jscomp$0, 0);
            markRootSuspended(root$jscomp$0, lanes, 0, true);
            break;
          }
          a: {
            shouldTimeSlice = root$jscomp$0;
            renderWasConcurrent = exitStatus;
            switch (renderWasConcurrent) {
              case 0:
              case 1:
                throw Error(formatProdErrorMessage(345));
              case 4:
                if ((lanes & 4194048) !== lanes) break;
              case 6:
                markRootSuspended(
                  shouldTimeSlice,
                  lanes,
                  workInProgressDeferredLane,
                  !workInProgressRootDidSkipSuspendedSiblings
                );
                break a;
              case 2:
                workInProgressRootRecoverableErrors = null;
                break;
              case 3:
              case 5:
                break;
              default:
                throw Error(formatProdErrorMessage(329));
            }
            if ((lanes & 62914560) === lanes && (exitStatus = globalMostRecentFallbackTime + 300 - now(), 10 < exitStatus)) {
              markRootSuspended(
                shouldTimeSlice,
                lanes,
                workInProgressDeferredLane,
                !workInProgressRootDidSkipSuspendedSiblings
              );
              if (0 !== getNextLanes(shouldTimeSlice, 0, true)) break a;
              shouldTimeSlice.timeoutHandle = scheduleTimeout(
                commitRootWhenReady.bind(
                  null,
                  shouldTimeSlice,
                  forceSync,
                  workInProgressRootRecoverableErrors,
                  workInProgressTransitions,
                  workInProgressRootDidIncludeRecursiveRenderUpdate,
                  lanes,
                  workInProgressDeferredLane,
                  workInProgressRootInterleavedUpdatedLanes,
                  workInProgressSuspendedRetryLanes,
                  workInProgressRootDidSkipSuspendedSiblings,
                  renderWasConcurrent,
                  2,
                  -0,
                  0
                ),
                exitStatus
              );
              break a;
            }
            commitRootWhenReady(
              shouldTimeSlice,
              forceSync,
              workInProgressRootRecoverableErrors,
              workInProgressTransitions,
              workInProgressRootDidIncludeRecursiveRenderUpdate,
              lanes,
              workInProgressDeferredLane,
              workInProgressRootInterleavedUpdatedLanes,
              workInProgressSuspendedRetryLanes,
              workInProgressRootDidSkipSuspendedSiblings,
              renderWasConcurrent,
              0,
              -0,
              0
            );
          }
        }
        break;
      } while (1);
      ensureRootIsScheduled(root$jscomp$0);
    }
    __name(performWorkOnRoot, "performWorkOnRoot");
    function commitRootWhenReady(root3, finishedWork, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, lanes, spawnedLane, updatedLanes, suspendedRetryLanes, didSkipSuspendedSiblings, exitStatus, suspendedCommitReason, completedRenderStartTime, completedRenderEndTime) {
      root3.timeoutHandle = -1;
      suspendedCommitReason = finishedWork.subtreeFlags;
      if (suspendedCommitReason & 8192 || 16785408 === (suspendedCommitReason & 16785408)) {
        if (suspendedState = { stylesheets: null, count: 0, unsuspend: noop2 }, accumulateSuspenseyCommitOnFiber(finishedWork), suspendedCommitReason = waitForCommitToBeReady(), null !== suspendedCommitReason) {
          root3.cancelPendingCommit = suspendedCommitReason(
            commitRoot.bind(
              null,
              root3,
              finishedWork,
              lanes,
              recoverableErrors,
              transitions,
              didIncludeRenderPhaseUpdate,
              spawnedLane,
              updatedLanes,
              suspendedRetryLanes,
              exitStatus,
              1,
              completedRenderStartTime,
              completedRenderEndTime
            )
          );
          markRootSuspended(root3, lanes, spawnedLane, !didSkipSuspendedSiblings);
          return;
        }
      }
      commitRoot(
        root3,
        finishedWork,
        lanes,
        recoverableErrors,
        transitions,
        didIncludeRenderPhaseUpdate,
        spawnedLane,
        updatedLanes,
        suspendedRetryLanes
      );
    }
    __name(commitRootWhenReady, "commitRootWhenReady");
    function isRenderConsistentWithExternalStores(finishedWork) {
      for (var node = finishedWork; ; ) {
        var tag = node.tag;
        if ((0 === tag || 11 === tag || 15 === tag) && node.flags & 16384 && (tag = node.updateQueue, null !== tag && (tag = tag.stores, null !== tag)))
          for (var i2 = 0; i2 < tag.length; i2++) {
            var check = tag[i2], getSnapshot = check.getSnapshot;
            check = check.value;
            try {
              if (!objectIs(getSnapshot(), check)) return false;
            } catch (error) {
              return false;
            }
          }
        tag = node.child;
        if (node.subtreeFlags & 16384 && null !== tag)
          tag.return = node, node = tag;
        else {
          if (node === finishedWork) break;
          for (; null === node.sibling; ) {
            if (null === node.return || node.return === finishedWork) return true;
            node = node.return;
          }
          node.sibling.return = node.return;
          node = node.sibling;
        }
      }
      return true;
    }
    __name(isRenderConsistentWithExternalStores, "isRenderConsistentWithExternalStores");
    function markRootSuspended(root3, suspendedLanes, spawnedLane, didAttemptEntireTree) {
      suspendedLanes &= ~workInProgressRootPingedLanes;
      suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes;
      root3.suspendedLanes |= suspendedLanes;
      root3.pingedLanes &= ~suspendedLanes;
      didAttemptEntireTree && (root3.warmLanes |= suspendedLanes);
      didAttemptEntireTree = root3.expirationTimes;
      for (var lanes = suspendedLanes; 0 < lanes; ) {
        var index$4 = 31 - clz32(lanes), lane = 1 << index$4;
        didAttemptEntireTree[index$4] = -1;
        lanes &= ~lane;
      }
      0 !== spawnedLane && markSpawnedDeferredLane(root3, spawnedLane, suspendedLanes);
    }
    __name(markRootSuspended, "markRootSuspended");
    function flushSyncWork$1() {
      return 0 === (executionContext & 6) ? (flushSyncWorkAcrossRoots_impl(0), false) : true;
    }
    __name(flushSyncWork$1, "flushSyncWork$1");
    function resetWorkInProgressStack() {
      if (null !== workInProgress) {
        if (0 === workInProgressSuspendedReason)
          var interruptedWork = workInProgress.return;
        else
          interruptedWork = workInProgress, lastContextDependency = currentlyRenderingFiber$1 = null, resetHooksOnUnwind(interruptedWork), thenableState = null, thenableIndexCounter = 0, interruptedWork = workInProgress;
        for (; null !== interruptedWork; )
          unwindInterruptedWork(interruptedWork.alternate, interruptedWork), interruptedWork = interruptedWork.return;
        workInProgress = null;
      }
    }
    __name(resetWorkInProgressStack, "resetWorkInProgressStack");
    function prepareFreshStack(root3, lanes) {
      var timeoutHandle = root3.timeoutHandle;
      -1 !== timeoutHandle && (root3.timeoutHandle = -1, cancelTimeout(timeoutHandle));
      timeoutHandle = root3.cancelPendingCommit;
      null !== timeoutHandle && (root3.cancelPendingCommit = null, timeoutHandle());
      resetWorkInProgressStack();
      workInProgressRoot = root3;
      workInProgress = timeoutHandle = createWorkInProgress(root3.current, null);
      workInProgressRootRenderLanes = lanes;
      workInProgressSuspendedReason = 0;
      workInProgressThrownValue = null;
      workInProgressRootDidSkipSuspendedSiblings = false;
      workInProgressRootIsPrerendering = checkIfRootIsPrerendering(root3, lanes);
      workInProgressRootDidAttachPingListener = false;
      workInProgressSuspendedRetryLanes = workInProgressDeferredLane = workInProgressRootPingedLanes = workInProgressRootInterleavedUpdatedLanes = workInProgressRootSkippedLanes = workInProgressRootExitStatus = 0;
      workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors = null;
      workInProgressRootDidIncludeRecursiveRenderUpdate = false;
      0 !== (lanes & 8) && (lanes |= lanes & 32);
      var allEntangledLanes = root3.entangledLanes;
      if (0 !== allEntangledLanes)
        for (root3 = root3.entanglements, allEntangledLanes &= lanes; 0 < allEntangledLanes; ) {
          var index$2 = 31 - clz32(allEntangledLanes), lane = 1 << index$2;
          lanes |= root3[index$2];
          allEntangledLanes &= ~lane;
        }
      entangledRenderLanes = lanes;
      finishQueueingConcurrentUpdates();
      return timeoutHandle;
    }
    __name(prepareFreshStack, "prepareFreshStack");
    function handleThrow(root3, thrownValue) {
      currentlyRenderingFiber = null;
      ReactSharedInternals.H = ContextOnlyDispatcher;
      thrownValue === SuspenseException || thrownValue === SuspenseActionException ? (thrownValue = getSuspendedThenable(), workInProgressSuspendedReason = 3) : thrownValue === SuspenseyCommitException ? (thrownValue = getSuspendedThenable(), workInProgressSuspendedReason = 4) : workInProgressSuspendedReason = thrownValue === SelectiveHydrationException ? 8 : null !== thrownValue && "object" === typeof thrownValue && "function" === typeof thrownValue.then ? 6 : 1;
      workInProgressThrownValue = thrownValue;
      null === workInProgress && (workInProgressRootExitStatus = 1, logUncaughtError(
        root3,
        createCapturedValueAtFiber(thrownValue, root3.current)
      ));
    }
    __name(handleThrow, "handleThrow");
    function pushDispatcher() {
      var prevDispatcher = ReactSharedInternals.H;
      ReactSharedInternals.H = ContextOnlyDispatcher;
      return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher;
    }
    __name(pushDispatcher, "pushDispatcher");
    function pushAsyncDispatcher() {
      var prevAsyncDispatcher = ReactSharedInternals.A;
      ReactSharedInternals.A = DefaultAsyncDispatcher;
      return prevAsyncDispatcher;
    }
    __name(pushAsyncDispatcher, "pushAsyncDispatcher");
    function renderDidSuspendDelayIfPossible() {
      workInProgressRootExitStatus = 4;
      workInProgressRootDidSkipSuspendedSiblings || (workInProgressRootRenderLanes & 4194048) !== workInProgressRootRenderLanes && null !== suspenseHandlerStackCursor.current || (workInProgressRootIsPrerendering = true);
      0 === (workInProgressRootSkippedLanes & 134217727) && 0 === (workInProgressRootInterleavedUpdatedLanes & 134217727) || null === workInProgressRoot || markRootSuspended(
        workInProgressRoot,
        workInProgressRootRenderLanes,
        workInProgressDeferredLane,
        false
      );
    }
    __name(renderDidSuspendDelayIfPossible, "renderDidSuspendDelayIfPossible");
    function renderRootSync(root3, lanes, shouldYieldForPrerendering) {
      var prevExecutionContext = executionContext;
      executionContext |= 2;
      var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher();
      if (workInProgressRoot !== root3 || workInProgressRootRenderLanes !== lanes)
        workInProgressTransitions = null, prepareFreshStack(root3, lanes);
      lanes = false;
      var exitStatus = workInProgressRootExitStatus;
      a: do
        try {
          if (0 !== workInProgressSuspendedReason && null !== workInProgress) {
            var unitOfWork = workInProgress, thrownValue = workInProgressThrownValue;
            switch (workInProgressSuspendedReason) {
              case 8:
                resetWorkInProgressStack();
                exitStatus = 6;
                break a;
              case 3:
              case 2:
              case 9:
              case 6:
                null === suspenseHandlerStackCursor.current && (lanes = true);
                var reason = workInProgressSuspendedReason;
                workInProgressSuspendedReason = 0;
                workInProgressThrownValue = null;
                throwAndUnwindWorkLoop(root3, unitOfWork, thrownValue, reason);
                if (shouldYieldForPrerendering && workInProgressRootIsPrerendering) {
                  exitStatus = 0;
                  break a;
                }
                break;
              default:
                reason = workInProgressSuspendedReason, workInProgressSuspendedReason = 0, workInProgressThrownValue = null, throwAndUnwindWorkLoop(root3, unitOfWork, thrownValue, reason);
            }
          }
          workLoopSync();
          exitStatus = workInProgressRootExitStatus;
          break;
        } catch (thrownValue$167) {
          handleThrow(root3, thrownValue$167);
        }
      while (1);
      lanes && root3.shellSuspendCounter++;
      lastContextDependency = currentlyRenderingFiber$1 = null;
      executionContext = prevExecutionContext;
      ReactSharedInternals.H = prevDispatcher;
      ReactSharedInternals.A = prevAsyncDispatcher;
      null === workInProgress && (workInProgressRoot = null, workInProgressRootRenderLanes = 0, finishQueueingConcurrentUpdates());
      return exitStatus;
    }
    __name(renderRootSync, "renderRootSync");
    function workLoopSync() {
      for (; null !== workInProgress; ) performUnitOfWork(workInProgress);
    }
    __name(workLoopSync, "workLoopSync");
    function renderRootConcurrent(root3, lanes) {
      var prevExecutionContext = executionContext;
      executionContext |= 2;
      var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher();
      workInProgressRoot !== root3 || workInProgressRootRenderLanes !== lanes ? (workInProgressTransitions = null, workInProgressRootRenderTargetTime = now() + 500, prepareFreshStack(root3, lanes)) : workInProgressRootIsPrerendering = checkIfRootIsPrerendering(
        root3,
        lanes
      );
      a: do
        try {
          if (0 !== workInProgressSuspendedReason && null !== workInProgress) {
            lanes = workInProgress;
            var thrownValue = workInProgressThrownValue;
            b: switch (workInProgressSuspendedReason) {
              case 1:
                workInProgressSuspendedReason = 0;
                workInProgressThrownValue = null;
                throwAndUnwindWorkLoop(root3, lanes, thrownValue, 1);
                break;
              case 2:
              case 9:
                if (isThenableResolved(thrownValue)) {
                  workInProgressSuspendedReason = 0;
                  workInProgressThrownValue = null;
                  replaySuspendedUnitOfWork(lanes);
                  break;
                }
                lanes = /* @__PURE__ */ __name(function() {
                  2 !== workInProgressSuspendedReason && 9 !== workInProgressSuspendedReason || workInProgressRoot !== root3 || (workInProgressSuspendedReason = 7);
                  ensureRootIsScheduled(root3);
                }, "lanes");
                thrownValue.then(lanes, lanes);
                break a;
              case 3:
                workInProgressSuspendedReason = 7;
                break a;
              case 4:
                workInProgressSuspendedReason = 5;
                break a;
              case 7:
                isThenableResolved(thrownValue) ? (workInProgressSuspendedReason = 0, workInProgressThrownValue = null, replaySuspendedUnitOfWork(lanes)) : (workInProgressSuspendedReason = 0, workInProgressThrownValue = null, throwAndUnwindWorkLoop(root3, lanes, thrownValue, 7));
                break;
              case 5:
                var resource = null;
                switch (workInProgress.tag) {
                  case 26:
                    resource = workInProgress.memoizedState;
                  case 5:
                  case 27:
                    var hostFiber = workInProgress;
                    if (resource ? preloadResource(resource) : 1) {
                      workInProgressSuspendedReason = 0;
                      workInProgressThrownValue = null;
                      var sibling = hostFiber.sibling;
                      if (null !== sibling) workInProgress = sibling;
                      else {
                        var returnFiber = hostFiber.return;
                        null !== returnFiber ? (workInProgress = returnFiber, completeUnitOfWork(returnFiber)) : workInProgress = null;
                      }
                      break b;
                    }
                }
                workInProgressSuspendedReason = 0;
                workInProgressThrownValue = null;
                throwAndUnwindWorkLoop(root3, lanes, thrownValue, 5);
                break;
              case 6:
                workInProgressSuspendedReason = 0;
                workInProgressThrownValue = null;
                throwAndUnwindWorkLoop(root3, lanes, thrownValue, 6);
                break;
              case 8:
                resetWorkInProgressStack();
                workInProgressRootExitStatus = 6;
                break a;
              default:
                throw Error(formatProdErrorMessage(462));
            }
          }
          workLoopConcurrentByScheduler();
          break;
        } catch (thrownValue$169) {
          handleThrow(root3, thrownValue$169);
        }
      while (1);
      lastContextDependency = currentlyRenderingFiber$1 = null;
      ReactSharedInternals.H = prevDispatcher;
      ReactSharedInternals.A = prevAsyncDispatcher;
      executionContext = prevExecutionContext;
      if (null !== workInProgress) return 0;
      workInProgressRoot = null;
      workInProgressRootRenderLanes = 0;
      finishQueueingConcurrentUpdates();
      return workInProgressRootExitStatus;
    }
    __name(renderRootConcurrent, "renderRootConcurrent");
    function workLoopConcurrentByScheduler() {
      for (; null !== workInProgress && !shouldYield(); )
        performUnitOfWork(workInProgress);
    }
    __name(workLoopConcurrentByScheduler, "workLoopConcurrentByScheduler");
    function performUnitOfWork(unitOfWork) {
      var next = beginWork(unitOfWork.alternate, unitOfWork, entangledRenderLanes);
      unitOfWork.memoizedProps = unitOfWork.pendingProps;
      null === next ? completeUnitOfWork(unitOfWork) : workInProgress = next;
    }
    __name(performUnitOfWork, "performUnitOfWork");
    function replaySuspendedUnitOfWork(unitOfWork) {
      var next = unitOfWork;
      var current = next.alternate;
      switch (next.tag) {
        case 15:
        case 0:
          next = replayFunctionComponent(
            current,
            next,
            next.pendingProps,
            next.type,
            void 0,
            workInProgressRootRenderLanes
          );
          break;
        case 11:
          next = replayFunctionComponent(
            current,
            next,
            next.pendingProps,
            next.type.render,
            next.ref,
            workInProgressRootRenderLanes
          );
          break;
        case 5:
          resetHooksOnUnwind(next);
        default:
          unwindInterruptedWork(current, next), next = workInProgress = resetWorkInProgress(next, entangledRenderLanes), next = beginWork(current, next, entangledRenderLanes);
      }
      unitOfWork.memoizedProps = unitOfWork.pendingProps;
      null === next ? completeUnitOfWork(unitOfWork) : workInProgress = next;
    }
    __name(replaySuspendedUnitOfWork, "replaySuspendedUnitOfWork");
    function throwAndUnwindWorkLoop(root3, unitOfWork, thrownValue, suspendedReason) {
      lastContextDependency = currentlyRenderingFiber$1 = null;
      resetHooksOnUnwind(unitOfWork);
      thenableState = null;
      thenableIndexCounter = 0;
      var returnFiber = unitOfWork.return;
      try {
        if (throwException(
          root3,
          returnFiber,
          unitOfWork,
          thrownValue,
          workInProgressRootRenderLanes
        )) {
          workInProgressRootExitStatus = 1;
          logUncaughtError(
            root3,
            createCapturedValueAtFiber(thrownValue, root3.current)
          );
          workInProgress = null;
          return;
        }
      } catch (error) {
        if (null !== returnFiber) throw workInProgress = returnFiber, error;
        workInProgressRootExitStatus = 1;
        logUncaughtError(
          root3,
          createCapturedValueAtFiber(thrownValue, root3.current)
        );
        workInProgress = null;
        return;
      }
      if (unitOfWork.flags & 32768) {
        if (isHydrating || 1 === suspendedReason) root3 = true;
        else if (workInProgressRootIsPrerendering || 0 !== (workInProgressRootRenderLanes & 536870912))
          root3 = false;
        else if (workInProgressRootDidSkipSuspendedSiblings = root3 = true, 2 === suspendedReason || 9 === suspendedReason || 3 === suspendedReason || 6 === suspendedReason)
          suspendedReason = suspenseHandlerStackCursor.current, null !== suspendedReason && 13 === suspendedReason.tag && (suspendedReason.flags |= 16384);
        unwindUnitOfWork(unitOfWork, root3);
      } else completeUnitOfWork(unitOfWork);
    }
    __name(throwAndUnwindWorkLoop, "throwAndUnwindWorkLoop");
    function completeUnitOfWork(unitOfWork) {
      var completedWork = unitOfWork;
      do {
        if (0 !== (completedWork.flags & 32768)) {
          unwindUnitOfWork(
            completedWork,
            workInProgressRootDidSkipSuspendedSiblings
          );
          return;
        }
        unitOfWork = completedWork.return;
        var next = completeWork(
          completedWork.alternate,
          completedWork,
          entangledRenderLanes
        );
        if (null !== next) {
          workInProgress = next;
          return;
        }
        completedWork = completedWork.sibling;
        if (null !== completedWork) {
          workInProgress = completedWork;
          return;
        }
        workInProgress = completedWork = unitOfWork;
      } while (null !== completedWork);
      0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5);
    }
    __name(completeUnitOfWork, "completeUnitOfWork");
    function unwindUnitOfWork(unitOfWork, skipSiblings) {
      do {
        var next = unwindWork(unitOfWork.alternate, unitOfWork);
        if (null !== next) {
          next.flags &= 32767;
          workInProgress = next;
          return;
        }
        next = unitOfWork.return;
        null !== next && (next.flags |= 32768, next.subtreeFlags = 0, next.deletions = null);
        if (!skipSiblings && (unitOfWork = unitOfWork.sibling, null !== unitOfWork)) {
          workInProgress = unitOfWork;
          return;
        }
        workInProgress = unitOfWork = next;
      } while (null !== unitOfWork);
      workInProgressRootExitStatus = 6;
      workInProgress = null;
    }
    __name(unwindUnitOfWork, "unwindUnitOfWork");
    function commitRoot(root3, finishedWork, lanes, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, suspendedRetryLanes) {
      root3.cancelPendingCommit = null;
      do
        flushPendingEffects();
      while (0 !== pendingEffectsStatus);
      if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327));
      if (null !== finishedWork) {
        if (finishedWork === root3.current) throw Error(formatProdErrorMessage(177));
        didIncludeRenderPhaseUpdate = finishedWork.lanes | finishedWork.childLanes;
        didIncludeRenderPhaseUpdate |= concurrentlyUpdatedLanes;
        markRootFinished(
          root3,
          lanes,
          didIncludeRenderPhaseUpdate,
          spawnedLane,
          updatedLanes,
          suspendedRetryLanes
        );
        root3 === workInProgressRoot && (workInProgress = workInProgressRoot = null, workInProgressRootRenderLanes = 0);
        pendingFinishedWork = finishedWork;
        pendingEffectsRoot = root3;
        pendingEffectsLanes = lanes;
        pendingEffectsRemainingLanes = didIncludeRenderPhaseUpdate;
        pendingPassiveTransitions = transitions;
        pendingRecoverableErrors = recoverableErrors;
        0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) ? (root3.callbackNode = null, root3.callbackPriority = 0, scheduleCallback$1(NormalPriority$1, function() {
          flushPassiveEffects();
          return null;
        })) : (root3.callbackNode = null, root3.callbackPriority = 0);
        recoverableErrors = 0 !== (finishedWork.flags & 13878);
        if (0 !== (finishedWork.subtreeFlags & 13878) || recoverableErrors) {
          recoverableErrors = ReactSharedInternals.T;
          ReactSharedInternals.T = null;
          transitions = ReactDOMSharedInternals.p;
          ReactDOMSharedInternals.p = 2;
          spawnedLane = executionContext;
          executionContext |= 4;
          try {
            commitBeforeMutationEffects(root3, finishedWork, lanes);
          } finally {
            executionContext = spawnedLane, ReactDOMSharedInternals.p = transitions, ReactSharedInternals.T = recoverableErrors;
          }
        }
        pendingEffectsStatus = 1;
        flushMutationEffects();
        flushLayoutEffects();
        flushSpawnedWork();
      }
    }
    __name(commitRoot, "commitRoot");
    function flushMutationEffects() {
      if (1 === pendingEffectsStatus) {
        pendingEffectsStatus = 0;
        var root3 = pendingEffectsRoot, finishedWork = pendingFinishedWork, rootMutationHasEffect = 0 !== (finishedWork.flags & 13878);
        if (0 !== (finishedWork.subtreeFlags & 13878) || rootMutationHasEffect) {
          rootMutationHasEffect = ReactSharedInternals.T;
          ReactSharedInternals.T = null;
          var previousPriority = ReactDOMSharedInternals.p;
          ReactDOMSharedInternals.p = 2;
          var prevExecutionContext = executionContext;
          executionContext |= 4;
          try {
            commitMutationEffectsOnFiber(finishedWork, root3);
            var priorSelectionInformation = selectionInformation, curFocusedElem = getActiveElementDeep(root3.containerInfo), priorFocusedElem = priorSelectionInformation.focusedElem, priorSelectionRange = priorSelectionInformation.selectionRange;
            if (curFocusedElem !== priorFocusedElem && priorFocusedElem && priorFocusedElem.ownerDocument && containsNode(
              priorFocusedElem.ownerDocument.documentElement,
              priorFocusedElem
            )) {
              if (null !== priorSelectionRange && hasSelectionCapabilities(priorFocusedElem)) {
                var start = priorSelectionRange.start, end = priorSelectionRange.end;
                void 0 === end && (end = start);
                if ("selectionStart" in priorFocusedElem)
                  priorFocusedElem.selectionStart = start, priorFocusedElem.selectionEnd = Math.min(
                    end,
                    priorFocusedElem.value.length
                  );
                else {
                  var doc = priorFocusedElem.ownerDocument || document, win2 = doc && doc.defaultView || window;
                  if (win2.getSelection) {
                    var selection = win2.getSelection(), length = priorFocusedElem.textContent.length, start$jscomp$0 = Math.min(priorSelectionRange.start, length), end$jscomp$0 = void 0 === priorSelectionRange.end ? start$jscomp$0 : Math.min(priorSelectionRange.end, length);
                    !selection.extend && start$jscomp$0 > end$jscomp$0 && (curFocusedElem = end$jscomp$0, end$jscomp$0 = start$jscomp$0, start$jscomp$0 = curFocusedElem);
                    var startMarker = getNodeForCharacterOffset(
                      priorFocusedElem,
                      start$jscomp$0
                    ), endMarker = getNodeForCharacterOffset(
                      priorFocusedElem,
                      end$jscomp$0
                    );
                    if (startMarker && endMarker && (1 !== selection.rangeCount || selection.anchorNode !== startMarker.node || selection.anchorOffset !== startMarker.offset || selection.focusNode !== endMarker.node || selection.focusOffset !== endMarker.offset)) {
                      var range2 = doc.createRange();
                      range2.setStart(startMarker.node, startMarker.offset);
                      selection.removeAllRanges();
                      start$jscomp$0 > end$jscomp$0 ? (selection.addRange(range2), selection.extend(endMarker.node, endMarker.offset)) : (range2.setEnd(endMarker.node, endMarker.offset), selection.addRange(range2));
                    }
                  }
                }
              }
              doc = [];
              for (selection = priorFocusedElem; selection = selection.parentNode; )
                1 === selection.nodeType && doc.push({
                  element: selection,
                  left: selection.scrollLeft,
                  top: selection.scrollTop
                });
              "function" === typeof priorFocusedElem.focus && priorFocusedElem.focus();
              for (priorFocusedElem = 0; priorFocusedElem < doc.length; priorFocusedElem++) {
                var info = doc[priorFocusedElem];
                info.element.scrollLeft = info.left;
                info.element.scrollTop = info.top;
              }
            }
            _enabled = !!eventsEnabled;
            selectionInformation = eventsEnabled = null;
          } finally {
            executionContext = prevExecutionContext, ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = rootMutationHasEffect;
          }
        }
        root3.current = finishedWork;
        pendingEffectsStatus = 2;
      }
    }
    __name(flushMutationEffects, "flushMutationEffects");
    function flushLayoutEffects() {
      if (2 === pendingEffectsStatus) {
        pendingEffectsStatus = 0;
        var root3 = pendingEffectsRoot, finishedWork = pendingFinishedWork, rootHasLayoutEffect = 0 !== (finishedWork.flags & 8772);
        if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) {
          rootHasLayoutEffect = ReactSharedInternals.T;
          ReactSharedInternals.T = null;
          var previousPriority = ReactDOMSharedInternals.p;
          ReactDOMSharedInternals.p = 2;
          var prevExecutionContext = executionContext;
          executionContext |= 4;
          try {
            commitLayoutEffectOnFiber(root3, finishedWork.alternate, finishedWork);
          } finally {
            executionContext = prevExecutionContext, ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = rootHasLayoutEffect;
          }
        }
        pendingEffectsStatus = 3;
      }
    }
    __name(flushLayoutEffects, "flushLayoutEffects");
    function flushSpawnedWork() {
      if (4 === pendingEffectsStatus || 3 === pendingEffectsStatus) {
        pendingEffectsStatus = 0;
        requestPaint();
        var root3 = pendingEffectsRoot, finishedWork = pendingFinishedWork, lanes = pendingEffectsLanes, recoverableErrors = pendingRecoverableErrors;
        0 !== (finishedWork.subtreeFlags & 10256) || 0 !== (finishedWork.flags & 10256) ? pendingEffectsStatus = 5 : (pendingEffectsStatus = 0, pendingFinishedWork = pendingEffectsRoot = null, releaseRootPooledCache(root3, root3.pendingLanes));
        var remainingLanes = root3.pendingLanes;
        0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null);
        lanesToEventPriority(lanes);
        finishedWork = finishedWork.stateNode;
        if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot)
          try {
            injectedHook.onCommitFiberRoot(
              rendererID,
              finishedWork,
              void 0,
              128 === (finishedWork.current.flags & 128)
            );
          } catch (err) {
          }
        if (null !== recoverableErrors) {
          finishedWork = ReactSharedInternals.T;
          remainingLanes = ReactDOMSharedInternals.p;
          ReactDOMSharedInternals.p = 2;
          ReactSharedInternals.T = null;
          try {
            for (var onRecoverableError = root3.onRecoverableError, i2 = 0; i2 < recoverableErrors.length; i2++) {
              var recoverableError = recoverableErrors[i2];
              onRecoverableError(recoverableError.value, {
                componentStack: recoverableError.stack
              });
            }
          } finally {
            ReactSharedInternals.T = finishedWork, ReactDOMSharedInternals.p = remainingLanes;
          }
        }
        0 !== (pendingEffectsLanes & 3) && flushPendingEffects();
        ensureRootIsScheduled(root3);
        remainingLanes = root3.pendingLanes;
        0 !== (lanes & 4194090) && 0 !== (remainingLanes & 42) ? root3 === rootWithNestedUpdates ? nestedUpdateCount++ : (nestedUpdateCount = 0, rootWithNestedUpdates = root3) : nestedUpdateCount = 0;
        flushSyncWorkAcrossRoots_impl(0);
      }
    }
    __name(flushSpawnedWork, "flushSpawnedWork");
    function releaseRootPooledCache(root3, remainingLanes) {
      0 === (root3.pooledCacheLanes &= remainingLanes) && (remainingLanes = root3.pooledCache, null != remainingLanes && (root3.pooledCache = null, releaseCache(remainingLanes)));
    }
    __name(releaseRootPooledCache, "releaseRootPooledCache");
    function flushPendingEffects(wasDelayedCommit) {
      flushMutationEffects();
      flushLayoutEffects();
      flushSpawnedWork();
      return flushPassiveEffects();
    }
    __name(flushPendingEffects, "flushPendingEffects");
    function flushPassiveEffects() {
      if (5 !== pendingEffectsStatus) return false;
      var root3 = pendingEffectsRoot, remainingLanes = pendingEffectsRemainingLanes;
      pendingEffectsRemainingLanes = 0;
      var renderPriority = lanesToEventPriority(pendingEffectsLanes), prevTransition = ReactSharedInternals.T, previousPriority = ReactDOMSharedInternals.p;
      try {
        ReactDOMSharedInternals.p = 32 > renderPriority ? 32 : renderPriority;
        ReactSharedInternals.T = null;
        renderPriority = pendingPassiveTransitions;
        pendingPassiveTransitions = null;
        var root$jscomp$0 = pendingEffectsRoot, lanes = pendingEffectsLanes;
        pendingEffectsStatus = 0;
        pendingFinishedWork = pendingEffectsRoot = null;
        pendingEffectsLanes = 0;
        if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331));
        var prevExecutionContext = executionContext;
        executionContext |= 4;
        commitPassiveUnmountOnFiber(root$jscomp$0.current);
        commitPassiveMountOnFiber(
          root$jscomp$0,
          root$jscomp$0.current,
          lanes,
          renderPriority
        );
        executionContext = prevExecutionContext;
        flushSyncWorkAcrossRoots_impl(0, false);
        if (injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot)
          try {
            injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0);
          } catch (err) {
          }
        return true;
      } finally {
        ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition, releaseRootPooledCache(root3, remainingLanes);
      }
    }
    __name(flushPassiveEffects, "flushPassiveEffects");
    function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
      sourceFiber = createCapturedValueAtFiber(error, sourceFiber);
      sourceFiber = createRootErrorUpdate(rootFiber.stateNode, sourceFiber, 2);
      rootFiber = enqueueUpdate(rootFiber, sourceFiber, 2);
      null !== rootFiber && (markRootUpdated$1(rootFiber, 2), ensureRootIsScheduled(rootFiber));
    }
    __name(captureCommitPhaseErrorOnRoot, "captureCommitPhaseErrorOnRoot");
    function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) {
      if (3 === sourceFiber.tag)
        captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
      else
        for (; null !== nearestMountedAncestor; ) {
          if (3 === nearestMountedAncestor.tag) {
            captureCommitPhaseErrorOnRoot(
              nearestMountedAncestor,
              sourceFiber,
              error
            );
            break;
          } else if (1 === nearestMountedAncestor.tag) {
            var instance = nearestMountedAncestor.stateNode;
            if ("function" === typeof nearestMountedAncestor.type.getDerivedStateFromError || "function" === typeof instance.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(instance))) {
              sourceFiber = createCapturedValueAtFiber(error, sourceFiber);
              error = createClassErrorUpdate(2);
              instance = enqueueUpdate(nearestMountedAncestor, error, 2);
              null !== instance && (initializeClassErrorUpdate(
                error,
                instance,
                nearestMountedAncestor,
                sourceFiber
              ), markRootUpdated$1(instance, 2), ensureRootIsScheduled(instance));
              break;
            }
          }
          nearestMountedAncestor = nearestMountedAncestor.return;
        }
    }
    __name(captureCommitPhaseError, "captureCommitPhaseError");
    function attachPingListener(root3, wakeable, lanes) {
      var pingCache = root3.pingCache;
      if (null === pingCache) {
        pingCache = root3.pingCache = new PossiblyWeakMap();
        var threadIDs = /* @__PURE__ */ new Set();
        pingCache.set(wakeable, threadIDs);
      } else
        threadIDs = pingCache.get(wakeable), void 0 === threadIDs && (threadIDs = /* @__PURE__ */ new Set(), pingCache.set(wakeable, threadIDs));
      threadIDs.has(lanes) || (workInProgressRootDidAttachPingListener = true, threadIDs.add(lanes), root3 = pingSuspendedRoot.bind(null, root3, wakeable, lanes), wakeable.then(root3, root3));
    }
    __name(attachPingListener, "attachPingListener");
    function pingSuspendedRoot(root3, wakeable, pingedLanes) {
      var pingCache = root3.pingCache;
      null !== pingCache && pingCache.delete(wakeable);
      root3.pingedLanes |= root3.suspendedLanes & pingedLanes;
      root3.warmLanes &= ~pingedLanes;
      workInProgressRoot === root3 && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus && (workInProgressRootRenderLanes & 62914560) === workInProgressRootRenderLanes && 300 > now() - globalMostRecentFallbackTime ? 0 === (executionContext & 2) && prepareFreshStack(root3, 0) : workInProgressRootPingedLanes |= pingedLanes, workInProgressSuspendedRetryLanes === workInProgressRootRenderLanes && (workInProgressSuspendedRetryLanes = 0));
      ensureRootIsScheduled(root3);
    }
    __name(pingSuspendedRoot, "pingSuspendedRoot");
    function retryTimedOutBoundary(boundaryFiber, retryLane) {
      0 === retryLane && (retryLane = claimNextRetryLane());
      boundaryFiber = enqueueConcurrentRenderForLane(boundaryFiber, retryLane);
      null !== boundaryFiber && (markRootUpdated$1(boundaryFiber, retryLane), ensureRootIsScheduled(boundaryFiber));
    }
    __name(retryTimedOutBoundary, "retryTimedOutBoundary");
    function retryDehydratedSuspenseBoundary(boundaryFiber) {
      var suspenseState = boundaryFiber.memoizedState, retryLane = 0;
      null !== suspenseState && (retryLane = suspenseState.retryLane);
      retryTimedOutBoundary(boundaryFiber, retryLane);
    }
    __name(retryDehydratedSuspenseBoundary, "retryDehydratedSuspenseBoundary");
    function resolveRetryWakeable(boundaryFiber, wakeable) {
      var retryLane = 0;
      switch (boundaryFiber.tag) {
        case 13:
          var retryCache = boundaryFiber.stateNode;
          var suspenseState = boundaryFiber.memoizedState;
          null !== suspenseState && (retryLane = suspenseState.retryLane);
          break;
        case 19:
          retryCache = boundaryFiber.stateNode;
          break;
        case 22:
          retryCache = boundaryFiber.stateNode._retryCache;
          break;
        default:
          throw Error(formatProdErrorMessage(314));
      }
      null !== retryCache && retryCache.delete(wakeable);
      retryTimedOutBoundary(boundaryFiber, retryLane);
    }
    __name(resolveRetryWakeable, "resolveRetryWakeable");
    function scheduleCallback$1(priorityLevel, callback) {
      return scheduleCallback$3(priorityLevel, callback);
    }
    __name(scheduleCallback$1, "scheduleCallback$1");
    var firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = false, mightHavePendingSyncWork = false, isFlushingWork = false, currentEventTransitionLane = 0;
    function ensureRootIsScheduled(root3) {
      root3 !== lastScheduledRoot && null === root3.next && (null === lastScheduledRoot ? firstScheduledRoot = lastScheduledRoot = root3 : lastScheduledRoot = lastScheduledRoot.next = root3);
      mightHavePendingSyncWork = true;
      didScheduleMicrotask || (didScheduleMicrotask = true, scheduleImmediateRootScheduleTask());
    }
    __name(ensureRootIsScheduled, "ensureRootIsScheduled");
    function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) {
      if (!isFlushingWork && mightHavePendingSyncWork) {
        isFlushingWork = true;
        do {
          var didPerformSomeWork = false;
          for (var root$174 = firstScheduledRoot; null !== root$174; ) {
            if (0 !== syncTransitionLanes) {
              var pendingLanes = root$174.pendingLanes;
              if (0 === pendingLanes) var JSCompiler_inline_result = 0;
              else {
                var suspendedLanes = root$174.suspendedLanes, pingedLanes = root$174.pingedLanes;
                JSCompiler_inline_result = (1 << 31 - clz32(42 | syncTransitionLanes) + 1) - 1;
                JSCompiler_inline_result &= pendingLanes & ~(suspendedLanes & ~pingedLanes);
                JSCompiler_inline_result = JSCompiler_inline_result & 201326741 ? JSCompiler_inline_result & 201326741 | 1 : JSCompiler_inline_result ? JSCompiler_inline_result | 2 : 0;
              }
              0 !== JSCompiler_inline_result && (didPerformSomeWork = true, performSyncWorkOnRoot(root$174, JSCompiler_inline_result));
            } else
              JSCompiler_inline_result = workInProgressRootRenderLanes, JSCompiler_inline_result = getNextLanes(
                root$174,
                root$174 === workInProgressRoot ? JSCompiler_inline_result : 0,
                null !== root$174.cancelPendingCommit || -1 !== root$174.timeoutHandle
              ), 0 === (JSCompiler_inline_result & 3) || checkIfRootIsPrerendering(root$174, JSCompiler_inline_result) || (didPerformSomeWork = true, performSyncWorkOnRoot(root$174, JSCompiler_inline_result));
            root$174 = root$174.next;
          }
        } while (didPerformSomeWork);
        isFlushingWork = false;
      }
    }
    __name(flushSyncWorkAcrossRoots_impl, "flushSyncWorkAcrossRoots_impl");
    function processRootScheduleInImmediateTask() {
      processRootScheduleInMicrotask();
    }
    __name(processRootScheduleInImmediateTask, "processRootScheduleInImmediateTask");
    function processRootScheduleInMicrotask() {
      mightHavePendingSyncWork = didScheduleMicrotask = false;
      var syncTransitionLanes = 0;
      0 !== currentEventTransitionLane && (shouldAttemptEagerTransition() && (syncTransitionLanes = currentEventTransitionLane), currentEventTransitionLane = 0);
      for (var currentTime = now(), prev = null, root3 = firstScheduledRoot; null !== root3; ) {
        var next = root3.next, nextLanes = scheduleTaskForRootDuringMicrotask(root3, currentTime);
        if (0 === nextLanes)
          root3.next = null, null === prev ? firstScheduledRoot = next : prev.next = next, null === next && (lastScheduledRoot = prev);
        else if (prev = root3, 0 !== syncTransitionLanes || 0 !== (nextLanes & 3))
          mightHavePendingSyncWork = true;
        root3 = next;
      }
      flushSyncWorkAcrossRoots_impl(syncTransitionLanes);
    }
    __name(processRootScheduleInMicrotask, "processRootScheduleInMicrotask");
    function scheduleTaskForRootDuringMicrotask(root3, currentTime) {
      for (var suspendedLanes = root3.suspendedLanes, pingedLanes = root3.pingedLanes, expirationTimes = root3.expirationTimes, lanes = root3.pendingLanes & -62914561; 0 < lanes; ) {
        var index$3 = 31 - clz32(lanes), lane = 1 << index$3, expirationTime = expirationTimes[index$3];
        if (-1 === expirationTime) {
          if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes))
            expirationTimes[index$3] = computeExpirationTime(lane, currentTime);
        } else expirationTime <= currentTime && (root3.expiredLanes |= lane);
        lanes &= ~lane;
      }
      currentTime = workInProgressRoot;
      suspendedLanes = workInProgressRootRenderLanes;
      suspendedLanes = getNextLanes(
        root3,
        root3 === currentTime ? suspendedLanes : 0,
        null !== root3.cancelPendingCommit || -1 !== root3.timeoutHandle
      );
      pingedLanes = root3.callbackNode;
      if (0 === suspendedLanes || root3 === currentTime && (2 === workInProgressSuspendedReason || 9 === workInProgressSuspendedReason) || null !== root3.cancelPendingCommit)
        return null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes), root3.callbackNode = null, root3.callbackPriority = 0;
      if (0 === (suspendedLanes & 3) || checkIfRootIsPrerendering(root3, suspendedLanes)) {
        currentTime = suspendedLanes & -suspendedLanes;
        if (currentTime === root3.callbackPriority) return currentTime;
        null !== pingedLanes && cancelCallback$1(pingedLanes);
        switch (lanesToEventPriority(suspendedLanes)) {
          case 2:
          case 8:
            suspendedLanes = UserBlockingPriority;
            break;
          case 32:
            suspendedLanes = NormalPriority$1;
            break;
          case 268435456:
            suspendedLanes = IdlePriority;
            break;
          default:
            suspendedLanes = NormalPriority$1;
        }
        pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root3);
        suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes);
        root3.callbackPriority = currentTime;
        root3.callbackNode = suspendedLanes;
        return currentTime;
      }
      null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes);
      root3.callbackPriority = 2;
      root3.callbackNode = null;
      return 2;
    }
    __name(scheduleTaskForRootDuringMicrotask, "scheduleTaskForRootDuringMicrotask");
    function performWorkOnRootViaSchedulerTask(root3, didTimeout) {
      if (0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus)
        return root3.callbackNode = null, root3.callbackPriority = 0, null;
      var originalCallbackNode = root3.callbackNode;
      if (flushPendingEffects() && root3.callbackNode !== originalCallbackNode)
        return null;
      var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes;
      workInProgressRootRenderLanes$jscomp$0 = getNextLanes(
        root3,
        root3 === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0,
        null !== root3.cancelPendingCommit || -1 !== root3.timeoutHandle
      );
      if (0 === workInProgressRootRenderLanes$jscomp$0) return null;
      performWorkOnRoot(root3, workInProgressRootRenderLanes$jscomp$0, didTimeout);
      scheduleTaskForRootDuringMicrotask(root3, now());
      return null != root3.callbackNode && root3.callbackNode === originalCallbackNode ? performWorkOnRootViaSchedulerTask.bind(null, root3) : null;
    }
    __name(performWorkOnRootViaSchedulerTask, "performWorkOnRootViaSchedulerTask");
    function performSyncWorkOnRoot(root3, lanes) {
      if (flushPendingEffects()) return null;
      performWorkOnRoot(root3, lanes, true);
    }
    __name(performSyncWorkOnRoot, "performSyncWorkOnRoot");
    function scheduleImmediateRootScheduleTask() {
      scheduleMicrotask(function() {
        0 !== (executionContext & 6) ? scheduleCallback$3(
          ImmediatePriority,
          processRootScheduleInImmediateTask
        ) : processRootScheduleInMicrotask();
      });
    }
    __name(scheduleImmediateRootScheduleTask, "scheduleImmediateRootScheduleTask");
    function requestTransitionLane() {
      0 === currentEventTransitionLane && (currentEventTransitionLane = claimNextTransitionLane());
      return currentEventTransitionLane;
    }
    __name(requestTransitionLane, "requestTransitionLane");
    function coerceFormActionProp(actionProp) {
      return null == actionProp || "symbol" === typeof actionProp || "boolean" === typeof actionProp ? null : "function" === typeof actionProp ? actionProp : sanitizeURL("" + actionProp);
    }
    __name(coerceFormActionProp, "coerceFormActionProp");
    function createFormDataWithSubmitter(form, submitter) {
      var temp = submitter.ownerDocument.createElement("input");
      temp.name = submitter.name;
      temp.value = submitter.value;
      form.id && temp.setAttribute("form", form.id);
      submitter.parentNode.insertBefore(temp, submitter);
      form = new FormData(form);
      temp.parentNode.removeChild(temp);
      return form;
    }
    __name(createFormDataWithSubmitter, "createFormDataWithSubmitter");
    function extractEvents$1(dispatchQueue, domEventName, maybeTargetInst, nativeEvent, nativeEventTarget) {
      if ("submit" === domEventName && maybeTargetInst && maybeTargetInst.stateNode === nativeEventTarget) {
        var action = coerceFormActionProp(
          (nativeEventTarget[internalPropsKey] || null).action
        ), submitter = nativeEvent.submitter;
        submitter && (domEventName = (domEventName = submitter[internalPropsKey] || null) ? coerceFormActionProp(domEventName.formAction) : submitter.getAttribute("formAction"), null !== domEventName && (action = domEventName, submitter = null));
        var event = new SyntheticEvent(
          "action",
          "action",
          null,
          nativeEvent,
          nativeEventTarget
        );
        dispatchQueue.push({
          event,
          listeners: [
            {
              instance: null,
              listener: /* @__PURE__ */ __name(function() {
                if (nativeEvent.defaultPrevented) {
                  if (0 !== currentEventTransitionLane) {
                    var formData = submitter ? createFormDataWithSubmitter(nativeEventTarget, submitter) : new FormData(nativeEventTarget);
                    startHostTransition(
                      maybeTargetInst,
                      {
                        pending: true,
                        data: formData,
                        method: nativeEventTarget.method,
                        action
                      },
                      null,
                      formData
                    );
                  }
                } else
                  "function" === typeof action && (event.preventDefault(), formData = submitter ? createFormDataWithSubmitter(nativeEventTarget, submitter) : new FormData(nativeEventTarget), startHostTransition(
                    maybeTargetInst,
                    {
                      pending: true,
                      data: formData,
                      method: nativeEventTarget.method,
                      action
                    },
                    action,
                    formData
                  ));
              }, "listener"),
              currentTarget: nativeEventTarget
            }
          ]
        });
      }
    }
    __name(extractEvents$1, "extractEvents$1");
    for (var i$jscomp$inline_1528 = 0; i$jscomp$inline_1528 < simpleEventPluginEvents.length; i$jscomp$inline_1528++) {
      var eventName$jscomp$inline_1529 = simpleEventPluginEvents[i$jscomp$inline_1528], domEventName$jscomp$inline_1530 = eventName$jscomp$inline_1529.toLowerCase(), capitalizedEvent$jscomp$inline_1531 = eventName$jscomp$inline_1529[0].toUpperCase() + eventName$jscomp$inline_1529.slice(1);
      registerSimpleEvent(
        domEventName$jscomp$inline_1530,
        "on" + capitalizedEvent$jscomp$inline_1531
      );
    }
    registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
    registerSimpleEvent(ANIMATION_ITERATION, "onAnimationIteration");
    registerSimpleEvent(ANIMATION_START, "onAnimationStart");
    registerSimpleEvent("dblclick", "onDoubleClick");
    registerSimpleEvent("focusin", "onFocus");
    registerSimpleEvent("focusout", "onBlur");
    registerSimpleEvent(TRANSITION_RUN, "onTransitionRun");
    registerSimpleEvent(TRANSITION_START, "onTransitionStart");
    registerSimpleEvent(TRANSITION_CANCEL, "onTransitionCancel");
    registerSimpleEvent(TRANSITION_END, "onTransitionEnd");
    registerDirectEvent("onMouseEnter", ["mouseout", "mouseover"]);
    registerDirectEvent("onMouseLeave", ["mouseout", "mouseover"]);
    registerDirectEvent("onPointerEnter", ["pointerout", "pointerover"]);
    registerDirectEvent("onPointerLeave", ["pointerout", "pointerover"]);
    registerTwoPhaseEvent(
      "onChange",
      "change click focusin focusout input keydown keyup selectionchange".split(" ")
    );
    registerTwoPhaseEvent(
      "onSelect",
      "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(
        " "
      )
    );
    registerTwoPhaseEvent("onBeforeInput", [
      "compositionend",
      "keypress",
      "textInput",
      "paste"
    ]);
    registerTwoPhaseEvent(
      "onCompositionEnd",
      "compositionend focusout keydown keypress keyup mousedown".split(" ")
    );
    registerTwoPhaseEvent(
      "onCompositionStart",
      "compositionstart focusout keydown keypress keyup mousedown".split(" ")
    );
    registerTwoPhaseEvent(
      "onCompositionUpdate",
      "compositionupdate focusout keydown keypress keyup mousedown".split(" ")
    );
    var mediaEventTypes = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(
      " "
    ), nonDelegatedEvents = new Set(
      "beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mediaEventTypes)
    );
    function processDispatchQueue(dispatchQueue, eventSystemFlags) {
      eventSystemFlags = 0 !== (eventSystemFlags & 4);
      for (var i2 = 0; i2 < dispatchQueue.length; i2++) {
        var _dispatchQueue$i = dispatchQueue[i2], event = _dispatchQueue$i.event;
        _dispatchQueue$i = _dispatchQueue$i.listeners;
        a: {
          var previousInstance = void 0;
          if (eventSystemFlags)
            for (var i$jscomp$0 = _dispatchQueue$i.length - 1; 0 <= i$jscomp$0; i$jscomp$0--) {
              var _dispatchListeners$i = _dispatchQueue$i[i$jscomp$0], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget;
              _dispatchListeners$i = _dispatchListeners$i.listener;
              if (instance !== previousInstance && event.isPropagationStopped())
                break a;
              previousInstance = _dispatchListeners$i;
              event.currentTarget = currentTarget;
              try {
                previousInstance(event);
              } catch (error) {
                reportGlobalError(error);
              }
              event.currentTarget = null;
              previousInstance = instance;
            }
          else
            for (i$jscomp$0 = 0; i$jscomp$0 < _dispatchQueue$i.length; i$jscomp$0++) {
              _dispatchListeners$i = _dispatchQueue$i[i$jscomp$0];
              instance = _dispatchListeners$i.instance;
              currentTarget = _dispatchListeners$i.currentTarget;
              _dispatchListeners$i = _dispatchListeners$i.listener;
              if (instance !== previousInstance && event.isPropagationStopped())
                break a;
              previousInstance = _dispatchListeners$i;
              event.currentTarget = currentTarget;
              try {
                previousInstance(event);
              } catch (error) {
                reportGlobalError(error);
              }
              event.currentTarget = null;
              previousInstance = instance;
            }
        }
      }
    }
    __name(processDispatchQueue, "processDispatchQueue");
    function listenToNonDelegatedEvent(domEventName, targetElement) {
      var JSCompiler_inline_result = targetElement[internalEventHandlersKey];
      void 0 === JSCompiler_inline_result && (JSCompiler_inline_result = targetElement[internalEventHandlersKey] = /* @__PURE__ */ new Set());
      var listenerSetKey = domEventName + "__bubble";
      JSCompiler_inline_result.has(listenerSetKey) || (addTrappedEventListener(targetElement, domEventName, 2, false), JSCompiler_inline_result.add(listenerSetKey));
    }
    __name(listenToNonDelegatedEvent, "listenToNonDelegatedEvent");
    function listenToNativeEvent(domEventName, isCapturePhaseListener, target) {
      var eventSystemFlags = 0;
      isCapturePhaseListener && (eventSystemFlags |= 4);
      addTrappedEventListener(
        target,
        domEventName,
        eventSystemFlags,
        isCapturePhaseListener
      );
    }
    __name(listenToNativeEvent, "listenToNativeEvent");
    var listeningMarker = "_reactListening" + Math.random().toString(36).slice(2);
    function listenToAllSupportedEvents(rootContainerElement) {
      if (!rootContainerElement[listeningMarker]) {
        rootContainerElement[listeningMarker] = true;
        allNativeEvents.forEach(function(domEventName) {
          "selectionchange" !== domEventName && (nonDelegatedEvents.has(domEventName) || listenToNativeEvent(domEventName, false, rootContainerElement), listenToNativeEvent(domEventName, true, rootContainerElement));
        });
        var ownerDocument = 9 === rootContainerElement.nodeType ? rootContainerElement : rootContainerElement.ownerDocument;
        null === ownerDocument || ownerDocument[listeningMarker] || (ownerDocument[listeningMarker] = true, listenToNativeEvent("selectionchange", false, ownerDocument));
      }
    }
    __name(listenToAllSupportedEvents, "listenToAllSupportedEvents");
    function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener) {
      switch (getEventPriority(domEventName)) {
        case 2:
          var listenerWrapper = dispatchDiscreteEvent;
          break;
        case 8:
          listenerWrapper = dispatchContinuousEvent;
          break;
        default:
          listenerWrapper = dispatchEvent;
      }
      eventSystemFlags = listenerWrapper.bind(
        null,
        domEventName,
        eventSystemFlags,
        targetContainer
      );
      listenerWrapper = void 0;
      !passiveBrowserEventsSupported || "touchstart" !== domEventName && "touchmove" !== domEventName && "wheel" !== domEventName || (listenerWrapper = true);
      isCapturePhaseListener ? void 0 !== listenerWrapper ? targetContainer.addEventListener(domEventName, eventSystemFlags, {
        capture: true,
        passive: listenerWrapper
      }) : targetContainer.addEventListener(domEventName, eventSystemFlags, true) : void 0 !== listenerWrapper ? targetContainer.addEventListener(domEventName, eventSystemFlags, {
        passive: listenerWrapper
      }) : targetContainer.addEventListener(domEventName, eventSystemFlags, false);
    }
    __name(addTrappedEventListener, "addTrappedEventListener");
    function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst$jscomp$0, targetContainer) {
      var ancestorInst = targetInst$jscomp$0;
      if (0 === (eventSystemFlags & 1) && 0 === (eventSystemFlags & 2) && null !== targetInst$jscomp$0)
        a: for (; ; ) {
          if (null === targetInst$jscomp$0) return;
          var nodeTag = targetInst$jscomp$0.tag;
          if (3 === nodeTag || 4 === nodeTag) {
            var container = targetInst$jscomp$0.stateNode.containerInfo;
            if (container === targetContainer) break;
            if (4 === nodeTag)
              for (nodeTag = targetInst$jscomp$0.return; null !== nodeTag; ) {
                var grandTag = nodeTag.tag;
                if ((3 === grandTag || 4 === grandTag) && nodeTag.stateNode.containerInfo === targetContainer)
                  return;
                nodeTag = nodeTag.return;
              }
            for (; null !== container; ) {
              nodeTag = getClosestInstanceFromNode(container);
              if (null === nodeTag) return;
              grandTag = nodeTag.tag;
              if (5 === grandTag || 6 === grandTag || 26 === grandTag || 27 === grandTag) {
                targetInst$jscomp$0 = ancestorInst = nodeTag;
                continue a;
              }
              container = container.parentNode;
            }
          }
          targetInst$jscomp$0 = targetInst$jscomp$0.return;
        }
      batchedUpdates$1(function() {
        var targetInst = ancestorInst, nativeEventTarget = getEventTarget(nativeEvent), dispatchQueue = [];
        a: {
          var reactName = topLevelEventsToReactNames.get(domEventName);
          if (void 0 !== reactName) {
            var SyntheticEventCtor = SyntheticEvent, reactEventType = domEventName;
            switch (domEventName) {
              case "keypress":
                if (0 === getEventCharCode(nativeEvent)) break a;
              case "keydown":
              case "keyup":
                SyntheticEventCtor = SyntheticKeyboardEvent;
                break;
              case "focusin":
                reactEventType = "focus";
                SyntheticEventCtor = SyntheticFocusEvent;
                break;
              case "focusout":
                reactEventType = "blur";
                SyntheticEventCtor = SyntheticFocusEvent;
                break;
              case "beforeblur":
              case "afterblur":
                SyntheticEventCtor = SyntheticFocusEvent;
                break;
              case "click":
                if (2 === nativeEvent.button) break a;
              case "auxclick":
              case "dblclick":
              case "mousedown":
              case "mousemove":
              case "mouseup":
              case "mouseout":
              case "mouseover":
              case "contextmenu":
                SyntheticEventCtor = SyntheticMouseEvent;
                break;
              case "drag":
              case "dragend":
              case "dragenter":
              case "dragexit":
              case "dragleave":
              case "dragover":
              case "dragstart":
              case "drop":
                SyntheticEventCtor = SyntheticDragEvent;
                break;
              case "touchcancel":
              case "touchend":
              case "touchmove":
              case "touchstart":
                SyntheticEventCtor = SyntheticTouchEvent;
                break;
              case ANIMATION_END:
              case ANIMATION_ITERATION:
              case ANIMATION_START:
                SyntheticEventCtor = SyntheticAnimationEvent;
                break;
              case TRANSITION_END:
                SyntheticEventCtor = SyntheticTransitionEvent;
                break;
              case "scroll":
              case "scrollend":
                SyntheticEventCtor = SyntheticUIEvent;
                break;
              case "wheel":
                SyntheticEventCtor = SyntheticWheelEvent;
                break;
              case "copy":
              case "cut":
              case "paste":
                SyntheticEventCtor = SyntheticClipboardEvent;
                break;
              case "gotpointercapture":
              case "lostpointercapture":
              case "pointercancel":
              case "pointerdown":
              case "pointermove":
              case "pointerout":
              case "pointerover":
              case "pointerup":
                SyntheticEventCtor = SyntheticPointerEvent;
                break;
              case "toggle":
              case "beforetoggle":
                SyntheticEventCtor = SyntheticToggleEvent;
            }
            var inCapturePhase = 0 !== (eventSystemFlags & 4), accumulateTargetOnly = !inCapturePhase && ("scroll" === domEventName || "scrollend" === domEventName), reactEventName = inCapturePhase ? null !== reactName ? reactName + "Capture" : null : reactName;
            inCapturePhase = [];
            for (var instance = targetInst, lastHostComponent; null !== instance; ) {
              var _instance = instance;
              lastHostComponent = _instance.stateNode;
              _instance = _instance.tag;
              5 !== _instance && 26 !== _instance && 27 !== _instance || null === lastHostComponent || null === reactEventName || (_instance = getListener(instance, reactEventName), null != _instance && inCapturePhase.push(
                createDispatchListener(instance, _instance, lastHostComponent)
              ));
              if (accumulateTargetOnly) break;
              instance = instance.return;
            }
            0 < inCapturePhase.length && (reactName = new SyntheticEventCtor(
              reactName,
              reactEventType,
              null,
              nativeEvent,
              nativeEventTarget
            ), dispatchQueue.push({ event: reactName, listeners: inCapturePhase }));
          }
        }
        if (0 === (eventSystemFlags & 7)) {
          a: {
            reactName = "mouseover" === domEventName || "pointerover" === domEventName;
            SyntheticEventCtor = "mouseout" === domEventName || "pointerout" === domEventName;
            if (reactName && nativeEvent !== currentReplayingEvent && (reactEventType = nativeEvent.relatedTarget || nativeEvent.fromElement) && (getClosestInstanceFromNode(reactEventType) || reactEventType[internalContainerInstanceKey]))
              break a;
            if (SyntheticEventCtor || reactName) {
              reactName = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget : (reactName = nativeEventTarget.ownerDocument) ? reactName.defaultView || reactName.parentWindow : window;
              if (SyntheticEventCtor) {
                if (reactEventType = nativeEvent.relatedTarget || nativeEvent.toElement, SyntheticEventCtor = targetInst, reactEventType = reactEventType ? getClosestInstanceFromNode(reactEventType) : null, null !== reactEventType && (accumulateTargetOnly = getNearestMountedFiber(reactEventType), inCapturePhase = reactEventType.tag, reactEventType !== accumulateTargetOnly || 5 !== inCapturePhase && 27 !== inCapturePhase && 6 !== inCapturePhase))
                  reactEventType = null;
              } else SyntheticEventCtor = null, reactEventType = targetInst;
              if (SyntheticEventCtor !== reactEventType) {
                inCapturePhase = SyntheticMouseEvent;
                _instance = "onMouseLeave";
                reactEventName = "onMouseEnter";
                instance = "mouse";
                if ("pointerout" === domEventName || "pointerover" === domEventName)
                  inCapturePhase = SyntheticPointerEvent, _instance = "onPointerLeave", reactEventName = "onPointerEnter", instance = "pointer";
                accumulateTargetOnly = null == SyntheticEventCtor ? reactName : getNodeFromInstance(SyntheticEventCtor);
                lastHostComponent = null == reactEventType ? reactName : getNodeFromInstance(reactEventType);
                reactName = new inCapturePhase(
                  _instance,
                  instance + "leave",
                  SyntheticEventCtor,
                  nativeEvent,
                  nativeEventTarget
                );
                reactName.target = accumulateTargetOnly;
                reactName.relatedTarget = lastHostComponent;
                _instance = null;
                getClosestInstanceFromNode(nativeEventTarget) === targetInst && (inCapturePhase = new inCapturePhase(
                  reactEventName,
                  instance + "enter",
                  reactEventType,
                  nativeEvent,
                  nativeEventTarget
                ), inCapturePhase.target = lastHostComponent, inCapturePhase.relatedTarget = accumulateTargetOnly, _instance = inCapturePhase);
                accumulateTargetOnly = _instance;
                if (SyntheticEventCtor && reactEventType)
                  b: {
                    inCapturePhase = SyntheticEventCtor;
                    reactEventName = reactEventType;
                    instance = 0;
                    for (lastHostComponent = inCapturePhase; lastHostComponent; lastHostComponent = getParent(lastHostComponent))
                      instance++;
                    lastHostComponent = 0;
                    for (_instance = reactEventName; _instance; _instance = getParent(_instance))
                      lastHostComponent++;
                    for (; 0 < instance - lastHostComponent; )
                      inCapturePhase = getParent(inCapturePhase), instance--;
                    for (; 0 < lastHostComponent - instance; )
                      reactEventName = getParent(reactEventName), lastHostComponent--;
                    for (; instance--; ) {
                      if (inCapturePhase === reactEventName || null !== reactEventName && inCapturePhase === reactEventName.alternate)
                        break b;
                      inCapturePhase = getParent(inCapturePhase);
                      reactEventName = getParent(reactEventName);
                    }
                    inCapturePhase = null;
                  }
                else inCapturePhase = null;
                null !== SyntheticEventCtor && accumulateEnterLeaveListenersForEvent(
                  dispatchQueue,
                  reactName,
                  SyntheticEventCtor,
                  inCapturePhase,
                  false
                );
                null !== reactEventType && null !== accumulateTargetOnly && accumulateEnterLeaveListenersForEvent(
                  dispatchQueue,
                  accumulateTargetOnly,
                  reactEventType,
                  inCapturePhase,
                  true
                );
              }
            }
          }
          a: {
            reactName = targetInst ? getNodeFromInstance(targetInst) : window;
            SyntheticEventCtor = reactName.nodeName && reactName.nodeName.toLowerCase();
            if ("select" === SyntheticEventCtor || "input" === SyntheticEventCtor && "file" === reactName.type)
              var getTargetInstFunc = getTargetInstForChangeEvent;
            else if (isTextInputElement(reactName))
              if (isInputEventSupported)
                getTargetInstFunc = getTargetInstForInputOrChangeEvent;
              else {
                getTargetInstFunc = getTargetInstForInputEventPolyfill;
                var handleEventFunc = handleEventsForInputEventPolyfill;
              }
            else
              SyntheticEventCtor = reactName.nodeName, !SyntheticEventCtor || "input" !== SyntheticEventCtor.toLowerCase() || "checkbox" !== reactName.type && "radio" !== reactName.type ? targetInst && isCustomElement(targetInst.elementType) && (getTargetInstFunc = getTargetInstForChangeEvent) : getTargetInstFunc = getTargetInstForClickEvent;
            if (getTargetInstFunc && (getTargetInstFunc = getTargetInstFunc(domEventName, targetInst))) {
              createAndAccumulateChangeEvent(
                dispatchQueue,
                getTargetInstFunc,
                nativeEvent,
                nativeEventTarget
              );
              break a;
            }
            handleEventFunc && handleEventFunc(domEventName, reactName, targetInst);
            "focusout" === domEventName && targetInst && "number" === reactName.type && null != targetInst.memoizedProps.value && setDefaultValue(reactName, "number", reactName.value);
          }
          handleEventFunc = targetInst ? getNodeFromInstance(targetInst) : window;
          switch (domEventName) {
            case "focusin":
              if (isTextInputElement(handleEventFunc) || "true" === handleEventFunc.contentEditable)
                activeElement = handleEventFunc, activeElementInst = targetInst, lastSelection = null;
              break;
            case "focusout":
              lastSelection = activeElementInst = activeElement = null;
              break;
            case "mousedown":
              mouseDown = true;
              break;
            case "contextmenu":
            case "mouseup":
            case "dragend":
              mouseDown = false;
              constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
              break;
            case "selectionchange":
              if (skipSelectionChangeEvent) break;
            case "keydown":
            case "keyup":
              constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);
          }
          var fallbackData;
          if (canUseCompositionEvent)
            b: {
              switch (domEventName) {
                case "compositionstart":
                  var eventType = "onCompositionStart";
                  break b;
                case "compositionend":
                  eventType = "onCompositionEnd";
                  break b;
                case "compositionupdate":
                  eventType = "onCompositionUpdate";
                  break b;
              }
              eventType = void 0;
            }
          else
            isComposing ? isFallbackCompositionEnd(domEventName, nativeEvent) && (eventType = "onCompositionEnd") : "keydown" === domEventName && 229 === nativeEvent.keyCode && (eventType = "onCompositionStart");
          eventType && (useFallbackCompositionData && "ko" !== nativeEvent.locale && (isComposing || "onCompositionStart" !== eventType ? "onCompositionEnd" === eventType && isComposing && (fallbackData = getData()) : (root2 = nativeEventTarget, startText = "value" in root2 ? root2.value : root2.textContent, isComposing = true)), handleEventFunc = accumulateTwoPhaseListeners(targetInst, eventType), 0 < handleEventFunc.length && (eventType = new SyntheticCompositionEvent(
            eventType,
            domEventName,
            null,
            nativeEvent,
            nativeEventTarget
          ), dispatchQueue.push({ event: eventType, listeners: handleEventFunc }), fallbackData ? eventType.data = fallbackData : (fallbackData = getDataFromCustomEvent(nativeEvent), null !== fallbackData && (eventType.data = fallbackData))));
          if (fallbackData = canUseTextInputEvent ? getNativeBeforeInputChars(domEventName, nativeEvent) : getFallbackBeforeInputChars(domEventName, nativeEvent))
            eventType = accumulateTwoPhaseListeners(targetInst, "onBeforeInput"), 0 < eventType.length && (handleEventFunc = new SyntheticCompositionEvent(
              "onBeforeInput",
              "beforeinput",
              null,
              nativeEvent,
              nativeEventTarget
            ), dispatchQueue.push({
              event: handleEventFunc,
              listeners: eventType
            }), handleEventFunc.data = fallbackData);
          extractEvents$1(
            dispatchQueue,
            domEventName,
            targetInst,
            nativeEvent,
            nativeEventTarget
          );
        }
        processDispatchQueue(dispatchQueue, eventSystemFlags);
      });
    }
    __name(dispatchEventForPluginEventSystem, "dispatchEventForPluginEventSystem");
    function createDispatchListener(instance, listener, currentTarget) {
      return {
        instance,
        listener,
        currentTarget
      };
    }
    __name(createDispatchListener, "createDispatchListener");
    function accumulateTwoPhaseListeners(targetFiber, reactName) {
      for (var captureName = reactName + "Capture", listeners = []; null !== targetFiber; ) {
        var _instance2 = targetFiber, stateNode = _instance2.stateNode;
        _instance2 = _instance2.tag;
        5 !== _instance2 && 26 !== _instance2 && 27 !== _instance2 || null === stateNode || (_instance2 = getListener(targetFiber, captureName), null != _instance2 && listeners.unshift(
          createDispatchListener(targetFiber, _instance2, stateNode)
        ), _instance2 = getListener(targetFiber, reactName), null != _instance2 && listeners.push(
          createDispatchListener(targetFiber, _instance2, stateNode)
        ));
        if (3 === targetFiber.tag) return listeners;
        targetFiber = targetFiber.return;
      }
      return [];
    }
    __name(accumulateTwoPhaseListeners, "accumulateTwoPhaseListeners");
    function getParent(inst) {
      if (null === inst) return null;
      do
        inst = inst.return;
      while (inst && 5 !== inst.tag && 27 !== inst.tag);
      return inst ? inst : null;
    }
    __name(getParent, "getParent");
    function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common2, inCapturePhase) {
      for (var registrationName = event._reactName, listeners = []; null !== target && target !== common2; ) {
        var _instance3 = target, alternate = _instance3.alternate, stateNode = _instance3.stateNode;
        _instance3 = _instance3.tag;
        if (null !== alternate && alternate === common2) break;
        5 !== _instance3 && 26 !== _instance3 && 27 !== _instance3 || null === stateNode || (alternate = stateNode, inCapturePhase ? (stateNode = getListener(target, registrationName), null != stateNode && listeners.unshift(
          createDispatchListener(target, stateNode, alternate)
        )) : inCapturePhase || (stateNode = getListener(target, registrationName), null != stateNode && listeners.push(
          createDispatchListener(target, stateNode, alternate)
        )));
        target = target.return;
      }
      0 !== listeners.length && dispatchQueue.push({ event, listeners });
    }
    __name(accumulateEnterLeaveListenersForEvent, "accumulateEnterLeaveListenersForEvent");
    var NORMALIZE_NEWLINES_REGEX = /\r\n?/g, NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
    function normalizeMarkupForTextOrAttribute(markup) {
      return ("string" === typeof markup ? markup : "" + markup).replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
    }
    __name(normalizeMarkupForTextOrAttribute, "normalizeMarkupForTextOrAttribute");
    function checkForUnmatchedText(serverText, clientText) {
      clientText = normalizeMarkupForTextOrAttribute(clientText);
      return normalizeMarkupForTextOrAttribute(serverText) === clientText ? true : false;
    }
    __name(checkForUnmatchedText, "checkForUnmatchedText");
    function noop$12() {
    }
    __name(noop$12, "noop$1");
    function setProp(domElement, tag, key, value, props, prevValue) {
      switch (key) {
        case "children":
          "string" === typeof value ? "body" === tag || "textarea" === tag && "" === value || setTextContent(domElement, value) : ("number" === typeof value || "bigint" === typeof value) && "body" !== tag && setTextContent(domElement, "" + value);
          break;
        case "className":
          setValueForKnownAttribute(domElement, "class", value);
          break;
        case "tabIndex":
          setValueForKnownAttribute(domElement, "tabindex", value);
          break;
        case "dir":
        case "role":
        case "viewBox":
        case "width":
        case "height":
          setValueForKnownAttribute(domElement, key, value);
          break;
        case "style":
          setValueForStyles(domElement, value, prevValue);
          break;
        case "data":
          if ("object" !== tag) {
            setValueForKnownAttribute(domElement, "data", value);
            break;
          }
        case "src":
        case "href":
          if ("" === value && ("a" !== tag || "href" !== key)) {
            domElement.removeAttribute(key);
            break;
          }
          if (null == value || "function" === typeof value || "symbol" === typeof value || "boolean" === typeof value) {
            domElement.removeAttribute(key);
            break;
          }
          value = sanitizeURL("" + value);
          domElement.setAttribute(key, value);
          break;
        case "action":
        case "formAction":
          if ("function" === typeof value) {
            domElement.setAttribute(
              key,
              "javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')"
            );
            break;
          } else
            "function" === typeof prevValue && ("formAction" === key ? ("input" !== tag && setProp(domElement, tag, "name", props.name, props, null), setProp(
              domElement,
              tag,
              "formEncType",
              props.formEncType,
              props,
              null
            ), setProp(
              domElement,
              tag,
              "formMethod",
              props.formMethod,
              props,
              null
            ), setProp(
              domElement,
              tag,
              "formTarget",
              props.formTarget,
              props,
              null
            )) : (setProp(domElement, tag, "encType", props.encType, props, null), setProp(domElement, tag, "method", props.method, props, null), setProp(domElement, tag, "target", props.target, props, null)));
          if (null == value || "symbol" === typeof value || "boolean" === typeof value) {
            domElement.removeAttribute(key);
            break;
          }
          value = sanitizeURL("" + value);
          domElement.setAttribute(key, value);
          break;
        case "onClick":
          null != value && (domElement.onclick = noop$12);
          break;
        case "onScroll":
          null != value && listenToNonDelegatedEvent("scroll", domElement);
          break;
        case "onScrollEnd":
          null != value && listenToNonDelegatedEvent("scrollend", domElement);
          break;
        case "dangerouslySetInnerHTML":
          if (null != value) {
            if ("object" !== typeof value || !("__html" in value))
              throw Error(formatProdErrorMessage(61));
            key = value.__html;
            if (null != key) {
              if (null != props.children) throw Error(formatProdErrorMessage(60));
              domElement.innerHTML = key;
            }
          }
          break;
        case "multiple":
          domElement.multiple = value && "function" !== typeof value && "symbol" !== typeof value;
          break;
        case "muted":
          domElement.muted = value && "function" !== typeof value && "symbol" !== typeof value;
          break;
        case "suppressContentEditableWarning":
        case "suppressHydrationWarning":
        case "defaultValue":
        case "defaultChecked":
        case "innerHTML":
        case "ref":
          break;
        case "autoFocus":
          break;
        case "xlinkHref":
          if (null == value || "function" === typeof value || "boolean" === typeof value || "symbol" === typeof value) {
            domElement.removeAttribute("xlink:href");
            break;
          }
          key = sanitizeURL("" + value);
          domElement.setAttributeNS(
            "http://www.w3.org/1999/xlink",
            "xlink:href",
            key
          );
          break;
        case "contentEditable":
        case "spellCheck":
        case "draggable":
        case "value":
        case "autoReverse":
        case "externalResourcesRequired":
        case "focusable":
        case "preserveAlpha":
          null != value && "function" !== typeof value && "symbol" !== typeof value ? domElement.setAttribute(key, "" + value) : domElement.removeAttribute(key);
          break;
        case "inert":
        case "allowFullScreen":
        case "async":
        case "autoPlay":
        case "controls":
        case "default":
        case "defer":
        case "disabled":
        case "disablePictureInPicture":
        case "disableRemotePlayback":
        case "formNoValidate":
        case "hidden":
        case "loop":
        case "noModule":
        case "noValidate":
        case "open":
        case "playsInline":
        case "readOnly":
        case "required":
        case "reversed":
        case "scoped":
        case "seamless":
        case "itemScope":
          value && "function" !== typeof value && "symbol" !== typeof value ? domElement.setAttribute(key, "") : domElement.removeAttribute(key);
          break;
        case "capture":
        case "download":
          true === value ? domElement.setAttribute(key, "") : false !== value && null != value && "function" !== typeof value && "symbol" !== typeof value ? domElement.setAttribute(key, value) : domElement.removeAttribute(key);
          break;
        case "cols":
        case "rows":
        case "size":
        case "span":
          null != value && "function" !== typeof value && "symbol" !== typeof value && !isNaN(value) && 1 <= value ? domElement.setAttribute(key, value) : domElement.removeAttribute(key);
          break;
        case "rowSpan":
        case "start":
          null == value || "function" === typeof value || "symbol" === typeof value || isNaN(value) ? domElement.removeAttribute(key) : domElement.setAttribute(key, value);
          break;
        case "popover":
          listenToNonDelegatedEvent("beforetoggle", domElement);
          listenToNonDelegatedEvent("toggle", domElement);
          setValueForAttribute(domElement, "popover", value);
          break;
        case "xlinkActuate":
          setValueForNamespacedAttribute(
            domElement,
            "http://www.w3.org/1999/xlink",
            "xlink:actuate",
            value
          );
          break;
        case "xlinkArcrole":
          setValueForNamespacedAttribute(
            domElement,
            "http://www.w3.org/1999/xlink",
            "xlink:arcrole",
            value
          );
          break;
        case "xlinkRole":
          setValueForNamespacedAttribute(
            domElement,
            "http://www.w3.org/1999/xlink",
            "xlink:role",
            value
          );
          break;
        case "xlinkShow":
          setValueForNamespacedAttribute(
            domElement,
            "http://www.w3.org/1999/xlink",
            "xlink:show",
            value
          );
          break;
        case "xlinkTitle":
          setValueForNamespacedAttribute(
            domElement,
            "http://www.w3.org/1999/xlink",
            "xlink:title",
            value
          );
          break;
        case "xlinkType":
          setValueForNamespacedAttribute(
            domElement,
            "http://www.w3.org/1999/xlink",
            "xlink:type",
            value
          );
          break;
        case "xmlBase":
          setValueForNamespacedAttribute(
            domElement,
            "http://www.w3.org/XML/1998/namespace",
            "xml:base",
            value
          );
          break;
        case "xmlLang":
          setValueForNamespacedAttribute(
            domElement,
            "http://www.w3.org/XML/1998/namespace",
            "xml:lang",
            value
          );
          break;
        case "xmlSpace":
          setValueForNamespacedAttribute(
            domElement,
            "http://www.w3.org/XML/1998/namespace",
            "xml:space",
            value
          );
          break;
        case "is":
          setValueForAttribute(domElement, "is", value);
          break;
        case "innerText":
        case "textContent":
          break;
        default:
          if (!(2 < key.length) || "o" !== key[0] && "O" !== key[0] || "n" !== key[1] && "N" !== key[1])
            key = aliases.get(key) || key, setValueForAttribute(domElement, key, value);
      }
    }
    __name(setProp, "setProp");
    function setPropOnCustomElement(domElement, tag, key, value, props, prevValue) {
      switch (key) {
        case "style":
          setValueForStyles(domElement, value, prevValue);
          break;
        case "dangerouslySetInnerHTML":
          if (null != value) {
            if ("object" !== typeof value || !("__html" in value))
              throw Error(formatProdErrorMessage(61));
            key = value.__html;
            if (null != key) {
              if (null != props.children) throw Error(formatProdErrorMessage(60));
              domElement.innerHTML = key;
            }
          }
          break;
        case "children":
          "string" === typeof value ? setTextContent(domElement, value) : ("number" === typeof value || "bigint" === typeof value) && setTextContent(domElement, "" + value);
          break;
        case "onScroll":
          null != value && listenToNonDelegatedEvent("scroll", domElement);
          break;
        case "onScrollEnd":
          null != value && listenToNonDelegatedEvent("scrollend", domElement);
          break;
        case "onClick":
          null != value && (domElement.onclick = noop$12);
          break;
        case "suppressContentEditableWarning":
        case "suppressHydrationWarning":
        case "innerHTML":
        case "ref":
          break;
        case "innerText":
        case "textContent":
          break;
        default:
          if (!registrationNameDependencies.hasOwnProperty(key))
            a: {
              if ("o" === key[0] && "n" === key[1] && (props = key.endsWith("Capture"), tag = key.slice(2, props ? key.length - 7 : void 0), prevValue = domElement[internalPropsKey] || null, prevValue = null != prevValue ? prevValue[key] : null, "function" === typeof prevValue && domElement.removeEventListener(tag, prevValue, props), "function" === typeof value)) {
                "function" !== typeof prevValue && null !== prevValue && (key in domElement ? domElement[key] = null : domElement.hasAttribute(key) && domElement.removeAttribute(key));
                domElement.addEventListener(tag, value, props);
                break a;
              }
              key in domElement ? domElement[key] = value : true === value ? domElement.setAttribute(key, "") : setValueForAttribute(domElement, key, value);
            }
      }
    }
    __name(setPropOnCustomElement, "setPropOnCustomElement");
    function setInitialProperties(domElement, tag, props) {
      switch (tag) {
        case "div":
        case "span":
        case "svg":
        case "path":
        case "a":
        case "g":
        case "p":
        case "li":
          break;
        case "img":
          listenToNonDelegatedEvent("error", domElement);
          listenToNonDelegatedEvent("load", domElement);
          var hasSrc = false, hasSrcSet = false, propKey;
          for (propKey in props)
            if (props.hasOwnProperty(propKey)) {
              var propValue = props[propKey];
              if (null != propValue)
                switch (propKey) {
                  case "src":
                    hasSrc = true;
                    break;
                  case "srcSet":
                    hasSrcSet = true;
                    break;
                  case "children":
                  case "dangerouslySetInnerHTML":
                    throw Error(formatProdErrorMessage(137, tag));
                  default:
                    setProp(domElement, tag, propKey, propValue, props, null);
                }
            }
          hasSrcSet && setProp(domElement, tag, "srcSet", props.srcSet, props, null);
          hasSrc && setProp(domElement, tag, "src", props.src, props, null);
          return;
        case "input":
          listenToNonDelegatedEvent("invalid", domElement);
          var defaultValue = propKey = propValue = hasSrcSet = null, checked = null, defaultChecked = null;
          for (hasSrc in props)
            if (props.hasOwnProperty(hasSrc)) {
              var propValue$188 = props[hasSrc];
              if (null != propValue$188)
                switch (hasSrc) {
                  case "name":
                    hasSrcSet = propValue$188;
                    break;
                  case "type":
                    propValue = propValue$188;
                    break;
                  case "checked":
                    checked = propValue$188;
                    break;
                  case "defaultChecked":
                    defaultChecked = propValue$188;
                    break;
                  case "value":
                    propKey = propValue$188;
                    break;
                  case "defaultValue":
                    defaultValue = propValue$188;
                    break;
                  case "children":
                  case "dangerouslySetInnerHTML":
                    if (null != propValue$188)
                      throw Error(formatProdErrorMessage(137, tag));
                    break;
                  default:
                    setProp(domElement, tag, hasSrc, propValue$188, props, null);
                }
            }
          initInput(
            domElement,
            propKey,
            defaultValue,
            checked,
            defaultChecked,
            propValue,
            hasSrcSet,
            false
          );
          track(domElement);
          return;
        case "select":
          listenToNonDelegatedEvent("invalid", domElement);
          hasSrc = propValue = propKey = null;
          for (hasSrcSet in props)
            if (props.hasOwnProperty(hasSrcSet) && (defaultValue = props[hasSrcSet], null != defaultValue))
              switch (hasSrcSet) {
                case "value":
                  propKey = defaultValue;
                  break;
                case "defaultValue":
                  propValue = defaultValue;
                  break;
                case "multiple":
                  hasSrc = defaultValue;
                default:
                  setProp(domElement, tag, hasSrcSet, defaultValue, props, null);
              }
          tag = propKey;
          props = propValue;
          domElement.multiple = !!hasSrc;
          null != tag ? updateOptions(domElement, !!hasSrc, tag, false) : null != props && updateOptions(domElement, !!hasSrc, props, true);
          return;
        case "textarea":
          listenToNonDelegatedEvent("invalid", domElement);
          propKey = hasSrcSet = hasSrc = null;
          for (propValue in props)
            if (props.hasOwnProperty(propValue) && (defaultValue = props[propValue], null != defaultValue))
              switch (propValue) {
                case "value":
                  hasSrc = defaultValue;
                  break;
                case "defaultValue":
                  hasSrcSet = defaultValue;
                  break;
                case "children":
                  propKey = defaultValue;
                  break;
                case "dangerouslySetInnerHTML":
                  if (null != defaultValue) throw Error(formatProdErrorMessage(91));
                  break;
                default:
                  setProp(domElement, tag, propValue, defaultValue, props, null);
              }
          initTextarea(domElement, hasSrc, hasSrcSet, propKey);
          track(domElement);
          return;
        case "option":
          for (checked in props)
            if (props.hasOwnProperty(checked) && (hasSrc = props[checked], null != hasSrc))
              switch (checked) {
                case "selected":
                  domElement.selected = hasSrc && "function" !== typeof hasSrc && "symbol" !== typeof hasSrc;
                  break;
                default:
                  setProp(domElement, tag, checked, hasSrc, props, null);
              }
          return;
        case "dialog":
          listenToNonDelegatedEvent("beforetoggle", domElement);
          listenToNonDelegatedEvent("toggle", domElement);
          listenToNonDelegatedEvent("cancel", domElement);
          listenToNonDelegatedEvent("close", domElement);
          break;
        case "iframe":
        case "object":
          listenToNonDelegatedEvent("load", domElement);
          break;
        case "video":
        case "audio":
          for (hasSrc = 0; hasSrc < mediaEventTypes.length; hasSrc++)
            listenToNonDelegatedEvent(mediaEventTypes[hasSrc], domElement);
          break;
        case "image":
          listenToNonDelegatedEvent("error", domElement);
          listenToNonDelegatedEvent("load", domElement);
          break;
        case "details":
          listenToNonDelegatedEvent("toggle", domElement);
          break;
        case "embed":
        case "source":
        case "link":
          listenToNonDelegatedEvent("error", domElement), listenToNonDelegatedEvent("load", domElement);
        case "area":
        case "base":
        case "br":
        case "col":
        case "hr":
        case "keygen":
        case "meta":
        case "param":
        case "track":
        case "wbr":
        case "menuitem":
          for (defaultChecked in props)
            if (props.hasOwnProperty(defaultChecked) && (hasSrc = props[defaultChecked], null != hasSrc))
              switch (defaultChecked) {
                case "children":
                case "dangerouslySetInnerHTML":
                  throw Error(formatProdErrorMessage(137, tag));
                default:
                  setProp(domElement, tag, defaultChecked, hasSrc, props, null);
              }
          return;
        default:
          if (isCustomElement(tag)) {
            for (propValue$188 in props)
              props.hasOwnProperty(propValue$188) && (hasSrc = props[propValue$188], void 0 !== hasSrc && setPropOnCustomElement(
                domElement,
                tag,
                propValue$188,
                hasSrc,
                props,
                void 0
              ));
            return;
          }
      }
      for (defaultValue in props)
        props.hasOwnProperty(defaultValue) && (hasSrc = props[defaultValue], null != hasSrc && setProp(domElement, tag, defaultValue, hasSrc, props, null));
    }
    __name(setInitialProperties, "setInitialProperties");
    function updateProperties(domElement, tag, lastProps, nextProps) {
      switch (tag) {
        case "div":
        case "span":
        case "svg":
        case "path":
        case "a":
        case "g":
        case "p":
        case "li":
          break;
        case "input":
          var name = null, type = null, value = null, defaultValue = null, lastDefaultValue = null, checked = null, defaultChecked = null;
          for (propKey in lastProps) {
            var lastProp = lastProps[propKey];
            if (lastProps.hasOwnProperty(propKey) && null != lastProp)
              switch (propKey) {
                case "checked":
                  break;
                case "value":
                  break;
                case "defaultValue":
                  lastDefaultValue = lastProp;
                default:
                  nextProps.hasOwnProperty(propKey) || setProp(domElement, tag, propKey, null, nextProps, lastProp);
              }
          }
          for (var propKey$205 in nextProps) {
            var propKey = nextProps[propKey$205];
            lastProp = lastProps[propKey$205];
            if (nextProps.hasOwnProperty(propKey$205) && (null != propKey || null != lastProp))
              switch (propKey$205) {
                case "type":
                  type = propKey;
                  break;
                case "name":
                  name = propKey;
                  break;
                case "checked":
                  checked = propKey;
                  break;
                case "defaultChecked":
                  defaultChecked = propKey;
                  break;
                case "value":
                  value = propKey;
                  break;
                case "defaultValue":
                  defaultValue = propKey;
                  break;
                case "children":
                case "dangerouslySetInnerHTML":
                  if (null != propKey)
                    throw Error(formatProdErrorMessage(137, tag));
                  break;
                default:
                  propKey !== lastProp && setProp(
                    domElement,
                    tag,
                    propKey$205,
                    propKey,
                    nextProps,
                    lastProp
                  );
              }
          }
          updateInput(
            domElement,
            value,
            defaultValue,
            lastDefaultValue,
            checked,
            defaultChecked,
            type,
            name
          );
          return;
        case "select":
          propKey = value = defaultValue = propKey$205 = null;
          for (type in lastProps)
            if (lastDefaultValue = lastProps[type], lastProps.hasOwnProperty(type) && null != lastDefaultValue)
              switch (type) {
                case "value":
                  break;
                case "multiple":
                  propKey = lastDefaultValue;
                default:
                  nextProps.hasOwnProperty(type) || setProp(
                    domElement,
                    tag,
                    type,
                    null,
                    nextProps,
                    lastDefaultValue
                  );
              }
          for (name in nextProps)
            if (type = nextProps[name], lastDefaultValue = lastProps[name], nextProps.hasOwnProperty(name) && (null != type || null != lastDefaultValue))
              switch (name) {
                case "value":
                  propKey$205 = type;
                  break;
                case "defaultValue":
                  defaultValue = type;
                  break;
                case "multiple":
                  value = type;
                default:
                  type !== lastDefaultValue && setProp(
                    domElement,
                    tag,
                    name,
                    type,
                    nextProps,
                    lastDefaultValue
                  );
              }
          tag = defaultValue;
          lastProps = value;
          nextProps = propKey;
          null != propKey$205 ? updateOptions(domElement, !!lastProps, propKey$205, false) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, true) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", false));
          return;
        case "textarea":
          propKey = propKey$205 = null;
          for (defaultValue in lastProps)
            if (name = lastProps[defaultValue], lastProps.hasOwnProperty(defaultValue) && null != name && !nextProps.hasOwnProperty(defaultValue))
              switch (defaultValue) {
                case "value":
                  break;
                case "children":
                  break;
                default:
                  setProp(domElement, tag, defaultValue, null, nextProps, name);
              }
          for (value in nextProps)
            if (name = nextProps[value], type = lastProps[value], nextProps.hasOwnProperty(value) && (null != name || null != type))
              switch (value) {
                case "value":
                  propKey$205 = name;
                  break;
                case "defaultValue":
                  propKey = name;
                  break;
                case "children":
                  break;
                case "dangerouslySetInnerHTML":
                  if (null != name) throw Error(formatProdErrorMessage(91));
                  break;
                default:
                  name !== type && setProp(domElement, tag, value, name, nextProps, type);
              }
          updateTextarea(domElement, propKey$205, propKey);
          return;
        case "option":
          for (var propKey$221 in lastProps)
            if (propKey$205 = lastProps[propKey$221], lastProps.hasOwnProperty(propKey$221) && null != propKey$205 && !nextProps.hasOwnProperty(propKey$221))
              switch (propKey$221) {
                case "selected":
                  domElement.selected = false;
                  break;
                default:
                  setProp(
                    domElement,
                    tag,
                    propKey$221,
                    null,
                    nextProps,
                    propKey$205
                  );
              }
          for (lastDefaultValue in nextProps)
            if (propKey$205 = nextProps[lastDefaultValue], propKey = lastProps[lastDefaultValue], nextProps.hasOwnProperty(lastDefaultValue) && propKey$205 !== propKey && (null != propKey$205 || null != propKey))
              switch (lastDefaultValue) {
                case "selected":
                  domElement.selected = propKey$205 && "function" !== typeof propKey$205 && "symbol" !== typeof propKey$205;
                  break;
                default:
                  setProp(
                    domElement,
                    tag,
                    lastDefaultValue,
                    propKey$205,
                    nextProps,
                    propKey
                  );
              }
          return;
        case "img":
        case "link":
        case "area":
        case "base":
        case "br":
        case "col":
        case "embed":
        case "hr":
        case "keygen":
        case "meta":
        case "param":
        case "source":
        case "track":
        case "wbr":
        case "menuitem":
          for (var propKey$226 in lastProps)
            propKey$205 = lastProps[propKey$226], lastProps.hasOwnProperty(propKey$226) && null != propKey$205 && !nextProps.hasOwnProperty(propKey$226) && setProp(domElement, tag, propKey$226, null, nextProps, propKey$205);
          for (checked in nextProps)
            if (propKey$205 = nextProps[checked], propKey = lastProps[checked], nextProps.hasOwnProperty(checked) && propKey$205 !== propKey && (null != propKey$205 || null != propKey))
              switch (checked) {
                case "children":
                case "dangerouslySetInnerHTML":
                  if (null != propKey$205)
                    throw Error(formatProdErrorMessage(137, tag));
                  break;
                default:
                  setProp(
                    domElement,
                    tag,
                    checked,
                    propKey$205,
                    nextProps,
                    propKey
                  );
              }
          return;
        default:
          if (isCustomElement(tag)) {
            for (var propKey$231 in lastProps)
              propKey$205 = lastProps[propKey$231], lastProps.hasOwnProperty(propKey$231) && void 0 !== propKey$205 && !nextProps.hasOwnProperty(propKey$231) && setPropOnCustomElement(
                domElement,
                tag,
                propKey$231,
                void 0,
                nextProps,
                propKey$205
              );
            for (defaultChecked in nextProps)
              propKey$205 = nextProps[defaultChecked], propKey = lastProps[defaultChecked], !nextProps.hasOwnProperty(defaultChecked) || propKey$205 === propKey || void 0 === propKey$205 && void 0 === propKey || setPropOnCustomElement(
                domElement,
                tag,
                defaultChecked,
                propKey$205,
                nextProps,
                propKey
              );
            return;
          }
      }
      for (var propKey$236 in lastProps)
        propKey$205 = lastProps[propKey$236], lastProps.hasOwnProperty(propKey$236) && null != propKey$205 && !nextProps.hasOwnProperty(propKey$236) && setProp(domElement, tag, propKey$236, null, nextProps, propKey$205);
      for (lastProp in nextProps)
        propKey$205 = nextProps[lastProp], propKey = lastProps[lastProp], !nextProps.hasOwnProperty(lastProp) || propKey$205 === propKey || null == propKey$205 && null == propKey || setProp(domElement, tag, lastProp, propKey$205, nextProps, propKey);
    }
    __name(updateProperties, "updateProperties");
    var eventsEnabled = null, selectionInformation = null;
    function getOwnerDocumentFromRootContainer(rootContainerElement) {
      return 9 === rootContainerElement.nodeType ? rootContainerElement : rootContainerElement.ownerDocument;
    }
    __name(getOwnerDocumentFromRootContainer, "getOwnerDocumentFromRootContainer");
    function getOwnHostContext(namespaceURI) {
      switch (namespaceURI) {
        case "http://www.w3.org/2000/svg":
          return 1;
        case "http://www.w3.org/1998/Math/MathML":
          return 2;
        default:
          return 0;
      }
    }
    __name(getOwnHostContext, "getOwnHostContext");
    function getChildHostContextProd(parentNamespace, type) {
      if (0 === parentNamespace)
        switch (type) {
          case "svg":
            return 1;
          case "math":
            return 2;
          default:
            return 0;
        }
      return 1 === parentNamespace && "foreignObject" === type ? 0 : parentNamespace;
    }
    __name(getChildHostContextProd, "getChildHostContextProd");
    function shouldSetTextContent(type, props) {
      return "textarea" === type || "noscript" === type || "string" === typeof props.children || "number" === typeof props.children || "bigint" === typeof props.children || "object" === typeof props.dangerouslySetInnerHTML && null !== props.dangerouslySetInnerHTML && null != props.dangerouslySetInnerHTML.__html;
    }
    __name(shouldSetTextContent, "shouldSetTextContent");
    var currentPopstateTransitionEvent = null;
    function shouldAttemptEagerTransition() {
      var event = window.event;
      if (event && "popstate" === event.type) {
        if (event === currentPopstateTransitionEvent) return false;
        currentPopstateTransitionEvent = event;
        return true;
      }
      currentPopstateTransitionEvent = null;
      return false;
    }
    __name(shouldAttemptEagerTransition, "shouldAttemptEagerTransition");
    var scheduleTimeout = "function" === typeof setTimeout ? setTimeout : void 0, cancelTimeout = "function" === typeof clearTimeout ? clearTimeout : void 0, localPromise = "function" === typeof Promise ? Promise : void 0, scheduleMicrotask = "function" === typeof queueMicrotask ? queueMicrotask : "undefined" !== typeof localPromise ? function(callback) {
      return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick);
    } : scheduleTimeout;
    function handleErrorInNextTick(error) {
      setTimeout(function() {
        throw error;
      });
    }
    __name(handleErrorInNextTick, "handleErrorInNextTick");
    function isSingletonScope(type) {
      return "head" === type;
    }
    __name(isSingletonScope, "isSingletonScope");
    function clearSuspenseBoundary(parentInstance, suspenseInstance) {
      var node = suspenseInstance, possiblePreambleContribution = 0, depth = 0;
      do {
        var nextNode = node.nextSibling;
        parentInstance.removeChild(node);
        if (nextNode && 8 === nextNode.nodeType)
          if (node = nextNode.data, "/$" === node) {
            if (0 < possiblePreambleContribution && 8 > possiblePreambleContribution) {
              node = possiblePreambleContribution;
              var ownerDocument = parentInstance.ownerDocument;
              node & 1 && releaseSingletonInstance(ownerDocument.documentElement);
              node & 2 && releaseSingletonInstance(ownerDocument.body);
              if (node & 4)
                for (node = ownerDocument.head, releaseSingletonInstance(node), ownerDocument = node.firstChild; ownerDocument; ) {
                  var nextNode$jscomp$0 = ownerDocument.nextSibling, nodeName = ownerDocument.nodeName;
                  ownerDocument[internalHoistableMarker] || "SCRIPT" === nodeName || "STYLE" === nodeName || "LINK" === nodeName && "stylesheet" === ownerDocument.rel.toLowerCase() || node.removeChild(ownerDocument);
                  ownerDocument = nextNode$jscomp$0;
                }
            }
            if (0 === depth) {
              parentInstance.removeChild(nextNode);
              retryIfBlockedOn(suspenseInstance);
              return;
            }
            depth--;
          } else
            "$" === node || "$?" === node || "$!" === node ? depth++ : possiblePreambleContribution = node.charCodeAt(0) - 48;
        else possiblePreambleContribution = 0;
        node = nextNode;
      } while (node);
      retryIfBlockedOn(suspenseInstance);
    }
    __name(clearSuspenseBoundary, "clearSuspenseBoundary");
    function clearContainerSparingly(container) {
      var nextNode = container.firstChild;
      nextNode && 10 === nextNode.nodeType && (nextNode = nextNode.nextSibling);
      for (; nextNode; ) {
        var node = nextNode;
        nextNode = nextNode.nextSibling;
        switch (node.nodeName) {
          case "HTML":
          case "HEAD":
          case "BODY":
            clearContainerSparingly(node);
            detachDeletedInstance(node);
            continue;
          case "SCRIPT":
          case "STYLE":
            continue;
          case "LINK":
            if ("stylesheet" === node.rel.toLowerCase()) continue;
        }
        container.removeChild(node);
      }
    }
    __name(clearContainerSparingly, "clearContainerSparingly");
    function canHydrateInstance(instance, type, props, inRootOrSingleton) {
      for (; 1 === instance.nodeType; ) {
        var anyProps = props;
        if (instance.nodeName.toLowerCase() !== type.toLowerCase()) {
          if (!inRootOrSingleton && ("INPUT" !== instance.nodeName || "hidden" !== instance.type))
            break;
        } else if (!inRootOrSingleton)
          if ("input" === type && "hidden" === instance.type) {
            var name = null == anyProps.name ? null : "" + anyProps.name;
            if ("hidden" === anyProps.type && instance.getAttribute("name") === name)
              return instance;
          } else return instance;
        else if (!instance[internalHoistableMarker])
          switch (type) {
            case "meta":
              if (!instance.hasAttribute("itemprop")) break;
              return instance;
            case "link":
              name = instance.getAttribute("rel");
              if ("stylesheet" === name && instance.hasAttribute("data-precedence"))
                break;
              else if (name !== anyProps.rel || instance.getAttribute("href") !== (null == anyProps.href || "" === anyProps.href ? null : anyProps.href) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin) || instance.getAttribute("title") !== (null == anyProps.title ? null : anyProps.title))
                break;
              return instance;
            case "style":
              if (instance.hasAttribute("data-precedence")) break;
              return instance;
            case "script":
              name = instance.getAttribute("src");
              if ((name !== (null == anyProps.src ? null : anyProps.src) || instance.getAttribute("type") !== (null == anyProps.type ? null : anyProps.type) || instance.getAttribute("crossorigin") !== (null == anyProps.crossOrigin ? null : anyProps.crossOrigin)) && name && instance.hasAttribute("async") && !instance.hasAttribute("itemprop"))
                break;
              return instance;
            default:
              return instance;
          }
        instance = getNextHydratable(instance.nextSibling);
        if (null === instance) break;
      }
      return null;
    }
    __name(canHydrateInstance, "canHydrateInstance");
    function canHydrateTextInstance(instance, text, inRootOrSingleton) {
      if ("" === text) return null;
      for (; 3 !== instance.nodeType; ) {
        if ((1 !== instance.nodeType || "INPUT" !== instance.nodeName || "hidden" !== instance.type) && !inRootOrSingleton)
          return null;
        instance = getNextHydratable(instance.nextSibling);
        if (null === instance) return null;
      }
      return instance;
    }
    __name(canHydrateTextInstance, "canHydrateTextInstance");
    function isSuspenseInstanceFallback(instance) {
      return "$!" === instance.data || "$?" === instance.data && "complete" === instance.ownerDocument.readyState;
    }
    __name(isSuspenseInstanceFallback, "isSuspenseInstanceFallback");
    function registerSuspenseInstanceRetry(instance, callback) {
      var ownerDocument = instance.ownerDocument;
      if ("$?" !== instance.data || "complete" === ownerDocument.readyState)
        callback();
      else {
        var listener = /* @__PURE__ */ __name(function() {
          callback();
          ownerDocument.removeEventListener("DOMContentLoaded", listener);
        }, "listener");
        ownerDocument.addEventListener("DOMContentLoaded", listener);
        instance._reactRetry = listener;
      }
    }
    __name(registerSuspenseInstanceRetry, "registerSuspenseInstanceRetry");
    function getNextHydratable(node) {
      for (; null != node; node = node.nextSibling) {
        var nodeType = node.nodeType;
        if (1 === nodeType || 3 === nodeType) break;
        if (8 === nodeType) {
          nodeType = node.data;
          if ("$" === nodeType || "$!" === nodeType || "$?" === nodeType || "F!" === nodeType || "F" === nodeType)
            break;
          if ("/$" === nodeType) return null;
        }
      }
      return node;
    }
    __name(getNextHydratable, "getNextHydratable");
    var previousHydratableOnEnteringScopedSingleton = null;
    function getParentSuspenseInstance(targetInstance) {
      targetInstance = targetInstance.previousSibling;
      for (var depth = 0; targetInstance; ) {
        if (8 === targetInstance.nodeType) {
          var data = targetInstance.data;
          if ("$" === data || "$!" === data || "$?" === data) {
            if (0 === depth) return targetInstance;
            depth--;
          } else "/$" === data && depth++;
        }
        targetInstance = targetInstance.previousSibling;
      }
      return null;
    }
    __name(getParentSuspenseInstance, "getParentSuspenseInstance");
    function resolveSingletonInstance(type, props, rootContainerInstance) {
      props = getOwnerDocumentFromRootContainer(rootContainerInstance);
      switch (type) {
        case "html":
          type = props.documentElement;
          if (!type) throw Error(formatProdErrorMessage(452));
          return type;
        case "head":
          type = props.head;
          if (!type) throw Error(formatProdErrorMessage(453));
          return type;
        case "body":
          type = props.body;
          if (!type) throw Error(formatProdErrorMessage(454));
          return type;
        default:
          throw Error(formatProdErrorMessage(451));
      }
    }
    __name(resolveSingletonInstance, "resolveSingletonInstance");
    function releaseSingletonInstance(instance) {
      for (var attributes = instance.attributes; attributes.length; )
        instance.removeAttributeNode(attributes[0]);
      detachDeletedInstance(instance);
    }
    __name(releaseSingletonInstance, "releaseSingletonInstance");
    var preloadPropsMap = /* @__PURE__ */ new Map(), preconnectsSet = /* @__PURE__ */ new Set();
    function getHoistableRoot(container) {
      return "function" === typeof container.getRootNode ? container.getRootNode() : 9 === container.nodeType ? container : container.ownerDocument;
    }
    __name(getHoistableRoot, "getHoistableRoot");
    var previousDispatcher = ReactDOMSharedInternals.d;
    ReactDOMSharedInternals.d = {
      f: flushSyncWork,
      r: requestFormReset,
      D: prefetchDNS,
      C: preconnect,
      L: preload,
      m: preloadModule,
      X: preinitScript,
      S: preinitStyle,
      M: preinitModuleScript
    };
    function flushSyncWork() {
      var previousWasRendering = previousDispatcher.f(), wasRendering = flushSyncWork$1();
      return previousWasRendering || wasRendering;
    }
    __name(flushSyncWork, "flushSyncWork");
    function requestFormReset(form) {
      var formInst = getInstanceFromNode(form);
      null !== formInst && 5 === formInst.tag && "form" === formInst.type ? requestFormReset$1(formInst) : previousDispatcher.r(form);
    }
    __name(requestFormReset, "requestFormReset");
    var globalDocument = "undefined" === typeof document ? null : document;
    function preconnectAs(rel, href, crossOrigin) {
      var ownerDocument = globalDocument;
      if (ownerDocument && "string" === typeof href && href) {
        var limitedEscapedHref = escapeSelectorAttributeValueInsideDoubleQuotes(href);
        limitedEscapedHref = 'link[rel="' + rel + '"][href="' + limitedEscapedHref + '"]';
        "string" === typeof crossOrigin && (limitedEscapedHref += '[crossorigin="' + crossOrigin + '"]');
        preconnectsSet.has(limitedEscapedHref) || (preconnectsSet.add(limitedEscapedHref), rel = { rel, crossOrigin, href }, null === ownerDocument.querySelector(limitedEscapedHref) && (href = ownerDocument.createElement("link"), setInitialProperties(href, "link", rel), markNodeAsHoistable(href), ownerDocument.head.appendChild(href)));
      }
    }
    __name(preconnectAs, "preconnectAs");
    function prefetchDNS(href) {
      previousDispatcher.D(href);
      preconnectAs("dns-prefetch", href, null);
    }
    __name(prefetchDNS, "prefetchDNS");
    function preconnect(href, crossOrigin) {
      previousDispatcher.C(href, crossOrigin);
      preconnectAs("preconnect", href, crossOrigin);
    }
    __name(preconnect, "preconnect");
    function preload(href, as, options3) {
      previousDispatcher.L(href, as, options3);
      var ownerDocument = globalDocument;
      if (ownerDocument && href && as) {
        var preloadSelector = 'link[rel="preload"][as="' + escapeSelectorAttributeValueInsideDoubleQuotes(as) + '"]';
        "image" === as ? options3 && options3.imageSrcSet ? (preloadSelector += '[imagesrcset="' + escapeSelectorAttributeValueInsideDoubleQuotes(
          options3.imageSrcSet
        ) + '"]', "string" === typeof options3.imageSizes && (preloadSelector += '[imagesizes="' + escapeSelectorAttributeValueInsideDoubleQuotes(
          options3.imageSizes
        ) + '"]')) : preloadSelector += '[href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]' : preloadSelector += '[href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]';
        var key = preloadSelector;
        switch (as) {
          case "style":
            key = getStyleKey(href);
            break;
          case "script":
            key = getScriptKey(href);
        }
        preloadPropsMap.has(key) || (href = assign(
          {
            rel: "preload",
            href: "image" === as && options3 && options3.imageSrcSet ? void 0 : href,
            as
          },
          options3
        ), preloadPropsMap.set(key, href), null !== ownerDocument.querySelector(preloadSelector) || "style" === as && ownerDocument.querySelector(getStylesheetSelectorFromKey(key)) || "script" === as && ownerDocument.querySelector(getScriptSelectorFromKey(key)) || (as = ownerDocument.createElement("link"), setInitialProperties(as, "link", href), markNodeAsHoistable(as), ownerDocument.head.appendChild(as)));
      }
    }
    __name(preload, "preload");
    function preloadModule(href, options3) {
      previousDispatcher.m(href, options3);
      var ownerDocument = globalDocument;
      if (ownerDocument && href) {
        var as = options3 && "string" === typeof options3.as ? options3.as : "script", preloadSelector = 'link[rel="modulepreload"][as="' + escapeSelectorAttributeValueInsideDoubleQuotes(as) + '"][href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"]', key = preloadSelector;
        switch (as) {
          case "audioworklet":
          case "paintworklet":
          case "serviceworker":
          case "sharedworker":
          case "worker":
          case "script":
            key = getScriptKey(href);
        }
        if (!preloadPropsMap.has(key) && (href = assign({ rel: "modulepreload", href }, options3), preloadPropsMap.set(key, href), null === ownerDocument.querySelector(preloadSelector))) {
          switch (as) {
            case "audioworklet":
            case "paintworklet":
            case "serviceworker":
            case "sharedworker":
            case "worker":
            case "script":
              if (ownerDocument.querySelector(getScriptSelectorFromKey(key)))
                return;
          }
          as = ownerDocument.createElement("link");
          setInitialProperties(as, "link", href);
          markNodeAsHoistable(as);
          ownerDocument.head.appendChild(as);
        }
      }
    }
    __name(preloadModule, "preloadModule");
    function preinitStyle(href, precedence, options3) {
      previousDispatcher.S(href, precedence, options3);
      var ownerDocument = globalDocument;
      if (ownerDocument && href) {
        var styles = getResourcesFromRoot(ownerDocument).hoistableStyles, key = getStyleKey(href);
        precedence = precedence || "default";
        var resource = styles.get(key);
        if (!resource) {
          var state = { loading: 0, preload: null };
          if (resource = ownerDocument.querySelector(
            getStylesheetSelectorFromKey(key)
          ))
            state.loading = 5;
          else {
            href = assign(
              { rel: "stylesheet", href, "data-precedence": precedence },
              options3
            );
            (options3 = preloadPropsMap.get(key)) && adoptPreloadPropsForStylesheet(href, options3);
            var link = resource = ownerDocument.createElement("link");
            markNodeAsHoistable(link);
            setInitialProperties(link, "link", href);
            link._p = new Promise(function(resolve, reject) {
              link.onload = resolve;
              link.onerror = reject;
            });
            link.addEventListener("load", function() {
              state.loading |= 1;
            });
            link.addEventListener("error", function() {
              state.loading |= 2;
            });
            state.loading |= 4;
            insertStylesheet(resource, precedence, ownerDocument);
          }
          resource = {
            type: "stylesheet",
            instance: resource,
            count: 1,
            state
          };
          styles.set(key, resource);
        }
      }
    }
    __name(preinitStyle, "preinitStyle");
    function preinitScript(src, options3) {
      previousDispatcher.X(src, options3);
      var ownerDocument = globalDocument;
      if (ownerDocument && src) {
        var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts, key = getScriptKey(src), resource = scripts.get(key);
        resource || (resource = ownerDocument.querySelector(getScriptSelectorFromKey(key)), resource || (src = assign({ src, async: true }, options3), (options3 = preloadPropsMap.get(key)) && adoptPreloadPropsForScript(src, options3), resource = ownerDocument.createElement("script"), markNodeAsHoistable(resource), setInitialProperties(resource, "link", src), ownerDocument.head.appendChild(resource)), resource = {
          type: "script",
          instance: resource,
          count: 1,
          state: null
        }, scripts.set(key, resource));
      }
    }
    __name(preinitScript, "preinitScript");
    function preinitModuleScript(src, options3) {
      previousDispatcher.M(src, options3);
      var ownerDocument = globalDocument;
      if (ownerDocument && src) {
        var scripts = getResourcesFromRoot(ownerDocument).hoistableScripts, key = getScriptKey(src), resource = scripts.get(key);
        resource || (resource = ownerDocument.querySelector(getScriptSelectorFromKey(key)), resource || (src = assign({ src, async: true, type: "module" }, options3), (options3 = preloadPropsMap.get(key)) && adoptPreloadPropsForScript(src, options3), resource = ownerDocument.createElement("script"), markNodeAsHoistable(resource), setInitialProperties(resource, "link", src), ownerDocument.head.appendChild(resource)), resource = {
          type: "script",
          instance: resource,
          count: 1,
          state: null
        }, scripts.set(key, resource));
      }
    }
    __name(preinitModuleScript, "preinitModuleScript");
    function getResource(type, currentProps, pendingProps, currentResource) {
      var JSCompiler_inline_result = (JSCompiler_inline_result = rootInstanceStackCursor.current) ? getHoistableRoot(JSCompiler_inline_result) : null;
      if (!JSCompiler_inline_result) throw Error(formatProdErrorMessage(446));
      switch (type) {
        case "meta":
        case "title":
          return null;
        case "style":
          return "string" === typeof pendingProps.precedence && "string" === typeof pendingProps.href ? (currentProps = getStyleKey(pendingProps.href), pendingProps = getResourcesFromRoot(
            JSCompiler_inline_result
          ).hoistableStyles, currentResource = pendingProps.get(currentProps), currentResource || (currentResource = {
            type: "style",
            instance: null,
            count: 0,
            state: null
          }, pendingProps.set(currentProps, currentResource)), currentResource) : { type: "void", instance: null, count: 0, state: null };
        case "link":
          if ("stylesheet" === pendingProps.rel && "string" === typeof pendingProps.href && "string" === typeof pendingProps.precedence) {
            type = getStyleKey(pendingProps.href);
            var styles$244 = getResourcesFromRoot(
              JSCompiler_inline_result
            ).hoistableStyles, resource$245 = styles$244.get(type);
            resource$245 || (JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result, resource$245 = {
              type: "stylesheet",
              instance: null,
              count: 0,
              state: { loading: 0, preload: null }
            }, styles$244.set(type, resource$245), (styles$244 = JSCompiler_inline_result.querySelector(
              getStylesheetSelectorFromKey(type)
            )) && !styles$244._p && (resource$245.instance = styles$244, resource$245.state.loading = 5), preloadPropsMap.has(type) || (pendingProps = {
              rel: "preload",
              as: "style",
              href: pendingProps.href,
              crossOrigin: pendingProps.crossOrigin,
              integrity: pendingProps.integrity,
              media: pendingProps.media,
              hrefLang: pendingProps.hrefLang,
              referrerPolicy: pendingProps.referrerPolicy
            }, preloadPropsMap.set(type, pendingProps), styles$244 || preloadStylesheet(
              JSCompiler_inline_result,
              type,
              pendingProps,
              resource$245.state
            )));
            if (currentProps && null === currentResource)
              throw Error(formatProdErrorMessage(528, ""));
            return resource$245;
          }
          if (currentProps && null !== currentResource)
            throw Error(formatProdErrorMessage(529, ""));
          return null;
        case "script":
          return currentProps = pendingProps.async, pendingProps = pendingProps.src, "string" === typeof pendingProps && currentProps && "function" !== typeof currentProps && "symbol" !== typeof currentProps ? (currentProps = getScriptKey(pendingProps), pendingProps = getResourcesFromRoot(
            JSCompiler_inline_result
          ).hoistableScripts, currentResource = pendingProps.get(currentProps), currentResource || (currentResource = {
            type: "script",
            instance: null,
            count: 0,
            state: null
          }, pendingProps.set(currentProps, currentResource)), currentResource) : { type: "void", instance: null, count: 0, state: null };
        default:
          throw Error(formatProdErrorMessage(444, type));
      }
    }
    __name(getResource, "getResource");
    function getStyleKey(href) {
      return 'href="' + escapeSelectorAttributeValueInsideDoubleQuotes(href) + '"';
    }
    __name(getStyleKey, "getStyleKey");
    function getStylesheetSelectorFromKey(key) {
      return 'link[rel="stylesheet"][' + key + "]";
    }
    __name(getStylesheetSelectorFromKey, "getStylesheetSelectorFromKey");
    function stylesheetPropsFromRawProps(rawProps) {
      return assign({}, rawProps, {
        "data-precedence": rawProps.precedence,
        precedence: null
      });
    }
    __name(stylesheetPropsFromRawProps, "stylesheetPropsFromRawProps");
    function preloadStylesheet(ownerDocument, key, preloadProps, state) {
      ownerDocument.querySelector('link[rel="preload"][as="style"][' + key + "]") ? state.loading = 1 : (key = ownerDocument.createElement("link"), state.preload = key, key.addEventListener("load", function() {
        return state.loading |= 1;
      }), key.addEventListener("error", function() {
        return state.loading |= 2;
      }), setInitialProperties(key, "link", preloadProps), markNodeAsHoistable(key), ownerDocument.head.appendChild(key));
    }
    __name(preloadStylesheet, "preloadStylesheet");
    function getScriptKey(src) {
      return '[src="' + escapeSelectorAttributeValueInsideDoubleQuotes(src) + '"]';
    }
    __name(getScriptKey, "getScriptKey");
    function getScriptSelectorFromKey(key) {
      return "script[async]" + key;
    }
    __name(getScriptSelectorFromKey, "getScriptSelectorFromKey");
    function acquireResource(hoistableRoot, resource, props) {
      resource.count++;
      if (null === resource.instance)
        switch (resource.type) {
          case "style":
            var instance = hoistableRoot.querySelector(
              'style[data-href~="' + escapeSelectorAttributeValueInsideDoubleQuotes(props.href) + '"]'
            );
            if (instance)
              return resource.instance = instance, markNodeAsHoistable(instance), instance;
            var styleProps = assign({}, props, {
              "data-href": props.href,
              "data-precedence": props.precedence,
              href: null,
              precedence: null
            });
            instance = (hoistableRoot.ownerDocument || hoistableRoot).createElement(
              "style"
            );
            markNodeAsHoistable(instance);
            setInitialProperties(instance, "style", styleProps);
            insertStylesheet(instance, props.precedence, hoistableRoot);
            return resource.instance = instance;
          case "stylesheet":
            styleProps = getStyleKey(props.href);
            var instance$250 = hoistableRoot.querySelector(
              getStylesheetSelectorFromKey(styleProps)
            );
            if (instance$250)
              return resource.state.loading |= 4, resource.instance = instance$250, markNodeAsHoistable(instance$250), instance$250;
            instance = stylesheetPropsFromRawProps(props);
            (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps);
            instance$250 = (hoistableRoot.ownerDocument || hoistableRoot).createElement("link");
            markNodeAsHoistable(instance$250);
            var linkInstance = instance$250;
            linkInstance._p = new Promise(function(resolve, reject) {
              linkInstance.onload = resolve;
              linkInstance.onerror = reject;
            });
            setInitialProperties(instance$250, "link", instance);
            resource.state.loading |= 4;
            insertStylesheet(instance$250, props.precedence, hoistableRoot);
            return resource.instance = instance$250;
          case "script":
            instance$250 = getScriptKey(props.src);
            if (styleProps = hoistableRoot.querySelector(
              getScriptSelectorFromKey(instance$250)
            ))
              return resource.instance = styleProps, markNodeAsHoistable(styleProps), styleProps;
            instance = props;
            if (styleProps = preloadPropsMap.get(instance$250))
              instance = assign({}, props), adoptPreloadPropsForScript(instance, styleProps);
            hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
            styleProps = hoistableRoot.createElement("script");
            markNodeAsHoistable(styleProps);
            setInitialProperties(styleProps, "link", instance);
            hoistableRoot.head.appendChild(styleProps);
            return resource.instance = styleProps;
          case "void":
            return null;
          default:
            throw Error(formatProdErrorMessage(443, resource.type));
        }
      else
        "stylesheet" === resource.type && 0 === (resource.state.loading & 4) && (instance = resource.instance, resource.state.loading |= 4, insertStylesheet(instance, props.precedence, hoistableRoot));
      return resource.instance;
    }
    __name(acquireResource, "acquireResource");
    function insertStylesheet(instance, precedence, root3) {
      for (var nodes = root3.querySelectorAll(
        'link[rel="stylesheet"][data-precedence],style[data-precedence]'
      ), last2 = nodes.length ? nodes[nodes.length - 1] : null, prior = last2, i2 = 0; i2 < nodes.length; i2++) {
        var node = nodes[i2];
        if (node.dataset.precedence === precedence) prior = node;
        else if (prior !== last2) break;
      }
      prior ? prior.parentNode.insertBefore(instance, prior.nextSibling) : (precedence = 9 === root3.nodeType ? root3.head : root3, precedence.insertBefore(instance, precedence.firstChild));
    }
    __name(insertStylesheet, "insertStylesheet");
    function adoptPreloadPropsForStylesheet(stylesheetProps, preloadProps) {
      null == stylesheetProps.crossOrigin && (stylesheetProps.crossOrigin = preloadProps.crossOrigin);
      null == stylesheetProps.referrerPolicy && (stylesheetProps.referrerPolicy = preloadProps.referrerPolicy);
      null == stylesheetProps.title && (stylesheetProps.title = preloadProps.title);
    }
    __name(adoptPreloadPropsForStylesheet, "adoptPreloadPropsForStylesheet");
    function adoptPreloadPropsForScript(scriptProps, preloadProps) {
      null == scriptProps.crossOrigin && (scriptProps.crossOrigin = preloadProps.crossOrigin);
      null == scriptProps.referrerPolicy && (scriptProps.referrerPolicy = preloadProps.referrerPolicy);
      null == scriptProps.integrity && (scriptProps.integrity = preloadProps.integrity);
    }
    __name(adoptPreloadPropsForScript, "adoptPreloadPropsForScript");
    var tagCaches = null;
    function getHydratableHoistableCache(type, keyAttribute, ownerDocument) {
      if (null === tagCaches) {
        var cache = /* @__PURE__ */ new Map();
        var caches = tagCaches = /* @__PURE__ */ new Map();
        caches.set(ownerDocument, cache);
      } else
        caches = tagCaches, cache = caches.get(ownerDocument), cache || (cache = /* @__PURE__ */ new Map(), caches.set(ownerDocument, cache));
      if (cache.has(type)) return cache;
      cache.set(type, null);
      ownerDocument = ownerDocument.getElementsByTagName(type);
      for (caches = 0; caches < ownerDocument.length; caches++) {
        var node = ownerDocument[caches];
        if (!(node[internalHoistableMarker] || node[internalInstanceKey] || "link" === type && "stylesheet" === node.getAttribute("rel")) && "http://www.w3.org/2000/svg" !== node.namespaceURI) {
          var nodeKey = node.getAttribute(keyAttribute) || "";
          nodeKey = type + nodeKey;
          var existing = cache.get(nodeKey);
          existing ? existing.push(node) : cache.set(nodeKey, [node]);
        }
      }
      return cache;
    }
    __name(getHydratableHoistableCache, "getHydratableHoistableCache");
    function mountHoistable(hoistableRoot, type, instance) {
      hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot;
      hoistableRoot.head.insertBefore(
        instance,
        "title" === type ? hoistableRoot.querySelector("head > title") : null
      );
    }
    __name(mountHoistable, "mountHoistable");
    function isHostHoistableType(type, props, hostContext) {
      if (1 === hostContext || null != props.itemProp) return false;
      switch (type) {
        case "meta":
        case "title":
          return true;
        case "style":
          if ("string" !== typeof props.precedence || "string" !== typeof props.href || "" === props.href)
            break;
          return true;
        case "link":
          if ("string" !== typeof props.rel || "string" !== typeof props.href || "" === props.href || props.onLoad || props.onError)
            break;
          switch (props.rel) {
            case "stylesheet":
              return type = props.disabled, "string" === typeof props.precedence && null == type;
            default:
              return true;
          }
        case "script":
          if (props.async && "function" !== typeof props.async && "symbol" !== typeof props.async && !props.onLoad && !props.onError && props.src && "string" === typeof props.src)
            return true;
      }
      return false;
    }
    __name(isHostHoistableType, "isHostHoistableType");
    function preloadResource(resource) {
      return "stylesheet" === resource.type && 0 === (resource.state.loading & 3) ? false : true;
    }
    __name(preloadResource, "preloadResource");
    var suspendedState = null;
    function noop2() {
    }
    __name(noop2, "noop");
    function suspendResource(hoistableRoot, resource, props) {
      if (null === suspendedState) throw Error(formatProdErrorMessage(475));
      var state = suspendedState;
      if ("stylesheet" === resource.type && ("string" !== typeof props.media || false !== matchMedia(props.media).matches) && 0 === (resource.state.loading & 4)) {
        if (null === resource.instance) {
          var key = getStyleKey(props.href), instance = hoistableRoot.querySelector(
            getStylesheetSelectorFromKey(key)
          );
          if (instance) {
            hoistableRoot = instance._p;
            null !== hoistableRoot && "object" === typeof hoistableRoot && "function" === typeof hoistableRoot.then && (state.count++, state = onUnsuspend.bind(state), hoistableRoot.then(state, state));
            resource.state.loading |= 4;
            resource.instance = instance;
            markNodeAsHoistable(instance);
            return;
          }
          instance = hoistableRoot.ownerDocument || hoistableRoot;
          props = stylesheetPropsFromRawProps(props);
          (key = preloadPropsMap.get(key)) && adoptPreloadPropsForStylesheet(props, key);
          instance = instance.createElement("link");
          markNodeAsHoistable(instance);
          var linkInstance = instance;
          linkInstance._p = new Promise(function(resolve, reject) {
            linkInstance.onload = resolve;
            linkInstance.onerror = reject;
          });
          setInitialProperties(instance, "link", props);
          resource.instance = instance;
        }
        null === state.stylesheets && (state.stylesheets = /* @__PURE__ */ new Map());
        state.stylesheets.set(resource, hoistableRoot);
        (hoistableRoot = resource.state.preload) && 0 === (resource.state.loading & 3) && (state.count++, resource = onUnsuspend.bind(state), hoistableRoot.addEventListener("load", resource), hoistableRoot.addEventListener("error", resource));
      }
    }
    __name(suspendResource, "suspendResource");
    function waitForCommitToBeReady() {
      if (null === suspendedState) throw Error(formatProdErrorMessage(475));
      var state = suspendedState;
      state.stylesheets && 0 === state.count && insertSuspendedStylesheets(state, state.stylesheets);
      return 0 < state.count ? function(commit) {
        var stylesheetTimer = setTimeout(function() {
          state.stylesheets && insertSuspendedStylesheets(state, state.stylesheets);
          if (state.unsuspend) {
            var unsuspend = state.unsuspend;
            state.unsuspend = null;
            unsuspend();
          }
        }, 6e4);
        state.unsuspend = commit;
        return function() {
          state.unsuspend = null;
          clearTimeout(stylesheetTimer);
        };
      } : null;
    }
    __name(waitForCommitToBeReady, "waitForCommitToBeReady");
    function onUnsuspend() {
      this.count--;
      if (0 === this.count) {
        if (this.stylesheets) insertSuspendedStylesheets(this, this.stylesheets);
        else if (this.unsuspend) {
          var unsuspend = this.unsuspend;
          this.unsuspend = null;
          unsuspend();
        }
      }
    }
    __name(onUnsuspend, "onUnsuspend");
    var precedencesByRoot = null;
    function insertSuspendedStylesheets(state, resources) {
      state.stylesheets = null;
      null !== state.unsuspend && (state.count++, precedencesByRoot = /* @__PURE__ */ new Map(), resources.forEach(insertStylesheetIntoRoot, state), precedencesByRoot = null, onUnsuspend.call(state));
    }
    __name(insertSuspendedStylesheets, "insertSuspendedStylesheets");
    function insertStylesheetIntoRoot(root3, resource) {
      if (!(resource.state.loading & 4)) {
        var precedences = precedencesByRoot.get(root3);
        if (precedences) var last2 = precedences.get(null);
        else {
          precedences = /* @__PURE__ */ new Map();
          precedencesByRoot.set(root3, precedences);
          for (var nodes = root3.querySelectorAll(
            "link[data-precedence],style[data-precedence]"
          ), i2 = 0; i2 < nodes.length; i2++) {
            var node = nodes[i2];
            if ("LINK" === node.nodeName || "not all" !== node.getAttribute("media"))
              precedences.set(node.dataset.precedence, node), last2 = node;
          }
          last2 && precedences.set(null, last2);
        }
        nodes = resource.instance;
        node = nodes.getAttribute("data-precedence");
        i2 = precedences.get(node) || last2;
        i2 === last2 && precedences.set(null, nodes);
        precedences.set(node, nodes);
        this.count++;
        last2 = onUnsuspend.bind(this);
        nodes.addEventListener("load", last2);
        nodes.addEventListener("error", last2);
        i2 ? i2.parentNode.insertBefore(nodes, i2.nextSibling) : (root3 = 9 === root3.nodeType ? root3.head : root3, root3.insertBefore(nodes, root3.firstChild));
        resource.state.loading |= 4;
      }
    }
    __name(insertStylesheetIntoRoot, "insertStylesheetIntoRoot");
    var HostTransitionContext = {
      $$typeof: REACT_CONTEXT_TYPE,
      Provider: null,
      Consumer: null,
      _currentValue: sharedNotPendingObject,
      _currentValue2: sharedNotPendingObject,
      _threadCount: 0
    };
    function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, formState) {
      this.tag = 1;
      this.containerInfo = containerInfo;
      this.pingCache = this.current = this.pendingChildren = null;
      this.timeoutHandle = -1;
      this.callbackNode = this.next = this.pendingContext = this.context = this.cancelPendingCommit = null;
      this.callbackPriority = 0;
      this.expirationTimes = createLaneMap(-1);
      this.entangledLanes = this.shellSuspendCounter = this.errorRecoveryDisabledLanes = this.expiredLanes = this.warmLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0;
      this.entanglements = createLaneMap(0);
      this.hiddenUpdates = createLaneMap(null);
      this.identifierPrefix = identifierPrefix;
      this.onUncaughtError = onUncaughtError;
      this.onCaughtError = onCaughtError;
      this.onRecoverableError = onRecoverableError;
      this.pooledCache = null;
      this.pooledCacheLanes = 0;
      this.formState = formState;
      this.incompleteTransitions = /* @__PURE__ */ new Map();
    }
    __name(FiberRootNode, "FiberRootNode");
    function createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transitionCallbacks, formState) {
      containerInfo = new FiberRootNode(
        containerInfo,
        tag,
        hydrate,
        identifierPrefix,
        onUncaughtError,
        onCaughtError,
        onRecoverableError,
        formState
      );
      tag = 1;
      true === isStrictMode && (tag |= 24);
      isStrictMode = createFiberImplClass(3, null, null, tag);
      containerInfo.current = isStrictMode;
      isStrictMode.stateNode = containerInfo;
      tag = createCache();
      tag.refCount++;
      containerInfo.pooledCache = tag;
      tag.refCount++;
      isStrictMode.memoizedState = {
        element: initialChildren,
        isDehydrated: hydrate,
        cache: tag
      };
      initializeUpdateQueue(isStrictMode);
      return containerInfo;
    }
    __name(createFiberRoot, "createFiberRoot");
    function getContextForSubtree(parentComponent) {
      if (!parentComponent) return emptyContextObject;
      parentComponent = emptyContextObject;
      return parentComponent;
    }
    __name(getContextForSubtree, "getContextForSubtree");
    function updateContainerImpl(rootFiber, lane, element, container, parentComponent, callback) {
      parentComponent = getContextForSubtree(parentComponent);
      null === container.context ? container.context = parentComponent : container.pendingContext = parentComponent;
      container = createUpdate(lane);
      container.payload = { element };
      callback = void 0 === callback ? null : callback;
      null !== callback && (container.callback = callback);
      element = enqueueUpdate(rootFiber, container, lane);
      null !== element && (scheduleUpdateOnFiber(element, rootFiber, lane), entangleTransitions(element, rootFiber, lane));
    }
    __name(updateContainerImpl, "updateContainerImpl");
    function markRetryLaneImpl(fiber, retryLane) {
      fiber = fiber.memoizedState;
      if (null !== fiber && null !== fiber.dehydrated) {
        var a2 = fiber.retryLane;
        fiber.retryLane = 0 !== a2 && a2 < retryLane ? a2 : retryLane;
      }
    }
    __name(markRetryLaneImpl, "markRetryLaneImpl");
    function markRetryLaneIfNotHydrated(fiber, retryLane) {
      markRetryLaneImpl(fiber, retryLane);
      (fiber = fiber.alternate) && markRetryLaneImpl(fiber, retryLane);
    }
    __name(markRetryLaneIfNotHydrated, "markRetryLaneIfNotHydrated");
    function attemptContinuousHydration(fiber) {
      if (13 === fiber.tag) {
        var root3 = enqueueConcurrentRenderForLane(fiber, 67108864);
        null !== root3 && scheduleUpdateOnFiber(root3, fiber, 67108864);
        markRetryLaneIfNotHydrated(fiber, 67108864);
      }
    }
    __name(attemptContinuousHydration, "attemptContinuousHydration");
    var _enabled = true;
    function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {
      var prevTransition = ReactSharedInternals.T;
      ReactSharedInternals.T = null;
      var previousPriority = ReactDOMSharedInternals.p;
      try {
        ReactDOMSharedInternals.p = 2, dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
      } finally {
        ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition;
      }
    }
    __name(dispatchDiscreteEvent, "dispatchDiscreteEvent");
    function dispatchContinuousEvent(domEventName, eventSystemFlags, container, nativeEvent) {
      var prevTransition = ReactSharedInternals.T;
      ReactSharedInternals.T = null;
      var previousPriority = ReactDOMSharedInternals.p;
      try {
        ReactDOMSharedInternals.p = 8, dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent);
      } finally {
        ReactDOMSharedInternals.p = previousPriority, ReactSharedInternals.T = prevTransition;
      }
    }
    __name(dispatchContinuousEvent, "dispatchContinuousEvent");
    function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {
      if (_enabled) {
        var blockedOn = findInstanceBlockingEvent(nativeEvent);
        if (null === blockedOn)
          dispatchEventForPluginEventSystem(
            domEventName,
            eventSystemFlags,
            nativeEvent,
            return_targetInst,
            targetContainer
          ), clearIfContinuousEvent(domEventName, nativeEvent);
        else if (queueIfContinuousEvent(
          blockedOn,
          domEventName,
          eventSystemFlags,
          targetContainer,
          nativeEvent
        ))
          nativeEvent.stopPropagation();
        else if (clearIfContinuousEvent(domEventName, nativeEvent), eventSystemFlags & 4 && -1 < discreteReplayableEvents.indexOf(domEventName)) {
          for (; null !== blockedOn; ) {
            var fiber = getInstanceFromNode(blockedOn);
            if (null !== fiber)
              switch (fiber.tag) {
                case 3:
                  fiber = fiber.stateNode;
                  if (fiber.current.memoizedState.isDehydrated) {
                    var lanes = getHighestPriorityLanes(fiber.pendingLanes);
                    if (0 !== lanes) {
                      var root3 = fiber;
                      root3.pendingLanes |= 2;
                      for (root3.entangledLanes |= 2; lanes; ) {
                        var lane = 1 << 31 - clz32(lanes);
                        root3.entanglements[1] |= lane;
                        lanes &= ~lane;
                      }
                      ensureRootIsScheduled(fiber);
                      0 === (executionContext & 6) && (workInProgressRootRenderTargetTime = now() + 500, flushSyncWorkAcrossRoots_impl(0));
                    }
                  }
                  break;
                case 13:
                  root3 = enqueueConcurrentRenderForLane(fiber, 2), null !== root3 && scheduleUpdateOnFiber(root3, fiber, 2), flushSyncWork$1(), markRetryLaneIfNotHydrated(fiber, 2);
              }
            fiber = findInstanceBlockingEvent(nativeEvent);
            null === fiber && dispatchEventForPluginEventSystem(
              domEventName,
              eventSystemFlags,
              nativeEvent,
              return_targetInst,
              targetContainer
            );
            if (fiber === blockedOn) break;
            blockedOn = fiber;
          }
          null !== blockedOn && nativeEvent.stopPropagation();
        } else
          dispatchEventForPluginEventSystem(
            domEventName,
            eventSystemFlags,
            nativeEvent,
            null,
            targetContainer
          );
      }
    }
    __name(dispatchEvent, "dispatchEvent");
    function findInstanceBlockingEvent(nativeEvent) {
      nativeEvent = getEventTarget(nativeEvent);
      return findInstanceBlockingTarget(nativeEvent);
    }
    __name(findInstanceBlockingEvent, "findInstanceBlockingEvent");
    var return_targetInst = null;
    function findInstanceBlockingTarget(targetNode) {
      return_targetInst = null;
      targetNode = getClosestInstanceFromNode(targetNode);
      if (null !== targetNode) {
        var nearestMounted = getNearestMountedFiber(targetNode);
        if (null === nearestMounted) targetNode = null;
        else {
          var tag = nearestMounted.tag;
          if (13 === tag) {
            targetNode = getSuspenseInstanceFromFiber(nearestMounted);
            if (null !== targetNode) return targetNode;
            targetNode = null;
          } else if (3 === tag) {
            if (nearestMounted.stateNode.current.memoizedState.isDehydrated)
              return 3 === nearestMounted.tag ? nearestMounted.stateNode.containerInfo : null;
            targetNode = null;
          } else nearestMounted !== targetNode && (targetNode = null);
        }
      }
      return_targetInst = targetNode;
      return null;
    }
    __name(findInstanceBlockingTarget, "findInstanceBlockingTarget");
    function getEventPriority(domEventName) {
      switch (domEventName) {
        case "beforetoggle":
        case "cancel":
        case "click":
        case "close":
        case "contextmenu":
        case "copy":
        case "cut":
        case "auxclick":
        case "dblclick":
        case "dragend":
        case "dragstart":
        case "drop":
        case "focusin":
        case "focusout":
        case "input":
        case "invalid":
        case "keydown":
        case "keypress":
        case "keyup":
        case "mousedown":
        case "mouseup":
        case "paste":
        case "pause":
        case "play":
        case "pointercancel":
        case "pointerdown":
        case "pointerup":
        case "ratechange":
        case "reset":
        case "resize":
        case "seeked":
        case "submit":
        case "toggle":
        case "touchcancel":
        case "touchend":
        case "touchstart":
        case "volumechange":
        case "change":
        case "selectionchange":
        case "textInput":
        case "compositionstart":
        case "compositionend":
        case "compositionupdate":
        case "beforeblur":
        case "afterblur":
        case "beforeinput":
        case "blur":
        case "fullscreenchange":
        case "focus":
        case "hashchange":
        case "popstate":
        case "select":
        case "selectstart":
          return 2;
        case "drag":
        case "dragenter":
        case "dragexit":
        case "dragleave":
        case "dragover":
        case "mousemove":
        case "mouseout":
        case "mouseover":
        case "pointermove":
        case "pointerout":
        case "pointerover":
        case "scroll":
        case "touchmove":
        case "wheel":
        case "mouseenter":
        case "mouseleave":
        case "pointerenter":
        case "pointerleave":
          return 8;
        case "message":
          switch (getCurrentPriorityLevel()) {
            case ImmediatePriority:
              return 2;
            case UserBlockingPriority:
              return 8;
            case NormalPriority$1:
            case LowPriority:
              return 32;
            case IdlePriority:
              return 268435456;
            default:
              return 32;
          }
        default:
          return 32;
      }
    }
    __name(getEventPriority, "getEventPriority");
    var hasScheduledReplayAttempt = false, queuedFocus = null, queuedDrag = null, queuedMouse = null, queuedPointers = /* @__PURE__ */ new Map(), queuedPointerCaptures = /* @__PURE__ */ new Map(), queuedExplicitHydrationTargets = [], discreteReplayableEvents = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(
      " "
    );
    function clearIfContinuousEvent(domEventName, nativeEvent) {
      switch (domEventName) {
        case "focusin":
        case "focusout":
          queuedFocus = null;
          break;
        case "dragenter":
        case "dragleave":
          queuedDrag = null;
          break;
        case "mouseover":
        case "mouseout":
          queuedMouse = null;
          break;
        case "pointerover":
        case "pointerout":
          queuedPointers.delete(nativeEvent.pointerId);
          break;
        case "gotpointercapture":
        case "lostpointercapture":
          queuedPointerCaptures.delete(nativeEvent.pointerId);
      }
    }
    __name(clearIfContinuousEvent, "clearIfContinuousEvent");
    function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
      if (null === existingQueuedEvent || existingQueuedEvent.nativeEvent !== nativeEvent)
        return existingQueuedEvent = {
          blockedOn,
          domEventName,
          eventSystemFlags,
          nativeEvent,
          targetContainers: [targetContainer]
        }, null !== blockedOn && (blockedOn = getInstanceFromNode(blockedOn), null !== blockedOn && attemptContinuousHydration(blockedOn)), existingQueuedEvent;
      existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
      blockedOn = existingQueuedEvent.targetContainers;
      null !== targetContainer && -1 === blockedOn.indexOf(targetContainer) && blockedOn.push(targetContainer);
      return existingQueuedEvent;
    }
    __name(accumulateOrCreateContinuousQueuedReplayableEvent, "accumulateOrCreateContinuousQueuedReplayableEvent");
    function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {
      switch (domEventName) {
        case "focusin":
          return queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(
            queuedFocus,
            blockedOn,
            domEventName,
            eventSystemFlags,
            targetContainer,
            nativeEvent
          ), true;
        case "dragenter":
          return queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(
            queuedDrag,
            blockedOn,
            domEventName,
            eventSystemFlags,
            targetContainer,
            nativeEvent
          ), true;
        case "mouseover":
          return queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(
            queuedMouse,
            blockedOn,
            domEventName,
            eventSystemFlags,
            targetContainer,
            nativeEvent
          ), true;
        case "pointerover":
          var pointerId = nativeEvent.pointerId;
          queuedPointers.set(
            pointerId,
            accumulateOrCreateContinuousQueuedReplayableEvent(
              queuedPointers.get(pointerId) || null,
              blockedOn,
              domEventName,
              eventSystemFlags,
              targetContainer,
              nativeEvent
            )
          );
          return true;
        case "gotpointercapture":
          return pointerId = nativeEvent.pointerId, queuedPointerCaptures.set(
            pointerId,
            accumulateOrCreateContinuousQueuedReplayableEvent(
              queuedPointerCaptures.get(pointerId) || null,
              blockedOn,
              domEventName,
              eventSystemFlags,
              targetContainer,
              nativeEvent
            )
          ), true;
      }
      return false;
    }
    __name(queueIfContinuousEvent, "queueIfContinuousEvent");
    function attemptExplicitHydrationTarget(queuedTarget) {
      var targetInst = getClosestInstanceFromNode(queuedTarget.target);
      if (null !== targetInst) {
        var nearestMounted = getNearestMountedFiber(targetInst);
        if (null !== nearestMounted) {
          if (targetInst = nearestMounted.tag, 13 === targetInst) {
            if (targetInst = getSuspenseInstanceFromFiber(nearestMounted), null !== targetInst) {
              queuedTarget.blockedOn = targetInst;
              runWithPriority(queuedTarget.priority, function() {
                if (13 === nearestMounted.tag) {
                  var lane = requestUpdateLane();
                  lane = getBumpedLaneForHydrationByLane(lane);
                  var root3 = enqueueConcurrentRenderForLane(nearestMounted, lane);
                  null !== root3 && scheduleUpdateOnFiber(root3, nearestMounted, lane);
                  markRetryLaneIfNotHydrated(nearestMounted, lane);
                }
              });
              return;
            }
          } else if (3 === targetInst && nearestMounted.stateNode.current.memoizedState.isDehydrated) {
            queuedTarget.blockedOn = 3 === nearestMounted.tag ? nearestMounted.stateNode.containerInfo : null;
            return;
          }
        }
      }
      queuedTarget.blockedOn = null;
    }
    __name(attemptExplicitHydrationTarget, "attemptExplicitHydrationTarget");
    function attemptReplayContinuousQueuedEvent(queuedEvent) {
      if (null !== queuedEvent.blockedOn) return false;
      for (var targetContainers = queuedEvent.targetContainers; 0 < targetContainers.length; ) {
        var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.nativeEvent);
        if (null === nextBlockedOn) {
          nextBlockedOn = queuedEvent.nativeEvent;
          var nativeEventClone = new nextBlockedOn.constructor(
            nextBlockedOn.type,
            nextBlockedOn
          );
          currentReplayingEvent = nativeEventClone;
          nextBlockedOn.target.dispatchEvent(nativeEventClone);
          currentReplayingEvent = null;
        } else
          return targetContainers = getInstanceFromNode(nextBlockedOn), null !== targetContainers && attemptContinuousHydration(targetContainers), queuedEvent.blockedOn = nextBlockedOn, false;
        targetContainers.shift();
      }
      return true;
    }
    __name(attemptReplayContinuousQueuedEvent, "attemptReplayContinuousQueuedEvent");
    function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map2) {
      attemptReplayContinuousQueuedEvent(queuedEvent) && map2.delete(key);
    }
    __name(attemptReplayContinuousQueuedEventInMap, "attemptReplayContinuousQueuedEventInMap");
    function replayUnblockedEvents() {
      hasScheduledReplayAttempt = false;
      null !== queuedFocus && attemptReplayContinuousQueuedEvent(queuedFocus) && (queuedFocus = null);
      null !== queuedDrag && attemptReplayContinuousQueuedEvent(queuedDrag) && (queuedDrag = null);
      null !== queuedMouse && attemptReplayContinuousQueuedEvent(queuedMouse) && (queuedMouse = null);
      queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
      queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
    }
    __name(replayUnblockedEvents, "replayUnblockedEvents");
    function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
      queuedEvent.blockedOn === unblocked && (queuedEvent.blockedOn = null, hasScheduledReplayAttempt || (hasScheduledReplayAttempt = true, Scheduler.unstable_scheduleCallback(
        Scheduler.unstable_NormalPriority,
        replayUnblockedEvents
      )));
    }
    __name(scheduleCallbackIfUnblocked, "scheduleCallbackIfUnblocked");
    var lastScheduledReplayQueue = null;
    function scheduleReplayQueueIfNeeded(formReplayingQueue) {
      lastScheduledReplayQueue !== formReplayingQueue && (lastScheduledReplayQueue = formReplayingQueue, Scheduler.unstable_scheduleCallback(
        Scheduler.unstable_NormalPriority,
        function() {
          lastScheduledReplayQueue === formReplayingQueue && (lastScheduledReplayQueue = null);
          for (var i2 = 0; i2 < formReplayingQueue.length; i2 += 3) {
            var form = formReplayingQueue[i2], submitterOrAction = formReplayingQueue[i2 + 1], formData = formReplayingQueue[i2 + 2];
            if ("function" !== typeof submitterOrAction)
              if (null === findInstanceBlockingTarget(submitterOrAction || form))
                continue;
              else break;
            var formInst = getInstanceFromNode(form);
            null !== formInst && (formReplayingQueue.splice(i2, 3), i2 -= 3, startHostTransition(
              formInst,
              {
                pending: true,
                data: formData,
                method: form.method,
                action: submitterOrAction
              },
              submitterOrAction,
              formData
            ));
          }
        }
      ));
    }
    __name(scheduleReplayQueueIfNeeded, "scheduleReplayQueueIfNeeded");
    function retryIfBlockedOn(unblocked) {
      function unblock(queuedEvent) {
        return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
      }
      __name(unblock, "unblock");
      null !== queuedFocus && scheduleCallbackIfUnblocked(queuedFocus, unblocked);
      null !== queuedDrag && scheduleCallbackIfUnblocked(queuedDrag, unblocked);
      null !== queuedMouse && scheduleCallbackIfUnblocked(queuedMouse, unblocked);
      queuedPointers.forEach(unblock);
      queuedPointerCaptures.forEach(unblock);
      for (var i2 = 0; i2 < queuedExplicitHydrationTargets.length; i2++) {
        var queuedTarget = queuedExplicitHydrationTargets[i2];
        queuedTarget.blockedOn === unblocked && (queuedTarget.blockedOn = null);
      }
      for (; 0 < queuedExplicitHydrationTargets.length && (i2 = queuedExplicitHydrationTargets[0], null === i2.blockedOn); )
        attemptExplicitHydrationTarget(i2), null === i2.blockedOn && queuedExplicitHydrationTargets.shift();
      i2 = (unblocked.ownerDocument || unblocked).$$reactFormReplay;
      if (null != i2)
        for (queuedTarget = 0; queuedTarget < i2.length; queuedTarget += 3) {
          var form = i2[queuedTarget], submitterOrAction = i2[queuedTarget + 1], formProps = form[internalPropsKey] || null;
          if ("function" === typeof submitterOrAction)
            formProps || scheduleReplayQueueIfNeeded(i2);
          else if (formProps) {
            var action = null;
            if (submitterOrAction && submitterOrAction.hasAttribute("formAction"))
              if (form = submitterOrAction, formProps = submitterOrAction[internalPropsKey] || null)
                action = formProps.formAction;
              else {
                if (null !== findInstanceBlockingTarget(form)) continue;
              }
            else action = formProps.action;
            "function" === typeof action ? i2[queuedTarget + 1] = action : (i2.splice(queuedTarget, 3), queuedTarget -= 3);
            scheduleReplayQueueIfNeeded(i2);
          }
        }
    }
    __name(retryIfBlockedOn, "retryIfBlockedOn");
    function ReactDOMRoot(internalRoot) {
      this._internalRoot = internalRoot;
    }
    __name(ReactDOMRoot, "ReactDOMRoot");
    ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function(children) {
      var root3 = this._internalRoot;
      if (null === root3) throw Error(formatProdErrorMessage(409));
      var current = root3.current, lane = requestUpdateLane();
      updateContainerImpl(current, lane, children, root3, null, null);
    };
    ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function() {
      var root3 = this._internalRoot;
      if (null !== root3) {
        this._internalRoot = null;
        var container = root3.containerInfo;
        updateContainerImpl(root3.current, 2, null, root3, null, null);
        flushSyncWork$1();
        container[internalContainerInstanceKey] = null;
      }
    };
    function ReactDOMHydrationRoot(internalRoot) {
      this._internalRoot = internalRoot;
    }
    __name(ReactDOMHydrationRoot, "ReactDOMHydrationRoot");
    ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function(target) {
      if (target) {
        var updatePriority = resolveUpdatePriority();
        target = { blockedOn: null, target, priority: updatePriority };
        for (var i2 = 0; i2 < queuedExplicitHydrationTargets.length && 0 !== updatePriority && updatePriority < queuedExplicitHydrationTargets[i2].priority; i2++) ;
        queuedExplicitHydrationTargets.splice(i2, 0, target);
        0 === i2 && attemptExplicitHydrationTarget(target);
      }
    };
    var isomorphicReactPackageVersion$jscomp$inline_1785 = React2.version;
    if ("19.1.1" !== isomorphicReactPackageVersion$jscomp$inline_1785)
      throw Error(
        formatProdErrorMessage(
          527,
          isomorphicReactPackageVersion$jscomp$inline_1785,
          "19.1.1"
        )
      );
    ReactDOMSharedInternals.findDOMNode = function(componentOrElement) {
      var fiber = componentOrElement._reactInternals;
      if (void 0 === fiber) {
        if ("function" === typeof componentOrElement.render)
          throw Error(formatProdErrorMessage(188));
        componentOrElement = Object.keys(componentOrElement).join(",");
        throw Error(formatProdErrorMessage(268, componentOrElement));
      }
      componentOrElement = findCurrentFiberUsingSlowPath(fiber);
      componentOrElement = null !== componentOrElement ? findCurrentHostFiberImpl(componentOrElement) : null;
      componentOrElement = null === componentOrElement ? null : componentOrElement.stateNode;
      return componentOrElement;
    };
    var internals$jscomp$inline_2256 = {
      bundleType: 0,
      version: "19.1.1",
      rendererPackageName: "react-dom",
      currentDispatcherRef: ReactSharedInternals,
      reconcilerVersion: "19.1.1"
    };
    if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
      var hook$jscomp$inline_2257 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
      if (!hook$jscomp$inline_2257.isDisabled && hook$jscomp$inline_2257.supportsFiber)
        try {
          rendererID = hook$jscomp$inline_2257.inject(
            internals$jscomp$inline_2256
          ), injectedHook = hook$jscomp$inline_2257;
        } catch (err) {
        }
    }
    reactDomClient_production.createRoot = function(container, options3) {
      if (!isValidContainer(container)) throw Error(formatProdErrorMessage(299));
      var isStrictMode = false, identifierPrefix = "", onUncaughtError = defaultOnUncaughtError, onCaughtError = defaultOnCaughtError, onRecoverableError = defaultOnRecoverableError, transitionCallbacks = null;
      null !== options3 && void 0 !== options3 && (true === options3.unstable_strictMode && (isStrictMode = true), void 0 !== options3.identifierPrefix && (identifierPrefix = options3.identifierPrefix), void 0 !== options3.onUncaughtError && (onUncaughtError = options3.onUncaughtError), void 0 !== options3.onCaughtError && (onCaughtError = options3.onCaughtError), void 0 !== options3.onRecoverableError && (onRecoverableError = options3.onRecoverableError), void 0 !== options3.unstable_transitionCallbacks && (transitionCallbacks = options3.unstable_transitionCallbacks));
      options3 = createFiberRoot(
        container,
        1,
        false,
        null,
        null,
        isStrictMode,
        identifierPrefix,
        onUncaughtError,
        onCaughtError,
        onRecoverableError,
        transitionCallbacks,
        null
      );
      container[internalContainerInstanceKey] = options3.current;
      listenToAllSupportedEvents(container);
      return new ReactDOMRoot(options3);
    };
    reactDomClient_production.hydrateRoot = function(container, initialChildren, options3) {
      if (!isValidContainer(container)) throw Error(formatProdErrorMessage(299));
      var isStrictMode = false, identifierPrefix = "", onUncaughtError = defaultOnUncaughtError, onCaughtError = defaultOnCaughtError, onRecoverableError = defaultOnRecoverableError, transitionCallbacks = null, formState = null;
      null !== options3 && void 0 !== options3 && (true === options3.unstable_strictMode && (isStrictMode = true), void 0 !== options3.identifierPrefix && (identifierPrefix = options3.identifierPrefix), void 0 !== options3.onUncaughtError && (onUncaughtError = options3.onUncaughtError), void 0 !== options3.onCaughtError && (onCaughtError = options3.onCaughtError), void 0 !== options3.onRecoverableError && (onRecoverableError = options3.onRecoverableError), void 0 !== options3.unstable_transitionCallbacks && (transitionCallbacks = options3.unstable_transitionCallbacks), void 0 !== options3.formState && (formState = options3.formState));
      initialChildren = createFiberRoot(
        container,
        1,
        true,
        initialChildren,
        null != options3 ? options3 : null,
        isStrictMode,
        identifierPrefix,
        onUncaughtError,
        onCaughtError,
        onRecoverableError,
        transitionCallbacks,
        formState
      );
      initialChildren.context = getContextForSubtree(null);
      options3 = initialChildren.current;
      isStrictMode = requestUpdateLane();
      isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode);
      identifierPrefix = createUpdate(isStrictMode);
      identifierPrefix.callback = null;
      enqueueUpdate(options3, identifierPrefix, isStrictMode);
      options3 = isStrictMode;
      initialChildren.current.lanes = options3;
      markRootUpdated$1(initialChildren, options3);
      ensureRootIsScheduled(initialChildren);
      container[internalContainerInstanceKey] = initialChildren.current;
      listenToAllSupportedEvents(container);
      return new ReactDOMHydrationRoot(initialChildren);
    };
    reactDomClient_production.version = "19.1.1";
    return reactDomClient_production;
  }
  __name(requireReactDomClient_production, "requireReactDomClient_production");
  var hasRequiredClient;
  function requireClient() {
    if (hasRequiredClient) return client.exports;
    hasRequiredClient = 1;
    function checkDCE() {
      if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
        return;
      }
      try {
        __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
      } catch (err) {
        console.error(err);
      }
    }
    __name(checkDCE, "checkDCE");
    {
      checkDCE();
      client.exports = requireReactDomClient_production();
    }
    return client.exports;
  }
  __name(requireClient, "requireClient");
  var clientExports = requireClient();
  var prefix = "Invariant failed";
  function invariant(condition, message) {
    if (condition) {
      return;
    }
    {
      throw new Error(prefix);
    }
  }
  __name(invariant, "invariant");
  function warning(condition, message) {
  }
  __name(warning, "warning");
  const __storeToDerived = /* @__PURE__ */ new WeakMap();
  const __derivedToStore = /* @__PURE__ */ new WeakMap();
  const __depsThatHaveWrittenThisTick = {
    current: []
  };
  let __isFlushing = false;
  let __batchDepth = 0;
  const __pendingUpdates = /* @__PURE__ */ new Set();
  const __initialBatchValues = /* @__PURE__ */ new Map();
  function __flush_internals(relatedVals) {
    const sorted = Array.from(relatedVals).sort((a2, b) => {
      if (a2 instanceof Derived && a2.options.deps.includes(b)) return 1;
      if (b instanceof Derived && b.options.deps.includes(a2)) return -1;
      return 0;
    });
    for (const derived of sorted) {
      if (__depsThatHaveWrittenThisTick.current.includes(derived)) {
        continue;
      }
      __depsThatHaveWrittenThisTick.current.push(derived);
      derived.recompute();
      const stores = __derivedToStore.get(derived);
      if (stores) {
        for (const store2 of stores) {
          const relatedLinkedDerivedVals = __storeToDerived.get(store2);
          if (!relatedLinkedDerivedVals) continue;
          __flush_internals(relatedLinkedDerivedVals);
        }
      }
    }
  }
  __name(__flush_internals, "__flush_internals");
  function __notifyListeners(store2) {
    store2.listeners.forEach(
      (listener) => listener({
        prevVal: store2.prevState,
        currentVal: store2.state
      })
    );
  }
  __name(__notifyListeners, "__notifyListeners");
  function __notifyDerivedListeners(derived) {
    derived.listeners.forEach(
      (listener) => listener({
        prevVal: derived.prevState,
        currentVal: derived.state
      })
    );
  }
  __name(__notifyDerivedListeners, "__notifyDerivedListeners");
  function __flush(store2) {
    var _a2;
    if (__batchDepth > 0 && !__initialBatchValues.has(store2)) {
      __initialBatchValues.set(store2, store2.prevState);
    }
    __pendingUpdates.add(store2);
    if (__batchDepth > 0) return;
    if (__isFlushing) return;
    try {
      __isFlushing = true;
      while (__pendingUpdates.size > 0) {
        const stores = Array.from(__pendingUpdates);
        __pendingUpdates.clear();
        for (const store22 of stores) {
          const prevState = (_a2 = __initialBatchValues.get(store22)) != null ? _a2 : store22.prevState;
          store22.prevState = prevState;
          __notifyListeners(store22);
        }
        for (const store22 of stores) {
          const derivedVals = __storeToDerived.get(store22);
          if (!derivedVals) continue;
          __depsThatHaveWrittenThisTick.current.push(store22);
          __flush_internals(derivedVals);
        }
        for (const store22 of stores) {
          const derivedVals = __storeToDerived.get(store22);
          if (!derivedVals) continue;
          for (const derived of derivedVals) {
            __notifyDerivedListeners(derived);
          }
        }
      }
    } finally {
      __isFlushing = false;
      __depsThatHaveWrittenThisTick.current = [];
      __initialBatchValues.clear();
    }
  }
  __name(__flush, "__flush");
  function batch(fn) {
    __batchDepth++;
    try {
      fn();
    } finally {
      __batchDepth--;
      if (__batchDepth === 0) {
        const pendingUpdateToFlush = Array.from(__pendingUpdates)[0];
        if (pendingUpdateToFlush) {
          __flush(pendingUpdateToFlush);
        }
      }
    }
  }
  __name(batch, "batch");
  function isUpdaterFunction(updater) {
    return typeof updater === "function";
  }
  __name(isUpdaterFunction, "isUpdaterFunction");
  const _Store = class _Store {
    constructor(initialState, options2) {
      this.listeners = /* @__PURE__ */ new Set();
      this.subscribe = (listener) => {
        var _a2, _b2;
        this.listeners.add(listener);
        const unsub = (_b2 = (_a2 = this.options) == null ? void 0 : _a2.onSubscribe) == null ? void 0 : _b2.call(_a2, listener, this);
        return () => {
          this.listeners.delete(listener);
          unsub == null ? void 0 : unsub();
        };
      };
      this.prevState = initialState;
      this.state = initialState;
      this.options = options2;
    }
    setState(updater) {
      var _a2, _b2, _c2;
      this.prevState = this.state;
      if ((_a2 = this.options) == null ? void 0 : _a2.updateFn) {
        this.state = this.options.updateFn(this.prevState)(updater);
      } else {
        if (isUpdaterFunction(updater)) {
          this.state = updater(this.prevState);
        } else {
          this.state = updater;
        }
      }
      (_c2 = (_b2 = this.options) == null ? void 0 : _b2.onUpdate) == null ? void 0 : _c2.call(_b2);
      __flush(this);
    }
  };
  __name(_Store, "Store");
  let Store = _Store;
  const _Derived = class _Derived {
    constructor(options2) {
      this.listeners = /* @__PURE__ */ new Set();
      this._subscriptions = [];
      this.lastSeenDepValues = [];
      this.getDepVals = () => {
        var _a2;
        const prevDepVals = [];
        const currDepVals = [];
        for (const dep of this.options.deps) {
          prevDepVals.push(dep.prevState);
          currDepVals.push(dep.state);
        }
        this.lastSeenDepValues = currDepVals;
        return {
          prevDepVals,
          currDepVals,
          prevVal: (_a2 = this.prevState) != null ? _a2 : void 0
        };
      };
      this.recompute = () => {
        var _a2, _b2;
        this.prevState = this.state;
        const { prevDepVals, currDepVals, prevVal } = this.getDepVals();
        this.state = this.options.fn({
          prevDepVals,
          currDepVals,
          prevVal
        });
        (_b2 = (_a2 = this.options).onUpdate) == null ? void 0 : _b2.call(_a2);
      };
      this.checkIfRecalculationNeededDeeply = () => {
        for (const dep of this.options.deps) {
          if (dep instanceof _Derived) {
            dep.checkIfRecalculationNeededDeeply();
          }
        }
        let shouldRecompute = false;
        const lastSeenDepValues = this.lastSeenDepValues;
        const { currDepVals } = this.getDepVals();
        for (let i2 = 0; i2 < currDepVals.length; i2++) {
          if (currDepVals[i2] !== lastSeenDepValues[i2]) {
            shouldRecompute = true;
            break;
          }
        }
        if (shouldRecompute) {
          this.recompute();
        }
      };
      this.mount = () => {
        this.registerOnGraph();
        this.checkIfRecalculationNeededDeeply();
        return () => {
          this.unregisterFromGraph();
          for (const cleanup of this._subscriptions) {
            cleanup();
          }
        };
      };
      this.subscribe = (listener) => {
        var _a2, _b2;
        this.listeners.add(listener);
        const unsub = (_b2 = (_a2 = this.options).onSubscribe) == null ? void 0 : _b2.call(_a2, listener, this);
        return () => {
          this.listeners.delete(listener);
          unsub == null ? void 0 : unsub();
        };
      };
      this.options = options2;
      this.state = options2.fn({
        prevDepVals: void 0,
        prevVal: void 0,
        currDepVals: this.getDepVals().currDepVals
      });
    }
    registerOnGraph(deps = this.options.deps) {
      for (const dep of deps) {
        if (dep instanceof _Derived) {
          dep.registerOnGraph();
          this.registerOnGraph(dep.options.deps);
        } else if (dep instanceof Store) {
          let relatedLinkedDerivedVals = __storeToDerived.get(dep);
          if (!relatedLinkedDerivedVals) {
            relatedLinkedDerivedVals = /* @__PURE__ */ new Set();
            __storeToDerived.set(dep, relatedLinkedDerivedVals);
          }
          relatedLinkedDerivedVals.add(this);
          let relatedStores = __derivedToStore.get(this);
          if (!relatedStores) {
            relatedStores = /* @__PURE__ */ new Set();
            __derivedToStore.set(this, relatedStores);
          }
          relatedStores.add(dep);
        }
      }
    }
    unregisterFromGraph(deps = this.options.deps) {
      for (const dep of deps) {
        if (dep instanceof _Derived) {
          this.unregisterFromGraph(dep.options.deps);
        } else if (dep instanceof Store) {
          const relatedLinkedDerivedVals = __storeToDerived.get(dep);
          if (relatedLinkedDerivedVals) {
            relatedLinkedDerivedVals.delete(this);
          }
          const relatedStores = __derivedToStore.get(this);
          if (relatedStores) {
            relatedStores.delete(dep);
          }
        }
      }
    }
  };
  __name(_Derived, "Derived");
  let Derived = _Derived;
  const stateIndexKey = "__TSR_index";
  const popStateEvent = "popstate";
  const beforeUnloadEvent = "beforeunload";
  function createHistory(opts) {
    let location = opts.getLocation();
    const subscribers = /* @__PURE__ */ new Set();
    const notify = /* @__PURE__ */ __name((action) => {
      location = opts.getLocation();
      subscribers.forEach((subscriber) => subscriber({ location, action }));
    }, "notify");
    const handleIndexChange = /* @__PURE__ */ __name((action) => {
      var _a2;
      if ((_a2 = opts.notifyOnIndexChange) != null ? _a2 : true) notify(action);
      else location = opts.getLocation();
    }, "handleIndexChange");
    const tryNavigation = /* @__PURE__ */ __name((_a2) => __async(null, null, function* () {
      var _b2 = _a2, {
        task,
        navigateOpts
      } = _b2, actionInfo = __objRest(_b2, [
        "task",
        "navigateOpts"
      ]);
      var _a4, _b4;
      var _a3, _b3;
      const ignoreBlocker = (_a4 = navigateOpts == null ? void 0 : navigateOpts.ignoreBlocker) != null ? _a4 : false;
      if (ignoreBlocker) {
        task();
        return;
      }
      const blockers = (_b4 = (_a3 = opts.getBlockers) == null ? void 0 : _a3.call(opts)) != null ? _b4 : [];
      const isPushOrReplace = actionInfo.type === "PUSH" || actionInfo.type === "REPLACE";
      if (typeof document !== "undefined" && blockers.length && isPushOrReplace) {
        for (const blocker of blockers) {
          const nextLocation = parseHref(actionInfo.path, actionInfo.state);
          const isBlocked = yield blocker.blockerFn({
            currentLocation: location,
            nextLocation,
            action: actionInfo.type
          });
          if (isBlocked) {
            (_b3 = opts.onBlocked) == null ? void 0 : _b3.call(opts);
            return;
          }
        }
      }
      task();
    }), "tryNavigation");
    return {
      get location() {
        return location;
      },
      get length() {
        return opts.getLength();
      },
      subscribers,
      subscribe: /* @__PURE__ */ __name((cb) => {
        subscribers.add(cb);
        return () => {
          subscribers.delete(cb);
        };
      }, "subscribe"),
      push: /* @__PURE__ */ __name((path, state, navigateOpts) => {
        const currentIndex = location.state[stateIndexKey];
        state = assignKeyAndIndex(currentIndex + 1, state);
        tryNavigation({
          task: /* @__PURE__ */ __name(() => {
            opts.pushState(path, state);
            notify({ type: "PUSH" });
          }, "task"),
          navigateOpts,
          type: "PUSH",
          path,
          state
        });
      }, "push"),
      replace: /* @__PURE__ */ __name((path, state, navigateOpts) => {
        const currentIndex = location.state[stateIndexKey];
        state = assignKeyAndIndex(currentIndex, state);
        tryNavigation({
          task: /* @__PURE__ */ __name(() => {
            opts.replaceState(path, state);
            notify({ type: "REPLACE" });
          }, "task"),
          navigateOpts,
          type: "REPLACE",
          path,
          state
        });
      }, "replace"),
      go: /* @__PURE__ */ __name((index2, navigateOpts) => {
        tryNavigation({
          task: /* @__PURE__ */ __name(() => {
            opts.go(index2);
            handleIndexChange({ type: "GO", index: index2 });
          }, "task"),
          navigateOpts,
          type: "GO"
        });
      }, "go"),
      back: /* @__PURE__ */ __name((navigateOpts) => {
        tryNavigation({
          task: /* @__PURE__ */ __name(() => {
            var _a2;
            opts.back((_a2 = navigateOpts == null ? void 0 : navigateOpts.ignoreBlocker) != null ? _a2 : false);
            handleIndexChange({ type: "BACK" });
          }, "task"),
          navigateOpts,
          type: "BACK"
        });
      }, "back"),
      forward: /* @__PURE__ */ __name((navigateOpts) => {
        tryNavigation({
          task: /* @__PURE__ */ __name(() => {
            var _a2;
            opts.forward((_a2 = navigateOpts == null ? void 0 : navigateOpts.ignoreBlocker) != null ? _a2 : false);
            handleIndexChange({ type: "FORWARD" });
          }, "task"),
          navigateOpts,
          type: "FORWARD"
        });
      }, "forward"),
      canGoBack: /* @__PURE__ */ __name(() => location.state[stateIndexKey] !== 0, "canGoBack"),
      createHref: /* @__PURE__ */ __name((str) => opts.createHref(str), "createHref"),
      block: /* @__PURE__ */ __name((blocker) => {
        var _a3;
        var _a2;
        if (!opts.setBlockers) return () => {
        };
        const blockers = (_a3 = (_a2 = opts.getBlockers) == null ? void 0 : _a2.call(opts)) != null ? _a3 : [];
        opts.setBlockers([...blockers, blocker]);
        return () => {
          var _a4;
          var _a22, _b2;
          const blockers2 = (_a4 = (_a22 = opts.getBlockers) == null ? void 0 : _a22.call(opts)) != null ? _a4 : [];
          (_b2 = opts.setBlockers) == null ? void 0 : _b2.call(opts, blockers2.filter((b) => b !== blocker));
        };
      }, "block"),
      flush: /* @__PURE__ */ __name(() => {
        var _a2;
        return (_a2 = opts.flush) == null ? void 0 : _a2.call(opts);
      }, "flush"),
      destroy: /* @__PURE__ */ __name(() => {
        var _a2;
        return (_a2 = opts.destroy) == null ? void 0 : _a2.call(opts);
      }, "destroy"),
      notify
    };
  }
  __name(createHistory, "createHistory");
  function assignKeyAndIndex(index2, state) {
    if (!state) {
      state = {};
    }
    const key = createRandomKey();
    return __spreadProps(__spreadValues({}, state), {
      key,
      // TODO: Remove in v2 - use __TSR_key instead
      __TSR_key: key,
      [stateIndexKey]: index2
    });
  }
  __name(assignKeyAndIndex, "assignKeyAndIndex");
  function createBrowserHistory(opts) {
    var _a3, _b3, _c2;
    var _a2, _b2;
    const win2 = (_a3 = opts == null ? void 0 : opts.window) != null ? _a3 : typeof document !== "undefined" ? window : void 0;
    const originalPushState = win2.history.pushState;
    const originalReplaceState = win2.history.replaceState;
    let blockers = [];
    const _getBlockers = /* @__PURE__ */ __name(() => blockers, "_getBlockers");
    const _setBlockers = /* @__PURE__ */ __name((newBlockers) => blockers = newBlockers, "_setBlockers");
    const createHref = (_b3 = opts == null ? void 0 : opts.createHref) != null ? _b3 : ((path) => path);
    const parseLocation = (_c2 = opts == null ? void 0 : opts.parseLocation) != null ? _c2 : (() => parseHref(
      `${win2.location.pathname}${win2.location.search}${win2.location.hash}`,
      win2.history.state
    ));
    if (!((_a2 = win2.history.state) == null ? void 0 : _a2.__TSR_key) && !((_b2 = win2.history.state) == null ? void 0 : _b2.key)) {
      const addedKey = createRandomKey();
      win2.history.replaceState(
        {
          [stateIndexKey]: 0,
          key: addedKey,
          // TODO: Remove in v2 - use __TSR_key instead
          __TSR_key: addedKey
        },
        ""
      );
    }
    let currentLocation = parseLocation();
    let rollbackLocation;
    let nextPopIsGo = false;
    let ignoreNextPop = false;
    let skipBlockerNextPop = false;
    let ignoreNextBeforeUnload = false;
    const getLocation = /* @__PURE__ */ __name(() => currentLocation, "getLocation");
    let next;
    let scheduled;
    const flush = /* @__PURE__ */ __name(() => {
      if (!next) {
        return;
      }
      history._ignoreSubscribers = true;
      (next.isPush ? win2.history.pushState : win2.history.replaceState)(
        next.state,
        "",
        next.href
      );
      history._ignoreSubscribers = false;
      next = void 0;
      scheduled = void 0;
      rollbackLocation = void 0;
    }, "flush");
    const queueHistoryAction = /* @__PURE__ */ __name((type, destHref, state) => {
      const href = createHref(destHref);
      if (!scheduled) {
        rollbackLocation = currentLocation;
      }
      currentLocation = parseHref(destHref, state);
      next = {
        href,
        state,
        isPush: (next == null ? void 0 : next.isPush) || type === "push"
      };
      if (!scheduled) {
        scheduled = Promise.resolve().then(() => flush());
      }
    }, "queueHistoryAction");
    const onPushPop = /* @__PURE__ */ __name((type) => {
      currentLocation = parseLocation();
      history.notify({ type });
    }, "onPushPop");
    const onPushPopEvent = /* @__PURE__ */ __name(() => __async(null, null, function* () {
      if (ignoreNextPop) {
        ignoreNextPop = false;
        return;
      }
      const nextLocation = parseLocation();
      const delta = nextLocation.state[stateIndexKey] - currentLocation.state[stateIndexKey];
      const isForward = delta === 1;
      const isBack = delta === -1;
      const isGo = !isForward && !isBack || nextPopIsGo;
      nextPopIsGo = false;
      const action = isGo ? "GO" : isBack ? "BACK" : "FORWARD";
      const notify = isGo ? {
        type: "GO",
        index: delta
      } : {
        type: isBack ? "BACK" : "FORWARD"
      };
      if (skipBlockerNextPop) {
        skipBlockerNextPop = false;
      } else {
        const blockers2 = _getBlockers();
        if (typeof document !== "undefined" && blockers2.length) {
          for (const blocker of blockers2) {
            const isBlocked = yield blocker.blockerFn({
              currentLocation,
              nextLocation,
              action
            });
            if (isBlocked) {
              ignoreNextPop = true;
              win2.history.go(1);
              history.notify(notify);
              return;
            }
          }
        }
      }
      currentLocation = parseLocation();
      history.notify(notify);
    }), "onPushPopEvent");
    const onBeforeUnload = /* @__PURE__ */ __name((e) => {
      var _a4;
      if (ignoreNextBeforeUnload) {
        ignoreNextBeforeUnload = false;
        return;
      }
      let shouldBlock = false;
      const blockers2 = _getBlockers();
      if (typeof document !== "undefined" && blockers2.length) {
        for (const blocker of blockers2) {
          const shouldHaveBeforeUnload = (_a4 = blocker.enableBeforeUnload) != null ? _a4 : true;
          if (shouldHaveBeforeUnload === true) {
            shouldBlock = true;
            break;
          }
          if (typeof shouldHaveBeforeUnload === "function" && shouldHaveBeforeUnload() === true) {
            shouldBlock = true;
            break;
          }
        }
      }
      if (shouldBlock) {
        e.preventDefault();
        return e.returnValue = "";
      }
      return;
    }, "onBeforeUnload");
    const history = createHistory({
      getLocation,
      getLength: /* @__PURE__ */ __name(() => win2.history.length, "getLength"),
      pushState: /* @__PURE__ */ __name((href, state) => queueHistoryAction("push", href, state), "pushState"),
      replaceState: /* @__PURE__ */ __name((href, state) => queueHistoryAction("replace", href, state), "replaceState"),
      back: /* @__PURE__ */ __name((ignoreBlocker) => {
        if (ignoreBlocker) skipBlockerNextPop = true;
        ignoreNextBeforeUnload = true;
        return win2.history.back();
      }, "back"),
      forward: /* @__PURE__ */ __name((ignoreBlocker) => {
        if (ignoreBlocker) skipBlockerNextPop = true;
        ignoreNextBeforeUnload = true;
        win2.history.forward();
      }, "forward"),
      go: /* @__PURE__ */ __name((n2) => {
        nextPopIsGo = true;
        win2.history.go(n2);
      }, "go"),
      createHref: /* @__PURE__ */ __name((href) => createHref(href), "createHref"),
      flush,
      destroy: /* @__PURE__ */ __name(() => {
        win2.history.pushState = originalPushState;
        win2.history.replaceState = originalReplaceState;
        win2.removeEventListener(beforeUnloadEvent, onBeforeUnload, {
          capture: true
        });
        win2.removeEventListener(popStateEvent, onPushPopEvent);
      }, "destroy"),
      onBlocked: /* @__PURE__ */ __name(() => {
        if (rollbackLocation && currentLocation !== rollbackLocation) {
          currentLocation = rollbackLocation;
        }
      }, "onBlocked"),
      getBlockers: _getBlockers,
      setBlockers: _setBlockers,
      notifyOnIndexChange: false
    });
    win2.addEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });
    win2.addEventListener(popStateEvent, onPushPopEvent);
    win2.history.pushState = function(...args) {
      const res = originalPushState.apply(win2.history, args);
      if (!history._ignoreSubscribers) onPushPop("PUSH");
      return res;
    };
    win2.history.replaceState = function(...args) {
      const res = originalReplaceState.apply(win2.history, args);
      if (!history._ignoreSubscribers) onPushPop("REPLACE");
      return res;
    };
    return history;
  }
  __name(createBrowserHistory, "createBrowserHistory");
  function createHashHistory(opts) {
    const win2 = typeof document !== "undefined" ? window : void 0;
    return createBrowserHistory({
      window: win2,
      parseLocation: /* @__PURE__ */ __name(() => {
        var _a2;
        const hashSplit = win2.location.hash.split("#").slice(1);
        const pathPart = (_a2 = hashSplit[0]) != null ? _a2 : "/";
        const searchPart = win2.location.search;
        const hashEntries = hashSplit.slice(1);
        const hashPart = hashEntries.length === 0 ? "" : `#${hashEntries.join("#")}`;
        const hashHref = `${pathPart}${searchPart}${hashPart}`;
        return parseHref(hashHref, win2.history.state);
      }, "parseLocation"),
      createHref: /* @__PURE__ */ __name((href) => `${win2.location.pathname}${win2.location.search}#${href}`, "createHref")
    });
  }
  __name(createHashHistory, "createHashHistory");
  function createMemoryHistory(opts = {
    initialEntries: ["/"]
  }) {
    const entries = opts.initialEntries;
    let index2 = opts.initialIndex ? Math.min(Math.max(opts.initialIndex, 0), entries.length - 1) : entries.length - 1;
    const states = entries.map(
      (_entry, index22) => assignKeyAndIndex(index22, void 0)
    );
    const getLocation = /* @__PURE__ */ __name(() => parseHref(entries[index2], states[index2]), "getLocation");
    return createHistory({
      getLocation,
      getLength: /* @__PURE__ */ __name(() => entries.length, "getLength"),
      pushState: /* @__PURE__ */ __name((path, state) => {
        if (index2 < entries.length - 1) {
          entries.splice(index2 + 1);
          states.splice(index2 + 1);
        }
        states.push(state);
        entries.push(path);
        index2 = Math.max(entries.length - 1, 0);
      }, "pushState"),
      replaceState: /* @__PURE__ */ __name((path, state) => {
        states[index2] = state;
        entries[index2] = path;
      }, "replaceState"),
      back: /* @__PURE__ */ __name(() => {
        index2 = Math.max(index2 - 1, 0);
      }, "back"),
      forward: /* @__PURE__ */ __name(() => {
        index2 = Math.min(index2 + 1, entries.length - 1);
      }, "forward"),
      go: /* @__PURE__ */ __name((n2) => {
        index2 = Math.min(Math.max(index2 + n2, 0), entries.length - 1);
      }, "go"),
      createHref: /* @__PURE__ */ __name((path) => path, "createHref")
    });
  }
  __name(createMemoryHistory, "createMemoryHistory");
  function parseHref(href, state) {
    const hashIndex = href.indexOf("#");
    const searchIndex = href.indexOf("?");
    const addedKey = createRandomKey();
    return {
      href,
      pathname: href.substring(
        0,
        hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : href.length
      ),
      hash: hashIndex > -1 ? href.substring(hashIndex) : "",
      search: searchIndex > -1 ? href.slice(searchIndex, hashIndex === -1 ? void 0 : hashIndex) : "",
      state: state || { [stateIndexKey]: 0, key: addedKey, __TSR_key: addedKey }
    };
  }
  __name(parseHref, "parseHref");
  function createRandomKey() {
    return (Math.random() + 1).toString(36).substring(7);
  }
  __name(createRandomKey, "createRandomKey");
  function last$1(arr) {
    return arr[arr.length - 1];
  }
  __name(last$1, "last$1");
  function isFunction$5(d) {
    return typeof d === "function";
  }
  __name(isFunction$5, "isFunction$5");
  function functionalUpdate(updater, previous) {
    if (isFunction$5(updater)) {
      return updater(previous);
    }
    return updater;
  }
  __name(functionalUpdate, "functionalUpdate");
  const hasOwn$1 = Object.prototype.hasOwnProperty;
  function replaceEqualDeep(prev, _next) {
    if (prev === _next) {
      return prev;
    }
    const next = _next;
    const array2 = isPlainArray(prev) && isPlainArray(next);
    if (!array2 && !(isPlainObject$2(prev) && isPlainObject$2(next))) return next;
    const prevItems = array2 ? prev : getEnumerableOwnKeys(prev);
    if (!prevItems) return next;
    const nextItems = array2 ? next : getEnumerableOwnKeys(next);
    if (!nextItems) return next;
    const prevSize = prevItems.length;
    const nextSize = nextItems.length;
    const copy2 = array2 ? new Array(nextSize) : {};
    let equalItems = 0;
    for (let i2 = 0; i2 < nextSize; i2++) {
      const key = array2 ? i2 : nextItems[i2];
      const p2 = prev[key];
      const n2 = next[key];
      if (p2 === n2) {
        copy2[key] = p2;
        if (array2 ? i2 < prevSize : hasOwn$1.call(prev, key)) equalItems++;
        continue;
      }
      if (p2 === null || n2 === null || typeof p2 !== "object" || typeof n2 !== "object") {
        copy2[key] = n2;
        continue;
      }
      const v = replaceEqualDeep(p2, n2);
      copy2[key] = v;
      if (v === p2) equalItems++;
    }
    return prevSize === nextSize && equalItems === prevSize ? prev : copy2;
  }
  __name(replaceEqualDeep, "replaceEqualDeep");
  function getEnumerableOwnKeys(o2) {
    const keys2 = [];
    const names = Object.getOwnPropertyNames(o2);
    for (const name of names) {
      if (!Object.prototype.propertyIsEnumerable.call(o2, name)) return false;
      keys2.push(name);
    }
    const symbols = Object.getOwnPropertySymbols(o2);
    for (const symbol of symbols) {
      if (!Object.prototype.propertyIsEnumerable.call(o2, symbol)) return false;
      keys2.push(symbol);
    }
    return keys2;
  }
  __name(getEnumerableOwnKeys, "getEnumerableOwnKeys");
  function isPlainObject$2(o2) {
    if (!hasObjectPrototype(o2)) {
      return false;
    }
    const ctor = o2.constructor;
    if (typeof ctor === "undefined") {
      return true;
    }
    const prot = ctor.prototype;
    if (!hasObjectPrototype(prot)) {
      return false;
    }
    if (!prot.hasOwnProperty("isPrototypeOf")) {
      return false;
    }
    return true;
  }
  __name(isPlainObject$2, "isPlainObject$2");
  function hasObjectPrototype(o2) {
    return Object.prototype.toString.call(o2) === "[object Object]";
  }
  __name(hasObjectPrototype, "hasObjectPrototype");
  function isPlainArray(value) {
    return Array.isArray(value) && value.length === Object.keys(value).length;
  }
  __name(isPlainArray, "isPlainArray");
  function deepEqual$3(a2, b, opts) {
    var _a2;
    if (a2 === b) {
      return true;
    }
    if (typeof a2 !== typeof b) {
      return false;
    }
    if (Array.isArray(a2) && Array.isArray(b)) {
      if (a2.length !== b.length) return false;
      for (let i2 = 0, l = a2.length; i2 < l; i2++) {
        if (!deepEqual$3(a2[i2], b[i2], opts)) return false;
      }
      return true;
    }
    if (isPlainObject$2(a2) && isPlainObject$2(b)) {
      const ignoreUndefined = (_a2 = opts == null ? void 0 : opts.ignoreUndefined) != null ? _a2 : true;
      if (opts == null ? void 0 : opts.partial) {
        for (const k2 in b) {
          if (!ignoreUndefined || b[k2] !== void 0) {
            if (!deepEqual$3(a2[k2], b[k2], opts)) return false;
          }
        }
        return true;
      }
      let aCount = 0;
      if (!ignoreUndefined) {
        aCount = Object.keys(a2).length;
      } else {
        for (const k2 in a2) {
          if (a2[k2] !== void 0) aCount++;
        }
      }
      let bCount = 0;
      for (const k2 in b) {
        if (!ignoreUndefined || b[k2] !== void 0) {
          bCount++;
          if (bCount > aCount || !deepEqual$3(a2[k2], b[k2], opts)) return false;
        }
      }
      return aCount === bCount;
    }
    return false;
  }
  __name(deepEqual$3, "deepEqual$3");
  function createControlledPromise(onResolve) {
    let resolveLoadPromise;
    let rejectLoadPromise;
    const controlledPromise = new Promise((resolve, reject) => {
      resolveLoadPromise = resolve;
      rejectLoadPromise = reject;
    });
    controlledPromise.status = "pending";
    controlledPromise.resolve = (value) => {
      controlledPromise.status = "resolved";
      controlledPromise.value = value;
      resolveLoadPromise(value);
      onResolve == null ? void 0 : onResolve(value);
    };
    controlledPromise.reject = (e) => {
      controlledPromise.status = "rejected";
      rejectLoadPromise(e);
    };
    return controlledPromise;
  }
  __name(createControlledPromise, "createControlledPromise");
  function isModuleNotFoundError(error) {
    if (typeof (error == null ? void 0 : error.message) !== "string") return false;
    return error.message.startsWith("Failed to fetch dynamically imported module") || error.message.startsWith("error loading dynamically imported module") || error.message.startsWith("Importing a module script failed");
  }
  __name(isModuleNotFoundError, "isModuleNotFoundError");
  function isPromise(value) {
    return Boolean(
      value && typeof value === "object" && typeof value.then === "function"
    );
  }
  __name(isPromise, "isPromise");
  const SEGMENT_TYPE_PATHNAME = 0;
  const SEGMENT_TYPE_PARAM = 1;
  const SEGMENT_TYPE_WILDCARD = 2;
  const SEGMENT_TYPE_OPTIONAL_PARAM = 3;
  function joinPaths(paths) {
    return cleanPath(
      paths.filter((val) => {
        return val !== void 0;
      }).join("/")
    );
  }
  __name(joinPaths, "joinPaths");
  function cleanPath(path) {
    return path.replace(/\/{2,}/g, "/");
  }
  __name(cleanPath, "cleanPath");
  function trimPathLeft(path) {
    return path === "/" ? path : path.replace(/^\/{1,}/, "");
  }
  __name(trimPathLeft, "trimPathLeft");
  function trimPathRight(path) {
    return path === "/" ? path : path.replace(/\/{1,}$/, "");
  }
  __name(trimPathRight, "trimPathRight");
  function trimPath(path) {
    return trimPathRight(trimPathLeft(path));
  }
  __name(trimPath, "trimPath");
  function removeTrailingSlash(value, basepath) {
    if ((value == null ? void 0 : value.endsWith("/")) && value !== "/" && value !== `${basepath}/`) {
      return value.slice(0, -1);
    }
    return value;
  }
  __name(removeTrailingSlash, "removeTrailingSlash");
  function exactPathTest(pathName1, pathName2, basepath) {
    return removeTrailingSlash(pathName1, basepath) === removeTrailingSlash(pathName2, basepath);
  }
  __name(exactPathTest, "exactPathTest");
  function segmentToString(segment) {
    const { type, value } = segment;
    if (type === SEGMENT_TYPE_PATHNAME) {
      return value;
    }
    const { prefixSegment, suffixSegment } = segment;
    if (type === SEGMENT_TYPE_PARAM) {
      const param = value.substring(1);
      if (prefixSegment && suffixSegment) {
        return `${prefixSegment}{$${param}}${suffixSegment}`;
      } else if (prefixSegment) {
        return `${prefixSegment}{$${param}}`;
      } else if (suffixSegment) {
        return `{$${param}}${suffixSegment}`;
      }
    }
    if (type === SEGMENT_TYPE_OPTIONAL_PARAM) {
      const param = value.substring(1);
      if (prefixSegment && suffixSegment) {
        return `${prefixSegment}{-$${param}}${suffixSegment}`;
      } else if (prefixSegment) {
        return `${prefixSegment}{-$${param}}`;
      } else if (suffixSegment) {
        return `{-$${param}}${suffixSegment}`;
      }
      return `{-$${param}}`;
    }
    if (type === SEGMENT_TYPE_WILDCARD) {
      if (prefixSegment && suffixSegment) {
        return `${prefixSegment}{$}${suffixSegment}`;
      } else if (prefixSegment) {
        return `${prefixSegment}{$}`;
      } else if (suffixSegment) {
        return `{$}${suffixSegment}`;
      }
    }
    return value;
  }
  __name(segmentToString, "segmentToString");
  function resolvePath({
    basepath,
    base,
    to,
    trailingSlash = "never",
    caseSensitive,
    parseCache
  }) {
    var _a2;
    base = removeBasepath(basepath, base, caseSensitive);
    to = removeBasepath(basepath, to, caseSensitive);
    let baseSegments = parsePathname(base, parseCache).slice();
    const toSegments = parsePathname(to, parseCache);
    if (baseSegments.length > 1 && ((_a2 = last$1(baseSegments)) == null ? void 0 : _a2.value) === "/") {
      baseSegments.pop();
    }
    for (let index2 = 0, length = toSegments.length; index2 < length; index2++) {
      const toSegment = toSegments[index2];
      const value = toSegment.value;
      if (value === "/") {
        if (!index2) {
          baseSegments = [toSegment];
        } else if (index2 === length - 1) {
          baseSegments.push(toSegment);
        } else ;
      } else if (value === "..") {
        baseSegments.pop();
      } else if (value === ".") ;
      else {
        baseSegments.push(toSegment);
      }
    }
    if (baseSegments.length > 1) {
      if (last$1(baseSegments).value === "/") {
        if (trailingSlash === "never") {
          baseSegments.pop();
        }
      } else if (trailingSlash === "always") {
        baseSegments.push({ type: SEGMENT_TYPE_PATHNAME, value: "/" });
      }
    }
    const segmentValues = baseSegments.map(segmentToString);
    const joined = joinPaths([basepath, ...segmentValues]);
    return joined;
  }
  __name(resolvePath, "resolvePath");
  const parsePathname = /* @__PURE__ */ __name((pathname, cache) => {
    if (!pathname) return [];
    const cached = cache == null ? void 0 : cache.get(pathname);
    if (cached) return cached;
    const parsed = baseParsePathname(pathname);
    cache == null ? void 0 : cache.set(pathname, parsed);
    return parsed;
  }, "parsePathname");
  const PARAM_RE = /^\$.{1,}$/;
  const PARAM_W_CURLY_BRACES_RE = /^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/;
  const OPTIONAL_PARAM_W_CURLY_BRACES_RE = /^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/;
  const WILDCARD_RE = /^\$$/;
  const WILDCARD_W_CURLY_BRACES_RE = /^(.*?)\{\$\}(.*)$/;
  function baseParsePathname(pathname) {
    pathname = cleanPath(pathname);
    const segments = [];
    if (pathname.slice(0, 1) === "/") {
      pathname = pathname.substring(1);
      segments.push({
        type: SEGMENT_TYPE_PATHNAME,
        value: "/"
      });
    }
    if (!pathname) {
      return segments;
    }
    const split = pathname.split("/").filter(Boolean);
    segments.push(
      ...split.map((part) => {
        const wildcardBracesMatch = part.match(WILDCARD_W_CURLY_BRACES_RE);
        if (wildcardBracesMatch) {
          const prefix2 = wildcardBracesMatch[1];
          const suffix = wildcardBracesMatch[2];
          return {
            type: SEGMENT_TYPE_WILDCARD,
            value: "$",
            prefixSegment: prefix2 || void 0,
            suffixSegment: suffix || void 0
          };
        }
        const optionalParamBracesMatch = part.match(
          OPTIONAL_PARAM_W_CURLY_BRACES_RE
        );
        if (optionalParamBracesMatch) {
          const prefix2 = optionalParamBracesMatch[1];
          const paramName = optionalParamBracesMatch[2];
          const suffix = optionalParamBracesMatch[3];
          return {
            type: SEGMENT_TYPE_OPTIONAL_PARAM,
            value: paramName,
            // Now just $paramName (no prefix)
            prefixSegment: prefix2 || void 0,
            suffixSegment: suffix || void 0
          };
        }
        const paramBracesMatch = part.match(PARAM_W_CURLY_BRACES_RE);
        if (paramBracesMatch) {
          const prefix2 = paramBracesMatch[1];
          const paramName = paramBracesMatch[2];
          const suffix = paramBracesMatch[3];
          return {
            type: SEGMENT_TYPE_PARAM,
            value: "" + paramName,
            prefixSegment: prefix2 || void 0,
            suffixSegment: suffix || void 0
          };
        }
        if (PARAM_RE.test(part)) {
          const paramName = part.substring(1);
          return {
            type: SEGMENT_TYPE_PARAM,
            value: "$" + paramName,
            prefixSegment: void 0,
            suffixSegment: void 0
          };
        }
        if (WILDCARD_RE.test(part)) {
          return {
            type: SEGMENT_TYPE_WILDCARD,
            value: "$",
            prefixSegment: void 0,
            suffixSegment: void 0
          };
        }
        return {
          type: SEGMENT_TYPE_PATHNAME,
          value: part.includes("%25") ? part.split("%25").map((segment) => decodeURI(segment)).join("%25") : decodeURI(part)
        };
      })
    );
    if (pathname.slice(-1) === "/") {
      pathname = pathname.substring(1);
      segments.push({
        type: SEGMENT_TYPE_PATHNAME,
        value: "/"
      });
    }
    return segments;
  }
  __name(baseParsePathname, "baseParsePathname");
  function interpolatePath({
    path,
    params,
    leaveWildcards,
    leaveParams,
    decodeCharMap,
    parseCache
  }) {
    const interpolatedPathSegments = parsePathname(path, parseCache);
    function encodeParam(key) {
      const value = params[key];
      const isValueString = typeof value === "string";
      if (key === "*" || key === "_splat") {
        return isValueString ? encodeURI(value) : value;
      } else {
        return isValueString ? encodePathParam(value, decodeCharMap) : value;
      }
    }
    __name(encodeParam, "encodeParam");
    let isMissingParams = false;
    const usedParams = {};
    const interpolatedPath = joinPaths(
      interpolatedPathSegments.map((segment) => {
        var _a2, _b2, _c2;
        if (segment.type === SEGMENT_TYPE_PATHNAME) {
          return segment.value;
        }
        if (segment.type === SEGMENT_TYPE_WILDCARD) {
          usedParams._splat = params._splat;
          usedParams["*"] = params._splat;
          const segmentPrefix = segment.prefixSegment || "";
          const segmentSuffix = segment.suffixSegment || "";
          if (!("_splat" in params)) {
            isMissingParams = true;
            if (leaveWildcards) {
              return `${segmentPrefix}${segment.value}${segmentSuffix}`;
            }
            if (segmentPrefix || segmentSuffix) {
              return `${segmentPrefix}${segmentSuffix}`;
            }
            return void 0;
          }
          const value = encodeParam("_splat");
          if (leaveWildcards) {
            return `${segmentPrefix}${segment.value}${value != null ? value : ""}${segmentSuffix}`;
          }
          return `${segmentPrefix}${value}${segmentSuffix}`;
        }
        if (segment.type === SEGMENT_TYPE_PARAM) {
          const key = segment.value.substring(1);
          if (!isMissingParams && !(key in params)) {
            isMissingParams = true;
          }
          usedParams[key] = params[key];
          const segmentPrefix = segment.prefixSegment || "";
          const segmentSuffix = segment.suffixSegment || "";
          if (leaveParams) {
            const value = encodeParam(segment.value);
            return `${segmentPrefix}${segment.value}${value != null ? value : ""}${segmentSuffix}`;
          }
          return `${segmentPrefix}${(_a2 = encodeParam(key)) != null ? _a2 : "undefined"}${segmentSuffix}`;
        }
        if (segment.type === SEGMENT_TYPE_OPTIONAL_PARAM) {
          const key = segment.value.substring(1);
          const segmentPrefix = segment.prefixSegment || "";
          const segmentSuffix = segment.suffixSegment || "";
          if (!(key in params) || params[key] == null) {
            if (leaveWildcards) {
              return `${segmentPrefix}${key}${segmentSuffix}`;
            }
            if (segmentPrefix || segmentSuffix) {
              return `${segmentPrefix}${segmentSuffix}`;
            }
            return void 0;
          }
          usedParams[key] = params[key];
          if (leaveParams) {
            const value = encodeParam(segment.value);
            return `${segmentPrefix}${segment.value}${value != null ? value : ""}${segmentSuffix}`;
          }
          if (leaveWildcards) {
            return `${segmentPrefix}${key}${(_b2 = encodeParam(key)) != null ? _b2 : ""}${segmentSuffix}`;
          }
          return `${segmentPrefix}${(_c2 = encodeParam(key)) != null ? _c2 : ""}${segmentSuffix}`;
        }
        return segment.value;
      })
    );
    return { usedParams, interpolatedPath, isMissingParams };
  }
  __name(interpolatePath, "interpolatePath");
  function encodePathParam(value, decodeCharMap) {
    let encoded = encodeURIComponent(value);
    if (decodeCharMap) {
      for (const [encodedChar, char] of decodeCharMap) {
        encoded = encoded.replaceAll(encodedChar, char);
      }
    }
    return encoded;
  }
  __name(encodePathParam, "encodePathParam");
  function matchPathname(basepath, currentPathname, matchLocation, parseCache) {
    const pathParams = matchByPath(
      basepath,
      currentPathname,
      matchLocation,
      parseCache
    );
    if (matchLocation.to && !pathParams) {
      return;
    }
    return pathParams != null ? pathParams : {};
  }
  __name(matchPathname, "matchPathname");
  function removeBasepath(basepath, pathname, caseSensitive = false) {
    const normalizedBasepath = caseSensitive ? basepath : basepath.toLowerCase();
    const normalizedPathname = caseSensitive ? pathname : pathname.toLowerCase();
    switch (true) {
      // default behaviour is to serve app from the root - pathname
      // left untouched
      case normalizedBasepath === "/":
        return pathname;
      // shortcut for removing the basepath if it matches the pathname
      case normalizedPathname === normalizedBasepath:
        return "";
      // in case pathname is shorter than basepath - there is
      // nothing to remove
      case pathname.length < basepath.length:
        return pathname;
      // avoid matching partial segments - strict equality handled
      // earlier, otherwise, basepath separated from pathname with
      // separator, therefore lack of separator means partial
      // segment match (`/app` should not match `/application`)
      case normalizedPathname[normalizedBasepath.length] !== "/":
        return pathname;
      // remove the basepath from the pathname if it starts with it
      case normalizedPathname.startsWith(normalizedBasepath):
        return pathname.slice(basepath.length);
      // otherwise, return the pathname as is
      default:
        return pathname;
    }
  }
  __name(removeBasepath, "removeBasepath");
  function matchByPath(basepath, from, {
    to,
    fuzzy,
    caseSensitive
  }, parseCache) {
    if (basepath !== "/" && !from.startsWith(basepath)) {
      return void 0;
    }
    from = removeBasepath(basepath, from, caseSensitive);
    to = removeBasepath(basepath, `${to != null ? to : "$"}`, caseSensitive);
    const baseSegments = parsePathname(
      from.startsWith("/") ? from : `/${from}`,
      parseCache
    );
    const routeSegments = parsePathname(
      to.startsWith("/") ? to : `/${to}`,
      parseCache
    );
    const params = {};
    const result = isMatch(
      baseSegments,
      routeSegments,
      params,
      fuzzy,
      caseSensitive
    );
    return result ? params : void 0;
  }
  __name(matchByPath, "matchByPath");
  function isMatch(baseSegments, routeSegments, params, fuzzy, caseSensitive) {
    var _a2, _b2, _c2;
    let baseIndex = 0;
    let routeIndex = 0;
    while (baseIndex < baseSegments.length || routeIndex < routeSegments.length) {
      const baseSegment = baseSegments[baseIndex];
      const routeSegment = routeSegments[routeIndex];
      if (routeSegment) {
        if (routeSegment.type === SEGMENT_TYPE_WILDCARD) {
          const remainingBaseSegments = baseSegments.slice(baseIndex);
          let _splat;
          if (routeSegment.prefixSegment || routeSegment.suffixSegment) {
            if (!baseSegment) return false;
            const prefix2 = routeSegment.prefixSegment || "";
            const suffix = routeSegment.suffixSegment || "";
            const baseValue = baseSegment.value;
            if ("prefixSegment" in routeSegment) {
              if (!baseValue.startsWith(prefix2)) {
                return false;
              }
            }
            if ("suffixSegment" in routeSegment) {
              if (!((_a2 = baseSegments[baseSegments.length - 1]) == null ? void 0 : _a2.value.endsWith(suffix))) {
                return false;
              }
            }
            let rejoinedSplat = decodeURI(
              joinPaths(remainingBaseSegments.map((d) => d.value))
            );
            if (prefix2 && rejoinedSplat.startsWith(prefix2)) {
              rejoinedSplat = rejoinedSplat.slice(prefix2.length);
            }
            if (suffix && rejoinedSplat.endsWith(suffix)) {
              rejoinedSplat = rejoinedSplat.slice(
                0,
                rejoinedSplat.length - suffix.length
              );
            }
            _splat = rejoinedSplat;
          } else {
            _splat = decodeURI(
              joinPaths(remainingBaseSegments.map((d) => d.value))
            );
          }
          params["*"] = _splat;
          params["_splat"] = _splat;
          return true;
        }
        if (routeSegment.type === SEGMENT_TYPE_PATHNAME) {
          if (routeSegment.value === "/" && !(baseSegment == null ? void 0 : baseSegment.value)) {
            routeIndex++;
            continue;
          }
          if (baseSegment) {
            if (caseSensitive) {
              if (routeSegment.value !== baseSegment.value) {
                return false;
              }
            } else if (routeSegment.value.toLowerCase() !== baseSegment.value.toLowerCase()) {
              return false;
            }
            baseIndex++;
            routeIndex++;
            continue;
          } else {
            return false;
          }
        }
        if (routeSegment.type === SEGMENT_TYPE_PARAM) {
          if (!baseSegment) {
            return false;
          }
          if (baseSegment.value === "/") {
            return false;
          }
          let _paramValue = "";
          let matched = false;
          if (routeSegment.prefixSegment || routeSegment.suffixSegment) {
            const prefix2 = routeSegment.prefixSegment || "";
            const suffix = routeSegment.suffixSegment || "";
            const baseValue = baseSegment.value;
            if (prefix2 && !baseValue.startsWith(prefix2)) {
              return false;
            }
            if (suffix && !baseValue.endsWith(suffix)) {
              return false;
            }
            let paramValue = baseValue;
            if (prefix2 && paramValue.startsWith(prefix2)) {
              paramValue = paramValue.slice(prefix2.length);
            }
            if (suffix && paramValue.endsWith(suffix)) {
              paramValue = paramValue.slice(0, paramValue.length - suffix.length);
            }
            _paramValue = decodeURIComponent(paramValue);
            matched = true;
          } else {
            _paramValue = decodeURIComponent(baseSegment.value);
            matched = true;
          }
          if (matched) {
            params[routeSegment.value.substring(1)] = _paramValue;
            baseIndex++;
          }
          routeIndex++;
          continue;
        }
        if (routeSegment.type === SEGMENT_TYPE_OPTIONAL_PARAM) {
          if (!baseSegment) {
            routeIndex++;
            continue;
          }
          if (baseSegment.value === "/") {
            routeIndex++;
            continue;
          }
          let _paramValue = "";
          let matched = false;
          if (routeSegment.prefixSegment || routeSegment.suffixSegment) {
            const prefix2 = routeSegment.prefixSegment || "";
            const suffix = routeSegment.suffixSegment || "";
            const baseValue = baseSegment.value;
            if ((!prefix2 || baseValue.startsWith(prefix2)) && (!suffix || baseValue.endsWith(suffix))) {
              let paramValue = baseValue;
              if (prefix2 && paramValue.startsWith(prefix2)) {
                paramValue = paramValue.slice(prefix2.length);
              }
              if (suffix && paramValue.endsWith(suffix)) {
                paramValue = paramValue.slice(
                  0,
                  paramValue.length - suffix.length
                );
              }
              _paramValue = decodeURIComponent(paramValue);
              matched = true;
            }
          } else {
            let shouldMatchOptional = true;
            for (let lookAhead = routeIndex + 1; lookAhead < routeSegments.length; lookAhead++) {
              const futureRouteSegment = routeSegments[lookAhead];
              if ((futureRouteSegment == null ? void 0 : futureRouteSegment.type) === SEGMENT_TYPE_PATHNAME && futureRouteSegment.value === baseSegment.value) {
                shouldMatchOptional = false;
                break;
              }
              if ((futureRouteSegment == null ? void 0 : futureRouteSegment.type) === SEGMENT_TYPE_PARAM || (futureRouteSegment == null ? void 0 : futureRouteSegment.type) === SEGMENT_TYPE_WILDCARD) {
                if (baseSegments.length < routeSegments.length) {
                  shouldMatchOptional = false;
                }
                break;
              }
            }
            if (shouldMatchOptional) {
              _paramValue = decodeURIComponent(baseSegment.value);
              matched = true;
            }
          }
          if (matched) {
            params[routeSegment.value.substring(1)] = _paramValue;
            baseIndex++;
          }
          routeIndex++;
          continue;
        }
      }
      if (baseIndex < baseSegments.length && routeIndex >= routeSegments.length) {
        params["**"] = joinPaths(
          baseSegments.slice(baseIndex).map((d) => d.value)
        );
        return !!fuzzy && ((_b2 = routeSegments[routeSegments.length - 1]) == null ? void 0 : _b2.value) !== "/";
      }
      if (routeIndex < routeSegments.length && baseIndex >= baseSegments.length) {
        for (let i2 = routeIndex; i2 < routeSegments.length; i2++) {
          if (((_c2 = routeSegments[i2]) == null ? void 0 : _c2.type) !== SEGMENT_TYPE_OPTIONAL_PARAM) {
            return false;
          }
        }
        break;
      }
      break;
    }
    return true;
  }
  __name(isMatch, "isMatch");
  const SLASH_SCORE = 0.75;
  const STATIC_SEGMENT_SCORE = 1;
  const REQUIRED_PARAM_BASE_SCORE = 0.5;
  const OPTIONAL_PARAM_BASE_SCORE = 0.4;
  const WILDCARD_PARAM_BASE_SCORE = 0.25;
  const STATIC_AFTER_DYNAMIC_BONUS_SCORE = 0.2;
  const BOTH_PRESENCE_BASE_SCORE = 0.05;
  const PREFIX_PRESENCE_BASE_SCORE = 0.02;
  const SUFFIX_PRESENCE_BASE_SCORE = 0.01;
  const PREFIX_LENGTH_SCORE_MULTIPLIER = 2e-4;
  const SUFFIX_LENGTH_SCORE_MULTIPLIER = 1e-4;
  function handleParam(segment, baseScore) {
    if (segment.prefixSegment && segment.suffixSegment) {
      return baseScore + BOTH_PRESENCE_BASE_SCORE + PREFIX_LENGTH_SCORE_MULTIPLIER * segment.prefixSegment.length + SUFFIX_LENGTH_SCORE_MULTIPLIER * segment.suffixSegment.length;
    }
    if (segment.prefixSegment) {
      return baseScore + PREFIX_PRESENCE_BASE_SCORE + PREFIX_LENGTH_SCORE_MULTIPLIER * segment.prefixSegment.length;
    }
    if (segment.suffixSegment) {
      return baseScore + SUFFIX_PRESENCE_BASE_SCORE + SUFFIX_LENGTH_SCORE_MULTIPLIER * segment.suffixSegment.length;
    }
    return baseScore;
  }
  __name(handleParam, "handleParam");
  function sortRoutes(routes) {
    const scoredRoutes = [];
    routes.forEach((d, i2) => {
      var _a2;
      if (d.isRoot || !d.path) {
        return;
      }
      const trimmed = trimPathLeft(d.fullPath);
      let parsed = parsePathname(trimmed);
      let skip = 0;
      while (parsed.length > skip + 1 && ((_a2 = parsed[skip]) == null ? void 0 : _a2.value) === "/") {
        skip++;
      }
      if (skip > 0) parsed = parsed.slice(skip);
      let optionalParamCount = 0;
      let hasStaticAfter = false;
      const scores = parsed.map((segment, index2) => {
        if (segment.value === "/") {
          return SLASH_SCORE;
        }
        if (segment.type === SEGMENT_TYPE_PATHNAME) {
          return STATIC_SEGMENT_SCORE;
        }
        let baseScore = void 0;
        if (segment.type === SEGMENT_TYPE_PARAM) {
          baseScore = REQUIRED_PARAM_BASE_SCORE;
        } else if (segment.type === SEGMENT_TYPE_OPTIONAL_PARAM) {
          baseScore = OPTIONAL_PARAM_BASE_SCORE;
          optionalParamCount++;
        } else {
          baseScore = WILDCARD_PARAM_BASE_SCORE;
        }
        for (let i22 = index2 + 1; i22 < parsed.length; i22++) {
          const nextSegment = parsed[i22];
          if (nextSegment.type === SEGMENT_TYPE_PATHNAME && nextSegment.value !== "/") {
            hasStaticAfter = true;
            return handleParam(
              segment,
              baseScore + STATIC_AFTER_DYNAMIC_BONUS_SCORE
            );
          }
        }
        return handleParam(segment, baseScore);
      });
      scoredRoutes.push({
        child: d,
        trimmed,
        parsed,
        index: i2,
        scores,
        optionalParamCount,
        hasStaticAfter
      });
    });
    const flatRoutes = scoredRoutes.sort((a2, b) => {
      const minLength = Math.min(a2.scores.length, b.scores.length);
      for (let i2 = 0; i2 < minLength; i2++) {
        if (a2.scores[i2] !== b.scores[i2]) {
          return b.scores[i2] - a2.scores[i2];
        }
      }
      if (a2.scores.length !== b.scores.length) {
        if (a2.optionalParamCount !== b.optionalParamCount) {
          if (a2.hasStaticAfter === b.hasStaticAfter) {
            return a2.optionalParamCount - b.optionalParamCount;
          } else if (a2.hasStaticAfter && !b.hasStaticAfter) {
            return -1;
          } else if (!a2.hasStaticAfter && b.hasStaticAfter) {
            return 1;
          }
        }
        return b.scores.length - a2.scores.length;
      }
      for (let i2 = 0; i2 < minLength; i2++) {
        if (a2.parsed[i2].value !== b.parsed[i2].value) {
          return a2.parsed[i2].value > b.parsed[i2].value ? 1 : -1;
        }
      }
      return a2.index - b.index;
    }).map((d, i2) => {
      d.child.rank = i2;
      return d.child;
    });
    return flatRoutes;
  }
  __name(sortRoutes, "sortRoutes");
  function processRouteTree({
    routeTree: routeTree2,
    initRoute
  }) {
    const routesById = {};
    const routesByPath = {};
    const recurseRoutes = /* @__PURE__ */ __name((childRoutes) => {
      childRoutes.forEach((childRoute, i2) => {
        initRoute == null ? void 0 : initRoute(childRoute, i2);
        const existingRoute = routesById[childRoute.id];
        invariant(
          !existingRoute,
          `Duplicate routes found with id: ${String(childRoute.id)}`
        );
        routesById[childRoute.id] = childRoute;
        if (!childRoute.isRoot && childRoute.path) {
          const trimmedFullPath = trimPathRight(childRoute.fullPath);
          if (!routesByPath[trimmedFullPath] || childRoute.fullPath.endsWith("/")) {
            routesByPath[trimmedFullPath] = childRoute;
          }
        }
        const children = childRoute.children;
        if (children == null ? void 0 : children.length) {
          recurseRoutes(children);
        }
      });
    }, "recurseRoutes");
    recurseRoutes([routeTree2]);
    const flatRoutes = sortRoutes(Object.values(routesById));
    return { routesById, routesByPath, flatRoutes };
  }
  __name(processRouteTree, "processRouteTree");
  function isNotFound(obj) {
    return !!(obj == null ? void 0 : obj.isNotFound);
  }
  __name(isNotFound, "isNotFound");
  function getSafeSessionStorage() {
    try {
      if (typeof window !== "undefined" && typeof window.sessionStorage === "object") {
        return window.sessionStorage;
      }
    } catch (e) {
    }
    return void 0;
  }
  __name(getSafeSessionStorage, "getSafeSessionStorage");
  const storageKey = "tsr-scroll-restoration-v1_3";
  const throttle$1 = /* @__PURE__ */ __name((fn, wait) => {
    let timeout;
    return (...args) => {
      if (!timeout) {
        timeout = setTimeout(() => {
          fn(...args);
          timeout = null;
        }, wait);
      }
    };
  }, "throttle$1");
  function createScrollRestorationCache() {
    const safeSessionStorage = getSafeSessionStorage();
    if (!safeSessionStorage) {
      return void 0;
    }
    const persistedState = safeSessionStorage.getItem(storageKey);
    let state = persistedState ? JSON.parse(persistedState) : {};
    return {
      state,
      // This setter is simply to make sure that we set the sessionStorage right
      // after the state is updated. It doesn't necessarily need to be a functional
      // update.
      set: /* @__PURE__ */ __name((updater) => (state = functionalUpdate(updater, state) || state, safeSessionStorage.setItem(storageKey, JSON.stringify(state))), "set")
    };
  }
  __name(createScrollRestorationCache, "createScrollRestorationCache");
  const scrollRestorationCache = createScrollRestorationCache();
  const defaultGetScrollRestorationKey = /* @__PURE__ */ __name((location) => {
    return location.state.__TSR_key || location.href;
  }, "defaultGetScrollRestorationKey");
  function getCssSelector(el) {
    const path = [];
    let parent;
    while (parent = el.parentNode) {
      path.push(
        `${el.tagName}:nth-child(${Array.prototype.indexOf.call(parent.children, el) + 1})`
      );
      el = parent;
    }
    return `${path.reverse().join(" > ")}`.toLowerCase();
  }
  __name(getCssSelector, "getCssSelector");
  let ignoreScroll = false;
  function restoreScroll({
    storageKey: storageKey2,
    key,
    behavior,
    shouldScrollRestoration,
    scrollToTopSelectors,
    location
  }) {
    var _a3;
    var _a2, _b2;
    let byKey;
    try {
      byKey = JSON.parse(sessionStorage.getItem(storageKey2) || "{}");
    } catch (error) {
      console.error(error);
      return;
    }
    const resolvedKey = key || ((_a2 = window.history.state) == null ? void 0 : _a2.key);
    const elementEntries = byKey[resolvedKey];
    ignoreScroll = true;
    scroll: {
      if (shouldScrollRestoration && elementEntries && Object.keys(elementEntries).length > 0) {
        for (const elementSelector in elementEntries) {
          const entry = elementEntries[elementSelector];
          if (elementSelector === "window") {
            window.scrollTo({
              top: entry.scrollY,
              left: entry.scrollX,
              behavior
            });
          } else if (elementSelector) {
            const element = document.querySelector(elementSelector);
            if (element) {
              element.scrollLeft = entry.scrollX;
              element.scrollTop = entry.scrollY;
            }
          }
        }
        break scroll;
      }
      const hash = (location != null ? location : window.location).hash.split("#", 2)[1];
      if (hash) {
        const hashScrollIntoViewOptions = (_a3 = (_b2 = window.history.state) == null ? void 0 : _b2.__hashScrollIntoViewOptions) != null ? _a3 : true;
        if (hashScrollIntoViewOptions) {
          const el = document.getElementById(hash);
          if (el) {
            el.scrollIntoView(hashScrollIntoViewOptions);
          }
        }
        break scroll;
      }
      const scrollOptions = { top: 0, left: 0, behavior };
      window.scrollTo(scrollOptions);
      if (scrollToTopSelectors) {
        for (const selector of scrollToTopSelectors) {
          if (selector === "window") continue;
          const element = typeof selector === "function" ? selector() : document.querySelector(selector);
          if (element) element.scrollTo(scrollOptions);
        }
      }
    }
    ignoreScroll = false;
  }
  __name(restoreScroll, "restoreScroll");
  function setupScrollRestoration(router2, force) {
    var _a2;
    if (scrollRestorationCache === void 0) {
      return;
    }
    const shouldScrollRestoration = (_a2 = router2.options.scrollRestoration) != null ? _a2 : false;
    if (shouldScrollRestoration) {
      router2.isScrollRestoring = true;
    }
    if (typeof document === "undefined" || router2.isScrollRestorationSetup) {
      return;
    }
    router2.isScrollRestorationSetup = true;
    ignoreScroll = false;
    const getKey = router2.options.getScrollRestorationKey || defaultGetScrollRestorationKey;
    window.history.scrollRestoration = "manual";
    const onScroll = /* @__PURE__ */ __name((event) => {
      if (ignoreScroll || !router2.isScrollRestoring) {
        return;
      }
      let elementSelector = "";
      if (event.target === document || event.target === window) {
        elementSelector = "window";
      } else {
        const attrId = event.target.getAttribute(
          "data-scroll-restoration-id"
        );
        if (attrId) {
          elementSelector = `[data-scroll-restoration-id="${attrId}"]`;
        } else {
          elementSelector = getCssSelector(event.target);
        }
      }
      const restoreKey = getKey(router2.state.location);
      scrollRestorationCache.set((state) => {
        const keyEntry = state[restoreKey] || (state[restoreKey] = {});
        const elementEntry = keyEntry[elementSelector] || (keyEntry[elementSelector] = {});
        if (elementSelector === "window") {
          elementEntry.scrollX = window.scrollX || 0;
          elementEntry.scrollY = window.scrollY || 0;
        } else if (elementSelector) {
          const element = document.querySelector(elementSelector);
          if (element) {
            elementEntry.scrollX = element.scrollLeft || 0;
            elementEntry.scrollY = element.scrollTop || 0;
          }
        }
        return state;
      });
    }, "onScroll");
    if (typeof document !== "undefined") {
      document.addEventListener("scroll", throttle$1(onScroll, 100), true);
    }
    router2.subscribe("onRendered", (event) => {
      const cacheKey = getKey(event.toLocation);
      if (!router2.resetNextScroll) {
        router2.resetNextScroll = true;
        return;
      }
      restoreScroll({
        storageKey,
        key: cacheKey,
        behavior: router2.options.scrollRestorationBehavior,
        shouldScrollRestoration: router2.isScrollRestoring,
        scrollToTopSelectors: router2.options.scrollToTopSelectors,
        location: router2.history.location
      });
      if (router2.isScrollRestoring) {
        scrollRestorationCache.set((state) => {
          state[cacheKey] || (state[cacheKey] = {});
          return state;
        });
      }
    });
  }
  __name(setupScrollRestoration, "setupScrollRestoration");
  function handleHashScroll(router2) {
    var _a2;
    if (typeof document !== "undefined" && document.querySelector) {
      const hashScrollIntoViewOptions = (_a2 = router2.state.location.state.__hashScrollIntoViewOptions) != null ? _a2 : true;
      if (hashScrollIntoViewOptions && router2.state.location.hash !== "") {
        const el = document.getElementById(router2.state.location.hash);
        if (el) {
          el.scrollIntoView(hashScrollIntoViewOptions);
        }
      }
    }
  }
  __name(handleHashScroll, "handleHashScroll");
  function encode(obj, stringify = String) {
    const result = new URLSearchParams();
    for (const key in obj) {
      const val = obj[key];
      if (val !== void 0) {
        result.set(key, stringify(val));
      }
    }
    return result.toString();
  }
  __name(encode, "encode");
  function toValue$1(str) {
    if (!str) return "";
    if (str === "false") return false;
    if (str === "true") return true;
    return +str * 0 === 0 && +str + "" === str ? +str : str;
  }
  __name(toValue$1, "toValue$1");
  function decode(str) {
    const searchParams = new URLSearchParams(str);
    const result = {};
    for (const [key, value] of searchParams.entries()) {
      const previousValue = result[key];
      if (previousValue == null) {
        result[key] = toValue$1(value);
      } else if (Array.isArray(previousValue)) {
        previousValue.push(toValue$1(value));
      } else {
        result[key] = [previousValue, toValue$1(value)];
      }
    }
    return result;
  }
  __name(decode, "decode");
  const defaultParseSearch = parseSearchWith(JSON.parse);
  const defaultStringifySearch = stringifySearchWith(
    JSON.stringify,
    JSON.parse
  );
  function parseSearchWith(parser) {
    return (searchStr) => {
      if (searchStr[0] === "?") {
        searchStr = searchStr.substring(1);
      }
      const query = decode(searchStr);
      for (const key in query) {
        const value = query[key];
        if (typeof value === "string") {
          try {
            query[key] = parser(value);
          } catch (_err) {
          }
        }
      }
      return query;
    };
  }
  __name(parseSearchWith, "parseSearchWith");
  function stringifySearchWith(stringify, parser) {
    const hasParser = typeof parser === "function";
    function stringifyValue(val) {
      if (typeof val === "object" && val !== null) {
        try {
          return stringify(val);
        } catch (_err) {
        }
      } else if (hasParser && typeof val === "string") {
        try {
          parser(val);
          return stringify(val);
        } catch (_err) {
        }
      }
      return val;
    }
    __name(stringifyValue, "stringifyValue");
    return (search) => {
      const searchStr = encode(search, stringifyValue);
      return searchStr ? `?${searchStr}` : "";
    };
  }
  __name(stringifySearchWith, "stringifySearchWith");
  const rootRouteId = "__root__";
  function redirect(opts) {
    opts.statusCode = opts.statusCode || opts.code || 307;
    if (!opts.reloadDocument && typeof opts.href === "string") {
      try {
        new URL(opts.href);
        opts.reloadDocument = true;
      } catch (e) {
      }
    }
    const headers = new Headers(opts.headers);
    if (opts.href && headers.get("Location") === null) {
      headers.set("Location", opts.href);
    }
    const response = new Response(null, {
      status: opts.statusCode,
      headers
    });
    response.options = opts;
    if (opts.throw) {
      throw response;
    }
    return response;
  }
  __name(redirect, "redirect");
  function isRedirect(obj) {
    return obj instanceof Response && !!obj.options;
  }
  __name(isRedirect, "isRedirect");
  function createLRUCache(max2) {
    const cache = /* @__PURE__ */ new Map();
    let oldest;
    let newest;
    const touch = /* @__PURE__ */ __name((entry) => {
      if (!entry.next) return;
      if (!entry.prev) {
        entry.next.prev = void 0;
        oldest = entry.next;
        entry.next = void 0;
        if (newest) {
          entry.prev = newest;
          newest.next = entry;
        }
      } else {
        entry.prev.next = entry.next;
        entry.next.prev = entry.prev;
        entry.next = void 0;
        if (newest) {
          newest.next = entry;
          entry.prev = newest;
        }
      }
      newest = entry;
    }, "touch");
    return {
      get(key) {
        const entry = cache.get(key);
        if (!entry) return void 0;
        touch(entry);
        return entry.value;
      },
      set(key, value) {
        if (cache.size >= max2 && oldest) {
          const toDelete = oldest;
          cache.delete(toDelete.key);
          if (toDelete.next) {
            oldest = toDelete.next;
            toDelete.next.prev = void 0;
          }
          if (toDelete === newest) {
            newest = void 0;
          }
        }
        const existing = cache.get(key);
        if (existing) {
          existing.value = value;
          touch(existing);
        } else {
          const entry = { key, value, prev: newest };
          if (newest) newest.next = entry;
          newest = entry;
          if (!oldest) oldest = entry;
          cache.set(key, entry);
        }
      }
    };
  }
  __name(createLRUCache, "createLRUCache");
  const triggerOnReady = /* @__PURE__ */ __name((inner) => {
    var _a2;
    if (!inner.rendered) {
      inner.rendered = true;
      return (_a2 = inner.onReady) == null ? void 0 : _a2.call(inner);
    }
  }, "triggerOnReady");
  const resolvePreload = /* @__PURE__ */ __name((inner, matchId) => {
    return !!(inner.preload && !inner.router.state.matches.some((d) => d.id === matchId));
  }, "resolvePreload");
  const _handleNotFound = /* @__PURE__ */ __name((inner, err) => {
    var _a3, _b2;
    var _a2;
    const routeCursor = (_b2 = inner.router.routesById[(_a3 = err.routeId) != null ? _a3 : ""]) != null ? _b2 : inner.router.routeTree;
    if (!routeCursor.options.notFoundComponent && ((_a2 = inner.router.options) == null ? void 0 : _a2.defaultNotFoundComponent)) {
      routeCursor.options.notFoundComponent = inner.router.options.defaultNotFoundComponent;
    }
    invariant(
      routeCursor.options.notFoundComponent
    );
    const matchForRoute = inner.matches.find((m2) => m2.routeId === routeCursor.id);
    invariant(matchForRoute, "Could not find match for route: " + routeCursor.id);
    inner.updateMatch(matchForRoute.id, (prev) => __spreadProps(__spreadValues({}, prev), {
      status: "notFound",
      error: err,
      isFetching: false
    }));
    if (err.routerCode === "BEFORE_LOAD" && routeCursor.parentRoute) {
      err.routeId = routeCursor.parentRoute.id;
      _handleNotFound(inner, err);
    }
  }, "_handleNotFound");
  const handleRedirectAndNotFound = /* @__PURE__ */ __name((inner, match, err) => {
    var _a2, _b2, _c2;
    if (!isRedirect(err) && !isNotFound(err)) return;
    if (isRedirect(err) && err.redirectHandled && !err.options.reloadDocument) {
      throw err;
    }
    if (match) {
      (_a2 = match._nonReactive.beforeLoadPromise) == null ? void 0 : _a2.resolve();
      (_b2 = match._nonReactive.loaderPromise) == null ? void 0 : _b2.resolve();
      match._nonReactive.beforeLoadPromise = void 0;
      match._nonReactive.loaderPromise = void 0;
      const status = isRedirect(err) ? "redirected" : "notFound";
      inner.updateMatch(match.id, (prev) => __spreadProps(__spreadValues({}, prev), {
        status,
        isFetching: false,
        error: err
      }));
      if (isNotFound(err) && !err.routeId) {
        err.routeId = match.routeId;
      }
      (_c2 = match._nonReactive.loadPromise) == null ? void 0 : _c2.resolve();
    }
    if (isRedirect(err)) {
      inner.rendered = true;
      err.options._fromLocation = inner.location;
      err.redirectHandled = true;
      err = inner.router.resolveRedirect(err);
      throw err;
    } else {
      _handleNotFound(inner, err);
      throw err;
    }
  }, "handleRedirectAndNotFound");
  const shouldSkipLoader = /* @__PURE__ */ __name((inner, matchId) => {
    const match = inner.router.getMatch(matchId);
    if (!inner.router.isServer && match._nonReactive.dehydrated) {
      return true;
    }
    if (inner.router.isServer && match.ssr === false) {
      return true;
    }
    return false;
  }, "shouldSkipLoader");
  const handleSerialError = /* @__PURE__ */ __name((inner, index2, err, routerCode) => {
    var _a3;
    var _a2, _b2;
    const { id: matchId, routeId } = inner.matches[index2];
    const route = inner.router.looseRoutesById[routeId];
    if (err instanceof Promise) {
      throw err;
    }
    err.routerCode = routerCode;
    (_a3 = inner.firstBadMatchIndex) != null ? _a3 : inner.firstBadMatchIndex = index2;
    handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), err);
    try {
      (_b2 = (_a2 = route.options).onError) == null ? void 0 : _b2.call(_a2, err);
    } catch (errorHandlerErr) {
      err = errorHandlerErr;
      handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), err);
    }
    inner.updateMatch(matchId, (prev) => {
      var _a22, _b22;
      (_a22 = prev._nonReactive.beforeLoadPromise) == null ? void 0 : _a22.resolve();
      prev._nonReactive.beforeLoadPromise = void 0;
      (_b22 = prev._nonReactive.loadPromise) == null ? void 0 : _b22.resolve();
      return __spreadProps(__spreadValues({}, prev), {
        error: err,
        status: "error",
        isFetching: false,
        updatedAt: Date.now(),
        abortController: new AbortController()
      });
    });
  }, "handleSerialError");
  const isBeforeLoadSsr = /* @__PURE__ */ __name((inner, matchId, index2, route) => {
    var _a3;
    var _a2;
    const existingMatch = inner.router.getMatch(matchId);
    const parentMatchId = (_a2 = inner.matches[index2 - 1]) == null ? void 0 : _a2.id;
    const parentMatch = parentMatchId ? inner.router.getMatch(parentMatchId) : void 0;
    if (inner.router.isShell()) {
      existingMatch.ssr = matchId === rootRouteId;
      return;
    }
    if ((parentMatch == null ? void 0 : parentMatch.ssr) === false) {
      existingMatch.ssr = false;
      return;
    }
    const parentOverride = /* @__PURE__ */ __name((tempSsr2) => {
      if (tempSsr2 === true && (parentMatch == null ? void 0 : parentMatch.ssr) === "data-only") {
        return "data-only";
      }
      return tempSsr2;
    }, "parentOverride");
    const defaultSsr = (_a3 = inner.router.options.defaultSsr) != null ? _a3 : true;
    if (route.options.ssr === void 0) {
      existingMatch.ssr = parentOverride(defaultSsr);
      return;
    }
    if (typeof route.options.ssr !== "function") {
      existingMatch.ssr = parentOverride(route.options.ssr);
      return;
    }
    const { search, params } = existingMatch;
    const ssrFnContext = {
      search: makeMaybe(search, existingMatch.searchError),
      params: makeMaybe(params, existingMatch.paramsError),
      location: inner.location,
      matches: inner.matches.map((match) => ({
        index: match.index,
        pathname: match.pathname,
        fullPath: match.fullPath,
        staticData: match.staticData,
        id: match.id,
        routeId: match.routeId,
        search: makeMaybe(match.search, match.searchError),
        params: makeMaybe(match.params, match.paramsError),
        ssr: match.ssr
      }))
    };
    const tempSsr = route.options.ssr(ssrFnContext);
    if (isPromise(tempSsr)) {
      return tempSsr.then((ssr) => {
        existingMatch.ssr = parentOverride(ssr != null ? ssr : defaultSsr);
      });
    }
    existingMatch.ssr = parentOverride(tempSsr != null ? tempSsr : defaultSsr);
    return;
  }, "isBeforeLoadSsr");
  const setupPendingTimeout = /* @__PURE__ */ __name((inner, matchId, route, match) => {
    var _a3, _b2;
    var _a2;
    if (match._nonReactive.pendingTimeout !== void 0) return;
    const pendingMs = (_a3 = route.options.pendingMs) != null ? _a3 : inner.router.options.defaultPendingMs;
    const shouldPending = !!(inner.onReady && !inner.router.isServer && !resolvePreload(inner, matchId) && (route.options.loader || route.options.beforeLoad || routeNeedsPreload(route)) && typeof pendingMs === "number" && pendingMs !== Infinity && ((_b2 = route.options.pendingComponent) != null ? _b2 : (_a2 = inner.router.options) == null ? void 0 : _a2.defaultPendingComponent));
    if (shouldPending) {
      const pendingTimeout = setTimeout(() => {
        triggerOnReady(inner);
      }, pendingMs);
      match._nonReactive.pendingTimeout = pendingTimeout;
    }
  }, "setupPendingTimeout");
  const preBeforeLoadSetup = /* @__PURE__ */ __name((inner, matchId, route) => {
    const existingMatch = inner.router.getMatch(matchId);
    if (!existingMatch._nonReactive.beforeLoadPromise && !existingMatch._nonReactive.loaderPromise)
      return;
    setupPendingTimeout(inner, matchId, route, existingMatch);
    const then = /* @__PURE__ */ __name(() => {
      const match = inner.router.getMatch(matchId);
      if (match.preload && (match.status === "redirected" || match.status === "notFound")) {
        handleRedirectAndNotFound(inner, match, match.error);
      }
    }, "then");
    return existingMatch._nonReactive.beforeLoadPromise ? existingMatch._nonReactive.beforeLoadPromise.then(then) : then();
  }, "preBeforeLoadSetup");
  const executeBeforeLoad = /* @__PURE__ */ __name((inner, matchId, index2, route) => {
    var _a3, _b2;
    var _a2;
    const match = inner.router.getMatch(matchId);
    const prevLoadPromise = match._nonReactive.loadPromise;
    match._nonReactive.loadPromise = createControlledPromise(() => {
      prevLoadPromise == null ? void 0 : prevLoadPromise.resolve();
    });
    const { paramsError, searchError } = match;
    if (paramsError) {
      handleSerialError(inner, index2, paramsError, "PARSE_PARAMS");
    }
    if (searchError) {
      handleSerialError(inner, index2, searchError, "VALIDATE_SEARCH");
    }
    setupPendingTimeout(inner, matchId, route, match);
    const abortController = new AbortController();
    const parentMatchId = (_a2 = inner.matches[index2 - 1]) == null ? void 0 : _a2.id;
    const parentMatch = parentMatchId ? inner.router.getMatch(parentMatchId) : void 0;
    const parentMatchContext = (_b2 = (_a3 = parentMatch == null ? void 0 : parentMatch.context) != null ? _a3 : inner.router.options.context) != null ? _b2 : void 0;
    const context = __spreadValues(__spreadValues({}, parentMatchContext), match.__routeContext);
    let isPending = false;
    const pending = /* @__PURE__ */ __name(() => {
      if (isPending) return;
      isPending = true;
      inner.updateMatch(matchId, (prev) => __spreadProps(__spreadValues({}, prev), {
        isFetching: "beforeLoad",
        fetchCount: prev.fetchCount + 1,
        abortController,
        context
      }));
    }, "pending");
    const resolve = /* @__PURE__ */ __name(() => {
      var _a22;
      (_a22 = match._nonReactive.beforeLoadPromise) == null ? void 0 : _a22.resolve();
      match._nonReactive.beforeLoadPromise = void 0;
      inner.updateMatch(matchId, (prev) => __spreadProps(__spreadValues({}, prev), {
        isFetching: false
      }));
    }, "resolve");
    if (!route.options.beforeLoad) {
      batch(() => {
        pending();
        resolve();
      });
      return;
    }
    match._nonReactive.beforeLoadPromise = createControlledPromise();
    const { search, params, cause } = match;
    const preload = resolvePreload(inner, matchId);
    const beforeLoadFnContext = {
      search,
      abortController,
      params,
      preload,
      context,
      location: inner.location,
      navigate: /* @__PURE__ */ __name((opts) => inner.router.navigate(__spreadProps(__spreadValues({}, opts), {
        _fromLocation: inner.location
      })), "navigate"),
      buildLocation: inner.router.buildLocation,
      cause: preload ? "preload" : cause,
      matches: inner.matches
    };
    const updateContext = /* @__PURE__ */ __name((beforeLoadContext2) => {
      if (beforeLoadContext2 === void 0) {
        batch(() => {
          pending();
          resolve();
        });
        return;
      }
      if (isRedirect(beforeLoadContext2) || isNotFound(beforeLoadContext2)) {
        pending();
        handleSerialError(inner, index2, beforeLoadContext2, "BEFORE_LOAD");
      }
      batch(() => {
        pending();
        inner.updateMatch(matchId, (prev) => __spreadProps(__spreadValues({}, prev), {
          __beforeLoadContext: beforeLoadContext2,
          context: __spreadValues(__spreadValues({}, prev.context), beforeLoadContext2)
        }));
        resolve();
      });
    }, "updateContext");
    let beforeLoadContext;
    try {
      beforeLoadContext = route.options.beforeLoad(beforeLoadFnContext);
      if (isPromise(beforeLoadContext)) {
        pending();
        return beforeLoadContext.catch((err) => {
          handleSerialError(inner, index2, err, "BEFORE_LOAD");
        }).then(updateContext);
      }
    } catch (err) {
      pending();
      handleSerialError(inner, index2, err, "BEFORE_LOAD");
    }
    updateContext(beforeLoadContext);
    return;
  }, "executeBeforeLoad");
  const handleBeforeLoad = /* @__PURE__ */ __name((inner, index2) => {
    const { id: matchId, routeId } = inner.matches[index2];
    const route = inner.router.looseRoutesById[routeId];
    const serverSsr = /* @__PURE__ */ __name(() => {
      if (inner.router.isServer) {
        const maybePromise = isBeforeLoadSsr(inner, matchId, index2, route);
        if (isPromise(maybePromise)) return maybePromise.then(queueExecution);
      }
      return queueExecution();
    }, "serverSsr");
    const queueExecution = /* @__PURE__ */ __name(() => {
      if (shouldSkipLoader(inner, matchId)) return;
      const result = preBeforeLoadSetup(inner, matchId, route);
      return isPromise(result) ? result.then(execute) : execute();
    }, "queueExecution");
    const execute = /* @__PURE__ */ __name(() => executeBeforeLoad(inner, matchId, index2, route), "execute");
    return serverSsr();
  }, "handleBeforeLoad");
  const executeHead = /* @__PURE__ */ __name((inner, matchId, route) => {
    var _a2, _b2, _c2, _d, _e2, _f;
    const match = inner.router.getMatch(matchId);
    if (!match) {
      return;
    }
    if (!route.options.head && !route.options.scripts && !route.options.headers) {
      return;
    }
    const assetContext = {
      matches: inner.matches,
      match,
      params: match.params,
      loaderData: match.loaderData
    };
    return Promise.all([
      (_b2 = (_a2 = route.options).head) == null ? void 0 : _b2.call(_a2, assetContext),
      (_d = (_c2 = route.options).scripts) == null ? void 0 : _d.call(_c2, assetContext),
      (_f = (_e2 = route.options).headers) == null ? void 0 : _f.call(_e2, assetContext)
    ]).then(([headFnContent, scripts, headers]) => {
      const meta = headFnContent == null ? void 0 : headFnContent.meta;
      const links = headFnContent == null ? void 0 : headFnContent.links;
      const headScripts = headFnContent == null ? void 0 : headFnContent.scripts;
      const styles = headFnContent == null ? void 0 : headFnContent.styles;
      return {
        meta,
        links,
        headScripts,
        headers,
        scripts,
        styles
      };
    });
  }, "executeHead");
  const getLoaderContext = /* @__PURE__ */ __name((inner, matchId, index2, route) => {
    const parentMatchPromise = inner.matchPromises[index2 - 1];
    const { params, loaderDeps, abortController, context, cause } = inner.router.getMatch(matchId);
    const preload = resolvePreload(inner, matchId);
    return {
      params,
      deps: loaderDeps,
      preload: !!preload,
      parentMatchPromise,
      abortController,
      context,
      location: inner.location,
      navigate: /* @__PURE__ */ __name((opts) => inner.router.navigate(__spreadProps(__spreadValues({}, opts), {
        _fromLocation: inner.location
      })), "navigate"),
      cause: preload ? "preload" : cause,
      route
    };
  }, "getLoaderContext");
  const runLoader = /* @__PURE__ */ __name((inner, matchId, index2, route) => __async(null, null, function* () {
    var _a2, _b2, _c2, _d;
    try {
      const match = inner.router.getMatch(matchId);
      try {
        if (!inner.router.isServer || match.ssr === true) {
          loadRouteChunk(route);
        }
        const loaderResult = (_b2 = (_a2 = route.options).loader) == null ? void 0 : _b2.call(
          _a2,
          getLoaderContext(inner, matchId, index2, route)
        );
        const loaderResultIsPromise = route.options.loader && isPromise(loaderResult);
        const willLoadSomething = !!(loaderResultIsPromise || route._lazyPromise || route._componentsPromise || route.options.head || route.options.scripts || route.options.headers || match._nonReactive.minPendingPromise);
        if (willLoadSomething) {
          inner.updateMatch(matchId, (prev) => __spreadProps(__spreadValues({}, prev), {
            isFetching: "loader"
          }));
        }
        if (route.options.loader) {
          const loaderData = loaderResultIsPromise ? yield loaderResult : loaderResult;
          handleRedirectAndNotFound(
            inner,
            inner.router.getMatch(matchId),
            loaderData
          );
          if (loaderData !== void 0) {
            inner.updateMatch(matchId, (prev) => __spreadProps(__spreadValues({}, prev), {
              loaderData
            }));
          }
        }
        if (route._lazyPromise) yield route._lazyPromise;
        const headResult = executeHead(inner, matchId, route);
        const head = headResult ? yield headResult : void 0;
        const pendingPromise = match._nonReactive.minPendingPromise;
        if (pendingPromise) yield pendingPromise;
        if (route._componentsPromise) yield route._componentsPromise;
        inner.updateMatch(matchId, (prev) => __spreadValues(__spreadProps(__spreadValues({}, prev), {
          error: void 0,
          status: "success",
          isFetching: false,
          updatedAt: Date.now()
        }), head));
      } catch (e) {
        let error = e;
        const pendingPromise = match._nonReactive.minPendingPromise;
        if (pendingPromise) yield pendingPromise;
        handleRedirectAndNotFound(inner, inner.router.getMatch(matchId), e);
        try {
          (_d = (_c2 = route.options).onError) == null ? void 0 : _d.call(_c2, e);
        } catch (onErrorError) {
          error = onErrorError;
          handleRedirectAndNotFound(
            inner,
            inner.router.getMatch(matchId),
            onErrorError
          );
        }
        const headResult = executeHead(inner, matchId, route);
        const head = headResult ? yield headResult : void 0;
        inner.updateMatch(matchId, (prev) => __spreadValues(__spreadProps(__spreadValues({}, prev), {
          error,
          status: "error",
          isFetching: false
        }), head));
      }
    } catch (err) {
      const match = inner.router.getMatch(matchId);
      if (match) {
        const headResult = executeHead(inner, matchId, route);
        if (headResult) {
          const head = yield headResult;
          inner.updateMatch(matchId, (prev) => __spreadValues(__spreadValues({}, prev), head));
        }
        match._nonReactive.loaderPromise = void 0;
      }
      handleRedirectAndNotFound(inner, match, err);
    }
  }), "runLoader");
  const loadRouteMatch = /* @__PURE__ */ __name((inner, index2) => __async(null, null, function* () {
    var _a3, _b3, _c2, _d;
    var _a2, _b2;
    const { id: matchId, routeId } = inner.matches[index2];
    let loaderShouldRunAsync = false;
    let loaderIsRunningAsync = false;
    const route = inner.router.looseRoutesById[routeId];
    if (shouldSkipLoader(inner, matchId)) {
      if (inner.router.isServer) {
        const headResult = executeHead(inner, matchId, route);
        if (headResult) {
          const head = yield headResult;
          inner.updateMatch(matchId, (prev) => __spreadValues(__spreadValues({}, prev), head));
        }
        return inner.router.getMatch(matchId);
      }
    } else {
      const prevMatch = inner.router.getMatch(matchId);
      if (prevMatch._nonReactive.loaderPromise) {
        if (prevMatch.status === "success" && !inner.sync && !prevMatch.preload) {
          return prevMatch;
        }
        yield prevMatch._nonReactive.loaderPromise;
        const match2 = inner.router.getMatch(matchId);
        if (match2.error) {
          handleRedirectAndNotFound(inner, match2, match2.error);
        }
      } else {
        const age = Date.now() - prevMatch.updatedAt;
        const preload = resolvePreload(inner, matchId);
        const staleAge = preload ? (_b3 = (_a3 = route.options.preloadStaleTime) != null ? _a3 : inner.router.options.defaultPreloadStaleTime) != null ? _b3 : 3e4 : (_d = (_c2 = route.options.staleTime) != null ? _c2 : inner.router.options.defaultStaleTime) != null ? _d : 0;
        const shouldReloadOption = route.options.shouldReload;
        const shouldReload = typeof shouldReloadOption === "function" ? shouldReloadOption(getLoaderContext(inner, matchId, index2, route)) : shouldReloadOption;
        const nextPreload = !!preload && !inner.router.state.matches.some((d) => d.id === matchId);
        const match2 = inner.router.getMatch(matchId);
        match2._nonReactive.loaderPromise = createControlledPromise();
        if (nextPreload !== match2.preload) {
          inner.updateMatch(matchId, (prev) => __spreadProps(__spreadValues({}, prev), {
            preload: nextPreload
          }));
        }
        const { status, invalid } = match2;
        loaderShouldRunAsync = status === "success" && (invalid || (shouldReload != null ? shouldReload : age > staleAge));
        if (preload && route.options.preload === false) ;
        else if (loaderShouldRunAsync && !inner.sync) {
          loaderIsRunningAsync = true;
          (() => __async(null, null, function* () {
            var _a22, _b22;
            try {
              yield runLoader(inner, matchId, index2, route);
              const match3 = inner.router.getMatch(matchId);
              (_a22 = match3._nonReactive.loaderPromise) == null ? void 0 : _a22.resolve();
              (_b22 = match3._nonReactive.loadPromise) == null ? void 0 : _b22.resolve();
              match3._nonReactive.loaderPromise = void 0;
            } catch (err) {
              if (isRedirect(err)) {
                yield inner.router.navigate(err.options);
              }
            }
          }))();
        } else if (status !== "success" || loaderShouldRunAsync && inner.sync) {
          yield runLoader(inner, matchId, index2, route);
        } else {
          const headResult = executeHead(inner, matchId, route);
          if (headResult) {
            const head = yield headResult;
            inner.updateMatch(matchId, (prev) => __spreadValues(__spreadValues({}, prev), head));
          }
        }
      }
    }
    const match = inner.router.getMatch(matchId);
    if (!loaderIsRunningAsync) {
      (_a2 = match._nonReactive.loaderPromise) == null ? void 0 : _a2.resolve();
      (_b2 = match._nonReactive.loadPromise) == null ? void 0 : _b2.resolve();
    }
    clearTimeout(match._nonReactive.pendingTimeout);
    match._nonReactive.pendingTimeout = void 0;
    if (!loaderIsRunningAsync) match._nonReactive.loaderPromise = void 0;
    match._nonReactive.dehydrated = void 0;
    const nextIsFetching = loaderIsRunningAsync ? match.isFetching : false;
    if (nextIsFetching !== match.isFetching || match.invalid !== false) {
      inner.updateMatch(matchId, (prev) => __spreadProps(__spreadValues({}, prev), {
        isFetching: nextIsFetching,
        invalid: false
      }));
      return inner.router.getMatch(matchId);
    } else {
      return match;
    }
  }), "loadRouteMatch");
  function loadMatches(arg) {
    return __async(this, null, function* () {
      var _a2;
      const inner = Object.assign(arg, {
        matchPromises: []
      });
      if (!inner.router.isServer && inner.router.state.matches.some((d) => d._forcePending)) {
        triggerOnReady(inner);
      }
      try {
        for (let i2 = 0; i2 < inner.matches.length; i2++) {
          const beforeLoad = handleBeforeLoad(inner, i2);
          if (isPromise(beforeLoad)) yield beforeLoad;
        }
        const max2 = (_a2 = inner.firstBadMatchIndex) != null ? _a2 : inner.matches.length;
        for (let i2 = 0; i2 < max2; i2++) {
          inner.matchPromises.push(loadRouteMatch(inner, i2));
        }
        yield Promise.all(inner.matchPromises);
        const readyPromise = triggerOnReady(inner);
        if (isPromise(readyPromise)) yield readyPromise;
      } catch (err) {
        if (isNotFound(err) && !inner.preload) {
          const readyPromise = triggerOnReady(inner);
          if (isPromise(readyPromise)) yield readyPromise;
          throw err;
        }
        if (isRedirect(err)) {
          throw err;
        }
      }
      return inner.matches;
    });
  }
  __name(loadMatches, "loadMatches");
  function loadRouteChunk(route) {
    return __async(this, null, function* () {
      if (!route._lazyLoaded && route._lazyPromise === void 0) {
        if (route.lazyFn) {
          route._lazyPromise = route.lazyFn().then((lazyRoute) => {
            const _a2 = lazyRoute.options, { id: _id } = _a2, options2 = __objRest(_a2, ["id"]);
            Object.assign(route.options, options2);
            route._lazyLoaded = true;
            route._lazyPromise = void 0;
          });
        } else {
          route._lazyLoaded = true;
        }
      }
      if (!route._componentsLoaded && route._componentsPromise === void 0) {
        const loadComponents = /* @__PURE__ */ __name(() => {
          var _a2;
          const preloads = [];
          for (const type of componentTypes) {
            const preload = (_a2 = route.options[type]) == null ? void 0 : _a2.preload;
            if (preload) preloads.push(preload());
          }
          if (preloads.length)
            return Promise.all(preloads).then(() => {
              route._componentsLoaded = true;
              route._componentsPromise = void 0;
            });
          route._componentsLoaded = true;
          route._componentsPromise = void 0;
          return;
        }, "loadComponents");
        route._componentsPromise = route._lazyPromise ? route._lazyPromise.then(loadComponents) : loadComponents();
      }
      return route._componentsPromise;
    });
  }
  __name(loadRouteChunk, "loadRouteChunk");
  function makeMaybe(value, error) {
    if (error) {
      return { status: "error", error };
    }
    return { status: "success", value };
  }
  __name(makeMaybe, "makeMaybe");
  function routeNeedsPreload(route) {
    var _a2;
    for (const componentType of componentTypes) {
      if ((_a2 = route.options[componentType]) == null ? void 0 : _a2.preload) {
        return true;
      }
    }
    return false;
  }
  __name(routeNeedsPreload, "routeNeedsPreload");
  const componentTypes = [
    "component",
    "errorComponent",
    "pendingComponent",
    "notFoundComponent"
  ];
  function getLocationChangeInfo(routerState) {
    const fromLocation = routerState.resolvedLocation;
    const toLocation = routerState.location;
    const pathChanged = (fromLocation == null ? void 0 : fromLocation.pathname) !== toLocation.pathname;
    const hrefChanged = (fromLocation == null ? void 0 : fromLocation.href) !== toLocation.href;
    const hashChanged = (fromLocation == null ? void 0 : fromLocation.hash) !== toLocation.hash;
    return { fromLocation, toLocation, pathChanged, hrefChanged, hashChanged };
  }
  __name(getLocationChangeInfo, "getLocationChangeInfo");
  const _RouterCore = class _RouterCore {
    /**
     * @deprecated Use the `createRouter` function instead
     */
    constructor(options2) {
      var _g, _h, _i, _j;
      this.tempLocationKey = `${Math.round(
        Math.random() * 1e7
      )}`;
      this.resetNextScroll = true;
      this.shouldViewTransition = void 0;
      this.isViewTransitionTypesSupported = void 0;
      this.subscribers = /* @__PURE__ */ new Set();
      this.isScrollRestoring = false;
      this.isScrollRestorationSetup = false;
      this.startTransition = (fn) => fn();
      this.update = (newOptions) => {
        var _a3, _b2;
        var _a2;
        if (newOptions.notFoundRoute) {
          console.warn(
            "The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info."
          );
        }
        const previousOptions = this.options;
        this.options = __spreadValues(__spreadValues({}, this.options), newOptions);
        this.isServer = (_a3 = this.options.isServer) != null ? _a3 : typeof document === "undefined";
        this.pathParamsDecodeCharMap = this.options.pathParamsAllowedCharacters ? new Map(
          this.options.pathParamsAllowedCharacters.map((char) => [
            encodeURIComponent(char),
            char
          ])
        ) : void 0;
        if (!this.basepath || newOptions.basepath && newOptions.basepath !== previousOptions.basepath) {
          if (newOptions.basepath === void 0 || newOptions.basepath === "" || newOptions.basepath === "/") {
            this.basepath = "/";
          } else {
            this.basepath = `/${trimPath(newOptions.basepath)}`;
          }
        }
        if (!this.history || this.options.history && this.options.history !== this.history) {
          this.history = (_b2 = this.options.history) != null ? _b2 : this.isServer ? createMemoryHistory({
            initialEntries: [this.basepath || "/"]
          }) : createBrowserHistory();
          this.updateLatestLocation();
        }
        if (this.options.routeTree !== this.routeTree) {
          this.routeTree = this.options.routeTree;
          this.buildRouteTree();
        }
        if (!this.__store) {
          this.__store = new Store(getInitialRouterState(this.latestLocation), {
            onUpdate: /* @__PURE__ */ __name(() => {
              this.__store.state = __spreadProps(__spreadValues({}, this.state), {
                cachedMatches: this.state.cachedMatches.filter(
                  (d) => !["redirected"].includes(d.status)
                )
              });
            }, "onUpdate")
          });
          setupScrollRestoration(this);
        }
        if (typeof window !== "undefined" && "CSS" in window && typeof ((_a2 = window.CSS) == null ? void 0 : _a2.supports) === "function") {
          this.isViewTransitionTypesSupported = window.CSS.supports(
            "selector(:active-view-transition-type(a)"
          );
        }
      };
      this.updateLatestLocation = () => {
        this.latestLocation = this.parseLocation(
          this.history.location,
          this.latestLocation
        );
      };
      this.buildRouteTree = () => {
        const { routesById, routesByPath, flatRoutes } = processRouteTree({
          routeTree: this.routeTree,
          initRoute: /* @__PURE__ */ __name((route, i2) => {
            route.init({
              originalIndex: i2
            });
          }, "initRoute")
        });
        this.routesById = routesById;
        this.routesByPath = routesByPath;
        this.flatRoutes = flatRoutes;
        const notFoundRoute = this.options.notFoundRoute;
        if (notFoundRoute) {
          notFoundRoute.init({
            originalIndex: 99999999999
          });
          this.routesById[notFoundRoute.id] = notFoundRoute;
        }
      };
      this.subscribe = (eventType, fn) => {
        const listener = {
          eventType,
          fn
        };
        this.subscribers.add(listener);
        return () => {
          this.subscribers.delete(listener);
        };
      };
      this.emit = (routerEvent) => {
        this.subscribers.forEach((listener) => {
          if (listener.eventType === routerEvent.type) {
            listener.fn(routerEvent);
          }
        });
      };
      this.parseLocation = (locationToParse, previousLocation) => {
        const parse2 = /* @__PURE__ */ __name(({
          pathname,
          search,
          hash,
          state
        }) => {
          var _a2;
          const parsedSearch = this.options.parseSearch(search);
          const searchStr = this.options.stringifySearch(parsedSearch);
          return {
            pathname,
            searchStr,
            search: replaceEqualDeep(previousLocation == null ? void 0 : previousLocation.search, parsedSearch),
            hash: (_a2 = hash.split("#").reverse()[0]) != null ? _a2 : "",
            href: `${pathname}${searchStr}${hash}`,
            state: replaceEqualDeep(previousLocation == null ? void 0 : previousLocation.state, state)
          };
        }, "parse");
        const location = parse2(locationToParse);
        const { __tempLocation, __tempKey } = location.state;
        if (__tempLocation && (!__tempKey || __tempKey === this.tempLocationKey)) {
          const parsedTempLocation = parse2(__tempLocation);
          parsedTempLocation.state.key = location.state.key;
          parsedTempLocation.state.__TSR_key = location.state.__TSR_key;
          delete parsedTempLocation.state.__tempLocation;
          return __spreadProps(__spreadValues({}, parsedTempLocation), {
            maskedLocation: location
          });
        }
        return location;
      };
      this.resolvePathWithBase = (from, path) => {
        const resolvedPath = resolvePath({
          basepath: this.basepath,
          base: from,
          to: cleanPath(path),
          trailingSlash: this.options.trailingSlash,
          caseSensitive: this.options.caseSensitive,
          parseCache: this.parsePathnameCache
        });
        return resolvedPath;
      };
      this.matchRoutes = (pathnameOrNext, locationSearchOrOpts, opts) => {
        if (typeof pathnameOrNext === "string") {
          return this.matchRoutesInternal(
            {
              pathname: pathnameOrNext,
              search: locationSearchOrOpts
            },
            opts
          );
        }
        return this.matchRoutesInternal(pathnameOrNext, locationSearchOrOpts);
      };
      this.parsePathnameCache = createLRUCache(1e3);
      this.getMatchedRoutes = (pathname, routePathname) => {
        return getMatchedRoutes({
          pathname,
          routePathname,
          basepath: this.basepath,
          caseSensitive: this.options.caseSensitive,
          routesByPath: this.routesByPath,
          routesById: this.routesById,
          flatRoutes: this.flatRoutes,
          parseCache: this.parsePathnameCache
        });
      };
      this.cancelMatch = (id) => {
        const match = this.getMatch(id);
        if (!match) return;
        match.abortController.abort();
        clearTimeout(match._nonReactive.pendingTimeout);
        match._nonReactive.pendingTimeout = void 0;
      };
      this.cancelMatches = () => {
        var _a2;
        (_a2 = this.state.pendingMatches) == null ? void 0 : _a2.forEach((match) => {
          this.cancelMatch(match.id);
        });
      };
      this.buildLocation = (opts) => {
        const build = /* @__PURE__ */ __name((dest = {}) => {
          var _a3, _b3, _c2;
          var _a2, _b2;
          const currentLocation = dest._fromLocation || this.latestLocation;
          const allCurrentLocationMatches = this.matchRoutes(currentLocation, {
            _buildLocation: true
          });
          const lastMatch = last$1(allCurrentLocationMatches);
          if (dest.from && false) ;
          const defaultedFromPath = dest.unsafeRelative === "path" ? currentLocation.pathname : (_a3 = dest.from) != null ? _a3 : lastMatch.fullPath;
          const fromPath = this.resolvePathWithBase(defaultedFromPath, ".");
          const fromSearch = lastMatch.search;
          const fromParams = __spreadValues({}, lastMatch.params);
          const nextTo = dest.to ? this.resolvePathWithBase(fromPath, `${dest.to}`) : this.resolvePathWithBase(fromPath, ".");
          const nextParams = dest.params === false || dest.params === null ? {} : ((_b3 = dest.params) != null ? _b3 : true) === true ? fromParams : Object.assign(
            fromParams,
            functionalUpdate(dest.params, fromParams)
          );
          const interpolatedNextTo = interpolatePath({
            path: nextTo,
            params: nextParams,
            parseCache: this.parsePathnameCache
          }).interpolatedPath;
          const destRoutes = this.matchRoutes(interpolatedNextTo, void 0, {
            _buildLocation: true
          }).map((d) => this.looseRoutesById[d.routeId]);
          if (Object.keys(nextParams).length > 0) {
            for (const route of destRoutes) {
              const fn = (_c2 = (_a2 = route.options.params) == null ? void 0 : _a2.stringify) != null ? _c2 : route.options.stringifyParams;
              if (fn) {
                Object.assign(nextParams, fn(nextParams));
              }
            }
          }
          const nextPathname = interpolatePath({
            // Use the original template path for interpolation
            // This preserves the original parameter syntax including optional parameters
            path: nextTo,
            params: nextParams,
            leaveWildcards: false,
            leaveParams: opts.leaveParams,
            decodeCharMap: this.pathParamsDecodeCharMap,
            parseCache: this.parsePathnameCache
          }).interpolatedPath;
          let nextSearch = fromSearch;
          if (opts._includeValidateSearch && ((_b2 = this.options.search) == null ? void 0 : _b2.strict)) {
            const validatedSearch = {};
            destRoutes.forEach((route) => {
              if (route.options.validateSearch) {
                try {
                  Object.assign(
                    validatedSearch,
                    validateSearch(route.options.validateSearch, __spreadValues(__spreadValues({}, validatedSearch), nextSearch))
                  );
                } catch (e) {
                }
              }
            });
            nextSearch = validatedSearch;
          }
          nextSearch = applySearchMiddleware({
            search: nextSearch,
            dest,
            destRoutes,
            _includeValidateSearch: opts._includeValidateSearch
          });
          nextSearch = replaceEqualDeep(fromSearch, nextSearch);
          const searchStr = this.options.stringifySearch(nextSearch);
          const hash = dest.hash === true ? currentLocation.hash : dest.hash ? functionalUpdate(dest.hash, currentLocation.hash) : void 0;
          const hashStr = hash ? `#${hash}` : "";
          let nextState = dest.state === true ? currentLocation.state : dest.state ? functionalUpdate(dest.state, currentLocation.state) : {};
          nextState = replaceEqualDeep(currentLocation.state, nextState);
          return {
            pathname: nextPathname,
            search: nextSearch,
            searchStr,
            state: nextState,
            hash: hash != null ? hash : "",
            href: `${nextPathname}${searchStr}${hashStr}`,
            unmaskOnReload: dest.unmaskOnReload
          };
        }, "build");
        const buildWithMatches = /* @__PURE__ */ __name((dest = {}, maskedDest) => {
          var _a2;
          const next = build(dest);
          let maskedNext = maskedDest ? build(maskedDest) : void 0;
          if (!maskedNext) {
            let params = {};
            const foundMask = (_a2 = this.options.routeMasks) == null ? void 0 : _a2.find((d) => {
              const match = matchPathname(
                this.basepath,
                next.pathname,
                {
                  to: d.from,
                  caseSensitive: false,
                  fuzzy: false
                },
                this.parsePathnameCache
              );
              if (match) {
                params = match;
                return true;
              }
              return false;
            });
            if (foundMask) {
              const _a3 = foundMask, { from: _from } = _a3, maskProps = __objRest(_a3, ["from"]);
              maskedDest = __spreadProps(__spreadValues({
                from: opts.from
              }, maskProps), {
                params
              });
              maskedNext = build(maskedDest);
            }
          }
          if (maskedNext) {
            next.maskedLocation = maskedNext;
          }
          return next;
        }, "buildWithMatches");
        if (opts.mask) {
          return buildWithMatches(opts, __spreadValues({
            from: opts.from
          }, opts.mask));
        }
        return buildWithMatches(opts);
      };
      this.commitLocation = (_a2) => {
        var _b2 = _a2, {
          viewTransition,
          ignoreBlocker
        } = _b2, next = __objRest(_b2, [
          "viewTransition",
          "ignoreBlocker"
        ]);
        var _b3, _c2, _d, _e2;
        const isSameState = /* @__PURE__ */ __name(() => {
          const ignoredProps = [
            "key",
            // TODO: Remove in v2 - use __TSR_key instead
            "__TSR_key",
            "__TSR_index",
            "__hashScrollIntoViewOptions"
          ];
          ignoredProps.forEach((prop) => {
            next.state[prop] = this.latestLocation.state[prop];
          });
          const isEqual2 = deepEqual$3(next.state, this.latestLocation.state);
          ignoredProps.forEach((prop) => {
            delete next.state[prop];
          });
          return isEqual2;
        }, "isSameState");
        const isSameUrl = this.latestLocation.href === next.href;
        const previousCommitPromise = this.commitLocationPromise;
        this.commitLocationPromise = createControlledPromise(() => {
          previousCommitPromise == null ? void 0 : previousCommitPromise.resolve();
        });
        if (isSameUrl && isSameState()) {
          this.load();
        } else {
          let _a3 = next, { maskedLocation, hashScrollIntoView } = _a3, nextHistory = __objRest(_a3, ["maskedLocation", "hashScrollIntoView"]);
          if (maskedLocation) {
            nextHistory = __spreadProps(__spreadValues({}, maskedLocation), {
              state: __spreadProps(__spreadValues({}, maskedLocation.state), {
                __tempKey: void 0,
                __tempLocation: __spreadProps(__spreadValues({}, nextHistory), {
                  search: nextHistory.searchStr,
                  state: __spreadProps(__spreadValues({}, nextHistory.state), {
                    __tempKey: void 0,
                    __tempLocation: void 0,
                    __TSR_key: void 0,
                    key: void 0
                    // TODO: Remove in v2 - use __TSR_key instead
                  })
                })
              })
            });
            if ((_c2 = (_b3 = nextHistory.unmaskOnReload) != null ? _b3 : this.options.unmaskOnReload) != null ? _c2 : false) {
              nextHistory.state.__tempKey = this.tempLocationKey;
            }
          }
          nextHistory.state.__hashScrollIntoViewOptions = (_d = hashScrollIntoView != null ? hashScrollIntoView : this.options.defaultHashScrollIntoView) != null ? _d : true;
          this.shouldViewTransition = viewTransition;
          this.history[next.replace ? "replace" : "push"](
            nextHistory.href,
            nextHistory.state,
            { ignoreBlocker }
          );
        }
        this.resetNextScroll = (_e2 = next.resetScroll) != null ? _e2 : true;
        if (!this.history.subscribers.size) {
          this.load();
        }
        return this.commitLocationPromise;
      };
      this.buildAndCommitLocation = (_c2 = {}) => {
        var _d = _c2, {
          replace,
          resetScroll,
          hashScrollIntoView,
          viewTransition,
          ignoreBlocker,
          href
        } = _d, rest = __objRest(_d, [
          "replace",
          "resetScroll",
          "hashScrollIntoView",
          "viewTransition",
          "ignoreBlocker",
          "href"
        ]);
        if (href) {
          const currentIndex = this.history.location.state.__TSR_index;
          const parsed = parseHref(href, {
            __TSR_index: replace ? currentIndex : currentIndex + 1
          });
          rest.to = parsed.pathname;
          rest.search = this.options.parseSearch(parsed.search);
          rest.hash = parsed.hash.slice(1);
        }
        const location = this.buildLocation(__spreadProps(__spreadValues({}, rest), {
          _includeValidateSearch: true
        }));
        return this.commitLocation(__spreadProps(__spreadValues({}, location), {
          viewTransition,
          replace,
          resetScroll,
          hashScrollIntoView,
          ignoreBlocker
        }));
      };
      this.navigate = (_e2) => {
        var _f = _e2, { to, reloadDocument, href } = _f, rest = __objRest(_f, ["to", "reloadDocument", "href"]);
        if (!reloadDocument && href) {
          try {
            new URL(`${href}`);
            reloadDocument = true;
          } catch (e) {
          }
        }
        if (reloadDocument) {
          if (!href) {
            const location = this.buildLocation(__spreadValues({ to }, rest));
            href = this.history.createHref(location.href);
          }
          if (rest.replace) {
            window.location.replace(href);
          } else {
            window.location.href = href;
          }
          return Promise.resolve();
        }
        return this.buildAndCommitLocation(__spreadProps(__spreadValues({}, rest), {
          href,
          to,
          _isNavigate: true
        }));
      };
      this.beforeLoad = () => {
        this.cancelMatches();
        this.updateLatestLocation();
        if (this.isServer) {
          const nextLocation = this.buildLocation({
            to: this.latestLocation.pathname,
            search: true,
            params: true,
            hash: true,
            state: true,
            _includeValidateSearch: true
          });
          const normalizeUrl = /* @__PURE__ */ __name((url) => {
            try {
              return encodeURI(decodeURI(url));
            } catch (e) {
              return url;
            }
          }, "normalizeUrl");
          if (trimPath(normalizeUrl(this.latestLocation.href)) !== trimPath(normalizeUrl(nextLocation.href))) {
            throw redirect({ href: nextLocation.href });
          }
        }
        const pendingMatches = this.matchRoutes(this.latestLocation);
        this.__store.setState((s2) => __spreadProps(__spreadValues({}, s2), {
          status: "pending",
          statusCode: 200,
          isLoading: true,
          location: this.latestLocation,
          pendingMatches,
          // If a cached moved to pendingMatches, remove it from cachedMatches
          cachedMatches: s2.cachedMatches.filter(
            (d) => !pendingMatches.some((e) => e.id === d.id)
          )
        }));
      };
      this.load = (opts) => __async(this, null, function* () {
        let redirect2;
        let notFound;
        let loadPromise;
        loadPromise = new Promise((resolve) => {
          this.startTransition(() => __async(this, null, function* () {
            var _a2;
            try {
              this.beforeLoad();
              const next = this.latestLocation;
              const prevLocation = this.state.resolvedLocation;
              if (!this.state.redirect) {
                this.emit(__spreadValues({
                  type: "onBeforeNavigate"
                }, getLocationChangeInfo({
                  resolvedLocation: prevLocation,
                  location: next
                })));
              }
              this.emit(__spreadValues({
                type: "onBeforeLoad"
              }, getLocationChangeInfo({
                resolvedLocation: prevLocation,
                location: next
              })));
              yield loadMatches({
                router: this,
                sync: opts == null ? void 0 : opts.sync,
                matches: this.state.pendingMatches,
                location: next,
                updateMatch: this.updateMatch,
                // eslint-disable-next-line @typescript-eslint/require-await
                onReady: /* @__PURE__ */ __name(() => __async(this, null, function* () {
                  this.startViewTransition(() => __async(this, null, function* () {
                    let exitingMatches;
                    let enteringMatches;
                    let stayingMatches;
                    batch(() => {
                      this.__store.setState((s2) => {
                        const previousMatches = s2.matches;
                        const newMatches = s2.pendingMatches || s2.matches;
                        exitingMatches = previousMatches.filter(
                          (match) => !newMatches.some((d) => d.id === match.id)
                        );
                        enteringMatches = newMatches.filter(
                          (match) => !previousMatches.some((d) => d.id === match.id)
                        );
                        stayingMatches = previousMatches.filter(
                          (match) => newMatches.some((d) => d.id === match.id)
                        );
                        return __spreadProps(__spreadValues({}, s2), {
                          isLoading: false,
                          loadedAt: Date.now(),
                          matches: newMatches,
                          pendingMatches: void 0,
                          cachedMatches: [
                            ...s2.cachedMatches,
                            ...exitingMatches.filter((d) => d.status !== "error")
                          ]
                        });
                      });
                      this.clearExpiredCache();
                    });
                    [
                      [exitingMatches, "onLeave"],
                      [enteringMatches, "onEnter"],
                      [stayingMatches, "onStay"]
                    ].forEach(([matches, hook]) => {
                      matches.forEach((match) => {
                        var _a22, _b2;
                        (_b2 = (_a22 = this.looseRoutesById[match.routeId].options)[hook]) == null ? void 0 : _b2.call(_a22, match);
                      });
                    });
                  }));
                }), "onReady")
              });
            } catch (err) {
              if (isRedirect(err)) {
                redirect2 = err;
                if (!this.isServer) {
                  this.navigate(__spreadProps(__spreadValues({}, redirect2.options), {
                    replace: true,
                    ignoreBlocker: true
                  }));
                }
              } else if (isNotFound(err)) {
                notFound = err;
              }
              this.__store.setState((s2) => __spreadProps(__spreadValues({}, s2), {
                statusCode: redirect2 ? redirect2.status : notFound ? 404 : s2.matches.some((d) => d.status === "error") ? 500 : 200,
                redirect: redirect2
              }));
            }
            if (this.latestLoadPromise === loadPromise) {
              (_a2 = this.commitLocationPromise) == null ? void 0 : _a2.resolve();
              this.latestLoadPromise = void 0;
              this.commitLocationPromise = void 0;
            }
            resolve();
          }));
        });
        this.latestLoadPromise = loadPromise;
        yield loadPromise;
        while (this.latestLoadPromise && loadPromise !== this.latestLoadPromise) {
          yield this.latestLoadPromise;
        }
        if (this.hasNotFoundMatch()) {
          this.__store.setState((s2) => __spreadProps(__spreadValues({}, s2), {
            statusCode: 404
          }));
        }
      });
      this.startViewTransition = (fn) => {
        var _a2;
        const shouldViewTransition = (_a2 = this.shouldViewTransition) != null ? _a2 : this.options.defaultViewTransition;
        delete this.shouldViewTransition;
        if (shouldViewTransition && typeof document !== "undefined" && "startViewTransition" in document && typeof document.startViewTransition === "function") {
          let startViewTransitionParams;
          if (typeof shouldViewTransition === "object" && this.isViewTransitionTypesSupported) {
            const next = this.latestLocation;
            const prevLocation = this.state.resolvedLocation;
            const resolvedViewTransitionTypes = typeof shouldViewTransition.types === "function" ? shouldViewTransition.types(
              getLocationChangeInfo({
                resolvedLocation: prevLocation,
                location: next
              })
            ) : shouldViewTransition.types;
            startViewTransitionParams = {
              update: fn,
              types: resolvedViewTransitionTypes
            };
          } else {
            startViewTransitionParams = fn;
          }
          document.startViewTransition(startViewTransitionParams);
        } else {
          fn();
        }
      };
      this.updateMatch = (id, updater) => {
        var _a2;
        const matchesKey = ((_a2 = this.state.pendingMatches) == null ? void 0 : _a2.some((d) => d.id === id)) ? "pendingMatches" : this.state.matches.some((d) => d.id === id) ? "matches" : this.state.cachedMatches.some((d) => d.id === id) ? "cachedMatches" : "";
        if (matchesKey) {
          this.__store.setState((s2) => {
            var _a22;
            return __spreadProps(__spreadValues({}, s2), {
              [matchesKey]: (_a22 = s2[matchesKey]) == null ? void 0 : _a22.map((d) => d.id === id ? updater(d) : d)
            });
          });
        }
      };
      this.getMatch = (matchId) => {
        var _a3, _b2;
        var _a2;
        const findFn = /* @__PURE__ */ __name((d) => d.id === matchId, "findFn");
        return (_b2 = (_a3 = this.state.cachedMatches.find(findFn)) != null ? _a3 : (_a2 = this.state.pendingMatches) == null ? void 0 : _a2.find(findFn)) != null ? _b2 : this.state.matches.find(findFn);
      };
      this.invalidate = (opts) => {
        const invalidate = /* @__PURE__ */ __name((d) => {
          var _a3;
          var _a2;
          if ((_a3 = (_a2 = opts == null ? void 0 : opts.filter) == null ? void 0 : _a2.call(opts, d)) != null ? _a3 : true) {
            return __spreadValues(__spreadProps(__spreadValues({}, d), {
              invalid: true
            }), (opts == null ? void 0 : opts.forcePending) || d.status === "error" ? { status: "pending", error: void 0 } : void 0);
          }
          return d;
        }, "invalidate");
        this.__store.setState((s2) => {
          var _a2;
          return __spreadProps(__spreadValues({}, s2), {
            matches: s2.matches.map(invalidate),
            cachedMatches: s2.cachedMatches.map(invalidate),
            pendingMatches: (_a2 = s2.pendingMatches) == null ? void 0 : _a2.map(invalidate)
          });
        });
        this.shouldViewTransition = false;
        return this.load({ sync: opts == null ? void 0 : opts.sync });
      };
      this.resolveRedirect = (redirect2) => {
        if (!redirect2.options.href) {
          redirect2.options.href = this.buildLocation(redirect2.options).href;
          redirect2.headers.set("Location", redirect2.options.href);
        }
        if (!redirect2.headers.get("Location")) {
          redirect2.headers.set("Location", redirect2.options.href);
        }
        return redirect2;
      };
      this.clearCache = (opts) => {
        const filter = opts == null ? void 0 : opts.filter;
        if (filter !== void 0) {
          this.__store.setState((s2) => {
            return __spreadProps(__spreadValues({}, s2), {
              cachedMatches: s2.cachedMatches.filter(
                (m2) => !filter(m2)
              )
            });
          });
        } else {
          this.__store.setState((s2) => {
            return __spreadProps(__spreadValues({}, s2), {
              cachedMatches: []
            });
          });
        }
      };
      this.clearExpiredCache = () => {
        const filter = /* @__PURE__ */ __name((d) => {
          var _a2, _b2, _c2;
          const route = this.looseRoutesById[d.routeId];
          if (!route.options.loader) {
            return true;
          }
          const gcTime = (_c2 = d.preload ? (_a2 = route.options.preloadGcTime) != null ? _a2 : this.options.defaultPreloadGcTime : (_b2 = route.options.gcTime) != null ? _b2 : this.options.defaultGcTime) != null ? _c2 : 5 * 60 * 1e3;
          const isError = d.status === "error";
          if (isError) return true;
          const gcEligible = Date.now() - d.updatedAt >= gcTime;
          return gcEligible;
        }, "filter");
        this.clearCache({ filter });
      };
      this.loadRouteChunk = loadRouteChunk;
      this.preloadRoute = (opts) => __async(this, null, function* () {
        var _a2;
        const next = this.buildLocation(opts);
        let matches = this.matchRoutes(next, {
          throwOnError: true,
          preload: true,
          dest: opts
        });
        const activeMatchIds = new Set(
          [...this.state.matches, ...(_a2 = this.state.pendingMatches) != null ? _a2 : []].map(
            (d) => d.id
          )
        );
        const loadedMatchIds = /* @__PURE__ */ new Set([
          ...activeMatchIds,
          ...this.state.cachedMatches.map((d) => d.id)
        ]);
        batch(() => {
          matches.forEach((match) => {
            if (!loadedMatchIds.has(match.id)) {
              this.__store.setState((s2) => __spreadProps(__spreadValues({}, s2), {
                cachedMatches: [...s2.cachedMatches, match]
              }));
            }
          });
        });
        try {
          matches = yield loadMatches({
            router: this,
            matches,
            location: next,
            preload: true,
            updateMatch: /* @__PURE__ */ __name((id, updater) => {
              if (activeMatchIds.has(id)) {
                matches = matches.map((d) => d.id === id ? updater(d) : d);
              } else {
                this.updateMatch(id, updater);
              }
            }, "updateMatch")
          });
          return matches;
        } catch (err) {
          if (isRedirect(err)) {
            if (err.options.reloadDocument) {
              return void 0;
            }
            return yield this.preloadRoute(__spreadProps(__spreadValues({}, err.options), {
              _fromLocation: next
            }));
          }
          if (!isNotFound(err)) {
            console.error(err);
          }
          return void 0;
        }
      });
      this.matchRoute = (location, opts) => {
        var _a2;
        const matchLocation = __spreadProps(__spreadValues({}, location), {
          to: location.to ? this.resolvePathWithBase(
            location.from || "",
            location.to
          ) : void 0,
          params: location.params || {},
          leaveParams: true
        });
        const next = this.buildLocation(matchLocation);
        if ((opts == null ? void 0 : opts.pending) && this.state.status !== "pending") {
          return false;
        }
        const pending = (opts == null ? void 0 : opts.pending) === void 0 ? !this.state.isLoading : opts.pending;
        const baseLocation = pending ? this.latestLocation : this.state.resolvedLocation || this.state.location;
        const match = matchPathname(
          this.basepath,
          baseLocation.pathname,
          __spreadProps(__spreadValues({}, opts), {
            to: next.pathname
          }),
          this.parsePathnameCache
        );
        if (!match) {
          return false;
        }
        if (location.params) {
          if (!deepEqual$3(match, location.params, { partial: true })) {
            return false;
          }
        }
        if (match && ((_a2 = opts == null ? void 0 : opts.includeSearch) != null ? _a2 : true)) {
          return deepEqual$3(baseLocation.search, next.search, { partial: true }) ? match : false;
        }
        return match;
      };
      this.hasNotFoundMatch = () => {
        return this.__store.state.matches.some(
          (d) => d.status === "notFound" || d.globalNotFound
        );
      };
      this.update(__spreadProps(__spreadValues({
        defaultPreloadDelay: 50,
        defaultPendingMs: 1e3,
        defaultPendingMinMs: 500,
        context: void 0
      }, options2), {
        caseSensitive: (_g = options2.caseSensitive) != null ? _g : false,
        notFoundMode: (_h = options2.notFoundMode) != null ? _h : "fuzzy",
        stringifySearch: (_i = options2.stringifySearch) != null ? _i : defaultStringifySearch,
        parseSearch: (_j = options2.parseSearch) != null ? _j : defaultParseSearch
      }));
      if (typeof document !== "undefined") {
        self.__TSR_ROUTER__ = this;
      }
    }
    isShell() {
      return !!this.options.isShell;
    }
    isPrerendering() {
      return !!this.options.isPrerendering;
    }
    get state() {
      return this.__store.state;
    }
    get looseRoutesById() {
      return this.routesById;
    }
    matchRoutesInternal(next, opts) {
      var _a2;
      const { foundRoute, matchedRoutes, routeParams } = this.getMatchedRoutes(
        next.pathname,
        (_a2 = opts == null ? void 0 : opts.dest) == null ? void 0 : _a2.to
      );
      let isGlobalNotFound = false;
      if (
        // If we found a route, and it's not an index route and we have left over path
        foundRoute ? foundRoute.path !== "/" && routeParams["**"] : (
          // Or if we didn't find a route and we have left over path
          trimPathRight(next.pathname)
        )
      ) {
        if (this.options.notFoundRoute) {
          matchedRoutes.push(this.options.notFoundRoute);
        } else {
          isGlobalNotFound = true;
        }
      }
      const globalNotFoundRouteId = (() => {
        if (!isGlobalNotFound) {
          return void 0;
        }
        if (this.options.notFoundMode !== "root") {
          for (let i2 = matchedRoutes.length - 1; i2 >= 0; i2--) {
            const route = matchedRoutes[i2];
            if (route.children) {
              return route.id;
            }
          }
        }
        return rootRouteId;
      })();
      const matches = [];
      const getParentContext = /* @__PURE__ */ __name((parentMatch) => {
        var _a3, _b2, _c2;
        const parentMatchId = parentMatch == null ? void 0 : parentMatch.id;
        const parentContext = !parentMatchId ? (_a3 = this.options.context) != null ? _a3 : void 0 : (_c2 = (_b2 = parentMatch.context) != null ? _b2 : this.options.context) != null ? _c2 : void 0;
        return parentContext;
      }, "getParentContext");
      matchedRoutes.forEach((route, index2) => {
        var _a3, _b3, _c3;
        var _a22, _b2, _c2;
        const parentMatch = matches[index2 - 1];
        const [preMatchSearch, strictMatchSearch, searchError] = (() => {
          var _a4, _b4, _c4;
          const parentSearch = (_a4 = parentMatch == null ? void 0 : parentMatch.search) != null ? _a4 : next.search;
          const parentStrictSearch = (_b4 = parentMatch == null ? void 0 : parentMatch._strictSearch) != null ? _b4 : void 0;
          try {
            const strictSearch = (_c4 = validateSearch(route.options.validateSearch, __spreadValues({}, parentSearch))) != null ? _c4 : void 0;
            return [
              __spreadValues(__spreadValues({}, parentSearch), strictSearch),
              __spreadValues(__spreadValues({}, parentStrictSearch), strictSearch),
              void 0
            ];
          } catch (err) {
            let searchParamError = err;
            if (!(err instanceof SearchParamError)) {
              searchParamError = new SearchParamError(err.message, {
                cause: err
              });
            }
            if (opts == null ? void 0 : opts.throwOnError) {
              throw searchParamError;
            }
            return [parentSearch, {}, searchParamError];
          }
        })();
        const loaderDeps = (_a3 = (_b2 = (_a22 = route.options).loaderDeps) == null ? void 0 : _b2.call(_a22, {
          search: preMatchSearch
        })) != null ? _a3 : "";
        const loaderDepsHash = loaderDeps ? JSON.stringify(loaderDeps) : "";
        const { interpolatedPath, usedParams } = interpolatePath({
          path: route.fullPath,
          params: routeParams,
          decodeCharMap: this.pathParamsDecodeCharMap
        });
        const matchId = interpolatePath({
          path: route.id,
          params: routeParams,
          leaveWildcards: true,
          decodeCharMap: this.pathParamsDecodeCharMap,
          parseCache: this.parsePathnameCache
        }).interpolatedPath + loaderDepsHash;
        const existingMatch = this.getMatch(matchId);
        const previousMatch = this.state.matches.find(
          (d) => d.routeId === route.id
        );
        const strictParams = (_b3 = existingMatch == null ? void 0 : existingMatch._strictParams) != null ? _b3 : usedParams;
        let paramsError = void 0;
        if (!existingMatch) {
          const strictParseParams = (_c3 = (_c2 = route.options.params) == null ? void 0 : _c2.parse) != null ? _c3 : route.options.parseParams;
          if (strictParseParams) {
            try {
              Object.assign(
                strictParams,
                strictParseParams(strictParams)
              );
            } catch (err) {
              paramsError = new PathParamError(err.message, {
                cause: err
              });
              if (opts == null ? void 0 : opts.throwOnError) {
                throw paramsError;
              }
            }
          }
        }
        Object.assign(routeParams, strictParams);
        const cause = previousMatch ? "stay" : "enter";
        let match;
        if (existingMatch) {
          match = __spreadProps(__spreadValues({}, existingMatch), {
            cause,
            params: previousMatch ? replaceEqualDeep(previousMatch.params, routeParams) : routeParams,
            _strictParams: strictParams,
            search: previousMatch ? replaceEqualDeep(previousMatch.search, preMatchSearch) : replaceEqualDeep(existingMatch.search, preMatchSearch),
            _strictSearch: strictMatchSearch
          });
        } else {
          const status = route.options.loader || route.options.beforeLoad || route.lazyFn || routeNeedsPreload(route) ? "pending" : "success";
          match = {
            id: matchId,
            index: index2,
            routeId: route.id,
            params: previousMatch ? replaceEqualDeep(previousMatch.params, routeParams) : routeParams,
            _strictParams: strictParams,
            pathname: joinPaths([this.basepath, interpolatedPath]),
            updatedAt: Date.now(),
            search: previousMatch ? replaceEqualDeep(previousMatch.search, preMatchSearch) : preMatchSearch,
            _strictSearch: strictMatchSearch,
            searchError: void 0,
            status,
            isFetching: false,
            error: void 0,
            paramsError,
            __routeContext: void 0,
            _nonReactive: {
              loadPromise: createControlledPromise()
            },
            __beforeLoadContext: void 0,
            context: {},
            abortController: new AbortController(),
            fetchCount: 0,
            cause,
            loaderDeps: previousMatch ? replaceEqualDeep(previousMatch.loaderDeps, loaderDeps) : loaderDeps,
            invalid: false,
            preload: false,
            links: void 0,
            scripts: void 0,
            headScripts: void 0,
            meta: void 0,
            staticData: route.options.staticData || {},
            fullPath: route.fullPath
          };
        }
        if (!(opts == null ? void 0 : opts.preload)) {
          match.globalNotFound = globalNotFoundRouteId === route.id;
        }
        match.searchError = searchError;
        const parentContext = getParentContext(parentMatch);
        match.context = __spreadValues(__spreadValues(__spreadValues({}, parentContext), match.__routeContext), match.__beforeLoadContext);
        matches.push(match);
      });
      matches.forEach((match, index2) => {
        var _a3;
        const route = this.looseRoutesById[match.routeId];
        const existingMatch = this.getMatch(match.id);
        if (!existingMatch && (opts == null ? void 0 : opts._buildLocation) !== true) {
          const parentMatch = matches[index2 - 1];
          const parentContext = getParentContext(parentMatch);
          if (route.options.context) {
            const contextFnContext = {
              deps: match.loaderDeps,
              params: match.params,
              context: parentContext != null ? parentContext : {},
              location: next,
              navigate: /* @__PURE__ */ __name((opts2) => this.navigate(__spreadProps(__spreadValues({}, opts2), { _fromLocation: next })), "navigate"),
              buildLocation: this.buildLocation,
              cause: match.cause,
              abortController: match.abortController,
              preload: !!match.preload,
              matches
            };
            match.__routeContext = (_a3 = route.options.context(contextFnContext)) != null ? _a3 : void 0;
          }
          match.context = __spreadValues(__spreadValues(__spreadValues({}, parentContext), match.__routeContext), match.__beforeLoadContext);
        }
      });
      return matches;
    }
  };
  __name(_RouterCore, "RouterCore");
  let RouterCore = _RouterCore;
  const _SearchParamError = class _SearchParamError extends Error {
  };
  __name(_SearchParamError, "SearchParamError");
  let SearchParamError = _SearchParamError;
  const _PathParamError = class _PathParamError extends Error {
  };
  __name(_PathParamError, "PathParamError");
  let PathParamError = _PathParamError;
  function getInitialRouterState(location) {
    return {
      loadedAt: 0,
      isLoading: false,
      isTransitioning: false,
      status: "idle",
      resolvedLocation: void 0,
      location,
      matches: [],
      pendingMatches: [],
      cachedMatches: [],
      statusCode: 200
    };
  }
  __name(getInitialRouterState, "getInitialRouterState");
  function validateSearch(validateSearch2, input) {
    if (validateSearch2 == null) return {};
    if ("~standard" in validateSearch2) {
      const result = validateSearch2["~standard"].validate(input);
      if (result instanceof Promise)
        throw new SearchParamError("Async validation not supported");
      if (result.issues)
        throw new SearchParamError(JSON.stringify(result.issues, void 0, 2), {
          cause: result
        });
      return result.value;
    }
    if ("parse" in validateSearch2) {
      return validateSearch2.parse(input);
    }
    if (typeof validateSearch2 === "function") {
      return validateSearch2(input);
    }
    return {};
  }
  __name(validateSearch, "validateSearch");
  function getMatchedRoutes({
    pathname,
    routePathname,
    basepath,
    caseSensitive,
    routesByPath,
    routesById,
    flatRoutes,
    parseCache
  }) {
    let routeParams = {};
    const trimmedPath = trimPathRight(pathname);
    const getMatchedParams = /* @__PURE__ */ __name((route) => {
      var _a3;
      var _a2;
      const result = matchPathname(
        basepath,
        trimmedPath,
        {
          to: route.fullPath,
          caseSensitive: (_a3 = (_a2 = route.options) == null ? void 0 : _a2.caseSensitive) != null ? _a3 : caseSensitive,
          // we need fuzzy matching for `notFoundMode: 'fuzzy'`
          fuzzy: true
        },
        parseCache
      );
      return result;
    }, "getMatchedParams");
    let foundRoute = routePathname !== void 0 ? routesByPath[routePathname] : void 0;
    if (foundRoute) {
      routeParams = getMatchedParams(foundRoute);
    } else {
      let fuzzyMatch = void 0;
      for (const route of flatRoutes) {
        const matchedParams = getMatchedParams(route);
        if (matchedParams) {
          if (route.path !== "/" && matchedParams["**"]) {
            if (!fuzzyMatch) {
              fuzzyMatch = { foundRoute: route, routeParams: matchedParams };
            }
          } else {
            foundRoute = route;
            routeParams = matchedParams;
            break;
          }
        }
      }
      if (!foundRoute && fuzzyMatch) {
        foundRoute = fuzzyMatch.foundRoute;
        routeParams = fuzzyMatch.routeParams;
      }
    }
    let routeCursor = foundRoute || routesById[rootRouteId];
    const matchedRoutes = [routeCursor];
    while (routeCursor.parentRoute) {
      routeCursor = routeCursor.parentRoute;
      matchedRoutes.push(routeCursor);
    }
    matchedRoutes.reverse();
    return { matchedRoutes, routeParams, foundRoute };
  }
  __name(getMatchedRoutes, "getMatchedRoutes");
  function applySearchMiddleware({
    search,
    dest,
    destRoutes,
    _includeValidateSearch
  }) {
    var _a2;
    const allMiddlewares = (_a2 = destRoutes.reduce(
      (acc, route) => {
        var _a3;
        const middlewares2 = [];
        if ("search" in route.options) {
          if ((_a3 = route.options.search) == null ? void 0 : _a3.middlewares) {
            middlewares2.push(...route.options.search.middlewares);
          }
        } else if (route.options.preSearchFilters || route.options.postSearchFilters) {
          const legacyMiddleware = /* @__PURE__ */ __name(({
            search: search2,
            next
          }) => {
            let nextSearch = search2;
            if ("preSearchFilters" in route.options && route.options.preSearchFilters) {
              nextSearch = route.options.preSearchFilters.reduce(
                (prev, next2) => next2(prev),
                search2
              );
            }
            const result = next(nextSearch);
            if ("postSearchFilters" in route.options && route.options.postSearchFilters) {
              return route.options.postSearchFilters.reduce(
                (prev, next2) => next2(prev),
                result
              );
            }
            return result;
          }, "legacyMiddleware");
          middlewares2.push(legacyMiddleware);
        }
        if (_includeValidateSearch && route.options.validateSearch) {
          const validate = /* @__PURE__ */ __name(({ search: search2, next }) => {
            var _a4;
            const result = next(search2);
            try {
              const validatedSearch = __spreadValues(__spreadValues({}, result), (_a4 = validateSearch(route.options.validateSearch, result)) != null ? _a4 : void 0);
              return validatedSearch;
            } catch (e) {
              return result;
            }
          }, "validate");
          middlewares2.push(validate);
        }
        return acc.concat(middlewares2);
      },
      []
    )) != null ? _a2 : [];
    const final = /* @__PURE__ */ __name(({ search: search2 }) => {
      if (!dest.search) {
        return {};
      }
      if (dest.search === true) {
        return search2;
      }
      return functionalUpdate(dest.search, search2);
    }, "final");
    allMiddlewares.push(final);
    const applyNext = /* @__PURE__ */ __name((index2, currentSearch) => {
      if (index2 >= allMiddlewares.length) {
        return currentSearch;
      }
      const middleware = allMiddlewares[index2];
      const next = /* @__PURE__ */ __name((newSearch) => {
        return applyNext(index2 + 1, newSearch);
      }, "next");
      return middleware({ search: currentSearch, next });
    }, "applyNext");
    return applyNext(0, search);
  }
  __name(applySearchMiddleware, "applySearchMiddleware");
  const preloadWarning = "Error preloading route! ☝️";
  const _BaseRoute = class _BaseRoute {
    constructor(options2) {
      this.init = (opts) => {
        var _a2, _b2;
        this.originalIndex = opts.originalIndex;
        const options22 = this.options;
        const isRoot = !(options22 == null ? void 0 : options22.path) && !(options22 == null ? void 0 : options22.id);
        this.parentRoute = (_b2 = (_a2 = this.options).getParentRoute) == null ? void 0 : _b2.call(_a2);
        if (isRoot) {
          this._path = rootRouteId;
        } else if (!this.parentRoute) {
          invariant(
            false
          );
        }
        let path = isRoot ? rootRouteId : options22 == null ? void 0 : options22.path;
        if (path && path !== "/") {
          path = trimPathLeft(path);
        }
        const customId = (options22 == null ? void 0 : options22.id) || path;
        let id = isRoot ? rootRouteId : joinPaths([
          this.parentRoute.id === rootRouteId ? "" : this.parentRoute.id,
          customId
        ]);
        if (path === rootRouteId) {
          path = "/";
        }
        if (id !== rootRouteId) {
          id = joinPaths(["/", id]);
        }
        const fullPath = id === rootRouteId ? "/" : joinPaths([this.parentRoute.fullPath, path]);
        this._path = path;
        this._id = id;
        this._fullPath = fullPath;
        this._to = fullPath;
      };
      this.clone = (other) => {
        this._path = other._path;
        this._id = other._id;
        this._fullPath = other._fullPath;
        this._to = other._to;
        this.options.getParentRoute = other.options.getParentRoute;
        this.children = other.children;
      };
      this.addChildren = (children) => {
        return this._addFileChildren(children);
      };
      this._addFileChildren = (children) => {
        if (Array.isArray(children)) {
          this.children = children;
        }
        if (typeof children === "object" && children !== null) {
          this.children = Object.values(children);
        }
        return this;
      };
      this._addFileTypes = () => {
        return this;
      };
      this.updateLoader = (options22) => {
        Object.assign(this.options, options22);
        return this;
      };
      this.update = (options22) => {
        Object.assign(this.options, options22);
        return this;
      };
      this.lazy = (lazyFn) => {
        this.lazyFn = lazyFn;
        return this;
      };
      this.options = options2 || {};
      this.isRoot = !(options2 == null ? void 0 : options2.getParentRoute);
      if ((options2 == null ? void 0 : options2.id) && (options2 == null ? void 0 : options2.path)) {
        throw new Error(`Route cannot have both an 'id' and a 'path' option.`);
      }
    }
    get to() {
      return this._to;
    }
    get id() {
      return this._id;
    }
    get path() {
      return this._path;
    }
    get fullPath() {
      return this._fullPath;
    }
  };
  __name(_BaseRoute, "BaseRoute");
  let BaseRoute = _BaseRoute;
  const _BaseRootRoute = class _BaseRootRoute extends BaseRoute {
    constructor(options2) {
      super(options2);
    }
  };
  __name(_BaseRootRoute, "BaseRootRoute");
  let BaseRootRoute = _BaseRootRoute;
  function CatchBoundary(props) {
    var _a2;
    const errorComponent = (_a2 = props.errorComponent) != null ? _a2 : ErrorComponent;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      CatchBoundaryImpl,
      {
        getResetKey: props.getResetKey,
        onCatch: props.onCatch,
        children: /* @__PURE__ */ __name(({ error, reset }) => {
          if (error) {
            return reactExports.createElement(errorComponent, {
              error,
              reset
            });
          }
          return props.children;
        }, "children")
      }
    );
  }
  __name(CatchBoundary, "CatchBoundary");
  const _CatchBoundaryImpl = class _CatchBoundaryImpl extends reactExports.Component {
    constructor() {
      super(...arguments);
      this.state = { error: null };
    }
    static getDerivedStateFromProps(props) {
      return { resetKey: props.getResetKey() };
    }
    static getDerivedStateFromError(error) {
      return { error };
    }
    reset() {
      this.setState({ error: null });
    }
    componentDidUpdate(prevProps, prevState) {
      if (prevState.error && prevState.resetKey !== this.state.resetKey) {
        this.reset();
      }
    }
    componentDidCatch(error, errorInfo) {
      if (this.props.onCatch) {
        this.props.onCatch(error, errorInfo);
      }
    }
    render() {
      return this.props.children({
        error: this.state.resetKey !== this.props.getResetKey() ? null : this.state.error,
        reset: /* @__PURE__ */ __name(() => {
          this.reset();
        }, "reset")
      });
    }
  };
  __name(_CatchBoundaryImpl, "CatchBoundaryImpl");
  let CatchBoundaryImpl = _CatchBoundaryImpl;
  function ErrorComponent({ error }) {
    const [show, setShow] = reactExports.useState(false);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { padding: ".5rem", maxWidth: "100%" }, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: ".5rem" }, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { style: { fontSize: "1rem" }, children: "Something went wrong!" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "button",
          {
            style: {
              appearance: "none",
              fontSize: ".6em",
              border: "1px solid currentColor",
              padding: ".1rem .2rem",
              fontWeight: "bold",
              borderRadius: ".25rem"
            },
            onClick: /* @__PURE__ */ __name(() => setShow((d) => !d), "onClick"),
            children: show ? "Hide Error" : "Show Error"
          }
        )
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { height: ".25rem" } }),
      show ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        "pre",
        {
          style: {
            fontSize: ".7em",
            border: "1px solid red",
            borderRadius: ".25rem",
            padding: ".3rem",
            color: "red",
            overflow: "auto"
          },
          children: error.message ? /* @__PURE__ */ jsxRuntimeExports.jsx("code", { children: error.message }) : null
        }
      ) }) : null
    ] });
  }
  __name(ErrorComponent, "ErrorComponent");
  function ClientOnly({ children, fallback = null }) {
    return useHydrated() ? /* @__PURE__ */ jsxRuntimeExports.jsx(React.Fragment, { children }) : /* @__PURE__ */ jsxRuntimeExports.jsx(React.Fragment, { children: fallback });
  }
  __name(ClientOnly, "ClientOnly");
  function useHydrated() {
    return React.useSyncExternalStore(
      subscribe,
      () => true,
      () => false
    );
  }
  __name(useHydrated, "useHydrated");
  function subscribe() {
    return () => {
    };
  }
  __name(subscribe, "subscribe");
  var withSelector = { exports: {} };
  var withSelector_production = {};
  var shim = { exports: {} };
  var useSyncExternalStoreShim_production = {};
  /**
   * @license React
   * use-sync-external-store-shim.production.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  var hasRequiredUseSyncExternalStoreShim_production;
  function requireUseSyncExternalStoreShim_production() {
    if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
    hasRequiredUseSyncExternalStoreShim_production = 1;
    var React2 = requireReact();
    function is(x2, y2) {
      return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
    }
    __name(is, "is");
    var objectIs = "function" === typeof Object.is ? Object.is : is, useState = React2.useState, useEffect = React2.useEffect, useLayoutEffect3 = React2.useLayoutEffect, useDebugValue = React2.useDebugValue;
    function useSyncExternalStore$2(subscribe2, getSnapshot) {
      var value = getSnapshot(), _useState = useState({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
      useLayoutEffect3(
        function() {
          inst.value = value;
          inst.getSnapshot = getSnapshot;
          checkIfSnapshotChanged(inst) && forceUpdate({ inst });
        },
        [subscribe2, value, getSnapshot]
      );
      useEffect(
        function() {
          checkIfSnapshotChanged(inst) && forceUpdate({ inst });
          return subscribe2(function() {
            checkIfSnapshotChanged(inst) && forceUpdate({ inst });
          });
        },
        [subscribe2]
      );
      useDebugValue(value);
      return value;
    }
    __name(useSyncExternalStore$2, "useSyncExternalStore$2");
    function checkIfSnapshotChanged(inst) {
      var latestGetSnapshot = inst.getSnapshot;
      inst = inst.value;
      try {
        var nextValue = latestGetSnapshot();
        return !objectIs(inst, nextValue);
      } catch (error) {
        return true;
      }
    }
    __name(checkIfSnapshotChanged, "checkIfSnapshotChanged");
    function useSyncExternalStore$1(subscribe2, getSnapshot) {
      return getSnapshot();
    }
    __name(useSyncExternalStore$1, "useSyncExternalStore$1");
    var shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
    useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React2.useSyncExternalStore ? React2.useSyncExternalStore : shim2;
    return useSyncExternalStoreShim_production;
  }
  __name(requireUseSyncExternalStoreShim_production, "requireUseSyncExternalStoreShim_production");
  var hasRequiredShim;
  function requireShim() {
    if (hasRequiredShim) return shim.exports;
    hasRequiredShim = 1;
    {
      shim.exports = requireUseSyncExternalStoreShim_production();
    }
    return shim.exports;
  }
  __name(requireShim, "requireShim");
  /**
   * @license React
   * use-sync-external-store-shim/with-selector.production.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  var hasRequiredWithSelector_production;
  function requireWithSelector_production() {
    if (hasRequiredWithSelector_production) return withSelector_production;
    hasRequiredWithSelector_production = 1;
    var React2 = requireReact(), shim2 = requireShim();
    function is(x2, y2) {
      return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
    }
    __name(is, "is");
    var objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = shim2.useSyncExternalStore, useRef = React2.useRef, useEffect = React2.useEffect, useMemo = React2.useMemo, useDebugValue = React2.useDebugValue;
    withSelector_production.useSyncExternalStoreWithSelector = function(subscribe2, getSnapshot, getServerSnapshot, selector, isEqual2) {
      var instRef = useRef(null);
      if (null === instRef.current) {
        var inst = { hasValue: false, value: null };
        instRef.current = inst;
      } else inst = instRef.current;
      instRef = useMemo(
        function() {
          function memoizedSelector(nextSnapshot) {
            if (!hasMemo) {
              hasMemo = true;
              memoizedSnapshot = nextSnapshot;
              nextSnapshot = selector(nextSnapshot);
              if (void 0 !== isEqual2 && inst.hasValue) {
                var currentSelection = inst.value;
                if (isEqual2(currentSelection, nextSnapshot))
                  return memoizedSelection = currentSelection;
              }
              return memoizedSelection = nextSnapshot;
            }
            currentSelection = memoizedSelection;
            if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
            var nextSelection = selector(nextSnapshot);
            if (void 0 !== isEqual2 && isEqual2(currentSelection, nextSelection))
              return memoizedSnapshot = nextSnapshot, currentSelection;
            memoizedSnapshot = nextSnapshot;
            return memoizedSelection = nextSelection;
          }
          __name(memoizedSelector, "memoizedSelector");
          var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
          return [
            function() {
              return memoizedSelector(getSnapshot());
            },
            null === maybeGetServerSnapshot ? void 0 : function() {
              return memoizedSelector(maybeGetServerSnapshot());
            }
          ];
        },
        [getSnapshot, getServerSnapshot, selector, isEqual2]
      );
      var value = useSyncExternalStore(subscribe2, instRef[0], instRef[1]);
      useEffect(
        function() {
          inst.hasValue = true;
          inst.value = value;
        },
        [value]
      );
      useDebugValue(value);
      return value;
    };
    return withSelector_production;
  }
  __name(requireWithSelector_production, "requireWithSelector_production");
  var hasRequiredWithSelector;
  function requireWithSelector() {
    if (hasRequiredWithSelector) return withSelector.exports;
    hasRequiredWithSelector = 1;
    {
      withSelector.exports = requireWithSelector_production();
    }
    return withSelector.exports;
  }
  __name(requireWithSelector, "requireWithSelector");
  var withSelectorExports = requireWithSelector();
  function useStore$1(store2, selector = (d) => d) {
    const slice = withSelectorExports.useSyncExternalStoreWithSelector(
      store2.subscribe,
      () => store2.state,
      () => store2.state,
      selector,
      shallow$1
    );
    return slice;
  }
  __name(useStore$1, "useStore$1");
  function shallow$1(objA, objB) {
    if (Object.is(objA, objB)) {
      return true;
    }
    if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
      return false;
    }
    if (objA instanceof Map && objB instanceof Map) {
      if (objA.size !== objB.size) return false;
      for (const [k2, v] of objA) {
        if (!objB.has(k2) || !Object.is(v, objB.get(k2))) return false;
      }
      return true;
    }
    if (objA instanceof Set && objB instanceof Set) {
      if (objA.size !== objB.size) return false;
      for (const v of objA) {
        if (!objB.has(v)) return false;
      }
      return true;
    }
    if (objA instanceof Date && objB instanceof Date) {
      if (objA.getTime() !== objB.getTime()) return false;
      return true;
    }
    const keysA = getOwnKeys(objA);
    if (keysA.length !== getOwnKeys(objB).length) {
      return false;
    }
    for (let i2 = 0; i2 < keysA.length; i2++) {
      if (!Object.prototype.hasOwnProperty.call(objB, keysA[i2]) || !Object.is(objA[keysA[i2]], objB[keysA[i2]])) {
        return false;
      }
    }
    return true;
  }
  __name(shallow$1, "shallow$1");
  function getOwnKeys(obj) {
    return Object.keys(obj).concat(
      Object.getOwnPropertySymbols(obj)
    );
  }
  __name(getOwnKeys, "getOwnKeys");
  const routerContext = reactExports.createContext(null);
  function getRouterContext() {
    if (typeof document === "undefined") {
      return routerContext;
    }
    if (window.__TSR_ROUTER_CONTEXT__) {
      return window.__TSR_ROUTER_CONTEXT__;
    }
    window.__TSR_ROUTER_CONTEXT__ = routerContext;
    return routerContext;
  }
  __name(getRouterContext, "getRouterContext");
  function useRouter(opts) {
    var _a2;
    const value = reactExports.useContext(getRouterContext());
    warning(
      !(((_a2 = opts == null ? void 0 : opts.warn) != null ? _a2 : true) && !value)
    );
    return value;
  }
  __name(useRouter, "useRouter");
  function useRouterState(opts) {
    const contextRouter = useRouter({
      warn: (opts == null ? void 0 : opts.router) === void 0
    });
    const router2 = (opts == null ? void 0 : opts.router) || contextRouter;
    const previousResult = reactExports.useRef(void 0);
    return useStore$1(router2.__store, (state) => {
      var _a2;
      if (opts == null ? void 0 : opts.select) {
        if ((_a2 = opts.structuralSharing) != null ? _a2 : router2.options.defaultStructuralSharing) {
          const newSlice = replaceEqualDeep(
            previousResult.current,
            opts.select(state)
          );
          previousResult.current = newSlice;
          return newSlice;
        }
        return opts.select(state);
      }
      return state;
    });
  }
  __name(useRouterState, "useRouterState");
  const matchContext = reactExports.createContext(void 0);
  const dummyMatchContext = reactExports.createContext(
    void 0
  );
  function useMatch(opts) {
    const nearestMatchId = reactExports.useContext(
      opts.from ? dummyMatchContext : matchContext
    );
    const matchSelection = useRouterState({
      select: /* @__PURE__ */ __name((state) => {
        var _a2;
        const match = state.matches.find(
          (d) => opts.from ? opts.from === d.routeId : d.id === nearestMatchId
        );
        invariant(
          !(((_a2 = opts.shouldThrow) != null ? _a2 : true) && !match),
          `Could not find ${opts.from ? `an active match from "${opts.from}"` : "a nearest match!"}`
        );
        if (match === void 0) {
          return void 0;
        }
        return opts.select ? opts.select(match) : match;
      }, "select"),
      structuralSharing: opts.structuralSharing
    });
    return matchSelection;
  }
  __name(useMatch, "useMatch");
  function useLoaderData(opts) {
    return useMatch({
      from: opts.from,
      strict: opts.strict,
      structuralSharing: opts.structuralSharing,
      select: /* @__PURE__ */ __name((s2) => {
        return opts.select ? opts.select(s2.loaderData) : s2.loaderData;
      }, "select")
    });
  }
  __name(useLoaderData, "useLoaderData");
  function useLoaderDeps(opts) {
    const _a2 = opts, { select } = _a2, rest = __objRest(_a2, ["select"]);
    return useMatch(__spreadProps(__spreadValues({}, rest), {
      select: /* @__PURE__ */ __name((s2) => {
        return select ? select(s2.loaderDeps) : s2.loaderDeps;
      }, "select")
    }));
  }
  __name(useLoaderDeps, "useLoaderDeps");
  function useParams(opts) {
    return useMatch({
      from: opts.from,
      shouldThrow: opts.shouldThrow,
      structuralSharing: opts.structuralSharing,
      strict: opts.strict,
      select: /* @__PURE__ */ __name((match) => {
        const params = opts.strict === false ? match.params : match._strictParams;
        return opts.select ? opts.select(params) : params;
      }, "select")
    });
  }
  __name(useParams, "useParams");
  function useSearch(opts) {
    return useMatch({
      from: opts.from,
      strict: opts.strict,
      shouldThrow: opts.shouldThrow,
      structuralSharing: opts.structuralSharing,
      select: /* @__PURE__ */ __name((match) => {
        return opts.select ? opts.select(match.search) : match.search;
      }, "select")
    });
  }
  __name(useSearch, "useSearch");
  function useNavigate(_defaultOpts) {
    const router2 = useRouter();
    return reactExports.useCallback(
      (options2) => {
        var _a2;
        return router2.navigate(__spreadProps(__spreadValues({}, options2), {
          from: (_a2 = options2.from) != null ? _a2 : _defaultOpts == null ? void 0 : _defaultOpts.from
        }));
      },
      [_defaultOpts == null ? void 0 : _defaultOpts.from, router2]
    );
  }
  __name(useNavigate, "useNavigate");
  var reactDomExports = requireReactDom();
  const ReactDOM = /* @__PURE__ */ getDefaultExportFromCjs(reactDomExports);
  const useLayoutEffect = typeof window !== "undefined" ? reactExports.useLayoutEffect : reactExports.useEffect;
  function usePrevious$1(value) {
    const ref = reactExports.useRef({
      value,
      prev: null
    });
    const current = ref.current.value;
    if (value !== current) {
      ref.current = {
        value,
        prev: current
      };
    }
    return ref.current.prev;
  }
  __name(usePrevious$1, "usePrevious$1");
  function useIntersectionObserver(ref, callback, intersectionObserverOptions2 = {}, options2 = {}) {
    reactExports.useEffect(() => {
      if (!ref.current || options2.disabled || typeof IntersectionObserver !== "function") {
        return;
      }
      const observer = new IntersectionObserver(([entry]) => {
        callback(entry);
      }, intersectionObserverOptions2);
      observer.observe(ref.current);
      return () => {
        observer.disconnect();
      };
    }, [callback, intersectionObserverOptions2, options2.disabled, ref]);
  }
  __name(useIntersectionObserver, "useIntersectionObserver");
  function useForwardedRef(ref) {
    const innerRef = reactExports.useRef(null);
    reactExports.useImperativeHandle(ref, () => innerRef.current, []);
    return innerRef;
  }
  __name(useForwardedRef, "useForwardedRef");
  function useLinkProps(options2, forwardedRef) {
    var _b2, _c2, _d;
    const router2 = useRouter();
    const [isTransitioning, setIsTransitioning] = reactExports.useState(false);
    const hasRenderFetched = reactExports.useRef(false);
    const innerRef = useForwardedRef(forwardedRef);
    const _a2 = options2, {
      activeProps: activeProps,
      inactiveProps,
      activeOptions,
      to,
      preload: userPreload,
      preloadDelay: userPreloadDelay,
      hashScrollIntoView,
      replace,
      startTransition,
      resetScroll,
      viewTransition,
      children: children,
      target,
      disabled,
      style,
      className,
      onClick,
      onFocus,
      onMouseEnter,
      onMouseLeave,
      onTouchStart,
      ignoreBlocker,
      params: _params,
      search: _search,
      hash: _hash,
      state: _state,
      mask: _mask,
      reloadDocument: _reloadDocument,
      unsafeRelative: _unsafeRelative,
      from: _from,
      _fromLocation
    } = _a2, propsSafeToSpread = __objRest(_a2, [
      // custom props
      "activeProps",
      "inactiveProps",
      "activeOptions",
      "to",
      "preload",
      "preloadDelay",
      "hashScrollIntoView",
      "replace",
      "startTransition",
      "resetScroll",
      "viewTransition",
      // element props
      "children",
      "target",
      "disabled",
      "style",
      "className",
      "onClick",
      "onFocus",
      "onMouseEnter",
      "onMouseLeave",
      "onTouchStart",
      "ignoreBlocker",
      // prevent these from being returned
      "params",
      "search",
      "hash",
      "state",
      "mask",
      "reloadDocument",
      "unsafeRelative",
      "from",
      "_fromLocation"
    ]);
    const type = reactExports.useMemo(() => {
      try {
        new URL(to);
        return "external";
      } catch (e) {
      }
      return "internal";
    }, [to]);
    const currentSearch = useRouterState({
      select: /* @__PURE__ */ __name((s2) => s2.location.search, "select"),
      structuralSharing: true
    });
    const from = options2.from;
    const _options = reactExports.useMemo(
      () => {
        return __spreadProps(__spreadValues({}, options2), { from });
      },
      // eslint-disable-next-line react-hooks/exhaustive-deps
      [
        router2,
        currentSearch,
        from,
        options2._fromLocation,
        options2.hash,
        options2.to,
        options2.search,
        options2.params,
        options2.state,
        options2.mask,
        options2.unsafeRelative
      ]
    );
    const next = reactExports.useMemo(
      () => router2.buildLocation(__spreadValues({}, _options)),
      [router2, _options]
    );
    const isExternal = type === "external";
    const preload = options2.reloadDocument || isExternal ? false : userPreload != null ? userPreload : router2.options.defaultPreload;
    const preloadDelay = (_b2 = userPreloadDelay != null ? userPreloadDelay : router2.options.defaultPreloadDelay) != null ? _b2 : 0;
    const isActive = useRouterState({
      select: /* @__PURE__ */ __name((s2) => {
        var _a3;
        if (isExternal) return false;
        if (activeOptions == null ? void 0 : activeOptions.exact) {
          const testExact = exactPathTest(
            s2.location.pathname,
            next.pathname,
            router2.basepath
          );
          if (!testExact) {
            return false;
          }
        } else {
          const currentPathSplit = removeTrailingSlash(
            s2.location.pathname,
            router2.basepath
          );
          const nextPathSplit = removeTrailingSlash(
            next.pathname,
            router2.basepath
          );
          const pathIsFuzzyEqual = currentPathSplit.startsWith(nextPathSplit) && (currentPathSplit.length === nextPathSplit.length || currentPathSplit[nextPathSplit.length] === "/");
          if (!pathIsFuzzyEqual) {
            return false;
          }
        }
        if ((_a3 = activeOptions == null ? void 0 : activeOptions.includeSearch) != null ? _a3 : true) {
          const searchTest = deepEqual$3(s2.location.search, next.search, {
            partial: !(activeOptions == null ? void 0 : activeOptions.exact),
            ignoreUndefined: !(activeOptions == null ? void 0 : activeOptions.explicitUndefined)
          });
          if (!searchTest) {
            return false;
          }
        }
        if (activeOptions == null ? void 0 : activeOptions.includeHash) {
          return s2.location.hash === next.hash;
        }
        return true;
      }, "select")
    });
    const doPreload = reactExports.useCallback(() => {
      router2.preloadRoute(__spreadValues({}, _options)).catch((err) => {
        console.warn(err);
        console.warn(preloadWarning);
      });
    }, [router2, _options]);
    const preloadViewportIoCallback = reactExports.useCallback(
      (entry) => {
        if (entry == null ? void 0 : entry.isIntersecting) {
          doPreload();
        }
      },
      [doPreload]
    );
    useIntersectionObserver(
      innerRef,
      preloadViewportIoCallback,
      intersectionObserverOptions,
      { disabled: !!disabled || !(preload === "viewport") }
    );
    reactExports.useEffect(() => {
      if (hasRenderFetched.current) {
        return;
      }
      if (!disabled && preload === "render") {
        doPreload();
        hasRenderFetched.current = true;
      }
    }, [disabled, doPreload, preload]);
    const handleClick = /* @__PURE__ */ __name((e) => {
      if (!disabled && !isCtrlEvent(e) && !e.defaultPrevented && (!target || target === "_self") && e.button === 0) {
        e.preventDefault();
        reactDomExports.flushSync(() => {
          setIsTransitioning(true);
        });
        const unsub = router2.subscribe("onResolved", () => {
          unsub();
          setIsTransitioning(false);
        });
        router2.navigate(__spreadProps(__spreadValues({}, _options), {
          replace,
          resetScroll,
          hashScrollIntoView,
          startTransition,
          viewTransition,
          ignoreBlocker
        }));
      }
    }, "handleClick");
    if (isExternal) {
      return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues({}, propsSafeToSpread), {
        ref: innerRef,
        type,
        href: to
      }), children && { children }), target && { target }), disabled && { disabled }), style && { style }), className && { className }), onClick && { onClick }), onFocus && { onFocus }), onMouseEnter && { onMouseEnter }), onMouseLeave && { onMouseLeave }), onTouchStart && { onTouchStart });
    }
    const handleFocus = /* @__PURE__ */ __name((_) => {
      if (disabled) return;
      if (preload) {
        doPreload();
      }
    }, "handleFocus");
    const handleTouchStart = handleFocus;
    const handleEnter = /* @__PURE__ */ __name((e) => {
      if (disabled || !preload) return;
      if (!preloadDelay) {
        doPreload();
      } else {
        const eventTarget = e.target;
        if (timeoutMap.has(eventTarget)) {
          return;
        }
        const id = setTimeout(() => {
          timeoutMap.delete(eventTarget);
          doPreload();
        }, preloadDelay);
        timeoutMap.set(eventTarget, id);
      }
    }, "handleEnter");
    const handleLeave = /* @__PURE__ */ __name((e) => {
      if (disabled || !preload || !preloadDelay) return;
      const eventTarget = e.target;
      const id = timeoutMap.get(eventTarget);
      if (id) {
        clearTimeout(id);
        timeoutMap.delete(eventTarget);
      }
    }, "handleLeave");
    const resolvedActiveProps = isActive ? (_c2 = functionalUpdate(activeProps, {})) != null ? _c2 : STATIC_ACTIVE_OBJECT : STATIC_EMPTY_OBJECT;
    const resolvedInactiveProps = isActive ? STATIC_EMPTY_OBJECT : (_d = functionalUpdate(inactiveProps, {})) != null ? _d : STATIC_EMPTY_OBJECT;
    const resolvedClassName = [
      className,
      resolvedActiveProps.className,
      resolvedInactiveProps.className
    ].filter(Boolean).join(" ");
    const resolvedStyle = (style || resolvedActiveProps.style || resolvedInactiveProps.style) && __spreadValues(__spreadValues(__spreadValues({}, style), resolvedActiveProps.style), resolvedInactiveProps.style);
    return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, propsSafeToSpread), resolvedActiveProps), resolvedInactiveProps), {
      href: disabled ? void 0 : next.maskedLocation ? router2.history.createHref(next.maskedLocation.href) : router2.history.createHref(next.href),
      ref: innerRef,
      onClick: composeHandlers([onClick, handleClick]),
      onFocus: composeHandlers([onFocus, handleFocus]),
      onMouseEnter: composeHandlers([onMouseEnter, handleEnter]),
      onMouseLeave: composeHandlers([onMouseLeave, handleLeave]),
      onTouchStart: composeHandlers([onTouchStart, handleTouchStart]),
      disabled: !!disabled,
      target
    }), resolvedStyle && { style: resolvedStyle }), resolvedClassName && { className: resolvedClassName }), disabled && STATIC_DISABLED_PROPS), isActive && STATIC_ACTIVE_PROPS), isTransitioning && STATIC_TRANSITIONING_PROPS);
  }
  __name(useLinkProps, "useLinkProps");
  const STATIC_EMPTY_OBJECT = {};
  const STATIC_ACTIVE_OBJECT = { className: "active" };
  const STATIC_DISABLED_PROPS = { role: "link", "aria-disabled": true };
  const STATIC_ACTIVE_PROPS = { "data-status": "active", "aria-current": "page" };
  const STATIC_TRANSITIONING_PROPS = { "data-transitioning": "transitioning" };
  const timeoutMap = /* @__PURE__ */ new WeakMap();
  const intersectionObserverOptions = {
    rootMargin: "100px"
  };
  const composeHandlers = /* @__PURE__ */ __name((handlers) => (e) => {
    handlers.filter(Boolean).forEach((handler) => {
      if (e.defaultPrevented) return;
      handler(e);
    });
  }, "composeHandlers");
  const Link = reactExports.forwardRef(
    (props, ref) => {
      const _a2 = props, { _asChild } = _a2, rest = __objRest(_a2, ["_asChild"]);
      const _b2 = useLinkProps(rest, ref), {
        type: _type,
        ref: innerRef
      } = _b2, linkProps = __objRest(_b2, [
        "type",
        "ref"
      ]);
      const children = typeof rest.children === "function" ? rest.children({
        isActive: linkProps["data-status"] === "active"
      }) : rest.children;
      if (_asChild === void 0) {
        delete linkProps.disabled;
      }
      return reactExports.createElement(
        _asChild ? _asChild : "a",
        __spreadProps(__spreadValues({}, linkProps), {
          ref: innerRef
        }),
        children
      );
    }
  );
  function isCtrlEvent(e) {
    return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
  }
  __name(isCtrlEvent, "isCtrlEvent");
  let Route$d = (_c = class extends BaseRoute {
    /**
     * @deprecated Use the `createRoute` function instead.
     */
    constructor(options2) {
      super(options2);
      this.useMatch = (opts) => {
        return useMatch({
          select: opts == null ? void 0 : opts.select,
          from: this.id,
          structuralSharing: opts == null ? void 0 : opts.structuralSharing
        });
      };
      this.useRouteContext = (opts) => {
        return useMatch(__spreadProps(__spreadValues({}, opts), {
          from: this.id,
          select: /* @__PURE__ */ __name((d) => (opts == null ? void 0 : opts.select) ? opts.select(d.context) : d.context, "select")
        }));
      };
      this.useSearch = (opts) => {
        return useSearch({
          select: opts == null ? void 0 : opts.select,
          structuralSharing: opts == null ? void 0 : opts.structuralSharing,
          from: this.id
        });
      };
      this.useParams = (opts) => {
        return useParams({
          select: opts == null ? void 0 : opts.select,
          structuralSharing: opts == null ? void 0 : opts.structuralSharing,
          from: this.id
        });
      };
      this.useLoaderDeps = (opts) => {
        return useLoaderDeps(__spreadProps(__spreadValues({}, opts), { from: this.id }));
      };
      this.useLoaderData = (opts) => {
        return useLoaderData(__spreadProps(__spreadValues({}, opts), { from: this.id }));
      };
      this.useNavigate = () => {
        return useNavigate({ from: this.fullPath });
      };
      this.Link = React.forwardRef(
        (props, ref) => {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Link, __spreadValues({ ref, from: this.fullPath }, props));
        }
      );
      this.$$typeof = Symbol.for("react.memo");
    }
  }, __name(_c, "Route"), _c);
  function createRoute(options2) {
    return new Route$d(options2);
  }
  __name(createRoute, "createRoute");
  const _RootRoute = class _RootRoute extends BaseRootRoute {
    /**
     * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
     */
    constructor(options2) {
      super(options2);
      this.useMatch = (opts) => {
        return useMatch({
          select: opts == null ? void 0 : opts.select,
          from: this.id,
          structuralSharing: opts == null ? void 0 : opts.structuralSharing
        });
      };
      this.useRouteContext = (opts) => {
        return useMatch(__spreadProps(__spreadValues({}, opts), {
          from: this.id,
          select: /* @__PURE__ */ __name((d) => (opts == null ? void 0 : opts.select) ? opts.select(d.context) : d.context, "select")
        }));
      };
      this.useSearch = (opts) => {
        return useSearch({
          select: opts == null ? void 0 : opts.select,
          structuralSharing: opts == null ? void 0 : opts.structuralSharing,
          from: this.id
        });
      };
      this.useParams = (opts) => {
        return useParams({
          select: opts == null ? void 0 : opts.select,
          structuralSharing: opts == null ? void 0 : opts.structuralSharing,
          from: this.id
        });
      };
      this.useLoaderDeps = (opts) => {
        return useLoaderDeps(__spreadProps(__spreadValues({}, opts), { from: this.id }));
      };
      this.useLoaderData = (opts) => {
        return useLoaderData(__spreadProps(__spreadValues({}, opts), { from: this.id }));
      };
      this.useNavigate = () => {
        return useNavigate({ from: this.fullPath });
      };
      this.Link = React.forwardRef(
        (props, ref) => {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Link, __spreadValues({ ref, from: this.fullPath }, props));
        }
      );
      this.$$typeof = Symbol.for("react.memo");
    }
  };
  __name(_RootRoute, "RootRoute");
  let RootRoute = _RootRoute;
  function createRootRoute(options2) {
    return new RootRoute(options2);
  }
  __name(createRootRoute, "createRootRoute");
  function createFileRoute(path) {
    if (typeof path === "object") {
      return new FileRoute(path, {
        silent: true
      }).createRoute(path);
    }
    return new FileRoute(path, {
      silent: true
    }).createRoute;
  }
  __name(createFileRoute, "createFileRoute");
  const _FileRoute = class _FileRoute {
    constructor(path, _opts) {
      this.path = path;
      this.createRoute = (options2) => {
        warning(
          this.silent
        );
        const route = createRoute(options2);
        route.isRoot = false;
        return route;
      };
      this.silent = _opts == null ? void 0 : _opts.silent;
    }
  };
  __name(_FileRoute, "FileRoute");
  let FileRoute = _FileRoute;
  const _LazyRoute = class _LazyRoute {
    constructor(opts) {
      this.useMatch = (opts2) => {
        return useMatch({
          select: opts2 == null ? void 0 : opts2.select,
          from: this.options.id,
          structuralSharing: opts2 == null ? void 0 : opts2.structuralSharing
        });
      };
      this.useRouteContext = (opts2) => {
        return useMatch({
          from: this.options.id,
          select: /* @__PURE__ */ __name((d) => (opts2 == null ? void 0 : opts2.select) ? opts2.select(d.context) : d.context, "select")
        });
      };
      this.useSearch = (opts2) => {
        return useSearch({
          select: opts2 == null ? void 0 : opts2.select,
          structuralSharing: opts2 == null ? void 0 : opts2.structuralSharing,
          from: this.options.id
        });
      };
      this.useParams = (opts2) => {
        return useParams({
          select: opts2 == null ? void 0 : opts2.select,
          structuralSharing: opts2 == null ? void 0 : opts2.structuralSharing,
          from: this.options.id
        });
      };
      this.useLoaderDeps = (opts2) => {
        return useLoaderDeps(__spreadProps(__spreadValues({}, opts2), { from: this.options.id }));
      };
      this.useLoaderData = (opts2) => {
        return useLoaderData(__spreadProps(__spreadValues({}, opts2), { from: this.options.id }));
      };
      this.useNavigate = () => {
        const router2 = useRouter();
        return useNavigate({ from: router2.routesById[this.options.id].fullPath });
      };
      this.options = opts;
      this.$$typeof = Symbol.for("react.memo");
    }
  };
  __name(_LazyRoute, "LazyRoute");
  let LazyRoute = _LazyRoute;
  function createLazyFileRoute(id) {
    if (typeof id === "object") {
      return new LazyRoute(id);
    }
    return (opts) => new LazyRoute(__spreadValues({ id }, opts));
  }
  __name(createLazyFileRoute, "createLazyFileRoute");
  function lazyRouteComponent(importer, exportName) {
    let loadPromise;
    let comp;
    let error;
    let reload;
    const load = /* @__PURE__ */ __name(() => {
      if (!loadPromise) {
        loadPromise = importer().then((res) => {
          loadPromise = void 0;
          comp = res[exportName];
        }).catch((err) => {
          error = err;
          if (isModuleNotFoundError(error)) {
            if (error instanceof Error && typeof window !== "undefined" && typeof sessionStorage !== "undefined") {
              const storageKey2 = `tanstack_router_reload:${error.message}`;
              if (!sessionStorage.getItem(storageKey2)) {
                sessionStorage.setItem(storageKey2, "1");
                reload = true;
              }
            }
          }
        });
      }
      return loadPromise;
    }, "load");
    const lazyComp = /* @__PURE__ */ __name(function Lazy(props) {
      if (reload) {
        window.location.reload();
        throw new Promise(() => {
        });
      }
      if (error) {
        throw error;
      }
      if (!comp) {
        throw load();
      }
      return reactExports.createElement(comp, props);
    }, "Lazy");
    lazyComp.preload = load;
    return lazyComp;
  }
  __name(lazyRouteComponent, "lazyRouteComponent");
  function Transitioner() {
    const router2 = useRouter();
    const mountLoadForRouter = reactExports.useRef({ router: router2, mounted: false });
    const [isTransitioning, setIsTransitioning] = reactExports.useState(false);
    const { hasPendingMatches, isLoading } = useRouterState({
      select: /* @__PURE__ */ __name((s2) => ({
        isLoading: s2.isLoading,
        hasPendingMatches: s2.matches.some((d) => d.status === "pending")
      }), "select"),
      structuralSharing: true
    });
    const previousIsLoading = usePrevious$1(isLoading);
    const isAnyPending = isLoading || isTransitioning || hasPendingMatches;
    const previousIsAnyPending = usePrevious$1(isAnyPending);
    const isPagePending = isLoading || hasPendingMatches;
    const previousIsPagePending = usePrevious$1(isPagePending);
    router2.startTransition = (fn) => {
      setIsTransitioning(true);
      reactExports.startTransition(() => {
        fn();
        setIsTransitioning(false);
      });
    };
    reactExports.useEffect(() => {
      const unsub = router2.history.subscribe(router2.load);
      const nextLocation = router2.buildLocation({
        to: router2.latestLocation.pathname,
        search: true,
        params: true,
        hash: true,
        state: true,
        _includeValidateSearch: true
      });
      if (trimPathRight(router2.latestLocation.href) !== trimPathRight(nextLocation.href)) {
        router2.commitLocation(__spreadProps(__spreadValues({}, nextLocation), { replace: true }));
      }
      return () => {
        unsub();
      };
    }, [router2, router2.history]);
    useLayoutEffect(() => {
      if (
        // if we are hydrating from SSR, loading is triggered in ssr-client
        typeof window !== "undefined" && router2.ssr || mountLoadForRouter.current.router === router2 && mountLoadForRouter.current.mounted
      ) {
        return;
      }
      mountLoadForRouter.current = { router: router2, mounted: true };
      const tryLoad = /* @__PURE__ */ __name(() => __async(null, null, function* () {
        try {
          yield router2.load();
        } catch (err) {
          console.error(err);
        }
      }), "tryLoad");
      tryLoad();
    }, [router2]);
    useLayoutEffect(() => {
      if (previousIsLoading && !isLoading) {
        router2.emit(__spreadValues({
          type: "onLoad"
        }, getLocationChangeInfo(router2.state)));
      }
    }, [previousIsLoading, router2, isLoading]);
    useLayoutEffect(() => {
      if (previousIsPagePending && !isPagePending) {
        router2.emit(__spreadValues({
          type: "onBeforeRouteMount"
        }, getLocationChangeInfo(router2.state)));
      }
    }, [isPagePending, previousIsPagePending, router2]);
    useLayoutEffect(() => {
      if (previousIsAnyPending && !isAnyPending) {
        router2.emit(__spreadValues({
          type: "onResolved"
        }, getLocationChangeInfo(router2.state)));
        router2.__store.setState((s2) => __spreadProps(__spreadValues({}, s2), {
          status: "idle",
          resolvedLocation: s2.location
        }));
        handleHashScroll(router2);
      }
    }, [isAnyPending, previousIsAnyPending, router2]);
    return null;
  }
  __name(Transitioner, "Transitioner");
  function CatchNotFound(props) {
    const resetKey = useRouterState({
      select: /* @__PURE__ */ __name((s2) => `not-found-${s2.location.pathname}-${s2.status}`, "select")
    });
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      CatchBoundary,
      {
        getResetKey: /* @__PURE__ */ __name(() => resetKey, "getResetKey"),
        onCatch: /* @__PURE__ */ __name((error, errorInfo) => {
          var _a2;
          if (isNotFound(error)) {
            (_a2 = props.onCatch) == null ? void 0 : _a2.call(props, error, errorInfo);
          } else {
            throw error;
          }
        }, "onCatch"),
        errorComponent: /* @__PURE__ */ __name(({ error }) => {
          var _a2;
          if (isNotFound(error)) {
            return (_a2 = props.fallback) == null ? void 0 : _a2.call(props, error);
          } else {
            throw error;
          }
        }, "errorComponent"),
        children: props.children
      }
    );
  }
  __name(CatchNotFound, "CatchNotFound");
  function DefaultGlobalNotFound() {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Not Found" });
  }
  __name(DefaultGlobalNotFound, "DefaultGlobalNotFound");
  function SafeFragment(props) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: props.children });
  }
  __name(SafeFragment, "SafeFragment");
  function renderRouteNotFound(router2, route, data) {
    if (!route.options.notFoundComponent) {
      if (router2.options.defaultNotFoundComponent) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(router2.options.defaultNotFoundComponent, { data });
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(DefaultGlobalNotFound, {});
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx(route.options.notFoundComponent, { data });
  }
  __name(renderRouteNotFound, "renderRouteNotFound");
  function ScriptOnce({
    children
  }) {
    if (typeof document !== "undefined") {
      return null;
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "script",
      {
        className: "$tsr",
        dangerouslySetInnerHTML: {
          __html: [children].filter(Boolean).join("\n")
        }
      }
    );
  }
  __name(ScriptOnce, "ScriptOnce");
  function ScrollRestoration() {
    const router2 = useRouter();
    const getKey = router2.options.getScrollRestorationKey || defaultGetScrollRestorationKey;
    const userKey = getKey(router2.latestLocation);
    const resolvedKey = userKey !== defaultGetScrollRestorationKey(router2.latestLocation) ? userKey : void 0;
    if (!router2.isScrollRestoring || !router2.isServer) {
      return null;
    }
    const restoreScrollOptions = {
      storageKey,
      shouldScrollRestoration: true
    };
    if (resolvedKey) {
      restoreScrollOptions.key = resolvedKey;
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      ScriptOnce,
      {
        children: `(${restoreScroll.toString()})(${JSON.stringify(restoreScrollOptions)})`
      }
    );
  }
  __name(ScrollRestoration, "ScrollRestoration");
  const Match = reactExports.memo(/* @__PURE__ */ __name(function MatchImpl({
    matchId
  }) {
    var _a3, _b3, _c2, _d, _e2, _f, _g;
    var _a2, _b2;
    const router2 = useRouter();
    const matchState = useRouterState({
      select: /* @__PURE__ */ __name((s2) => {
        const match = s2.matches.find((d) => d.id === matchId);
        invariant(
          match
        );
        return {
          routeId: match.routeId,
          ssr: match.ssr,
          _displayPending: match._displayPending
        };
      }, "select"),
      structuralSharing: true
    });
    const route = router2.routesById[matchState.routeId];
    const PendingComponent = (_a3 = route.options.pendingComponent) != null ? _a3 : router2.options.defaultPendingComponent;
    const pendingElement = PendingComponent ? /* @__PURE__ */ jsxRuntimeExports.jsx(PendingComponent, {}) : null;
    const routeErrorComponent = (_b3 = route.options.errorComponent) != null ? _b3 : router2.options.defaultErrorComponent;
    const routeOnCatch = (_c2 = route.options.onCatch) != null ? _c2 : router2.options.defaultOnCatch;
    const routeNotFoundComponent = route.isRoot ? (
      // If it's the root route, use the globalNotFound option, with fallback to the notFoundRoute's component
      (_d = route.options.notFoundComponent) != null ? _d : (_a2 = router2.options.notFoundRoute) == null ? void 0 : _a2.options.component
    ) : route.options.notFoundComponent;
    const resolvedNoSsr = matchState.ssr === false || matchState.ssr === "data-only";
    const ResolvedSuspenseBoundary = (
      // If we're on the root route, allow forcefully wrapping in suspense
      (!route.isRoot || route.options.wrapInSuspense || resolvedNoSsr) && ((_f = (_e2 = route.options.wrapInSuspense) != null ? _e2 : PendingComponent) != null ? _f : ((_b2 = route.options.errorComponent) == null ? void 0 : _b2.preload) || resolvedNoSsr) ? reactExports.Suspense : SafeFragment
    );
    const ResolvedCatchBoundary = routeErrorComponent ? CatchBoundary : SafeFragment;
    const ResolvedNotFoundBoundary = routeNotFoundComponent ? CatchNotFound : SafeFragment;
    const resetKey = useRouterState({
      select: /* @__PURE__ */ __name((s2) => s2.loadedAt, "select")
    });
    const parentRouteId = useRouterState({
      select: /* @__PURE__ */ __name((s2) => {
        var _a22;
        const index2 = s2.matches.findIndex((d) => d.id === matchId);
        return (_a22 = s2.matches[index2 - 1]) == null ? void 0 : _a22.routeId;
      }, "select")
    });
    const ShellComponent = route.isRoot ? (_g = route.options.shellComponent) != null ? _g : SafeFragment : SafeFragment;
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(ShellComponent, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(matchContext.Provider, { value: matchId, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResolvedSuspenseBoundary, { fallback: pendingElement, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        ResolvedCatchBoundary,
        {
          getResetKey: /* @__PURE__ */ __name(() => resetKey, "getResetKey"),
          errorComponent: routeErrorComponent || ErrorComponent,
          onCatch: /* @__PURE__ */ __name((error, errorInfo) => {
            if (isNotFound(error)) throw error;
            routeOnCatch == null ? void 0 : routeOnCatch(error, errorInfo);
          }, "onCatch"),
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            ResolvedNotFoundBoundary,
            {
              fallback: /* @__PURE__ */ __name((error) => {
                if (!routeNotFoundComponent || error.routeId && error.routeId !== matchState.routeId || !error.routeId && !route.isRoot)
                  throw error;
                return reactExports.createElement(routeNotFoundComponent, error);
              }, "fallback"),
              children: resolvedNoSsr || matchState._displayPending ? /* @__PURE__ */ jsxRuntimeExports.jsx(ClientOnly, { fallback: pendingElement, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MatchInner, { matchId }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(MatchInner, { matchId })
            }
          )
        }
      ) }) }),
      parentRouteId === rootRouteId && router2.options.scrollRestoration ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(OnRendered, {}),
        /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollRestoration, {})
      ] }) : null
    ] });
  }, "MatchImpl"));
  function OnRendered() {
    const router2 = useRouter();
    const prevLocationRef = reactExports.useRef(
      void 0
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "script",
      {
        suppressHydrationWarning: true,
        ref: /* @__PURE__ */ __name((el) => {
          if (el && (prevLocationRef.current === void 0 || prevLocationRef.current.href !== router2.latestLocation.href)) {
            router2.emit(__spreadValues({
              type: "onRendered"
            }, getLocationChangeInfo(router2.state)));
            prevLocationRef.current = router2.latestLocation;
          }
        }, "ref")
      },
      router2.latestLocation.state.__TSR_key
    );
  }
  __name(OnRendered, "OnRendered");
  const MatchInner = reactExports.memo(/* @__PURE__ */ __name(function MatchInnerImpl({
    matchId
  }) {
    var _a3, _b3;
    var _a2, _b2, _c2, _d;
    const router2 = useRouter();
    const { match, key, routeId } = useRouterState({
      select: /* @__PURE__ */ __name((s2) => {
        var _a4;
        const match2 = s2.matches.find((d) => d.id === matchId);
        const routeId2 = match2.routeId;
        const remountFn = (_a4 = router2.routesById[routeId2].options.remountDeps) != null ? _a4 : router2.options.defaultRemountDeps;
        const remountDeps = remountFn == null ? void 0 : remountFn({
          routeId: routeId2,
          loaderDeps: match2.loaderDeps,
          params: match2._strictParams,
          search: match2._strictSearch
        });
        const key2 = remountDeps ? JSON.stringify(remountDeps) : void 0;
        return {
          key: key2,
          routeId: routeId2,
          match: {
            id: match2.id,
            status: match2.status,
            error: match2.error,
            _forcePending: match2._forcePending,
            _displayPending: match2._displayPending
          }
        };
      }, "select"),
      structuralSharing: true
    });
    const route = router2.routesById[routeId];
    const out = reactExports.useMemo(() => {
      var _a4;
      const Comp = (_a4 = route.options.component) != null ? _a4 : router2.options.defaultComponent;
      if (Comp) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, {}, key);
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {});
    }, [key, route.options.component, router2.options.defaultComponent]);
    if (match._displayPending) {
      throw (_a2 = router2.getMatch(match.id)) == null ? void 0 : _a2._nonReactive.displayPendingPromise;
    }
    if (match._forcePending) {
      throw (_b2 = router2.getMatch(match.id)) == null ? void 0 : _b2._nonReactive.minPendingPromise;
    }
    if (match.status === "pending") {
      const pendingMinMs = (_a3 = route.options.pendingMinMs) != null ? _a3 : router2.options.defaultPendingMinMs;
      if (pendingMinMs) {
        const routerMatch = router2.getMatch(match.id);
        if (routerMatch && !routerMatch._nonReactive.minPendingPromise) {
          if (!router2.isServer) {
            const minPendingPromise = createControlledPromise();
            routerMatch._nonReactive.minPendingPromise = minPendingPromise;
            setTimeout(() => {
              minPendingPromise.resolve();
              routerMatch._nonReactive.minPendingPromise = void 0;
            }, pendingMinMs);
          }
        }
      }
      throw (_c2 = router2.getMatch(match.id)) == null ? void 0 : _c2._nonReactive.loadPromise;
    }
    if (match.status === "notFound") {
      invariant(isNotFound(match.error));
      return renderRouteNotFound(router2, route, match.error);
    }
    if (match.status === "redirected") {
      invariant(isRedirect(match.error));
      throw (_d = router2.getMatch(match.id)) == null ? void 0 : _d._nonReactive.loadPromise;
    }
    if (match.status === "error") {
      if (router2.isServer) {
        const RouteErrorComponent = ((_b3 = route.options.errorComponent) != null ? _b3 : router2.options.defaultErrorComponent) || ErrorComponent;
        return /* @__PURE__ */ jsxRuntimeExports.jsx(
          RouteErrorComponent,
          {
            error: match.error,
            reset: void 0,
            info: {
              componentStack: ""
            }
          }
        );
      }
      throw match.error;
    }
    return out;
  }, "MatchInnerImpl"));
  const Outlet = reactExports.memo(/* @__PURE__ */ __name(function OutletImpl() {
    const router2 = useRouter();
    const matchId = reactExports.useContext(matchContext);
    const routeId = useRouterState({
      select: /* @__PURE__ */ __name((s2) => {
        var _a2;
        return (_a2 = s2.matches.find((d) => d.id === matchId)) == null ? void 0 : _a2.routeId;
      }, "select")
    });
    const route = router2.routesById[routeId];
    const parentGlobalNotFound = useRouterState({
      select: /* @__PURE__ */ __name((s2) => {
        const matches = s2.matches;
        const parentMatch = matches.find((d) => d.id === matchId);
        invariant(
          parentMatch
        );
        return parentMatch.globalNotFound;
      }, "select")
    });
    const childMatchId = useRouterState({
      select: /* @__PURE__ */ __name((s2) => {
        var _a2;
        const matches = s2.matches;
        const index2 = matches.findIndex((d) => d.id === matchId);
        return (_a2 = matches[index2 + 1]) == null ? void 0 : _a2.id;
      }, "select")
    });
    const pendingElement = router2.options.defaultPendingComponent ? /* @__PURE__ */ jsxRuntimeExports.jsx(router2.options.defaultPendingComponent, {}) : null;
    if (parentGlobalNotFound) {
      return renderRouteNotFound(router2, route, void 0);
    }
    if (!childMatchId) {
      return null;
    }
    const nextMatch = /* @__PURE__ */ jsxRuntimeExports.jsx(Match, { matchId: childMatchId });
    if (matchId === rootRouteId) {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: pendingElement, children: nextMatch });
    }
    return nextMatch;
  }, "OutletImpl"));
  function Matches() {
    const router2 = useRouter();
    const pendingElement = router2.options.defaultPendingComponent ? /* @__PURE__ */ jsxRuntimeExports.jsx(router2.options.defaultPendingComponent, {}) : null;
    const ResolvedSuspense = router2.isServer || typeof document !== "undefined" && router2.ssr ? SafeFragment : reactExports.Suspense;
    const inner = /* @__PURE__ */ jsxRuntimeExports.jsxs(ResolvedSuspense, { fallback: pendingElement, children: [
      !router2.isServer && /* @__PURE__ */ jsxRuntimeExports.jsx(Transitioner, {}),
      /* @__PURE__ */ jsxRuntimeExports.jsx(MatchesInner, {})
    ] });
    return router2.options.InnerWrap ? /* @__PURE__ */ jsxRuntimeExports.jsx(router2.options.InnerWrap, { children: inner }) : inner;
  }
  __name(Matches, "Matches");
  function MatchesInner() {
    const router2 = useRouter();
    const matchId = useRouterState({
      select: /* @__PURE__ */ __name((s2) => {
        var _a2;
        return (_a2 = s2.matches[0]) == null ? void 0 : _a2.id;
      }, "select")
    });
    const resetKey = useRouterState({
      select: /* @__PURE__ */ __name((s2) => s2.loadedAt, "select")
    });
    const matchComponent = matchId ? /* @__PURE__ */ jsxRuntimeExports.jsx(Match, { matchId }) : null;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(matchContext.Provider, { value: matchId, children: router2.options.disableGlobalCatchBoundary ? matchComponent : /* @__PURE__ */ jsxRuntimeExports.jsx(
      CatchBoundary,
      {
        getResetKey: /* @__PURE__ */ __name(() => resetKey, "getResetKey"),
        errorComponent: ErrorComponent,
        onCatch: /* @__PURE__ */ __name((error) => {
          warning(false, error.message || error.toString());
        }, "onCatch"),
        children: matchComponent
      }
    ) });
  }
  __name(MatchesInner, "MatchesInner");
  function useMatches(opts) {
    return useRouterState({
      select: /* @__PURE__ */ __name((state) => {
        const matches = state.matches;
        return matches;
      }, "select"),
      structuralSharing: void 0
    });
  }
  __name(useMatches, "useMatches");
  const createRouter = /* @__PURE__ */ __name((options2) => {
    return new Router(options2);
  }, "createRouter");
  const _Router = class _Router extends RouterCore {
    constructor(options2) {
      super(options2);
    }
  };
  __name(_Router, "Router");
  let Router = _Router;
  if (typeof globalThis !== "undefined") {
    globalThis.createFileRoute = createFileRoute;
    globalThis.createLazyFileRoute = createLazyFileRoute;
  } else if (typeof window !== "undefined") {
    window.createFileRoute = createFileRoute;
    window.createLazyFileRoute = createLazyFileRoute;
  }
  function RouterContextProvider(_d) {
    var _e2 = _d, {
      router: router2,
      children
    } = _e2, rest = __objRest(_e2, [
      "router",
      "children"
    ]);
    if (Object.keys(rest).length > 0) {
      router2.update(__spreadProps(__spreadValues(__spreadValues({}, router2.options), rest), {
        context: __spreadValues(__spreadValues({}, router2.options.context), rest.context)
      }));
    }
    const routerContext2 = getRouterContext();
    const provider = /* @__PURE__ */ jsxRuntimeExports.jsx(routerContext2.Provider, { value: router2, children });
    if (router2.options.Wrap) {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(router2.options.Wrap, { children: provider });
    }
    return provider;
  }
  __name(RouterContextProvider, "RouterContextProvider");
  function RouterProvider(_f) {
    var _g = _f, { router: router2 } = _g, rest = __objRest(_g, ["router"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(RouterContextProvider, __spreadProps(__spreadValues({ router: router2 }, rest), { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Matches, {}) }));
  }
  __name(RouterProvider, "RouterProvider");
  function _resolveBlockerOpts(opts, condition) {
    var _a2;
    if (opts === void 0) {
      return {
        shouldBlockFn: /* @__PURE__ */ __name(() => true, "shouldBlockFn"),
        withResolver: false
      };
    }
    if ("shouldBlockFn" in opts) {
      return opts;
    }
    if (typeof opts === "function") {
      const shouldBlock2 = Boolean(true);
      const _customBlockerFn2 = /* @__PURE__ */ __name(() => __async(null, null, function* () {
        if (shouldBlock2) return yield opts();
        return false;
      }), "_customBlockerFn2");
      return {
        shouldBlockFn: _customBlockerFn2,
        enableBeforeUnload: shouldBlock2,
        withResolver: false
      };
    }
    const shouldBlock = Boolean((_a2 = opts.condition) != null ? _a2 : true);
    const fn = opts.blockerFn;
    const _customBlockerFn = /* @__PURE__ */ __name(() => __async(null, null, function* () {
      if (shouldBlock && fn !== void 0) {
        return yield fn();
      }
      return shouldBlock;
    }), "_customBlockerFn");
    return {
      shouldBlockFn: _customBlockerFn,
      enableBeforeUnload: shouldBlock,
      withResolver: fn === void 0
    };
  }
  __name(_resolveBlockerOpts, "_resolveBlockerOpts");
  function useBlocker(opts, condition) {
    const {
      shouldBlockFn,
      enableBeforeUnload = true,
      disabled = false,
      withResolver = false
    } = _resolveBlockerOpts(opts);
    const router2 = useRouter();
    const { history } = router2;
    const [resolver, setResolver] = reactExports.useState({
      status: "idle",
      current: void 0,
      next: void 0,
      action: void 0,
      proceed: void 0,
      reset: void 0
    });
    reactExports.useEffect(() => {
      const blockerFnComposed = /* @__PURE__ */ __name((blockerFnArgs) => __async(null, null, function* () {
        function getLocation(location) {
          const parsedLocation = router2.parseLocation(location);
          const matchedRoutes = router2.getMatchedRoutes(
            parsedLocation.pathname,
            void 0
          );
          if (matchedRoutes.foundRoute === void 0) {
            throw new Error(`No route found for location ${location.href}`);
          }
          return {
            routeId: matchedRoutes.foundRoute.id,
            fullPath: matchedRoutes.foundRoute.fullPath,
            pathname: parsedLocation.pathname,
            params: matchedRoutes.routeParams,
            search: parsedLocation.search
          };
        }
        __name(getLocation, "getLocation");
        const current = getLocation(blockerFnArgs.currentLocation);
        const next = getLocation(blockerFnArgs.nextLocation);
        const shouldBlock = yield shouldBlockFn({
          action: blockerFnArgs.action,
          current,
          next
        });
        if (!withResolver) {
          return shouldBlock;
        }
        if (!shouldBlock) {
          return false;
        }
        const promise = new Promise((resolve) => {
          setResolver({
            status: "blocked",
            current,
            next,
            action: blockerFnArgs.action,
            proceed: /* @__PURE__ */ __name(() => resolve(false), "proceed"),
            reset: /* @__PURE__ */ __name(() => resolve(true), "reset")
          });
        });
        const canNavigateAsync = yield promise;
        setResolver({
          status: "idle",
          current: void 0,
          next: void 0,
          action: void 0,
          proceed: void 0,
          reset: void 0
        });
        return canNavigateAsync;
      }), "blockerFnComposed");
      return disabled ? void 0 : history.block({ blockerFn: blockerFnComposed, enableBeforeUnload });
    }, [
      shouldBlockFn,
      enableBeforeUnload,
      disabled,
      withResolver,
      history,
      router2
    ]);
    return resolver;
  }
  __name(useBlocker, "useBlocker");
  const CookieYes = /* @__PURE__ */ __name(({
    width = "18px",
    height = "100%",
    color: color2 = "currentColor"
  }) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "svg",
      {
        width,
        height,
        viewBox: "0 0 1250 250",
        fill: "none",
        xmlns: "http://www.w3.org/2000/svg",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M92.9114 47.9141C134.161 47.9141 164.995 70.8307 174.995 108.331H128.745C121.661 93.3307 108.328 86.2474 92.4948 86.2474C66.6615 86.2474 48.7448 105.414 48.7448 136.247C48.7448 167.081 66.6615 186.247 92.4948 186.247C108.328 186.247 121.661 178.747 128.745 164.164H174.995C164.995 201.664 134.161 224.581 92.9114 224.581C41.6614 224.164 5.82812 187.914 5.82812 135.831C5.82812 83.7474 41.6614 47.9141 92.9114 47.9141Z",
              fill: color2
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M259.161 225.003C218.745 225.003 188.328 197.919 188.328 154.169C188.328 110.419 219.578 83.3359 259.995 83.3359C300.411 83.3359 331.661 110.419 331.661 154.169C331.661 197.919 299.578 225.003 259.161 225.003ZM259.161 188.336C274.161 188.336 288.328 177.086 288.328 154.169C288.328 130.836 274.578 120.003 259.578 120.003C244.161 120.003 230.828 130.836 230.828 154.169C231.245 177.086 243.745 188.336 259.161 188.336Z",
              fill: color2
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M415.411 225.003C374.995 225.003 344.578 197.919 344.578 154.169C344.578 110.419 375.828 83.3359 416.245 83.3359C456.661 83.3359 487.911 110.419 487.911 154.169C487.911 197.919 455.828 225.003 415.411 225.003ZM415.411 188.336C430.411 188.336 444.578 177.086 444.578 154.169C444.578 130.836 430.828 120.003 415.828 120.003C400.411 120.003 387.078 130.836 387.078 154.169C387.078 177.086 399.995 188.336 415.411 188.336Z",
              fill: color2
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M502.914 47.9141H544.997V141.247L586.664 85.4141H638.747L581.664 154.164L639.581 222.914H587.497L545.414 164.997V222.914H503.331V47.9141H502.914Z",
              fill: color2
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M648.746 48.3307C648.746 35.4141 658.746 25.4141 673.746 25.4141C688.746 25.4141 698.746 35.4141 698.746 48.3307C698.746 60.8307 688.746 70.8307 673.746 70.8307C658.746 70.8307 648.746 60.8307 648.746 48.3307ZM652.913 84.9974H694.996V222.497H652.913V84.9974Z",
              fill: color2
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M780.001 225.003C739.585 225.003 710.418 197.919 710.418 154.169C710.418 110.419 739.168 83.3359 780.001 83.3359C820.001 83.3359 848.751 110.003 848.751 152.086C848.751 155.836 848.335 160.419 847.918 164.586H752.501C754.168 182.503 765.001 190.836 778.751 190.836C790.418 190.836 797.085 185.003 800.835 177.503H845.835C838.751 204.169 814.585 225.003 780.001 225.003ZM752.918 140.836H805.835C805.835 125.836 794.168 117.086 780.001 117.086C765.835 117.086 755.418 125.419 752.918 140.836Z",
              fill: color2
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M1043.33 225.003C1002.91 225.003 973.746 197.919 973.746 154.169C973.746 110.419 1002.5 83.3359 1043.33 83.3359C1083.33 83.3359 1112.08 110.003 1112.08 152.086C1112.08 155.836 1111.66 160.419 1111.25 164.586H1015.83C1017.5 182.503 1028.33 190.836 1042.08 190.836C1053.75 190.836 1060.41 185.003 1064.16 177.503H1109.16C1102.08 204.169 1077.5 225.003 1043.33 225.003ZM1015.83 140.836H1068.75C1068.75 125.836 1057.08 117.086 1042.91 117.086C1029.16 117.086 1018.33 125.419 1015.83 140.836Z",
              fill: color2
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M1188.33 225.003C1151.67 225.003 1127.08 204.586 1125 177.919H1166.67C1167.5 187.503 1176.25 193.753 1187.92 193.753C1198.75 193.753 1204.58 188.753 1204.58 182.503C1204.58 160.419 1129.58 176.253 1129.58 125.836C1129.58 102.503 1149.58 83.3359 1185.42 83.3359C1220.83 83.3359 1240.83 102.919 1243.33 130.003H1204.17C1202.92 120.836 1195.83 114.586 1183.75 114.586C1173.75 114.586 1168.33 118.336 1168.33 125.003C1168.33 147.086 1242.92 131.253 1243.75 182.919C1244.17 206.669 1222.92 225.003 1188.33 225.003Z",
              fill: color2
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M892.496 87.5H848.746L888.746 161.667H932.496L892.496 87.5Z",
              fill: color2
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M887.906 159.586L889.156 161.669H932.906L904.156 109.586L887.906 159.586Z",
              fill: color2
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M967.91 25L889.16 161.667H932.91L1011.66 25H967.91Z",
              fill: color2
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M889.16 182.086H931.66V225.003H889.16V182.086Z", fill: color2 })
        ]
      }
    );
  }, "CookieYes");
  const Help = /* @__PURE__ */ __name(({
    width = "44",
    height = "38",
    color: color2 = "currentColor"
  }) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "svg",
      {
        width,
        height,
        viewBox: "0 0 150 150",
        fill: "none",
        xmlns: "http://www.w3.org/2000/svg",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M61.0383 94.1116C50.3883 90.4066 42.6933 80.2666 42.6933 68.3266C42.6933 53.2816 54.9033 41.0716 69.9783 41.0716C81.5733 41.0716 91.5183 48.3316 95.4483 58.5916C99.8433 57.3316 104.373 56.7016 109.038 56.7016C115.728 56.7016 122.193 58.0216 128.313 60.6016C131.898 62.1166 135.258 64.0516 138.363 66.3166C138.243 61.0066 137.868 58.8466 137.868 58.8466C137.328 55.8616 134.448 52.8466 131.493 52.1566L129.258 51.6466C124.038 50.0716 119.373 46.5916 116.418 41.5066C113.463 36.3916 112.773 30.5716 114.063 25.2316L114.753 23.1316C115.638 20.2366 114.498 16.2466 112.143 14.2516C112.143 14.2516 110.043 12.4666 104.163 9.07655C98.2533 5.68655 95.7183 4.77155 95.7183 4.77155C92.8233 3.75155 88.8033 4.72655 86.7033 6.96155L85.1583 8.62655C81.1983 12.3916 75.8583 14.6566 69.9333 14.6566C64.0233 14.6566 58.6533 12.3616 54.6633 8.56655L53.1633 6.96155C51.0933 4.72655 47.0433 3.75155 44.1783 4.78655C44.1783 4.78655 41.5983 5.73155 35.7033 9.09155C29.7933 12.5416 27.7533 14.2966 27.7533 14.2966C25.4283 16.2466 24.2733 20.2066 25.1433 23.1466L25.7733 25.2766C27.0333 30.6166 26.3733 36.4216 23.4183 41.5366C20.4633 46.6516 15.7833 50.1466 10.5183 51.7066L8.35828 52.2016C5.40328 52.8616 2.49328 55.8766 1.98328 58.8916C1.98328 58.8916 1.48828 61.5616 1.48828 68.4016C1.48828 75.2116 1.98328 77.9116 1.98328 77.9116C2.52328 80.9266 5.40328 83.9116 8.35828 84.6016L10.4583 85.0965C15.7083 86.6415 20.4483 90.1516 23.3733 95.2966C26.3283 100.412 27.0183 106.232 25.7283 111.572L25.1283 113.642C24.2433 116.537 25.3833 120.527 27.7383 122.522C27.7383 122.522 29.8383 124.307 35.7183 127.697C41.6283 131.117 44.1633 132.002 44.1633 132.002C47.0283 133.037 51.0483 132.062 53.1483 129.827L54.6183 128.252C56.8533 126.122 59.5533 124.457 62.5383 123.392C60.4983 117.902 59.4633 112.142 59.4633 106.247C59.5383 102.077 60.0633 98.0266 61.0383 94.1116Z",
              fill: color2
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M109.052 66.7188C87.2566 66.7188 69.6016 84.3738 69.6016 106.169C69.6016 127.964 87.2566 145.619 109.052 145.619C130.847 145.619 148.502 127.964 148.502 106.169C148.502 84.3738 130.847 66.7188 109.052 66.7188ZM109.787 136.814C106.367 136.814 103.607 133.964 103.607 130.469C103.607 126.959 106.367 124.124 109.787 124.124C113.207 124.124 115.967 126.974 115.967 130.469C115.967 133.979 113.207 136.814 109.787 136.814ZM127.052 96.9288C126.197 98.5638 125.192 99.9738 124.007 101.174C122.837 102.374 120.737 104.369 117.692 107.174C116.852 107.984 116.177 108.674 115.682 109.274C115.172 109.874 114.797 110.429 114.557 110.909C114.302 111.404 114.122 111.914 113.987 112.409C113.837 112.904 113.642 113.789 113.387 115.049C112.922 117.719 111.467 119.039 108.992 119.039C107.702 119.039 106.637 118.604 105.752 117.749C104.867 116.894 104.432 115.589 104.432 113.879C104.432 111.719 104.747 109.859 105.377 108.314C106.007 106.739 106.877 105.359 107.927 104.174C108.992 103.004 110.432 101.564 112.232 99.9288C113.807 98.4888 114.962 97.4237 115.652 96.6887C116.372 95.9688 116.942 95.1438 117.437 94.2438C117.932 93.3588 118.157 92.3838 118.157 91.3188C118.157 89.2788 117.407 87.5237 115.952 86.1137C114.482 84.7037 112.592 83.9838 110.267 83.9838C107.537 83.9838 105.557 84.7037 104.267 86.1137C102.977 87.5237 101.882 89.6238 101.027 92.3988C100.187 95.2938 98.5816 96.7338 96.2566 96.7338C94.8766 96.7338 93.7066 96.2238 92.7466 95.2188C91.8016 94.2138 91.3066 93.1188 91.3066 91.9488C91.3066 89.5038 92.0566 87.0438 93.5716 84.5688C95.0716 82.0638 97.2766 80.0088 100.172 78.3588C103.067 76.7238 106.427 75.8838 110.282 75.8838C113.867 75.8838 117.032 76.5738 119.762 77.9538C122.492 79.3338 124.622 81.1938 126.107 83.5188C127.607 85.8738 128.342 88.4238 128.342 91.1838C128.312 93.3738 127.907 95.2938 127.052 96.9288Z",
              fill: color2
            }
          )
        ]
      }
    );
  }, "Help");
  const Chat = /* @__PURE__ */ __name(({
    width = "18px",
    height = "100%",
    color: color2 = "currentColor"
  }) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "svg",
      {
        width,
        height,
        viewBox: "0 0 142 150",
        fill: "none",
        xmlns: "http://www.w3.org/2000/svg",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("g", { clipPath: "url(#clip0)", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M20.9961 0H93.5913C99.3652 0 104.614 2.35596 108.423 6.16455C112.231 9.97315 114.587 15.2222 114.587 20.9961V67.8223C114.587 73.5962 112.231 78.8452 108.423 82.6538C104.614 86.4624 99.3652 88.8184 93.5913 88.8184H57.2876L25.4028 116.223C23.9258 117.493 21.6919 117.322 20.4224 115.833C19.7998 115.1 19.519 114.197 19.5801 113.306L21.2769 88.8062H20.9961C15.2222 88.8062 9.97315 86.4502 6.16455 82.6416C2.35596 78.8452 0 73.5962 0 67.8223V20.9961C0 15.2222 2.35596 9.97315 6.16455 6.16455C9.96094 2.35596 15.21 0 20.9961 0ZM124.89 34.1553C129.004 34.9487 132.69 36.9751 135.547 39.8315C139.27 43.5547 141.589 48.6939 141.589 54.3579V101.184C141.589 106.848 139.282 111.987 135.547 115.71C131.824 119.434 126.685 121.753 121.021 121.753H120.276L122.009 146.704C122.058 147.485 121.826 148.291 121.277 148.926C120.166 150.232 118.201 150.378 116.907 149.268L84.8999 120.947H42.7368L63.501 99.8291H107.495C117.09 99.8291 124.951 91.98 124.951 82.3731V35.5347C124.939 35.0708 124.927 34.6069 124.89 34.1553ZM31.3477 53.3203C29.3945 53.3203 27.8076 51.7334 27.8076 49.7803C27.8076 47.8272 29.3945 46.2402 31.3477 46.2402H68.396C70.3491 46.2402 71.936 47.8272 71.936 49.7803C71.936 51.7334 70.3491 53.3203 68.396 53.3203H31.3477ZM31.3477 35.791C29.3945 35.791 27.8076 34.2041 27.8076 32.251C27.8076 30.2979 29.3945 28.7109 31.3477 28.7109H83.8623C85.8154 28.7109 87.4024 30.2979 87.4024 32.251C87.4024 34.2041 85.8154 35.791 83.8623 35.791H31.3477ZM93.5791 7.08008H20.9961C17.1753 7.08008 13.6963 8.64258 11.1694 11.1694C8.64258 13.6963 7.08008 17.1631 7.08008 20.9961V67.8223C7.08008 71.6431 8.64258 75.1221 11.1694 77.6489C13.6963 80.1758 17.1753 81.7383 20.9961 81.7383H25.0732V81.7505L25.3052 81.7627C27.2461 81.897 28.7231 83.5816 28.5889 85.5225L27.2095 105.371L53.5034 82.7637C54.1382 82.1289 55.0171 81.7383 55.9937 81.7383H93.5791C97.3999 81.7383 100.879 80.1758 103.406 77.6489C105.933 75.1221 107.495 71.6431 107.495 67.8223V20.9961C107.495 17.1753 105.933 13.6963 103.406 11.1694C100.891 8.64258 97.4121 7.08008 93.5791 7.08008Z",
              fill: color2
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("defs", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("clipPath", { id: "clip0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { width: "141.577", height: "150", fill: "white" }) }) })
        ]
      }
    );
  }, "Chat");
  const Close$1 = /* @__PURE__ */ __name(({
    width = "18px",
    height = "100%",
    color: color2 = "inherit"
  }) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width, height, viewBox: "0 0 384 512", children: /* @__PURE__ */ jsxRuntimeExports.jsx("g", { fill: color2, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      "path",
      {
        d: "M231.6 256l130.1-130.1c4.7-4.7 4.7-12.3 0-17l-22.6-22.6c-4.7-4.7-12.3-4.7-17 0L192 216.4 61.9 86.3c-4.7-4.7-12.3-4.7-17 0l-22.6 22.6c-4.7 4.7-4.7 12.3 0 17L152.4 256 22.3 386.1c-4.7 4.7-4.7 12.3 0 17l22.6 22.6c4.7 4.7 12.3 4.7 17 0L192 295.6l130.1 130.1c4.7 4.7 12.3 4.7 17 0l22.6-22.6c4.7-4.7 4.7-12.3 0-17L231.6 256z"
      }
    ) }) });
  }, "Close$1");
  const Crown = /* @__PURE__ */ __name(({
    width = "10px",
    height = "8px",
    color: color2 = "currentColor"
  }) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "svg",
      {
        width,
        height,
        viewBox: "0 0 24 24",
        fill: "none",
        xmlns: "http://www.w3.org/2000/svg",
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M12 4.79999L16.8 12L22.8 7.19999L20.4 19.2H3.6L1.2 7.19999L7.2 12L12 4.79999Z",
            fill: color2,
            stroke: color2,
            strokeWidth: "1.5",
            strokeLinecap: "round",
            strokeLinejoin: "round"
          }
        )
      }
    );
  }, "Crown");
  const CrownOutline = /* @__PURE__ */ __name(({
    width = "18px",
    height = "100%",
    color: color2 = "currentColor"
  }) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "svg",
      {
        width,
        height,
        viewBox: "0 0 24 24",
        fill: "none",
        xmlns: "http://www.w3.org/2000/svg",
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M12 4.79999L16.8 12L22.8 7.19999L20.4 19.2H3.6L1.2 7.19999L7.2 12L12 4.79999Z",
            fill: "none",
            stroke: color2,
            strokeWidth: "1.5",
            strokeLinecap: "round",
            strokeLinejoin: "round"
          }
        )
      }
    );
  }, "CrownOutline");
  const Eye = /* @__PURE__ */ __name(({
    width = "18px",
    height = "100%",
    color: color2 = "#4E4B66"
  }) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "svg",
      {
        width,
        height,
        viewBox: "0 0 18 13",
        fill: "none",
        xmlns: "http://www.w3.org/2000/svg",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M7.33301 6.50016C7.33301 6.94219 7.5086 7.36611 7.82116 7.67867C8.13372 7.99123 8.55765 8.16683 8.99967 8.16683C9.4417 8.16683 9.86562 7.99123 10.1782 7.67867C10.4907 7.36611 10.6663 6.94219 10.6663 6.50016C10.6663 6.05814 10.4907 5.63421 10.1782 5.32165C9.86562 5.00909 9.4417 4.8335 8.99967 4.8335C8.55765 4.8335 8.13372 5.00909 7.82116 5.32165C7.5086 5.63421 7.33301 6.05814 7.33301 6.50016Z",
              stroke: color2,
              strokeWidth: "1.33333",
              strokeLinecap: "round",
              strokeLinejoin: "round"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M16.5 6.5C14.5 9.83333 12 11.5 9 11.5C6 11.5 3.5 9.83333 1.5 6.5C3.5 3.16667 6 1.5 9 1.5C12 1.5 14.5 3.16667 16.5 6.5Z",
              stroke: color2,
              strokeWidth: "1.33333",
              strokeLinecap: "round",
              strokeLinejoin: "round"
            }
          )
        ]
      }
    );
  }, "Eye");
  const EditAlt = /* @__PURE__ */ __name(({
    width = "18px",
    height = "100%",
    color: color2 = "currentColor"
  }) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "svg",
      {
        width,
        height,
        viewBox: "0 0 13 12",
        fill: "none",
        xmlns: "http://www.w3.org/2000/svg",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M10 7.33V10C10 10.2652 9.89464 10.5196 9.7071 10.7071C9.51957 10.8946 9.26521 11 9 11H2C1.73478 11 1.48043 10.8946 1.29289 10.7071C1.10536 10.5196 1 10.2652 1 10V3C1 2.73478 1.10536 2.48043 1.29289 2.29289C1.48043 2.10536 1.73478 2 2 2H4.67",
              stroke: color2,
              strokeOpacity: "0.7",
              strokeLinecap: "square"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M9.40039 1L11.4004 3L6.40039 8H4.40039V6L9.40039 1Z",
              stroke: color2,
              strokeOpacity: "0.7",
              strokeLinecap: "square"
            }
          )
        ]
      }
    );
  }, "EditAlt");
  const Edit = /* @__PURE__ */ __name((_h) => {
    var _i = _h, {
      width = "18px",
      height = "100%",
      color: color2 = "currentColor"
    } = _i, props = __objRest(_i, [
      "width",
      "height",
      "color"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "svg",
      __spreadProps(__spreadValues({
        width,
        height,
        viewBox: "0 0 111 111",
        fill: "none",
        xmlns: "http://www.w3.org/2000/svg"
      }, props), {
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M110.582 17.2926C110.577 12.6648 108.771 8.31676 105.496 5.04875C98.7401 -1.69178 87.7571 -1.68248 81.009 5.07411L11.3007 75.0629C9.0333 77.3287 7.30253 80.1335 6.29517 83.1751L6.23009 83.3728L0 110.769L27.4726 104.619L27.6771 104.551C30.7195 103.544 33.5261 101.815 35.7994 99.5422L105.517 29.5449C108.787 26.271 110.586 21.9195 110.582 17.2926ZM15.2347 98.4968L12.3216 95.582L14.425 86.3298L24.5097 96.4204L15.2347 98.4968ZM99.3942 23.4382L31.7108 91.3937L19.4543 79.1296L65.8174 32.5805L72.8774 39.6405L78.9917 33.5262L71.919 26.4535L78.4965 19.8507L85.5818 26.9361L91.6961 20.8217L84.5981 13.7237L87.1309 11.1808C90.5071 7.80041 96.0061 7.79534 99.3883 11.1698C101.028 12.8059 101.932 14.9829 101.935 17.2994C101.936 19.6166 101.036 21.7945 99.3942 23.4382ZM45.4885 102.028H110.582V110.676H36.871L45.4885 102.028Z",
            fill: color2
          }
        )
      })
    );
  }, "Edit");
  const Trash = /* @__PURE__ */ __name(({ width = "18px", height = "100%", color: color2 = "currentColor" }) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "svg",
      {
        xmlns: "http://www.w3.org/2000/svg",
        width,
        height,
        fill: "none",
        viewBox: "0 0 16 16",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              d: "M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z",
              fill: color2
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              fillRule: "evenodd",
              d: "M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z",
              fill: color2
            }
          )
        ]
      }
    );
  }, "Trash");
  const Blank = /* @__PURE__ */ __name((_j) => {
    var _k = _j, {
      width = "18px",
      height = "100%",
      color: color2 = "currentColor"
    } = _k, props = __objRest(_k, [
      "width",
      "height",
      "color"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "svg",
      __spreadProps(__spreadValues({
        width,
        height,
        viewBox: "0 0 130 130",
        fill: "none",
        xmlns: "http://www.w3.org/2000/svg"
      }, props), {
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            fill: color2,
            fillRule: "evenodd",
            d: "M60.5 28.362c2.95-2.475 3.352-6.895.863-9.861-2.49-2.967-6.913-3.338-9.863-.863a6.99 6.99 0 0 0-.862 9.862 6.99 6.99 0 0 0 9.862.862M40.178 76.841c5.705-4.787 6.465-13.296 1.664-19.018-4.788-5.706-13.314-6.452-19.019-1.665-5.722 4.802-6.452 13.314-1.664 19.02a13.482 13.482 0 0 0 19.02 1.663m69.284-8.467c6.564-5.508 7.419-15.273 1.91-21.837-5.494-6.548-15.272-7.419-21.836-1.91-6.548 5.494-7.405 15.288-1.91 21.836 5.507 6.564 15.288 7.405 21.836 1.91m-28.678 44.522c3.792-3.182 4.306-8.87 1.11-12.68-3.197-3.81-8.888-4.291-12.68-1.109a8.997 8.997 0 0 0-1.11 12.68 8.997 8.997 0 0 0 12.68 1.109m25.996 1.898c-27.506 23.08-68.493 19.495-91.574-8.011-23.08-27.507-19.494-68.495 8.012-91.575s68.493-19.495 91.574 8.012c23.08 27.506 19.494 68.494-8.012 91.574"
          }
        )
      })
    );
  }, "Blank");
  const TooltipIcon = /* @__PURE__ */ __name(({
    width = "12",
    height = "12",
    color: color2 = "#A6A8B1"
  }) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "svg",
      {
        width,
        height,
        viewBox: "0 0 120 120",
        fill: "none",
        xmlns: "http://www.w3.org/2000/svg",
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M60 0C26.865 0 0 26.865 0 60c0 33.135 26.865 60 60 60 33.135 0 60-26.865 60-60 0-33.135-26.865-60-60-60zm-.005 28.75c3.45 0 6.255 2.8 6.255 6.25s-2.805 6.25-6.255 6.25c-3.45 0-6.245-2.8-6.245-6.25s2.795-6.25 6.245-6.25zM70 90H50v-5c2.42-.895 5-1.005 5-3.675V58.99c0-2.67-2.58-3.09-5-3.985v-5h15V81.33c0 2.675 2.585 2.79 5 3.675V90z",
            fill: color2
          }
        )
      }
    );
  }, "TooltipIcon");
  const Cookie = /* @__PURE__ */ __name(({
    width = "32px",
    height = "32px",
    color: color2 = "#1C5C98"
  }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
    "svg",
    {
      width,
      height,
      viewBox: "0 0 32 33",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      "aria-hidden": true,
      children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M16 3.5C8.832 3.5 3 9.332 3 16.5C3 23.668 8.832 29.5 16 29.5C23.168 29.5 29 23.668 29 16.5C29 9.332 23.168 3.5 16 3.5ZM16 5.5C22.065 5.5 27 10.435 27 16.5C27 22.565 22.065 27.5 16 27.5C9.935 27.5 5 22.565 5 16.5C5 10.435 9.935 5.5 16 5.5ZM14 9.5C13.7348 9.5 13.4804 9.60536 13.2929 9.79289C13.1054 9.98043 13 10.2348 13 10.5C13 10.7652 13.1054 11.0196 13.2929 11.2071C13.4804 11.3946 13.7348 11.5 14 11.5C14.2652 11.5 14.5196 11.3946 14.7071 11.2071C14.8946 11.0196 15 10.7652 15 10.5C15 10.2348 14.8946 9.98043 14.7071 9.79289C14.5196 9.60536 14.2652 9.5 14 9.5ZM19.5 10.5C19.1022 10.5 18.7206 10.658 18.4393 10.9393C18.158 11.2206 18 11.6022 18 12C18 12.3978 18.158 12.7794 18.4393 13.0607C18.7206 13.342 19.1022 13.5 19.5 13.5C19.8978 13.5 20.2794 13.342 20.5607 13.0607C20.842 12.7794 21 12.3978 21 12C21 11.6022 20.842 11.2206 20.5607 10.9393C20.2794 10.658 19.8978 10.5 19.5 10.5ZM11 13.5C10.4696 13.5 9.96086 13.7107 9.58579 14.0858C9.21071 14.4609 9 14.9696 9 15.5C9 16.0304 9.21071 16.5391 9.58579 16.9142C9.96086 17.2893 10.4696 17.5 11 17.5C11.5304 17.5 12.0391 17.2893 12.4142 16.9142C12.7893 16.5391 13 16.0304 13 15.5C13 14.9696 12.7893 14.4609 12.4142 14.0858C12.0391 13.7107 11.5304 13.5 11 13.5ZM17 15.5C16.7348 15.5 16.4804 15.6054 16.2929 15.7929C16.1054 15.9804 16 16.2348 16 16.5C16 16.7652 16.1054 17.0196 16.2929 17.2071C16.4804 17.3946 16.7348 17.5 17 17.5C17.2652 17.5 17.5196 17.3946 17.7071 17.2071C17.8946 17.0196 18 16.7652 18 16.5C18 16.2348 17.8946 15.9804 17.7071 15.7929C17.5196 15.6054 17.2652 15.5 17 15.5ZM22 16.5C21.7348 16.5 21.4804 16.6054 21.2929 16.7929C21.1054 16.9804 21 17.2348 21 17.5C21 17.7652 21.1054 18.0196 21.2929 18.2071C21.4804 18.3946 21.7348 18.5 22 18.5C22.2652 18.5 22.5196 18.3946 22.7071 18.2071C22.8946 18.0196 23 17.7652 23 17.5C23 17.2348 22.8946 16.9804 22.7071 16.7929C22.5196 16.6054 22.2652 16.5 22 16.5ZM12.5 19.5C12.1022 19.5 11.7206 19.658 11.4393 19.9393C11.158 20.2206 11 20.6022 11 21C11 21.3978 11.158 21.7794 11.4393 22.0607C11.7206 22.342 12.1022 22.5 12.5 22.5C12.8978 22.5 13.2794 22.342 13.5607 22.0607C13.842 21.7794 14 21.3978 14 21C14 20.6022 13.842 20.2206 13.5607 19.9393C13.2794 19.658 12.8978 19.5 12.5 19.5ZM19.5 20.5C19.1022 20.5 18.7206 20.658 18.4393 20.9393C18.158 21.2206 18 21.6022 18 22C18 22.3978 18.158 22.7794 18.4393 23.0607C18.7206 23.342 19.1022 23.5 19.5 23.5C19.8978 23.5 20.2794 23.342 20.5607 23.0607C20.842 22.7794 21 22.3978 21 22C21 21.3978 20.842 21.2206 20.5607 20.9393C20.2794 20.658 19.8978 20.5 19.5 20.5Z",
          fill: color2
        }
      )
    }
  ), "Cookie");
  const Categories = /* @__PURE__ */ __name(({
    width = "32px",
    height = "32px",
    color: color2 = "#087357"
  }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
    "svg",
    {
      width,
      height,
      viewBox: "0 0 32 33",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      "aria-hidden": true,
      children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M18.5442 5.8335H26.2775V13.8335H18.5442V5.8335ZM5.65527 19.1668H13.3886V27.1668H5.65527V19.1668Z",
            stroke: color2,
            strokeWidth: "2",
            strokeLinecap: "round",
            strokeLinejoin: "round"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M22.4106 27.167C24.5461 27.167 26.2773 25.3761 26.2773 23.167C26.2773 20.9579 24.5461 19.167 22.4106 19.167C20.2751 19.167 18.5439 20.9579 18.5439 23.167C18.5439 25.3761 20.2751 27.167 22.4106 27.167Z",
            stroke: color2,
            strokeWidth: "2",
            strokeLinecap: "round",
            strokeLinejoin: "round"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M9.52194 13.8335C11.6574 13.8335 13.3886 12.0426 13.3886 9.8335C13.3886 7.62436 11.6574 5.8335 9.52194 5.8335C7.38644 5.8335 5.65527 7.62436 5.65527 9.8335C5.65527 12.0426 7.38644 13.8335 9.52194 13.8335Z",
            stroke: color2,
            strokeWidth: "2",
            strokeLinecap: "round",
            strokeLinejoin: "round"
          }
        )
      ]
    }
  ), "Categories");
  const Scan = /* @__PURE__ */ __name(({
    width = "32px",
    height = "32px",
    color: color2 = "#1160C6"
  }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
    "svg",
    {
      width,
      height,
      viewBox: "0 0 32 33",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      "aria-hidden": true,
      children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M14.6667 25.8333C20.5577 25.8333 25.3333 21.0577 25.3333 15.1667C25.3333 9.27563 20.5577 4.5 14.6667 4.5C8.77563 4.5 4 9.27563 4 15.1667C4 21.0577 8.77563 25.8333 14.6667 25.8333Z",
            stroke: color2,
            strokeWidth: "2"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M28.0002 28.5002L22.2002 22.7002",
            stroke: color2,
            strokeWidth: "2"
          }
        )
      ]
    }
  ), "Scan");
  const Pages = /* @__PURE__ */ __name(({
    width = "32px",
    height = "32px",
    color: color2 = "#A6742A"
  }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
    "svg",
    {
      width,
      height,
      viewBox: "0 0 33 33",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      "aria-hidden": true,
      children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M19.1663 3.1665H8.49967C7.79243 3.1665 7.11415 3.44746 6.61406 3.94755C6.11396 4.44765 5.83301 5.12593 5.83301 5.83317V27.1665C5.83301 27.8737 6.11396 28.552 6.61406 29.0521C7.11415 29.5522 7.79243 29.8332 8.49967 29.8332H24.4997C25.2069 29.8332 25.8852 29.5522 26.3853 29.0521C26.8854 28.552 27.1663 27.8737 27.1663 27.1665V11.1665L19.1663 3.1665Z",
            stroke: color2,
            strokeWidth: "2",
            strokeLinecap: "round",
            strokeLinejoin: "round"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M19.167 3.1665V11.1665H27.167",
            stroke: color2,
            strokeWidth: "2",
            strokeLinecap: "round",
            strokeLinejoin: "round"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M21.8337 17.8335H11.167",
            stroke: color2,
            strokeWidth: "2",
            strokeLinecap: "round",
            strokeLinejoin: "round"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M21.8337 23.1665H11.167",
            stroke: color2,
            strokeWidth: "2",
            strokeLinecap: "round",
            strokeLinejoin: "round"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M13.8337 12.5H12.5003H11.167",
            stroke: color2,
            strokeWidth: "2",
            strokeLinecap: "round",
            strokeLinejoin: "round"
          }
        )
      ]
    }
  ), "Pages");
  const PrivacyPolicy = /* @__PURE__ */ __name(({
    width = "56px",
    height = "56px"
  }) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width, height, viewBox: "0 0 56 56", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M29.0189 20.2314V23.8901C29.0189 26.9322 27.5937 29.7701 25.2268 31.4411L22.2737 33.5259L19.3206 31.4411C16.9536 29.7701 15.5284 26.9322 15.5284 23.8901V17.0904C19.2075 14.9958 23.5211 14.7279 27.3625 16.2867",
          fill: "#57BD8D"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M29.0189 20.2314V23.8901C29.0189 26.9322 27.5937 29.7701 25.2268 31.4411L22.2737 33.5259L19.3206 31.4411C16.9536 29.7701 15.5284 26.9322 15.5284 23.8901V17.0904C19.2075 14.9958 23.5211 14.7279 27.3625 16.2867L28.9164 17.0904L29.0189 20.2314Z",
          stroke: "#57BD8D",
          strokeWidth: "1.25",
          strokeMiterlimit: "10",
          strokeLinecap: "round",
          strokeLinejoin: "round"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M29.9625 2.11816H3.78017C2.81796 2.11816 2.03796 2.93826 2.03796 3.94996L2.03796 52.9706C2.03796 53.9823 2.81796 54.8024 3.78017 54.8024H41.7151C42.6774 54.8024 43.4574 53.9823 43.4574 52.9706V16.3069C43.4574 15.8035 43.2672 15.3207 42.9286 14.9648L31.239 2.67409C30.9005 2.31814 30.4413 2.11816 29.9625 2.11816Z",
          stroke: "#134FB0",
          strokeWidth: "2",
          strokeMiterlimit: "10",
          strokeLinecap: "round",
          strokeLinejoin: "round"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M8.23358 47.8887H10.4531",
          stroke: "#134FB0",
          strokeWidth: "2",
          strokeMiterlimit: "10",
          strokeLinecap: "round",
          strokeLinejoin: "round"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M8.23358 40.5186H10.4531",
          stroke: "#134FB0",
          strokeWidth: "2",
          strokeMiterlimit: "10",
          strokeLinecap: "round",
          strokeLinejoin: "round"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M15.9838 40.5186H37.2615",
          stroke: "#134FB0",
          strokeWidth: "2",
          strokeMiterlimit: "10",
          strokeLinecap: "round",
          strokeLinejoin: "round"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M15.9839 47.8887H37.2616",
          stroke: "#134FB0",
          strokeWidth: "2",
          strokeMiterlimit: "10",
          strokeLinecap: "round",
          strokeLinejoin: "round"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M30.7095 3.13086L30.7095 12.84C30.7095 13.7608 31.4194 14.5072 32.2952 14.5072H42.5099",
          stroke: "#134FB0",
          strokeWidth: "2",
          strokeMiterlimit: "10",
          strokeLinecap: "round",
          strokeLinejoin: "round"
        }
      )
    ] });
  }, "PrivacyPolicy");
  const CookiePolicy = /* @__PURE__ */ __name(({
    width = "56px",
    height = "56px"
  }) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width, height, viewBox: "0 0 56 56", fill: "none", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M9.41992 12.1953H25.2252",
          stroke: "#134FB0",
          strokeWidth: "2",
          strokeMiterlimit: "10",
          strokeLinecap: "round",
          strokeLinejoin: "round"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M9.41797 22.7324H32.7859",
          stroke: "#134FB0",
          strokeWidth: "2",
          strokeMiterlimit: "10",
          strokeLinecap: "round",
          strokeLinejoin: "round"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M9.41992 36.7812L23.6694 36.7813",
          stroke: "#134FB0",
          strokeWidth: "2",
          strokeMiterlimit: "10",
          strokeLinecap: "round",
          strokeLinejoin: "round"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M9.41992 29.7559H25.6957",
          stroke: "#134FB0",
          strokeWidth: "2",
          strokeMiterlimit: "10",
          strokeLinecap: "round",
          strokeLinejoin: "round"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M45.9583 20.9082V1.6582L2.39453 1.6582V54.3424H28.7347",
          stroke: "#134FB0",
          strokeWidth: "2",
          strokeMiterlimit: "10",
          strokeLinecap: "round",
          strokeLinejoin: "round"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M42.8986 26.3436L46.9121 28.005C46.1167 29.0515 45.6857 30.3296 45.6849 31.6441C45.6842 32.9586 46.1138 34.2372 46.908 35.2846C47.7023 36.332 48.8175 37.0906 50.0835 37.4446C51.3494 37.7985 52.6964 37.7284 53.9187 37.2448L53.9985 37.4435C54.4566 38.5496 54.4566 39.7925 53.9985 40.8986C53.2511 42.0825 52.7374 43.0115 52.4575 43.6856C52.1736 44.3719 51.8425 45.4834 51.4643 47.0204C51.0058 48.1264 50.1267 49.0049 49.0204 49.4628C47.4433 49.8581 46.3317 50.1896 45.6856 50.4575C44.9713 50.7535 44.0423 51.2671 42.8986 51.9985C41.7925 52.4566 40.5496 52.4566 39.4435 51.9985C38.2366 51.242 37.3076 50.7284 36.6565 50.4575C35.9472 50.1646 34.8356 49.8335 33.3217 49.4643C32.2157 49.0058 31.3372 48.1267 30.8793 47.0204C30.481 45.4383 30.1495 44.3267 29.8846 43.6856C29.5856 42.9653 29.072 42.0363 28.3436 40.8986C27.8855 39.7925 27.8855 38.5496 28.3436 37.4435C29.065 36.3239 29.5786 35.3949 29.8846 34.6565C30.1424 34.0345 30.4735 32.9229 30.8778 31.3217C31.3363 30.2157 32.2154 29.3372 33.3217 28.8793C34.8737 28.4941 35.9853 28.1625 36.6565 27.8846C37.3457 27.5987 38.2747 27.085 39.4435 26.3436C40.5496 25.8855 41.7925 25.8855 42.8986 26.3436Z",
          fill: "#57BD8D",
          stroke: "#57BD8D",
          strokeWidth: "1.25",
          strokeMiterlimit: "22.9256",
          strokeLinecap: "round",
          strokeLinejoin: "round"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "path",
        {
          d: "M35.1504 40.6747V40.6897M41.1698 46.6941V46.7092M41.1698 39.1698V39.1849M47.1893 42.1796V42.1946M39.665 33.1504V33.1654",
          stroke: "white",
          strokeWidth: "1.25",
          strokeMiterlimit: "22.9256",
          strokeLinecap: "round",
          strokeLinejoin: "round"
        }
      )
    ] });
  }, "CookiePolicy");
  const General = /* @__PURE__ */ __name(({
    width = "18px",
    height = "18px",
    color: color2 = "currentColor"
  }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
    "svg",
    {
      width,
      height,
      viewBox: "0 0 16 16",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { y: "1.06641", width: "16", height: "2.13333", rx: "1", fill: color2 }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { y: "12.7998", width: "16", height: "2.13333", rx: "1", fill: color2 }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { y: "7.4668", width: "16", height: "2.13333", rx: "1", fill: color2 }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M13.664 2.13333C13.664 3.28073 12.6663 4.21667 11.4283 4.21667C10.1902 4.21667 9.19258 3.28073 9.19258 2.13333C9.19258 0.985933 10.1902 0.05 11.4283 0.05C12.6663 0.05 13.664 0.985933 13.664 2.13333Z",
            fill: color2,
            stroke: "#565662",
            strokeWidth: "0.1"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx("ellipse", { cx: "11.4285", cy: "2.13307", rx: "1.14286", ry: "1.06667", fill: "white" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M13.664 13.8667C13.664 15.0141 12.6663 15.9501 11.4283 15.9501C10.1902 15.9501 9.19258 15.0141 9.19258 13.8667C9.19258 12.7193 10.1902 11.7834 11.4283 11.7834C12.6663 11.7834 13.664 12.7193 13.664 13.8667Z",
            fill: color2,
            stroke: "#565662",
            strokeWidth: "0.1"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M6.80805 8.53372C6.80805 9.68112 5.81039 10.6171 4.57234 10.6171C3.33428 10.6171 2.33662 9.68112 2.33662 8.53372C2.33662 7.38632 3.33428 6.45039 4.57234 6.45039C5.81039 6.45039 6.80805 7.38632 6.80805 8.53372Z",
            fill: color2,
            stroke: "#565662",
            strokeWidth: "0.1"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx("ellipse", { cx: "4.57206", cy: "8.53346", rx: "1.14286", ry: "1.06667", fill: "white" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("ellipse", { cx: "11.4285", cy: "13.8665", rx: "1.14286", ry: "1.06667", fill: "white" })
      ]
    }
  ), "General");
  const BannerLayout = /* @__PURE__ */ __name(({
    width = "18px",
    height = "18px",
    color: color2 = "currentColor"
  }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
    "svg",
    {
      width,
      height,
      viewBox: "0 0 160 180",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M112.099 85.8059H47.901C24.2446 85.8059 5 66.5574 5 42.901C5 19.2446 24.2446 0 47.901 0H112.099C135.755 0 155 19.2446 155 42.901C155 66.5574 135.755 85.8059 112.099 85.8059ZM47.901 12.4385C31.1052 12.4385 17.4385 26.1052 17.4385 42.901C17.4385 59.6968 31.1052 73.3636 47.901 73.3636H112.099C128.899 73.3636 142.562 59.6968 142.562 42.901C142.562 26.1052 128.899 12.4385 112.099 12.4385H47.901Z",
            fill: color2
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M47.9039 12.4375C31.1081 12.4375 17.4414 26.1042 17.4414 42.9C17.4414 59.6958 31.1081 73.3626 47.9039 73.3626H112.102C128.902 73.3626 142.565 59.6958 142.565 42.9C142.565 26.1042 128.902 12.4375 112.102 12.4375H47.9039Z",
            fill: color2
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M87.5 45.0007C87.5 54.6524 95.3481 62.5 105 62.5C114.652 62.5 122.5 54.6507 122.5 44.9993C122.5 35.3476 114.652 27.5 105 27.5C95.3478 27.5 87.5 35.3493 87.5 45.0007ZM96.849 44.9993C96.849 40.5077 100.507 36.8488 105 36.8488C109.493 36.8488 113.151 40.5077 113.151 44.9993C113.151 49.4908 109.492 53.1498 105 53.1498C100.508 53.1498 96.849 49.4908 96.849 44.9993Z",
            fill: "white",
            stroke: "#ADADAD",
            strokeWidth: "0.5"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M112.099 179.751H47.9049C24.2446 179.751 5 160.507 5 136.846C5 113.186 24.2446 93.9453 47.9049 93.9453H112.099C135.755 93.9453 155 113.19 155 136.846C155 160.503 135.755 179.751 112.099 179.751ZM47.9049 106.384C31.1052 106.384 17.4385 120.051 17.4385 136.846C17.4385 153.642 31.1052 167.309 47.901 167.309H112.095C128.895 167.309 142.558 153.642 142.558 136.846C142.558 120.051 128.891 106.384 112.095 106.384H47.9049Z",
            fill: color2
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M47.9078 106.383C31.1081 106.383 17.4414 120.05 17.4414 136.845C17.4414 153.641 31.1081 167.308 47.9039 167.308H112.098C128.898 167.308 142.561 153.641 142.561 136.845C142.561 120.05 128.894 106.383 112.098 106.383H47.9078Z",
            fill: color2
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M37.5 135.001C37.5 144.652 45.3481 152.5 55 152.5C64.6522 152.5 72.5 144.651 72.5 134.999C72.5 125.348 64.6519 117.5 55 117.5C45.3478 117.5 37.5 125.349 37.5 135.001ZM46.849 134.999C46.849 130.508 50.5069 126.849 55 126.849C59.4931 126.849 63.151 130.508 63.151 134.999C63.151 139.491 59.4919 143.15 55 143.15C50.5081 143.15 46.849 139.491 46.849 134.999Z",
            fill: "white",
            stroke: "#ADADAD",
            strokeWidth: "0.5"
          }
        )
      ]
    }
  ), "BannerLayout");
  const Note = /* @__PURE__ */ __name(({
    width = "18px",
    height = "18px",
    color: color2 = "currentColor"
  }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
    "svg",
    {
      width,
      height,
      viewBox: "0 0 150 188",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M119.744 178.977H30.2557C16.1572 178.977 4.6875 167.508 4.6875 153.409V25.5682C4.6875 11.4698 16.1572 0 30.2557 0H69.7066C74.8282 0 79.6422 1.99352 83.2617 5.61701L139.696 62.0508C143.315 65.6743 145.309 70.4883 145.312 75.6059V153.409C145.312 167.508 133.843 178.977 119.744 178.977ZM30.2557 12.7841C23.2085 12.7841 17.4716 18.521 17.4716 25.5682V153.409C17.4716 160.456 23.2085 166.193 30.2557 166.193H119.744C126.791 166.193 132.529 160.456 132.529 153.409V75.6059C132.529 73.9 131.865 72.294 130.655 71.0875L74.225 14.6538C73.0185 13.4472 71.4125 12.7841 69.7066 12.7841H30.2557Z",
            fill: color2
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M30.2528 12.7852C23.2056 12.7852 17.4688 18.522 17.4688 25.5692V153.41C17.4688 160.457 23.2056 166.194 30.2528 166.194H119.741C126.788 166.194 132.526 160.457 132.526 153.41V75.6069C132.526 73.9011 131.862 72.295 130.652 71.0886L74.2221 14.6548C73.0156 13.4483 71.4096 12.7852 69.7037 12.7852H30.2528Z",
            fill: color2
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M30.2557 0H119.744C133.843 0 145.312 11.4697 145.312 25.5682V153.409C145.312 167.508 133.843 178.977 119.744 178.977H80.2934C75.1717 178.977 70.3578 176.984 66.7383 173.361L10.3045 116.927C6.68501 113.303 4.69149 108.489 4.6875 103.371V25.5682C4.6875 11.4697 16.1572 0 30.2557 0ZM119.744 166.193C126.791 166.193 132.529 160.457 132.529 153.409V25.5682C132.529 18.521 126.791 12.7841 119.744 12.7841H30.2557C23.2085 12.7841 17.4716 18.521 17.4716 25.5682V103.371C17.4716 105.077 18.1348 106.684 19.3452 107.889L75.775 164.324C76.9815 165.53 78.5875 166.193 80.2934 166.193H119.744Z",
            fill: color2
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M119.741 166.194C126.788 166.194 132.526 160.458 132.526 153.41V25.5692C132.526 18.522 126.788 12.7852 119.741 12.7852H30.2528C23.2056 12.7852 17.4688 18.522 17.4688 25.5692V103.372C17.4688 105.078 18.1319 106.685 19.3423 107.89L75.7722 164.325C76.9786 165.531 78.5847 166.194 80.2905 166.194H119.741Z",
            fill: color2
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M106.613 71.1591H43.403C39.9107 71.1591 37.082 68.2986 37.082 64.767C37.082 61.2355 39.9107 58.375 43.403 58.375H106.613C110.105 58.375 112.933 61.2355 112.933 64.767C112.933 68.2986 110.105 71.1591 106.613 71.1591Z",
            fill: "white"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M106.965 102.691H43.0444C39.5128 102.691 36.6523 99.8302 36.6523 96.2987C36.6523 92.7667 39.5128 89.9062 43.0444 89.9062H106.965C110.497 89.9062 113.357 92.7667 113.357 96.2987C113.357 99.8302 110.497 102.691 106.965 102.691Z",
            fill: "white"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M106.965 134.229H43.0444C39.5128 134.229 36.6523 131.369 36.6523 127.837C36.6523 124.306 39.5128 121.445 43.0444 121.445H106.965C110.497 121.445 113.357 124.306 113.357 127.837C113.357 131.369 110.497 134.229 106.965 134.229Z",
            fill: "white"
          }
        )
      ]
    }
  ), "Note");
  const Css = /* @__PURE__ */ __name(({
    width = "18px",
    height = "18px",
    color: color2 = "currentColor"
  }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
    "svg",
    {
      width,
      height,
      viewBox: "0 0 170 180",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M154.058 34.9258C154.036 33.556 153.437 32.3411 152.506 31.4648L120.631 1.46484C119.636 0.526042 118.257 0 116.875 0H21.25C18.3157 0 15.9375 2.23828 15.9375 5V61.1927C9.75342 63.2578 5.3125 68.8151 5.3125 75.3333V135.333C5.3125 141.852 9.75342 147.409 15.9375 149.474V165.667C15.9375 168.428 18.3157 170.667 21.25 170.667H148.75C151.685 170.667 154.062 168.428 154.062 165.667V149.474C160.246 147.409 164.688 141.852 164.688 135.333V75.3333C164.688 68.8151 160.246 63.2578 154.062 61.1927V35C154.062 34.9753 154.058 34.9505 154.058 34.9258ZM122.188 17.0716L135.923 30H122.188V17.0716ZM111.562 10V35C111.562 37.7617 113.94 40 116.875 40H143.438V60.3333H26.5625V10H111.562ZM26.5625 160.667V150.333H143.438V160.667H26.5625ZM154.062 135.333C154.062 138.09 151.679 140.333 148.75 140.333H21.25C18.3212 140.333 15.9375 138.09 15.9375 135.333V75.3333C15.9375 72.5768 18.3212 70.3333 21.25 70.3333H148.75C151.679 70.3333 154.062 72.5768 154.062 75.3333V135.333Z",
            fill: color2
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M111.562 10V35C111.562 37.7617 113.94 40 116.875 40H143.438V60.3333H26.5625V10H111.562Z",
            fill: color2
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M26.5625 160.666V150.332H143.438V160.666H26.5625Z", fill: color2 }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M154.062 135.332C154.062 138.089 151.679 140.332 148.75 140.332H21.25C18.3212 140.332 15.9375 138.089 15.9375 135.332V75.332C15.9375 72.5755 18.3212 70.332 21.25 70.332H148.75C151.679 70.332 154.062 72.5755 154.062 75.332V135.332Z",
            fill: color2
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M42.5 90.332C45.4288 90.332 47.8125 92.5755 47.8125 95.332C47.8125 98.0938 50.1907 100.332 53.125 100.332C56.0593 100.332 58.4375 98.0938 58.4375 95.332C58.4375 87.0612 51.2877 80.332 42.5 80.332C33.7123 80.332 26.5625 87.0612 26.5625 95.332V115.332C26.5625 123.603 33.7123 130.332 42.5 130.332C51.2877 130.332 58.4375 123.603 58.4375 115.332C58.4375 112.57 56.0593 110.332 53.125 110.332C50.1907 110.332 47.8125 112.57 47.8125 115.332C47.8125 118.089 45.4288 120.332 42.5 120.332C39.5712 120.332 37.1875 118.089 37.1875 115.332V95.332C37.1875 92.5755 39.5712 90.332 42.5 90.332Z",
            fill: "white"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M85 90.332C87.9288 90.332 90.3125 92.5755 90.3125 95.332C90.3125 98.0938 92.6907 100.332 95.625 100.332C98.5593 100.332 100.938 98.0938 100.938 95.332C100.938 87.0612 93.7877 80.332 85 80.332C76.2123 80.332 69.0625 87.0612 69.0625 95.332C69.0625 103.603 76.2123 110.332 85 110.332C87.9288 110.332 90.3125 112.576 90.3125 115.332C90.3125 118.089 87.9288 120.332 85 120.332C82.0712 120.332 79.6875 118.089 79.6875 115.332C79.6875 112.57 77.3093 110.332 74.375 110.332C71.4407 110.332 69.0625 112.57 69.0625 115.332C69.0625 123.603 76.2123 130.332 85 130.332C93.7877 130.332 100.938 123.603 100.938 115.332C100.938 107.061 93.7877 100.332 85 100.332C82.0712 100.332 79.6875 98.0885 79.6875 95.332C79.6875 92.5755 82.0712 90.332 85 90.332Z",
            fill: "white"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M127.5 90.332C130.429 90.332 132.812 92.5755 132.812 95.332C132.812 98.0938 135.191 100.332 138.125 100.332C141.06 100.332 143.438 98.0938 143.438 95.332C143.438 87.0612 136.288 80.332 127.5 80.332C118.712 80.332 111.562 87.0612 111.562 95.332C111.562 103.603 118.712 110.332 127.5 110.332C130.429 110.332 132.812 112.576 132.812 115.332C132.812 118.089 130.429 120.332 127.5 120.332C124.572 120.332 122.188 118.089 122.188 115.332C122.188 112.57 119.81 110.332 116.875 110.332C113.941 110.332 111.562 112.57 111.562 115.332C111.562 123.603 118.712 130.332 127.5 130.332C136.288 130.332 143.438 123.603 143.438 115.332C143.438 107.061 136.288 100.332 127.5 100.332C124.572 100.332 122.188 98.0885 122.188 95.332C122.188 92.5755 124.572 90.332 127.5 90.332Z",
            fill: "white"
          }
        )
      ]
    }
  ), "Css");
  const CkyIcon = /* @__PURE__ */ __name(({
    icon = "logo",
    width = "18px",
    height = "100%",
    color: color2 = "currentColor",
    onClick,
    className = "",
    style = {},
    title,
    "aria-label": ariaLabel,
    "aria-hidden": ariaHidden = false
  }) => {
    const styleObj = reactExports.useMemo(() => __spreadValues({
      height: height.includes("px") ? height : `${height}px`,
      width: width.includes("px") ? width : `${width}px`,
      display: "inline-block",
      cursor: onClick || icon === "close" ? "pointer" : "default"
    }, style), [height, width, onClick, icon, style]);
    const iconProps = reactExports.useMemo(() => {
      const fill = icon === "tooltip" && color2 === "currentColor" ? "#A6A8B1" : color2;
      return { width, height, color: fill };
    }, [width, height, color2, icon]);
    const renderIcon = /* @__PURE__ */ __name(() => {
      switch (icon) {
        case "logo":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(CookieYes, __spreadValues({}, iconProps));
        case "help":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Help, __spreadValues({}, iconProps));
        case "chat":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Chat, __spreadValues({}, iconProps));
        case "close":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Close$1, __spreadValues({}, iconProps));
        case "crown":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Crown, __spreadValues({}, iconProps));
        case "crownOutline":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(CrownOutline, __spreadValues({}, iconProps));
        case "eye":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Eye, __spreadValues({}, iconProps));
        case "editAlt":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(EditAlt, __spreadValues({}, iconProps));
        case "edit":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Edit, __spreadValues({}, iconProps));
        case "trash":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Trash, __spreadValues({}, iconProps));
        case "blank":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Blank, __spreadValues({}, iconProps));
        case "tooltip":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipIcon, __spreadValues({}, iconProps));
        case "cookie":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Cookie, __spreadValues({}, iconProps));
        case "categories":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Categories, __spreadValues({}, iconProps));
        case "scan":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Scan, __spreadValues({}, iconProps));
        case "pages":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Pages, __spreadValues({}, iconProps));
        case "privacy-policy":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(PrivacyPolicy, __spreadValues({}, iconProps));
        case "cookie-policy":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(CookiePolicy, __spreadValues({}, iconProps));
        case "general":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(General, __spreadValues({}, iconProps));
        case "layout":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(BannerLayout, __spreadValues({}, iconProps));
        case "note":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Note, __spreadValues({}, iconProps));
        case "css":
          return /* @__PURE__ */ jsxRuntimeExports.jsx(Css, __spreadValues({}, iconProps));
        default:
          return /* @__PURE__ */ jsxRuntimeExports.jsx(CookieYes, __spreadValues({}, iconProps));
      }
    }, "renderIcon");
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "span",
      {
        className,
        style: styleObj,
        onClick,
        title,
        "aria-label": ariaLabel,
        "aria-hidden": ariaHidden,
        role: onClick ? "button" : void 0,
        tabIndex: onClick ? 0 : void 0,
        children: renderIcon()
      }
    );
  }, "CkyIcon");
  function __$1(text, domain) {
    if (typeof window === "undefined") return text;
    return __$2(text, domain);
  }
  __name(__$1, "__$1");
  function t$1(text) {
    return __$2(text, "cookie-law-info");
  }
  __name(t$1, "t$1");
  /**
   * @license lucide-react v0.543.0 - ISC
   *
   * This source code is licensed under the ISC license.
   * See the LICENSE file in the root directory of this source tree.
   */
  const toKebabCase = /* @__PURE__ */ __name((string2) => string2.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), "toKebabCase");
  const toCamelCase = /* @__PURE__ */ __name((string2) => string2.replace(
    /^([A-Z])|[\s-_]+(\w)/g,
    (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
  ), "toCamelCase");
  const toPascalCase = /* @__PURE__ */ __name((string2) => {
    const camelCase = toCamelCase(string2);
    return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
  }, "toPascalCase");
  const mergeClasses = /* @__PURE__ */ __name((...classes) => classes.filter((className, index2, array2) => {
    return Boolean(className) && className.trim() !== "" && array2.indexOf(className) === index2;
  }).join(" ").trim(), "mergeClasses");
  const hasA11yProp = /* @__PURE__ */ __name((props) => {
    for (const prop in props) {
      if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
        return true;
      }
    }
  }, "hasA11yProp");
  /**
   * @license lucide-react v0.543.0 - ISC
   *
   * This source code is licensed under the ISC license.
   * See the LICENSE file in the root directory of this source tree.
   */
  var defaultAttributes = {
    xmlns: "http://www.w3.org/2000/svg",
    width: 24,
    height: 24,
    viewBox: "0 0 24 24",
    fill: "none",
    stroke: "currentColor",
    strokeWidth: 2,
    strokeLinecap: "round",
    strokeLinejoin: "round"
  };
  /**
   * @license lucide-react v0.543.0 - ISC
   *
   * This source code is licensed under the ISC license.
   * See the LICENSE file in the root directory of this source tree.
   */
  const Icon$1 = reactExports.forwardRef(
    (_l, ref) => {
      var _m = _l, {
        color: color2 = "currentColor",
        size: size2 = 24,
        strokeWidth = 2,
        absoluteStrokeWidth,
        className = "",
        children,
        iconNode
      } = _m, rest = __objRest(_m, [
        "color",
        "size",
        "strokeWidth",
        "absoluteStrokeWidth",
        "className",
        "children",
        "iconNode"
      ]);
      return reactExports.createElement(
        "svg",
        __spreadValues(__spreadValues(__spreadProps(__spreadValues({
          ref
        }, defaultAttributes), {
          width: size2,
          height: size2,
          stroke: color2,
          strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size2) : strokeWidth,
          className: mergeClasses("lucide", className)
        }), !children && !hasA11yProp(rest) && { "aria-hidden": "true" }), rest),
        [
          ...iconNode.map(([tag, attrs]) => reactExports.createElement(tag, attrs)),
          ...Array.isArray(children) ? children : [children]
        ]
      );
    }
  );
  /**
   * @license lucide-react v0.543.0 - ISC
   *
   * This source code is licensed under the ISC license.
   * See the LICENSE file in the root directory of this source tree.
   */
  const createLucideIcon = /* @__PURE__ */ __name((iconName, iconNode) => {
    const Component = reactExports.forwardRef(
      (_a2, ref) => {
        var _b2 = _a2, { className } = _b2, props = __objRest(_b2, ["className"]);
        return reactExports.createElement(Icon$1, __spreadValues({
          ref,
          iconNode,
          className: mergeClasses(
            `lucide-${toKebabCase(toPascalCase(iconName))}`,
            `lucide-${iconName}`,
            className
          )
        }, props));
      }
    );
    Component.displayName = toPascalCase(iconName);
    return Component;
  }, "createLucideIcon");
  /**
   * @license lucide-react v0.543.0 - ISC
   *
   * This source code is licensed under the ISC license.
   * See the LICENSE file in the root directory of this source tree.
   */
  const __iconNode$7 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
  const Check = createLucideIcon("check", __iconNode$7);
  /**
   * @license lucide-react v0.543.0 - ISC
   *
   * This source code is licensed under the ISC license.
   * See the LICENSE file in the root directory of this source tree.
   */
  const __iconNode$6 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
  const ChevronDown = createLucideIcon("chevron-down", __iconNode$6);
  /**
   * @license lucide-react v0.543.0 - ISC
   *
   * This source code is licensed under the ISC license.
   * See the LICENSE file in the root directory of this source tree.
   */
  const __iconNode$5 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
  const ChevronRight = createLucideIcon("chevron-right", __iconNode$5);
  /**
   * @license lucide-react v0.543.0 - ISC
   *
   * This source code is licensed under the ISC license.
   * See the LICENSE file in the root directory of this source tree.
   */
  const __iconNode$4 = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
  const ChevronUp = createLucideIcon("chevron-up", __iconNode$4);
  /**
   * @license lucide-react v0.543.0 - ISC
   *
   * This source code is licensed under the ISC license.
   * See the LICENSE file in the root directory of this source tree.
   */
  const __iconNode$3 = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
  const Circle = createLucideIcon("circle", __iconNode$3);
  /**
   * @license lucide-react v0.543.0 - ISC
   *
   * This source code is licensed under the ISC license.
   * See the LICENSE file in the root directory of this source tree.
   */
  const __iconNode$2 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
  const LoaderCircle = createLucideIcon("loader-circle", __iconNode$2);
  /**
   * @license lucide-react v0.543.0 - ISC
   *
   * This source code is licensed under the ISC license.
   * See the LICENSE file in the root directory of this source tree.
   */
  const __iconNode$1 = [
    ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
    ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
  ];
  const Search = createLucideIcon("search", __iconNode$1);
  /**
   * @license lucide-react v0.543.0 - ISC
   *
   * This source code is licensed under the ISC license.
   * See the LICENSE file in the root directory of this source tree.
   */
  const __iconNode = [
    ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
    ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
  ];
  const X$1 = createLucideIcon("x", __iconNode);
  function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
    return /* @__PURE__ */ __name(function handleEvent(event) {
      originalEventHandler == null ? void 0 : originalEventHandler(event);
      if (checkForDefaultPrevented === false || !event.defaultPrevented) {
        return ourEventHandler == null ? void 0 : ourEventHandler(event);
      }
    }, "handleEvent");
  }
  __name(composeEventHandlers, "composeEventHandlers");
  function setRef(ref, value) {
    if (typeof ref === "function") {
      return ref(value);
    } else if (ref !== null && ref !== void 0) {
      ref.current = value;
    }
  }
  __name(setRef, "setRef");
  function composeRefs(...refs) {
    return (node) => {
      let hasCleanup = false;
      const cleanups = refs.map((ref) => {
        const cleanup = setRef(ref, node);
        if (!hasCleanup && typeof cleanup == "function") {
          hasCleanup = true;
        }
        return cleanup;
      });
      if (hasCleanup) {
        return () => {
          for (let i2 = 0; i2 < cleanups.length; i2++) {
            const cleanup = cleanups[i2];
            if (typeof cleanup == "function") {
              cleanup();
            } else {
              setRef(refs[i2], null);
            }
          }
        };
      }
    };
  }
  __name(composeRefs, "composeRefs");
  function useComposedRefs(...refs) {
    return reactExports.useCallback(composeRefs(...refs), refs);
  }
  __name(useComposedRefs, "useComposedRefs");
  function createContext2(rootComponentName, defaultContext) {
    const Context = reactExports.createContext(defaultContext);
    const Provider2 = /* @__PURE__ */ __name((props) => {
      const _a2 = props, { children } = _a2, context = __objRest(_a2, ["children"]);
      const value = reactExports.useMemo(() => context, Object.values(context));
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children });
    }, "Provider");
    Provider2.displayName = rootComponentName + "Provider";
    function useContext2(consumerName) {
      const context = reactExports.useContext(Context);
      if (context) return context;
      if (defaultContext !== void 0) return defaultContext;
      throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
    }
    __name(useContext2, "useContext2");
    return [Provider2, useContext2];
  }
  __name(createContext2, "createContext2");
  function createContextScope(scopeName, createContextScopeDeps = []) {
    let defaultContexts = [];
    function createContext3(rootComponentName, defaultContext) {
      const BaseContext = reactExports.createContext(defaultContext);
      const index2 = defaultContexts.length;
      defaultContexts = [...defaultContexts, defaultContext];
      const Provider2 = /* @__PURE__ */ __name((props) => {
        var _b2;
        const _a2 = props, { scope, children } = _a2, context = __objRest(_a2, ["scope", "children"]);
        const Context = ((_b2 = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _b2[index2]) || BaseContext;
        const value = reactExports.useMemo(() => context, Object.values(context));
        return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children });
      }, "Provider");
      Provider2.displayName = rootComponentName + "Provider";
      function useContext2(consumerName, scope) {
        var _a2;
        const Context = ((_a2 = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a2[index2]) || BaseContext;
        const context = reactExports.useContext(Context);
        if (context) return context;
        if (defaultContext !== void 0) return defaultContext;
        throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
      }
      __name(useContext2, "useContext2");
      return [Provider2, useContext2];
    }
    __name(createContext3, "createContext3");
    const createScope = /* @__PURE__ */ __name(() => {
      const scopeContexts = defaultContexts.map((defaultContext) => {
        return reactExports.createContext(defaultContext);
      });
      return /* @__PURE__ */ __name(function useScope(scope) {
        const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
        return reactExports.useMemo(
          () => ({ [`__scope${scopeName}`]: __spreadProps(__spreadValues({}, scope), { [scopeName]: contexts }) }),
          [scope, contexts]
        );
      }, "useScope");
    }, "createScope");
    createScope.scopeName = scopeName;
    return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
  }
  __name(createContextScope, "createContextScope");
  function composeContextScopes(...scopes) {
    const baseScope = scopes[0];
    if (scopes.length === 1) return baseScope;
    const createScope = /* @__PURE__ */ __name(() => {
      const scopeHooks = scopes.map((createScope2) => ({
        useScope: createScope2(),
        scopeName: createScope2.scopeName
      }));
      return /* @__PURE__ */ __name(function useComposedScopes(overrideScopes) {
        const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
          const scopeProps = useScope(overrideScopes);
          const currentScope = scopeProps[`__scope${scopeName}`];
          return __spreadValues(__spreadValues({}, nextScopes2), currentScope);
        }, {});
        return reactExports.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
      }, "useComposedScopes");
    }, "createScope");
    createScope.scopeName = baseScope.scopeName;
    return createScope;
  }
  __name(composeContextScopes, "composeContextScopes");
  var useLayoutEffect2 = (globalThis == null ? void 0 : globalThis.document) ? reactExports.useLayoutEffect : () => {
  };
  var useInsertionEffect = React$1[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
  function useControllableState({
    prop,
    defaultProp,
    onChange = /* @__PURE__ */ __name(() => {
    }, "onChange"),
    caller
  }) {
    const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
      defaultProp,
      onChange
    });
    const isControlled = prop !== void 0;
    const value = isControlled ? prop : uncontrolledProp;
    {
      const isControlledRef = reactExports.useRef(prop !== void 0);
      reactExports.useEffect(() => {
        const wasControlled = isControlledRef.current;
        if (wasControlled !== isControlled) {
          const from = wasControlled ? "controlled" : "uncontrolled";
          const to = isControlled ? "controlled" : "uncontrolled";
          console.warn(
            `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
          );
        }
        isControlledRef.current = isControlled;
      }, [isControlled, caller]);
    }
    const setValue = reactExports.useCallback(
      (nextValue) => {
        var _a2;
        if (isControlled) {
          const value2 = isFunction$4(nextValue) ? nextValue(prop) : nextValue;
          if (value2 !== prop) {
            (_a2 = onChangeRef.current) == null ? void 0 : _a2.call(onChangeRef, value2);
          }
        } else {
          setUncontrolledProp(nextValue);
        }
      },
      [isControlled, prop, setUncontrolledProp, onChangeRef]
    );
    return [value, setValue];
  }
  __name(useControllableState, "useControllableState");
  function useUncontrolledState({
    defaultProp,
    onChange
  }) {
    const [value, setValue] = reactExports.useState(defaultProp);
    const prevValueRef = reactExports.useRef(value);
    const onChangeRef = reactExports.useRef(onChange);
    useInsertionEffect(() => {
      onChangeRef.current = onChange;
    }, [onChange]);
    reactExports.useEffect(() => {
      var _a2;
      if (prevValueRef.current !== value) {
        (_a2 = onChangeRef.current) == null ? void 0 : _a2.call(onChangeRef, value);
        prevValueRef.current = value;
      }
    }, [value, prevValueRef]);
    return [value, setValue, onChangeRef];
  }
  __name(useUncontrolledState, "useUncontrolledState");
  function isFunction$4(value) {
    return typeof value === "function";
  }
  __name(isFunction$4, "isFunction$4");
  // @__NO_SIDE_EFFECTS__
  function createSlot$5(ownerName) {
    const SlotClone = /* @__PURE__ */ createSlotClone$5(ownerName);
    const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
      const _a2 = props, { children } = _a2, slotProps = __objRest(_a2, ["children"]);
      const childrenArray = reactExports.Children.toArray(children);
      const slottable = childrenArray.find(isSlottable$5);
      if (slottable) {
        const newElement = slottable.props.children;
        const newChildren = childrenArray.map((child) => {
          if (child === slottable) {
            if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
            return reactExports.isValidElement(newElement) ? newElement.props.children : null;
          } else {
            return child;
          }
        });
        return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null }));
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children }));
    });
    Slot2.displayName = `${ownerName}.Slot`;
    return Slot2;
  }
  __name(createSlot$5, "createSlot$5");
  // @__NO_SIDE_EFFECTS__
  function createSlotClone$5(ownerName) {
    const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
      const _a2 = props, { children } = _a2, slotProps = __objRest(_a2, ["children"]);
      if (reactExports.isValidElement(children)) {
        const childrenRef = getElementRef$6(children);
        const props2 = mergeProps$5(slotProps, children.props);
        if (children.type !== reactExports.Fragment) {
          props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
        }
        return reactExports.cloneElement(children, props2);
      }
      return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null;
    });
    SlotClone.displayName = `${ownerName}.SlotClone`;
    return SlotClone;
  }
  __name(createSlotClone$5, "createSlotClone$5");
  var SLOTTABLE_IDENTIFIER$6 = Symbol("radix.slottable");
  function isSlottable$5(child) {
    return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$6;
  }
  __name(isSlottable$5, "isSlottable$5");
  function mergeProps$5(slotProps, childProps) {
    const overrideProps = __spreadValues({}, childProps);
    for (const propName in childProps) {
      const slotPropValue = slotProps[propName];
      const childPropValue = childProps[propName];
      const isHandler = /^on[A-Z]/.test(propName);
      if (isHandler) {
        if (slotPropValue && childPropValue) {
          overrideProps[propName] = (...args) => {
            const result = childPropValue(...args);
            slotPropValue(...args);
            return result;
          };
        } else if (slotPropValue) {
          overrideProps[propName] = slotPropValue;
        }
      } else if (propName === "style") {
        overrideProps[propName] = __spreadValues(__spreadValues({}, slotPropValue), childPropValue);
      } else if (propName === "className") {
        overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
      }
    }
    return __spreadValues(__spreadValues({}, slotProps), overrideProps);
  }
  __name(mergeProps$5, "mergeProps$5");
  function getElementRef$6(element) {
    var _a2, _b2;
    let getter = (_a2 = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a2.get;
    let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
    if (mayWarn) {
      return element.ref;
    }
    getter = (_b2 = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b2.get;
    mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
    if (mayWarn) {
      return element.props.ref;
    }
    return element.props.ref || element.ref;
  }
  __name(getElementRef$6, "getElementRef$6");
  var NODES$1 = [
    "a",
    "button",
    "div",
    "form",
    "h2",
    "h3",
    "img",
    "input",
    "label",
    "li",
    "nav",
    "ol",
    "p",
    "select",
    "span",
    "svg",
    "ul"
  ];
  var Primitive$1 = NODES$1.reduce((primitive, node) => {
    const Slot2 = /* @__PURE__ */ createSlot$5(`Primitive.${node}`);
    const Node2 = reactExports.forwardRef((props, forwardedRef) => {
      const _a2 = props, { asChild } = _a2, primitiveProps = __objRest(_a2, ["asChild"]);
      const Comp = asChild ? Slot2 : node;
      if (typeof window !== "undefined") {
        window[Symbol.for("radix-ui")] = true;
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, __spreadProps(__spreadValues({}, primitiveProps), { ref: forwardedRef }));
    });
    Node2.displayName = `Primitive.${node}`;
    return __spreadProps(__spreadValues({}, primitive), { [node]: Node2 });
  }, {});
  function dispatchDiscreteCustomEvent(target, event) {
    if (target) reactDomExports.flushSync(() => target.dispatchEvent(event));
  }
  __name(dispatchDiscreteCustomEvent, "dispatchDiscreteCustomEvent");
  // @__NO_SIDE_EFFECTS__
  function createSlot$4(ownerName) {
    const SlotClone = /* @__PURE__ */ createSlotClone$4(ownerName);
    const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
      const _a2 = props, { children } = _a2, slotProps = __objRest(_a2, ["children"]);
      const childrenArray = reactExports.Children.toArray(children);
      const slottable = childrenArray.find(isSlottable$4);
      if (slottable) {
        const newElement = slottable.props.children;
        const newChildren = childrenArray.map((child) => {
          if (child === slottable) {
            if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
            return reactExports.isValidElement(newElement) ? newElement.props.children : null;
          } else {
            return child;
          }
        });
        return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null }));
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children }));
    });
    Slot2.displayName = `${ownerName}.Slot`;
    return Slot2;
  }
  __name(createSlot$4, "createSlot$4");
  // @__NO_SIDE_EFFECTS__
  function createSlotClone$4(ownerName) {
    const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
      const _a2 = props, { children } = _a2, slotProps = __objRest(_a2, ["children"]);
      if (reactExports.isValidElement(children)) {
        const childrenRef = getElementRef$5(children);
        const props2 = mergeProps$4(slotProps, children.props);
        if (children.type !== reactExports.Fragment) {
          props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
        }
        return reactExports.cloneElement(children, props2);
      }
      return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null;
    });
    SlotClone.displayName = `${ownerName}.SlotClone`;
    return SlotClone;
  }
  __name(createSlotClone$4, "createSlotClone$4");
  var SLOTTABLE_IDENTIFIER$5 = Symbol("radix.slottable");
  function isSlottable$4(child) {
    return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$5;
  }
  __name(isSlottable$4, "isSlottable$4");
  function mergeProps$4(slotProps, childProps) {
    const overrideProps = __spreadValues({}, childProps);
    for (const propName in childProps) {
      const slotPropValue = slotProps[propName];
      const childPropValue = childProps[propName];
      const isHandler = /^on[A-Z]/.test(propName);
      if (isHandler) {
        if (slotPropValue && childPropValue) {
          overrideProps[propName] = (...args) => {
            const result = childPropValue(...args);
            slotPropValue(...args);
            return result;
          };
        } else if (slotPropValue) {
          overrideProps[propName] = slotPropValue;
        }
      } else if (propName === "style") {
        overrideProps[propName] = __spreadValues(__spreadValues({}, slotPropValue), childPropValue);
      } else if (propName === "className") {
        overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
      }
    }
    return __spreadValues(__spreadValues({}, slotProps), overrideProps);
  }
  __name(mergeProps$4, "mergeProps$4");
  function getElementRef$5(element) {
    var _a2, _b2;
    let getter = (_a2 = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a2.get;
    let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
    if (mayWarn) {
      return element.ref;
    }
    getter = (_b2 = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b2.get;
    mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
    if (mayWarn) {
      return element.props.ref;
    }
    return element.props.ref || element.ref;
  }
  __name(getElementRef$5, "getElementRef$5");
  function createCollection(name) {
    const PROVIDER_NAME2 = name + "CollectionProvider";
    const [createCollectionContext, createCollectionScope2] = createContextScope(PROVIDER_NAME2);
    const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
      PROVIDER_NAME2,
      { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
    );
    const CollectionProvider = /* @__PURE__ */ __name((props) => {
      const { scope, children } = props;
      const ref = React.useRef(null);
      const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
    }, "CollectionProvider");
    CollectionProvider.displayName = PROVIDER_NAME2;
    const COLLECTION_SLOT_NAME = name + "CollectionSlot";
    const CollectionSlotImpl = /* @__PURE__ */ createSlot$4(COLLECTION_SLOT_NAME);
    const CollectionSlot = React.forwardRef(
      (props, forwardedRef) => {
        const { scope, children } = props;
        const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
        const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
        return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionSlotImpl, { ref: composedRefs, children });
      }
    );
    CollectionSlot.displayName = COLLECTION_SLOT_NAME;
    const ITEM_SLOT_NAME = name + "CollectionItemSlot";
    const ITEM_DATA_ATTR = "data-radix-collection-item";
    const CollectionItemSlotImpl = /* @__PURE__ */ createSlot$4(ITEM_SLOT_NAME);
    const CollectionItemSlot = React.forwardRef(
      (props, forwardedRef) => {
        const _a2 = props, { scope, children } = _a2, itemData = __objRest(_a2, ["scope", "children"]);
        const ref = React.useRef(null);
        const composedRefs = useComposedRefs(forwardedRef, ref);
        const context = useCollectionContext(ITEM_SLOT_NAME, scope);
        React.useEffect(() => {
          context.itemMap.set(ref, __spreadValues({ ref }, itemData));
          return () => void context.itemMap.delete(ref);
        });
        return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionItemSlotImpl, __spreadProps(__spreadValues({}, { [ITEM_DATA_ATTR]: "" }), { ref: composedRefs, children }));
      }
    );
    CollectionItemSlot.displayName = ITEM_SLOT_NAME;
    function useCollection2(scope) {
      const context = useCollectionContext(name + "CollectionConsumer", scope);
      const getItems = React.useCallback(() => {
        const collectionNode = context.collectionRef.current;
        if (!collectionNode) return [];
        const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
        const items = Array.from(context.itemMap.values());
        const orderedItems = items.sort(
          (a2, b) => orderedNodes.indexOf(a2.ref.current) - orderedNodes.indexOf(b.ref.current)
        );
        return orderedItems;
      }, [context.collectionRef, context.itemMap]);
      return getItems;
    }
    __name(useCollection2, "useCollection");
    return [
      { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
      useCollection2,
      createCollectionScope2
    ];
  }
  __name(createCollection, "createCollection");
  var DirectionContext = reactExports.createContext(void 0);
  function useDirection(localDir) {
    const globalDir = reactExports.useContext(DirectionContext);
    return localDir || globalDir || "ltr";
  }
  __name(useDirection, "useDirection");
  function useCallbackRef$1(callback) {
    const callbackRef = reactExports.useRef(callback);
    reactExports.useEffect(() => {
      callbackRef.current = callback;
    });
    return reactExports.useMemo(() => (...args) => {
      var _a2;
      return (_a2 = callbackRef.current) == null ? void 0 : _a2.call(callbackRef, ...args);
    }, []);
  }
  __name(useCallbackRef$1, "useCallbackRef$1");
  function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
    const onEscapeKeyDown = useCallbackRef$1(onEscapeKeyDownProp);
    reactExports.useEffect(() => {
      const handleKeyDown = /* @__PURE__ */ __name((event) => {
        if (event.key === "Escape") {
          onEscapeKeyDown(event);
        }
      }, "handleKeyDown");
      ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
      return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
    }, [onEscapeKeyDown, ownerDocument]);
  }
  __name(useEscapeKeydown, "useEscapeKeydown");
  var DISMISSABLE_LAYER_NAME = "DismissableLayer";
  var CONTEXT_UPDATE = "dismissableLayer.update";
  var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
  var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
  var originalBodyPointerEvents;
  var DismissableLayerContext = reactExports.createContext({
    layers: /* @__PURE__ */ new Set(),
    layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
    branches: /* @__PURE__ */ new Set()
  });
  var DismissableLayer = reactExports.forwardRef(
    (props, forwardedRef) => {
      var _b2;
      const _a2 = props, {
        disableOutsidePointerEvents = false,
        onEscapeKeyDown,
        onPointerDownOutside,
        onFocusOutside,
        onInteractOutside,
        onDismiss
      } = _a2, layerProps = __objRest(_a2, [
        "disableOutsidePointerEvents",
        "onEscapeKeyDown",
        "onPointerDownOutside",
        "onFocusOutside",
        "onInteractOutside",
        "onDismiss"
      ]);
      const context = reactExports.useContext(DismissableLayerContext);
      const [node, setNode] = reactExports.useState(null);
      const ownerDocument = (_b2 = node == null ? void 0 : node.ownerDocument) != null ? _b2 : globalThis == null ? void 0 : globalThis.document;
      const [, force] = reactExports.useState({});
      const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
      const layers = Array.from(context.layers);
      const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
      const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
      const index2 = node ? layers.indexOf(node) : -1;
      const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
      const isPointerEventsEnabled = index2 >= highestLayerWithOutsidePointerEventsDisabledIndex;
      const pointerDownOutside = usePointerDownOutside((event) => {
        const target = event.target;
        const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
        if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
        onPointerDownOutside == null ? void 0 : onPointerDownOutside(event);
        onInteractOutside == null ? void 0 : onInteractOutside(event);
        if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
      }, ownerDocument);
      const focusOutside = useFocusOutside((event) => {
        const target = event.target;
        const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
        if (isFocusInBranch) return;
        onFocusOutside == null ? void 0 : onFocusOutside(event);
        onInteractOutside == null ? void 0 : onInteractOutside(event);
        if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
      }, ownerDocument);
      useEscapeKeydown((event) => {
        const isHighestLayer = index2 === context.layers.size - 1;
        if (!isHighestLayer) return;
        onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(event);
        if (!event.defaultPrevented && onDismiss) {
          event.preventDefault();
          onDismiss();
        }
      }, ownerDocument);
      reactExports.useEffect(() => {
        if (!node) return;
        if (disableOutsidePointerEvents) {
          if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
            originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
            ownerDocument.body.style.pointerEvents = "none";
          }
          context.layersWithOutsidePointerEventsDisabled.add(node);
        }
        context.layers.add(node);
        dispatchUpdate();
        return () => {
          if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
            ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
          }
        };
      }, [node, ownerDocument, disableOutsidePointerEvents, context]);
      reactExports.useEffect(() => {
        return () => {
          if (!node) return;
          context.layers.delete(node);
          context.layersWithOutsidePointerEventsDisabled.delete(node);
          dispatchUpdate();
        };
      }, [node, context]);
      reactExports.useEffect(() => {
        const handleUpdate = /* @__PURE__ */ __name(() => force({}), "handleUpdate");
        document.addEventListener(CONTEXT_UPDATE, handleUpdate);
        return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
      }, []);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.div,
        __spreadProps(__spreadValues({}, layerProps), {
          ref: composedRefs,
          style: __spreadValues({
            pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0
          }, props.style),
          onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
          onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
          onPointerDownCapture: composeEventHandlers(
            props.onPointerDownCapture,
            pointerDownOutside.onPointerDownCapture
          )
        })
      );
    }
  );
  DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
  var BRANCH_NAME = "DismissableLayerBranch";
  var DismissableLayerBranch = reactExports.forwardRef((props, forwardedRef) => {
    const context = reactExports.useContext(DismissableLayerContext);
    const ref = reactExports.useRef(null);
    const composedRefs = useComposedRefs(forwardedRef, ref);
    reactExports.useEffect(() => {
      const node = ref.current;
      if (node) {
        context.branches.add(node);
        return () => {
          context.branches.delete(node);
        };
      }
    }, [context.branches]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, __spreadProps(__spreadValues({}, props), { ref: composedRefs }));
  });
  DismissableLayerBranch.displayName = BRANCH_NAME;
  function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
    const handlePointerDownOutside = useCallbackRef$1(onPointerDownOutside);
    const isPointerInsideReactTreeRef = reactExports.useRef(false);
    const handleClickRef = reactExports.useRef(() => {
    });
    reactExports.useEffect(() => {
      const handlePointerDown = /* @__PURE__ */ __name((event) => {
        if (event.target && !isPointerInsideReactTreeRef.current) {
          let handleAndDispatchPointerDownOutsideEvent2 = /* @__PURE__ */ __name(function() {
            handleAndDispatchCustomEvent(
              POINTER_DOWN_OUTSIDE,
              handlePointerDownOutside,
              eventDetail,
              { discrete: true }
            );
          }, "handleAndDispatchPointerDownOutsideEvent2");
          const eventDetail = { originalEvent: event };
          if (event.pointerType === "touch") {
            ownerDocument.removeEventListener("click", handleClickRef.current);
            handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
            ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
          } else {
            handleAndDispatchPointerDownOutsideEvent2();
          }
        } else {
          ownerDocument.removeEventListener("click", handleClickRef.current);
        }
        isPointerInsideReactTreeRef.current = false;
      }, "handlePointerDown");
      const timerId = window.setTimeout(() => {
        ownerDocument.addEventListener("pointerdown", handlePointerDown);
      }, 0);
      return () => {
        window.clearTimeout(timerId);
        ownerDocument.removeEventListener("pointerdown", handlePointerDown);
        ownerDocument.removeEventListener("click", handleClickRef.current);
      };
    }, [ownerDocument, handlePointerDownOutside]);
    return {
      // ensures we check React component tree (not just DOM tree)
      onPointerDownCapture: /* @__PURE__ */ __name(() => isPointerInsideReactTreeRef.current = true, "onPointerDownCapture")
    };
  }
  __name(usePointerDownOutside, "usePointerDownOutside");
  function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
    const handleFocusOutside = useCallbackRef$1(onFocusOutside);
    const isFocusInsideReactTreeRef = reactExports.useRef(false);
    reactExports.useEffect(() => {
      const handleFocus = /* @__PURE__ */ __name((event) => {
        if (event.target && !isFocusInsideReactTreeRef.current) {
          const eventDetail = { originalEvent: event };
          handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
            discrete: false
          });
        }
      }, "handleFocus");
      ownerDocument.addEventListener("focusin", handleFocus);
      return () => ownerDocument.removeEventListener("focusin", handleFocus);
    }, [ownerDocument, handleFocusOutside]);
    return {
      onFocusCapture: /* @__PURE__ */ __name(() => isFocusInsideReactTreeRef.current = true, "onFocusCapture"),
      onBlurCapture: /* @__PURE__ */ __name(() => isFocusInsideReactTreeRef.current = false, "onBlurCapture")
    };
  }
  __name(useFocusOutside, "useFocusOutside");
  function dispatchUpdate() {
    const event = new CustomEvent(CONTEXT_UPDATE);
    document.dispatchEvent(event);
  }
  __name(dispatchUpdate, "dispatchUpdate");
  function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
    const target = detail.originalEvent.target;
    const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
    if (handler) target.addEventListener(name, handler, { once: true });
    if (discrete) {
      dispatchDiscreteCustomEvent(target, event);
    } else {
      target.dispatchEvent(event);
    }
  }
  __name(handleAndDispatchCustomEvent, "handleAndDispatchCustomEvent");
  var count$1 = 0;
  function useFocusGuards() {
    reactExports.useEffect(() => {
      var _a2, _b2;
      const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
      document.body.insertAdjacentElement("afterbegin", (_a2 = edgeGuards[0]) != null ? _a2 : createFocusGuard());
      document.body.insertAdjacentElement("beforeend", (_b2 = edgeGuards[1]) != null ? _b2 : createFocusGuard());
      count$1++;
      return () => {
        if (count$1 === 1) {
          document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
        }
        count$1--;
      };
    }, []);
  }
  __name(useFocusGuards, "useFocusGuards");
  function createFocusGuard() {
    const element = document.createElement("span");
    element.setAttribute("data-radix-focus-guard", "");
    element.tabIndex = 0;
    element.style.outline = "none";
    element.style.opacity = "0";
    element.style.position = "fixed";
    element.style.pointerEvents = "none";
    return element;
  }
  __name(createFocusGuard, "createFocusGuard");
  var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
  var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
  var EVENT_OPTIONS$1 = { bubbles: false, cancelable: true };
  var FOCUS_SCOPE_NAME = "FocusScope";
  var FocusScope = reactExports.forwardRef((props, forwardedRef) => {
    const _a2 = props, {
      loop = false,
      trapped = false,
      onMountAutoFocus: onMountAutoFocusProp,
      onUnmountAutoFocus: onUnmountAutoFocusProp
    } = _a2, scopeProps = __objRest(_a2, [
      "loop",
      "trapped",
      "onMountAutoFocus",
      "onUnmountAutoFocus"
    ]);
    const [container, setContainer] = reactExports.useState(null);
    const onMountAutoFocus = useCallbackRef$1(onMountAutoFocusProp);
    const onUnmountAutoFocus = useCallbackRef$1(onUnmountAutoFocusProp);
    const lastFocusedElementRef = reactExports.useRef(null);
    const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
    const focusScope = reactExports.useRef({
      paused: false,
      pause() {
        this.paused = true;
      },
      resume() {
        this.paused = false;
      }
    }).current;
    reactExports.useEffect(() => {
      if (trapped) {
        let handleFocusIn2 = /* @__PURE__ */ __name(function(event) {
          if (focusScope.paused || !container) return;
          const target = event.target;
          if (container.contains(target)) {
            lastFocusedElementRef.current = target;
          } else {
            focus(lastFocusedElementRef.current, { select: true });
          }
        }, "handleFocusIn2"), handleFocusOut2 = /* @__PURE__ */ __name(function(event) {
          if (focusScope.paused || !container) return;
          const relatedTarget = event.relatedTarget;
          if (relatedTarget === null) return;
          if (!container.contains(relatedTarget)) {
            focus(lastFocusedElementRef.current, { select: true });
          }
        }, "handleFocusOut2"), handleMutations2 = /* @__PURE__ */ __name(function(mutations) {
          const focusedElement = document.activeElement;
          if (focusedElement !== document.body) return;
          for (const mutation of mutations) {
            if (mutation.removedNodes.length > 0) focus(container);
          }
        }, "handleMutations2");
        document.addEventListener("focusin", handleFocusIn2);
        document.addEventListener("focusout", handleFocusOut2);
        const mutationObserver = new MutationObserver(handleMutations2);
        if (container) mutationObserver.observe(container, { childList: true, subtree: true });
        return () => {
          document.removeEventListener("focusin", handleFocusIn2);
          document.removeEventListener("focusout", handleFocusOut2);
          mutationObserver.disconnect();
        };
      }
    }, [trapped, container, focusScope.paused]);
    reactExports.useEffect(() => {
      if (container) {
        focusScopesStack.add(focusScope);
        const previouslyFocusedElement = document.activeElement;
        const hasFocusedCandidate = container.contains(previouslyFocusedElement);
        if (!hasFocusedCandidate) {
          const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS$1);
          container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
          container.dispatchEvent(mountEvent);
          if (!mountEvent.defaultPrevented) {
            focusFirst$2(removeLinks(getTabbableCandidates(container)), { select: true });
            if (document.activeElement === previouslyFocusedElement) {
              focus(container);
            }
          }
        }
        return () => {
          container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
          setTimeout(() => {
            const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS$1);
            container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
            container.dispatchEvent(unmountEvent);
            if (!unmountEvent.defaultPrevented) {
              focus(previouslyFocusedElement != null ? previouslyFocusedElement : document.body, { select: true });
            }
            container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
            focusScopesStack.remove(focusScope);
          }, 0);
        };
      }
    }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
    const handleKeyDown = reactExports.useCallback(
      (event) => {
        if (!loop && !trapped) return;
        if (focusScope.paused) return;
        const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
        const focusedElement = document.activeElement;
        if (isTabKey && focusedElement) {
          const container2 = event.currentTarget;
          const [first, last2] = getTabbableEdges(container2);
          const hasTabbableElementsInside = first && last2;
          if (!hasTabbableElementsInside) {
            if (focusedElement === container2) event.preventDefault();
          } else {
            if (!event.shiftKey && focusedElement === last2) {
              event.preventDefault();
              if (loop) focus(first, { select: true });
            } else if (event.shiftKey && focusedElement === first) {
              event.preventDefault();
              if (loop) focus(last2, { select: true });
            }
          }
        }
      },
      [loop, trapped, focusScope.paused]
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, __spreadProps(__spreadValues({ tabIndex: -1 }, scopeProps), { ref: composedRefs, onKeyDown: handleKeyDown }));
  });
  FocusScope.displayName = FOCUS_SCOPE_NAME;
  function focusFirst$2(candidates, { select = false } = {}) {
    const previouslyFocusedElement = document.activeElement;
    for (const candidate of candidates) {
      focus(candidate, { select });
      if (document.activeElement !== previouslyFocusedElement) return;
    }
  }
  __name(focusFirst$2, "focusFirst$2");
  function getTabbableEdges(container) {
    const candidates = getTabbableCandidates(container);
    const first = findVisible(candidates, container);
    const last2 = findVisible(candidates.reverse(), container);
    return [first, last2];
  }
  __name(getTabbableEdges, "getTabbableEdges");
  function getTabbableCandidates(container) {
    const nodes = [];
    const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
      acceptNode: /* @__PURE__ */ __name((node) => {
        const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
        if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
        return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
      }, "acceptNode")
    });
    while (walker.nextNode()) nodes.push(walker.currentNode);
    return nodes;
  }
  __name(getTabbableCandidates, "getTabbableCandidates");
  function findVisible(elements, container) {
    for (const element of elements) {
      if (!isHidden(element, { upTo: container })) return element;
    }
  }
  __name(findVisible, "findVisible");
  function isHidden(node, { upTo }) {
    if (getComputedStyle(node).visibility === "hidden") return true;
    while (node) {
      if (upTo !== void 0 && node === upTo) return false;
      if (getComputedStyle(node).display === "none") return true;
      node = node.parentElement;
    }
    return false;
  }
  __name(isHidden, "isHidden");
  function isSelectableInput(element) {
    return element instanceof HTMLInputElement && "select" in element;
  }
  __name(isSelectableInput, "isSelectableInput");
  function focus(element, { select = false } = {}) {
    if (element && element.focus) {
      const previouslyFocusedElement = document.activeElement;
      element.focus({ preventScroll: true });
      if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
        element.select();
    }
  }
  __name(focus, "focus");
  var focusScopesStack = createFocusScopesStack();
  function createFocusScopesStack() {
    let stack = [];
    return {
      add(focusScope) {
        const activeFocusScope = stack[0];
        if (focusScope !== activeFocusScope) {
          activeFocusScope == null ? void 0 : activeFocusScope.pause();
        }
        stack = arrayRemove(stack, focusScope);
        stack.unshift(focusScope);
      },
      remove(focusScope) {
        var _a2;
        stack = arrayRemove(stack, focusScope);
        (_a2 = stack[0]) == null ? void 0 : _a2.resume();
      }
    };
  }
  __name(createFocusScopesStack, "createFocusScopesStack");
  function arrayRemove(array2, item) {
    const updatedArray = [...array2];
    const index2 = updatedArray.indexOf(item);
    if (index2 !== -1) {
      updatedArray.splice(index2, 1);
    }
    return updatedArray;
  }
  __name(arrayRemove, "arrayRemove");
  function removeLinks(items) {
    return items.filter((item) => item.tagName !== "A");
  }
  __name(removeLinks, "removeLinks");
  var useReactId = React$1[" useId ".trim().toString()] || (() => void 0);
  var count = 0;
  function useId(deterministicId) {
    const [id, setId] = reactExports.useState(useReactId());
    useLayoutEffect2(() => {
      setId((reactId) => reactId != null ? reactId : String(count++));
    }, [deterministicId]);
    return id ? `radix-${id}` : "";
  }
  __name(useId, "useId");
  const sides = ["top", "right", "bottom", "left"];
  const min$2 = Math.min;
  const max$2 = Math.max;
  const round$1 = Math.round;
  const floor = Math.floor;
  const createCoords = /* @__PURE__ */ __name((v) => ({
    x: v,
    y: v
  }), "createCoords");
  const oppositeSideMap = {
    left: "right",
    right: "left",
    bottom: "top",
    top: "bottom"
  };
  const oppositeAlignmentMap = {
    start: "end",
    end: "start"
  };
  function clamp$1(start, value, end) {
    return max$2(start, min$2(value, end));
  }
  __name(clamp$1, "clamp$1");
  function evaluate(value, param) {
    return typeof value === "function" ? value(param) : value;
  }
  __name(evaluate, "evaluate");
  function getSide(placement) {
    return placement.split("-")[0];
  }
  __name(getSide, "getSide");
  function getAlignment(placement) {
    return placement.split("-")[1];
  }
  __name(getAlignment, "getAlignment");
  function getOppositeAxis(axis) {
    return axis === "x" ? "y" : "x";
  }
  __name(getOppositeAxis, "getOppositeAxis");
  function getAxisLength(axis) {
    return axis === "y" ? "height" : "width";
  }
  __name(getAxisLength, "getAxisLength");
  const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
  function getSideAxis(placement) {
    return yAxisSides.has(getSide(placement)) ? "y" : "x";
  }
  __name(getSideAxis, "getSideAxis");
  function getAlignmentAxis(placement) {
    return getOppositeAxis(getSideAxis(placement));
  }
  __name(getAlignmentAxis, "getAlignmentAxis");
  function getAlignmentSides(placement, rects, rtl) {
    if (rtl === void 0) {
      rtl = false;
    }
    const alignment = getAlignment(placement);
    const alignmentAxis = getAlignmentAxis(placement);
    const length = getAxisLength(alignmentAxis);
    let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
    if (rects.reference[length] > rects.floating[length]) {
      mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
    }
    return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
  }
  __name(getAlignmentSides, "getAlignmentSides");
  function getExpandedPlacements(placement) {
    const oppositePlacement = getOppositePlacement(placement);
    return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
  }
  __name(getExpandedPlacements, "getExpandedPlacements");
  function getOppositeAlignmentPlacement(placement) {
    return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
  }
  __name(getOppositeAlignmentPlacement, "getOppositeAlignmentPlacement");
  const lrPlacement = ["left", "right"];
  const rlPlacement = ["right", "left"];
  const tbPlacement = ["top", "bottom"];
  const btPlacement = ["bottom", "top"];
  function getSideList(side, isStart, rtl) {
    switch (side) {
      case "top":
      case "bottom":
        if (rtl) return isStart ? rlPlacement : lrPlacement;
        return isStart ? lrPlacement : rlPlacement;
      case "left":
      case "right":
        return isStart ? tbPlacement : btPlacement;
      default:
        return [];
    }
  }
  __name(getSideList, "getSideList");
  function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
    const alignment = getAlignment(placement);
    let list = getSideList(getSide(placement), direction === "start", rtl);
    if (alignment) {
      list = list.map((side) => side + "-" + alignment);
      if (flipAlignment) {
        list = list.concat(list.map(getOppositeAlignmentPlacement));
      }
    }
    return list;
  }
  __name(getOppositeAxisPlacements, "getOppositeAxisPlacements");
  function getOppositePlacement(placement) {
    return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
  }
  __name(getOppositePlacement, "getOppositePlacement");
  function expandPaddingObject(padding) {
    return __spreadValues({
      top: 0,
      right: 0,
      bottom: 0,
      left: 0
    }, padding);
  }
  __name(expandPaddingObject, "expandPaddingObject");
  function getPaddingObject(padding) {
    return typeof padding !== "number" ? expandPaddingObject(padding) : {
      top: padding,
      right: padding,
      bottom: padding,
      left: padding
    };
  }
  __name(getPaddingObject, "getPaddingObject");
  function rectToClientRect(rect) {
    const {
      x: x2,
      y: y2,
      width,
      height
    } = rect;
    return {
      width,
      height,
      top: y2,
      left: x2,
      right: x2 + width,
      bottom: y2 + height,
      x: x2,
      y: y2
    };
  }
  __name(rectToClientRect, "rectToClientRect");
  function computeCoordsFromPlacement(_ref, placement, rtl) {
    let {
      reference,
      floating
    } = _ref;
    const sideAxis = getSideAxis(placement);
    const alignmentAxis = getAlignmentAxis(placement);
    const alignLength = getAxisLength(alignmentAxis);
    const side = getSide(placement);
    const isVertical = sideAxis === "y";
    const commonX = reference.x + reference.width / 2 - floating.width / 2;
    const commonY = reference.y + reference.height / 2 - floating.height / 2;
    const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
    let coords;
    switch (side) {
      case "top":
        coords = {
          x: commonX,
          y: reference.y - floating.height
        };
        break;
      case "bottom":
        coords = {
          x: commonX,
          y: reference.y + reference.height
        };
        break;
      case "right":
        coords = {
          x: reference.x + reference.width,
          y: commonY
        };
        break;
      case "left":
        coords = {
          x: reference.x - floating.width,
          y: commonY
        };
        break;
      default:
        coords = {
          x: reference.x,
          y: reference.y
        };
    }
    switch (getAlignment(placement)) {
      case "start":
        coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
        break;
      case "end":
        coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
        break;
    }
    return coords;
  }
  __name(computeCoordsFromPlacement, "computeCoordsFromPlacement");
  const computePosition$1 = /* @__PURE__ */ __name((reference, floating, config2) => __async(null, null, function* () {
    const {
      placement = "bottom",
      strategy = "absolute",
      middleware = [],
      platform: platform2
    } = config2;
    const validMiddleware = middleware.filter(Boolean);
    const rtl = yield platform2.isRTL == null ? void 0 : platform2.isRTL(floating);
    let rects = yield platform2.getElementRects({
      reference,
      floating,
      strategy
    });
    let {
      x: x2,
      y: y2
    } = computeCoordsFromPlacement(rects, placement, rtl);
    let statefulPlacement = placement;
    let middlewareData = {};
    let resetCount = 0;
    for (let i2 = 0; i2 < validMiddleware.length; i2++) {
      const {
        name,
        fn
      } = validMiddleware[i2];
      const {
        x: nextX,
        y: nextY,
        data,
        reset
      } = yield fn({
        x: x2,
        y: y2,
        initialPlacement: placement,
        placement: statefulPlacement,
        strategy,
        middlewareData,
        rects,
        platform: platform2,
        elements: {
          reference,
          floating
        }
      });
      x2 = nextX != null ? nextX : x2;
      y2 = nextY != null ? nextY : y2;
      middlewareData = __spreadProps(__spreadValues({}, middlewareData), {
        [name]: __spreadValues(__spreadValues({}, middlewareData[name]), data)
      });
      if (reset && resetCount <= 50) {
        resetCount++;
        if (typeof reset === "object") {
          if (reset.placement) {
            statefulPlacement = reset.placement;
          }
          if (reset.rects) {
            rects = reset.rects === true ? yield platform2.getElementRects({
              reference,
              floating,
              strategy
            }) : reset.rects;
          }
          ({
            x: x2,
            y: y2
          } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
        }
        i2 = -1;
      }
    }
    return {
      x: x2,
      y: y2,
      placement: statefulPlacement,
      strategy,
      middlewareData
    };
  }), "computePosition$1");
  function detectOverflow(state, options2) {
    return __async(this, null, function* () {
      var _await$platform$isEle;
      if (options2 === void 0) {
        options2 = {};
      }
      const {
        x: x2,
        y: y2,
        platform: platform2,
        rects,
        elements,
        strategy
      } = state;
      const {
        boundary = "clippingAncestors",
        rootBoundary = "viewport",
        elementContext = "floating",
        altBoundary = false,
        padding = 0
      } = evaluate(options2, state);
      const paddingObject = getPaddingObject(padding);
      const altContext = elementContext === "floating" ? "reference" : "floating";
      const element = elements[altBoundary ? altContext : elementContext];
      const clippingClientRect = rectToClientRect(yield platform2.getClippingRect({
        element: ((_await$platform$isEle = yield platform2.isElement == null ? void 0 : platform2.isElement(element)) != null ? _await$platform$isEle : true) ? element : element.contextElement || (yield platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
        boundary,
        rootBoundary,
        strategy
      }));
      const rect = elementContext === "floating" ? {
        x: x2,
        y: y2,
        width: rects.floating.width,
        height: rects.floating.height
      } : rects.reference;
      const offsetParent = yield platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating);
      const offsetScale = (yield platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? (yield platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
        x: 1,
        y: 1
      } : {
        x: 1,
        y: 1
      };
      const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? yield platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
        elements,
        rect,
        offsetParent,
        strategy
      }) : rect);
      return {
        top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
        bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
        left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
        right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
      };
    });
  }
  __name(detectOverflow, "detectOverflow");
  const arrow$3 = /* @__PURE__ */ __name((options2) => ({
    name: "arrow",
    options: options2,
    fn(state) {
      return __async(this, null, function* () {
        const {
          x: x2,
          y: y2,
          placement,
          rects,
          platform: platform2,
          elements,
          middlewareData
        } = state;
        const {
          element,
          padding = 0
        } = evaluate(options2, state) || {};
        if (element == null) {
          return {};
        }
        const paddingObject = getPaddingObject(padding);
        const coords = {
          x: x2,
          y: y2
        };
        const axis = getAlignmentAxis(placement);
        const length = getAxisLength(axis);
        const arrowDimensions = yield platform2.getDimensions(element);
        const isYAxis = axis === "y";
        const minProp = isYAxis ? "top" : "left";
        const maxProp = isYAxis ? "bottom" : "right";
        const clientProp = isYAxis ? "clientHeight" : "clientWidth";
        const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
        const startDiff = coords[axis] - rects.reference[axis];
        const arrowOffsetParent = yield platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element);
        let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
        if (!clientSize || !(yield platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
          clientSize = elements.floating[clientProp] || rects.floating[length];
        }
        const centerToReference = endDiff / 2 - startDiff / 2;
        const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
        const minPadding = min$2(paddingObject[minProp], largestPossiblePadding);
        const maxPadding = min$2(paddingObject[maxProp], largestPossiblePadding);
        const min$12 = minPadding;
        const max2 = clientSize - arrowDimensions[length] - maxPadding;
        const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
        const offset2 = clamp$1(min$12, center, max2);
        const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < min$12 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
        const alignmentOffset = shouldAddOffset ? center < min$12 ? center - min$12 : center - max2 : 0;
        return {
          [axis]: coords[axis] + alignmentOffset,
          data: __spreadValues({
            [axis]: offset2,
            centerOffset: center - offset2 - alignmentOffset
          }, shouldAddOffset && {
            alignmentOffset
          }),
          reset: shouldAddOffset
        };
      });
    }
  }), "arrow$3");
  const flip$2 = /* @__PURE__ */ __name(function(options2) {
    if (options2 === void 0) {
      options2 = {};
    }
    return {
      name: "flip",
      options: options2,
      fn(state) {
        return __async(this, null, function* () {
          var _middlewareData$arrow, _middlewareData$flip;
          const {
            placement,
            middlewareData,
            rects,
            initialPlacement,
            platform: platform2,
            elements
          } = state;
          const _a3 = evaluate(options2, state), {
            mainAxis: checkMainAxis = true,
            crossAxis: checkCrossAxis = true,
            fallbackPlacements: specifiedFallbackPlacements,
            fallbackStrategy = "bestFit",
            fallbackAxisSideDirection = "none",
            flipAlignment = true
          } = _a3, detectOverflowOptions = __objRest(_a3, [
            "mainAxis",
            "crossAxis",
            "fallbackPlacements",
            "fallbackStrategy",
            "fallbackAxisSideDirection",
            "flipAlignment"
          ]);
          if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
            return {};
          }
          const side = getSide(placement);
          const initialSideAxis = getSideAxis(initialPlacement);
          const isBasePlacement = getSide(initialPlacement) === initialPlacement;
          const rtl = yield platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating);
          const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
          const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
          if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
            fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
          }
          const placements = [initialPlacement, ...fallbackPlacements];
          const overflow = yield detectOverflow(state, detectOverflowOptions);
          const overflows = [];
          let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
          if (checkMainAxis) {
            overflows.push(overflow[side]);
          }
          if (checkCrossAxis) {
            const sides2 = getAlignmentSides(placement, rects, rtl);
            overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
          }
          overflowsData = [...overflowsData, {
            placement,
            overflows
          }];
          if (!overflows.every((side2) => side2 <= 0)) {
            var _middlewareData$flip2, _overflowsData$filter;
            const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
            const nextPlacement = placements[nextIndex];
            if (nextPlacement) {
              const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
              if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
              // overflows the main axis.
              overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
                return {
                  data: {
                    index: nextIndex,
                    overflows: overflowsData
                  },
                  reset: {
                    placement: nextPlacement
                  }
                };
              }
            }
            let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a2, b) => a2.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
            if (!resetPlacement) {
              switch (fallbackStrategy) {
                case "bestFit": {
                  var _overflowsData$filter2;
                  const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
                    if (hasFallbackAxisSideDirection) {
                      const currentSideAxis = getSideAxis(d.placement);
                      return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
                      // reading directions favoring greater width.
                      currentSideAxis === "y";
                    }
                    return true;
                  }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b) => a2[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
                  if (placement2) {
                    resetPlacement = placement2;
                  }
                  break;
                }
                case "initialPlacement":
                  resetPlacement = initialPlacement;
                  break;
              }
            }
            if (placement !== resetPlacement) {
              return {
                reset: {
                  placement: resetPlacement
                }
              };
            }
          }
          return {};
        });
      }
    };
  }, "flip$2");
  function getSideOffsets(overflow, rect) {
    return {
      top: overflow.top - rect.height,
      right: overflow.right - rect.width,
      bottom: overflow.bottom - rect.height,
      left: overflow.left - rect.width
    };
  }
  __name(getSideOffsets, "getSideOffsets");
  function isAnySideFullyClipped(overflow) {
    return sides.some((side) => overflow[side] >= 0);
  }
  __name(isAnySideFullyClipped, "isAnySideFullyClipped");
  const hide$2 = /* @__PURE__ */ __name(function(options2) {
    if (options2 === void 0) {
      options2 = {};
    }
    return {
      name: "hide",
      options: options2,
      fn(state) {
        return __async(this, null, function* () {
          const {
            rects
          } = state;
          const _a3 = evaluate(options2, state), {
            strategy = "referenceHidden"
          } = _a3, detectOverflowOptions = __objRest(_a3, [
            "strategy"
          ]);
          switch (strategy) {
            case "referenceHidden": {
              const overflow = yield detectOverflow(state, __spreadProps(__spreadValues({}, detectOverflowOptions), {
                elementContext: "reference"
              }));
              const offsets = getSideOffsets(overflow, rects.reference);
              return {
                data: {
                  referenceHiddenOffsets: offsets,
                  referenceHidden: isAnySideFullyClipped(offsets)
                }
              };
            }
            case "escaped": {
              const overflow = yield detectOverflow(state, __spreadProps(__spreadValues({}, detectOverflowOptions), {
                altBoundary: true
              }));
              const offsets = getSideOffsets(overflow, rects.floating);
              return {
                data: {
                  escapedOffsets: offsets,
                  escaped: isAnySideFullyClipped(offsets)
                }
              };
            }
            default: {
              return {};
            }
          }
        });
      }
    };
  }, "hide$2");
  const originSides = /* @__PURE__ */ new Set(["left", "top"]);
  function convertValueToCoords(state, options2) {
    return __async(this, null, function* () {
      const {
        placement,
        platform: platform2,
        elements
      } = state;
      const rtl = yield platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating);
      const side = getSide(placement);
      const alignment = getAlignment(placement);
      const isVertical = getSideAxis(placement) === "y";
      const mainAxisMulti = originSides.has(side) ? -1 : 1;
      const crossAxisMulti = rtl && isVertical ? -1 : 1;
      const rawValue = evaluate(options2, state);
      let {
        mainAxis,
        crossAxis,
        alignmentAxis
      } = typeof rawValue === "number" ? {
        mainAxis: rawValue,
        crossAxis: 0,
        alignmentAxis: null
      } : {
        mainAxis: rawValue.mainAxis || 0,
        crossAxis: rawValue.crossAxis || 0,
        alignmentAxis: rawValue.alignmentAxis
      };
      if (alignment && typeof alignmentAxis === "number") {
        crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
      }
      return isVertical ? {
        x: crossAxis * crossAxisMulti,
        y: mainAxis * mainAxisMulti
      } : {
        x: mainAxis * mainAxisMulti,
        y: crossAxis * crossAxisMulti
      };
    });
  }
  __name(convertValueToCoords, "convertValueToCoords");
  const offset$2 = /* @__PURE__ */ __name(function(options2) {
    if (options2 === void 0) {
      options2 = 0;
    }
    return {
      name: "offset",
      options: options2,
      fn(state) {
        return __async(this, null, function* () {
          var _middlewareData$offse, _middlewareData$arrow;
          const {
            x: x2,
            y: y2,
            placement,
            middlewareData
          } = state;
          const diffCoords = yield convertValueToCoords(state, options2);
          if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
            return {};
          }
          return {
            x: x2 + diffCoords.x,
            y: y2 + diffCoords.y,
            data: __spreadProps(__spreadValues({}, diffCoords), {
              placement
            })
          };
        });
      }
    };
  }, "offset$2");
  const shift$2 = /* @__PURE__ */ __name(function(options2) {
    if (options2 === void 0) {
      options2 = {};
    }
    return {
      name: "shift",
      options: options2,
      fn(state) {
        return __async(this, null, function* () {
          const {
            x: x2,
            y: y2,
            placement
          } = state;
          const _a3 = evaluate(options2, state), {
            mainAxis: checkMainAxis = true,
            crossAxis: checkCrossAxis = false,
            limiter = {
              fn: /* @__PURE__ */ __name((_ref) => {
                let {
                  x: x3,
                  y: y3
                } = _ref;
                return {
                  x: x3,
                  y: y3
                };
              }, "fn")
            }
          } = _a3, detectOverflowOptions = __objRest(_a3, [
            "mainAxis",
            "crossAxis",
            "limiter"
          ]);
          const coords = {
            x: x2,
            y: y2
          };
          const overflow = yield detectOverflow(state, detectOverflowOptions);
          const crossAxis = getSideAxis(getSide(placement));
          const mainAxis = getOppositeAxis(crossAxis);
          let mainAxisCoord = coords[mainAxis];
          let crossAxisCoord = coords[crossAxis];
          if (checkMainAxis) {
            const minSide = mainAxis === "y" ? "top" : "left";
            const maxSide = mainAxis === "y" ? "bottom" : "right";
            const min2 = mainAxisCoord + overflow[minSide];
            const max2 = mainAxisCoord - overflow[maxSide];
            mainAxisCoord = clamp$1(min2, mainAxisCoord, max2);
          }
          if (checkCrossAxis) {
            const minSide = crossAxis === "y" ? "top" : "left";
            const maxSide = crossAxis === "y" ? "bottom" : "right";
            const min2 = crossAxisCoord + overflow[minSide];
            const max2 = crossAxisCoord - overflow[maxSide];
            crossAxisCoord = clamp$1(min2, crossAxisCoord, max2);
          }
          const limitedCoords = limiter.fn(__spreadProps(__spreadValues({}, state), {
            [mainAxis]: mainAxisCoord,
            [crossAxis]: crossAxisCoord
          }));
          return __spreadProps(__spreadValues({}, limitedCoords), {
            data: {
              x: limitedCoords.x - x2,
              y: limitedCoords.y - y2,
              enabled: {
                [mainAxis]: checkMainAxis,
                [crossAxis]: checkCrossAxis
              }
            }
          });
        });
      }
    };
  }, "shift$2");
  const limitShift$2 = /* @__PURE__ */ __name(function(options2) {
    if (options2 === void 0) {
      options2 = {};
    }
    return {
      options: options2,
      fn(state) {
        const {
          x: x2,
          y: y2,
          placement,
          rects,
          middlewareData
        } = state;
        const {
          offset: offset2 = 0,
          mainAxis: checkMainAxis = true,
          crossAxis: checkCrossAxis = true
        } = evaluate(options2, state);
        const coords = {
          x: x2,
          y: y2
        };
        const crossAxis = getSideAxis(placement);
        const mainAxis = getOppositeAxis(crossAxis);
        let mainAxisCoord = coords[mainAxis];
        let crossAxisCoord = coords[crossAxis];
        const rawOffset = evaluate(offset2, state);
        const computedOffset = typeof rawOffset === "number" ? {
          mainAxis: rawOffset,
          crossAxis: 0
        } : __spreadValues({
          mainAxis: 0,
          crossAxis: 0
        }, rawOffset);
        if (checkMainAxis) {
          const len = mainAxis === "y" ? "height" : "width";
          const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
          const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
          if (mainAxisCoord < limitMin) {
            mainAxisCoord = limitMin;
          } else if (mainAxisCoord > limitMax) {
            mainAxisCoord = limitMax;
          }
        }
        if (checkCrossAxis) {
          var _middlewareData$offse, _middlewareData$offse2;
          const len = mainAxis === "y" ? "width" : "height";
          const isOriginSide = originSides.has(getSide(placement));
          const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
          const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
          if (crossAxisCoord < limitMin) {
            crossAxisCoord = limitMin;
          } else if (crossAxisCoord > limitMax) {
            crossAxisCoord = limitMax;
          }
        }
        return {
          [mainAxis]: mainAxisCoord,
          [crossAxis]: crossAxisCoord
        };
      }
    };
  }, "limitShift$2");
  const size$2 = /* @__PURE__ */ __name(function(options2) {
    if (options2 === void 0) {
      options2 = {};
    }
    return {
      name: "size",
      options: options2,
      fn(state) {
        return __async(this, null, function* () {
          var _state$middlewareData, _state$middlewareData2;
          const {
            placement,
            rects,
            platform: platform2,
            elements
          } = state;
          const _a3 = evaluate(options2, state), {
            apply = /* @__PURE__ */ __name(() => {
            }, "apply")
          } = _a3, detectOverflowOptions = __objRest(_a3, [
            "apply"
          ]);
          const overflow = yield detectOverflow(state, detectOverflowOptions);
          const side = getSide(placement);
          const alignment = getAlignment(placement);
          const isYAxis = getSideAxis(placement) === "y";
          const {
            width,
            height
          } = rects.floating;
          let heightSide;
          let widthSide;
          if (side === "top" || side === "bottom") {
            heightSide = side;
            widthSide = alignment === ((yield platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
          } else {
            widthSide = side;
            heightSide = alignment === "end" ? "top" : "bottom";
          }
          const maximumClippingHeight = height - overflow.top - overflow.bottom;
          const maximumClippingWidth = width - overflow.left - overflow.right;
          const overflowAvailableHeight = min$2(height - overflow[heightSide], maximumClippingHeight);
          const overflowAvailableWidth = min$2(width - overflow[widthSide], maximumClippingWidth);
          const noShift = !state.middlewareData.shift;
          let availableHeight = overflowAvailableHeight;
          let availableWidth = overflowAvailableWidth;
          if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
            availableWidth = maximumClippingWidth;
          }
          if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
            availableHeight = maximumClippingHeight;
          }
          if (noShift && !alignment) {
            const xMin = max$2(overflow.left, 0);
            const xMax = max$2(overflow.right, 0);
            const yMin = max$2(overflow.top, 0);
            const yMax = max$2(overflow.bottom, 0);
            if (isYAxis) {
              availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max$2(overflow.left, overflow.right));
            } else {
              availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max$2(overflow.top, overflow.bottom));
            }
          }
          yield apply(__spreadProps(__spreadValues({}, state), {
            availableWidth,
            availableHeight
          }));
          const nextDimensions = yield platform2.getDimensions(elements.floating);
          if (width !== nextDimensions.width || height !== nextDimensions.height) {
            return {
              reset: {
                rects: true
              }
            };
          }
          return {};
        });
      }
    };
  }, "size$2");
  function hasWindow() {
    return typeof window !== "undefined";
  }
  __name(hasWindow, "hasWindow");
  function getNodeName(node) {
    if (isNode(node)) {
      return (node.nodeName || "").toLowerCase();
    }
    return "#document";
  }
  __name(getNodeName, "getNodeName");
  function getWindow(node) {
    var _node$ownerDocument;
    return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
  }
  __name(getWindow, "getWindow");
  function getDocumentElement(node) {
    var _ref;
    return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
  }
  __name(getDocumentElement, "getDocumentElement");
  function isNode(value) {
    if (!hasWindow()) {
      return false;
    }
    return value instanceof Node || value instanceof getWindow(value).Node;
  }
  __name(isNode, "isNode");
  function isElement(value) {
    if (!hasWindow()) {
      return false;
    }
    return value instanceof Element || value instanceof getWindow(value).Element;
  }
  __name(isElement, "isElement");
  function isHTMLElement$1(value) {
    if (!hasWindow()) {
      return false;
    }
    return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
  }
  __name(isHTMLElement$1, "isHTMLElement$1");
  function isShadowRoot(value) {
    if (!hasWindow() || typeof ShadowRoot === "undefined") {
      return false;
    }
    return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
  }
  __name(isShadowRoot, "isShadowRoot");
  const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
  function isOverflowElement(element) {
    const {
      overflow,
      overflowX,
      overflowY,
      display
    } = getComputedStyle$1(element);
    return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
  }
  __name(isOverflowElement, "isOverflowElement");
  const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
  function isTableElement(element) {
    return tableElements.has(getNodeName(element));
  }
  __name(isTableElement, "isTableElement");
  const topLayerSelectors = [":popover-open", ":modal"];
  function isTopLayer(element) {
    return topLayerSelectors.some((selector) => {
      try {
        return element.matches(selector);
      } catch (_e2) {
        return false;
      }
    });
  }
  __name(isTopLayer, "isTopLayer");
  const transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
  const willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
  const containValues = ["paint", "layout", "strict", "content"];
  function isContainingBlock(elementOrCss) {
    const webkit = isWebKit();
    const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
    return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value));
  }
  __name(isContainingBlock, "isContainingBlock");
  function getContainingBlock(element) {
    let currentNode = getParentNode(element);
    while (isHTMLElement$1(currentNode) && !isLastTraversableNode(currentNode)) {
      if (isContainingBlock(currentNode)) {
        return currentNode;
      } else if (isTopLayer(currentNode)) {
        return null;
      }
      currentNode = getParentNode(currentNode);
    }
    return null;
  }
  __name(getContainingBlock, "getContainingBlock");
  function isWebKit() {
    if (typeof CSS === "undefined" || !CSS.supports) return false;
    return CSS.supports("-webkit-backdrop-filter", "none");
  }
  __name(isWebKit, "isWebKit");
  const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
  function isLastTraversableNode(node) {
    return lastTraversableNodeNames.has(getNodeName(node));
  }
  __name(isLastTraversableNode, "isLastTraversableNode");
  function getComputedStyle$1(element) {
    return getWindow(element).getComputedStyle(element);
  }
  __name(getComputedStyle$1, "getComputedStyle$1");
  function getNodeScroll(element) {
    if (isElement(element)) {
      return {
        scrollLeft: element.scrollLeft,
        scrollTop: element.scrollTop
      };
    }
    return {
      scrollLeft: element.scrollX,
      scrollTop: element.scrollY
    };
  }
  __name(getNodeScroll, "getNodeScroll");
  function getParentNode(node) {
    if (getNodeName(node) === "html") {
      return node;
    }
    const result = (
      // Step into the shadow DOM of the parent of a slotted node.
      node.assignedSlot || // DOM Element detected.
      node.parentNode || // ShadowRoot detected.
      isShadowRoot(node) && node.host || // Fallback.
      getDocumentElement(node)
    );
    return isShadowRoot(result) ? result.host : result;
  }
  __name(getParentNode, "getParentNode");
  function getNearestOverflowAncestor(node) {
    const parentNode = getParentNode(node);
    if (isLastTraversableNode(parentNode)) {
      return node.ownerDocument ? node.ownerDocument.body : node.body;
    }
    if (isHTMLElement$1(parentNode) && isOverflowElement(parentNode)) {
      return parentNode;
    }
    return getNearestOverflowAncestor(parentNode);
  }
  __name(getNearestOverflowAncestor, "getNearestOverflowAncestor");
  function getOverflowAncestors(node, list, traverseIframes) {
    var _node$ownerDocument2;
    if (list === void 0) {
      list = [];
    }
    if (traverseIframes === void 0) {
      traverseIframes = true;
    }
    const scrollableAncestor = getNearestOverflowAncestor(node);
    const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
    const win2 = getWindow(scrollableAncestor);
    if (isBody) {
      const frameElement = getFrameElement(win2);
      return list.concat(win2, win2.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
    }
    return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
  }
  __name(getOverflowAncestors, "getOverflowAncestors");
  function getFrameElement(win2) {
    return win2.parent && Object.getPrototypeOf(win2.parent) ? win2.frameElement : null;
  }
  __name(getFrameElement, "getFrameElement");
  function getCssDimensions(element) {
    const css = getComputedStyle$1(element);
    let width = parseFloat(css.width) || 0;
    let height = parseFloat(css.height) || 0;
    const hasOffset = isHTMLElement$1(element);
    const offsetWidth = hasOffset ? element.offsetWidth : width;
    const offsetHeight = hasOffset ? element.offsetHeight : height;
    const shouldFallback = round$1(width) !== offsetWidth || round$1(height) !== offsetHeight;
    if (shouldFallback) {
      width = offsetWidth;
      height = offsetHeight;
    }
    return {
      width,
      height,
      $: shouldFallback
    };
  }
  __name(getCssDimensions, "getCssDimensions");
  function unwrapElement(element) {
    return !isElement(element) ? element.contextElement : element;
  }
  __name(unwrapElement, "unwrapElement");
  function getScale(element) {
    const domElement = unwrapElement(element);
    if (!isHTMLElement$1(domElement)) {
      return createCoords(1);
    }
    const rect = domElement.getBoundingClientRect();
    const {
      width,
      height,
      $: $2
    } = getCssDimensions(domElement);
    let x2 = ($2 ? round$1(rect.width) : rect.width) / width;
    let y2 = ($2 ? round$1(rect.height) : rect.height) / height;
    if (!x2 || !Number.isFinite(x2)) {
      x2 = 1;
    }
    if (!y2 || !Number.isFinite(y2)) {
      y2 = 1;
    }
    return {
      x: x2,
      y: y2
    };
  }
  __name(getScale, "getScale");
  const noOffsets = /* @__PURE__ */ createCoords(0);
  function getVisualOffsets(element) {
    const win2 = getWindow(element);
    if (!isWebKit() || !win2.visualViewport) {
      return noOffsets;
    }
    return {
      x: win2.visualViewport.offsetLeft,
      y: win2.visualViewport.offsetTop
    };
  }
  __name(getVisualOffsets, "getVisualOffsets");
  function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
    if (isFixed === void 0) {
      isFixed = false;
    }
    if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
      return false;
    }
    return isFixed;
  }
  __name(shouldAddVisualOffsets, "shouldAddVisualOffsets");
  function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
    if (includeScale === void 0) {
      includeScale = false;
    }
    if (isFixedStrategy === void 0) {
      isFixedStrategy = false;
    }
    const clientRect = element.getBoundingClientRect();
    const domElement = unwrapElement(element);
    let scale = createCoords(1);
    if (includeScale) {
      if (offsetParent) {
        if (isElement(offsetParent)) {
          scale = getScale(offsetParent);
        }
      } else {
        scale = getScale(element);
      }
    }
    const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
    let x2 = (clientRect.left + visualOffsets.x) / scale.x;
    let y2 = (clientRect.top + visualOffsets.y) / scale.y;
    let width = clientRect.width / scale.x;
    let height = clientRect.height / scale.y;
    if (domElement) {
      const win2 = getWindow(domElement);
      const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
      let currentWin = win2;
      let currentIFrame = getFrameElement(currentWin);
      while (currentIFrame && offsetParent && offsetWin !== currentWin) {
        const iframeScale = getScale(currentIFrame);
        const iframeRect = currentIFrame.getBoundingClientRect();
        const css = getComputedStyle$1(currentIFrame);
        const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
        const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
        x2 *= iframeScale.x;
        y2 *= iframeScale.y;
        width *= iframeScale.x;
        height *= iframeScale.y;
        x2 += left;
        y2 += top;
        currentWin = getWindow(currentIFrame);
        currentIFrame = getFrameElement(currentWin);
      }
    }
    return rectToClientRect({
      width,
      height,
      x: x2,
      y: y2
    });
  }
  __name(getBoundingClientRect, "getBoundingClientRect");
  function getWindowScrollBarX(element, rect) {
    const leftScroll = getNodeScroll(element).scrollLeft;
    if (!rect) {
      return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
    }
    return rect.left + leftScroll;
  }
  __name(getWindowScrollBarX, "getWindowScrollBarX");
  function getHTMLOffset(documentElement, scroll) {
    const htmlRect = documentElement.getBoundingClientRect();
    const x2 = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
    const y2 = htmlRect.top + scroll.scrollTop;
    return {
      x: x2,
      y: y2
    };
  }
  __name(getHTMLOffset, "getHTMLOffset");
  function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
    let {
      elements,
      rect,
      offsetParent,
      strategy
    } = _ref;
    const isFixed = strategy === "fixed";
    const documentElement = getDocumentElement(offsetParent);
    const topLayer = elements ? isTopLayer(elements.floating) : false;
    if (offsetParent === documentElement || topLayer && isFixed) {
      return rect;
    }
    let scroll = {
      scrollLeft: 0,
      scrollTop: 0
    };
    let scale = createCoords(1);
    const offsets = createCoords(0);
    const isOffsetParentAnElement = isHTMLElement$1(offsetParent);
    if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
      if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
        scroll = getNodeScroll(offsetParent);
      }
      if (isHTMLElement$1(offsetParent)) {
        const offsetRect = getBoundingClientRect(offsetParent);
        scale = getScale(offsetParent);
        offsets.x = offsetRect.x + offsetParent.clientLeft;
        offsets.y = offsetRect.y + offsetParent.clientTop;
      }
    }
    const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
    return {
      width: rect.width * scale.x,
      height: rect.height * scale.y,
      x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
      y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
    };
  }
  __name(convertOffsetParentRelativeRectToViewportRelativeRect, "convertOffsetParentRelativeRectToViewportRelativeRect");
  function getClientRects(element) {
    return Array.from(element.getClientRects());
  }
  __name(getClientRects, "getClientRects");
  function getDocumentRect(element) {
    const html = getDocumentElement(element);
    const scroll = getNodeScroll(element);
    const body = element.ownerDocument.body;
    const width = max$2(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
    const height = max$2(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
    let x2 = -scroll.scrollLeft + getWindowScrollBarX(element);
    const y2 = -scroll.scrollTop;
    if (getComputedStyle$1(body).direction === "rtl") {
      x2 += max$2(html.clientWidth, body.clientWidth) - width;
    }
    return {
      width,
      height,
      x: x2,
      y: y2
    };
  }
  __name(getDocumentRect, "getDocumentRect");
  const SCROLLBAR_MAX = 25;
  function getViewportRect(element, strategy) {
    const win2 = getWindow(element);
    const html = getDocumentElement(element);
    const visualViewport = win2.visualViewport;
    let width = html.clientWidth;
    let height = html.clientHeight;
    let x2 = 0;
    let y2 = 0;
    if (visualViewport) {
      width = visualViewport.width;
      height = visualViewport.height;
      const visualViewportBased = isWebKit();
      if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
        x2 = visualViewport.offsetLeft;
        y2 = visualViewport.offsetTop;
      }
    }
    const windowScrollbarX = getWindowScrollBarX(html);
    if (windowScrollbarX <= 0) {
      const doc = html.ownerDocument;
      const body = doc.body;
      const bodyStyles = getComputedStyle(body);
      const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
      const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
      if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
        width -= clippingStableScrollbarWidth;
      }
    } else if (windowScrollbarX <= SCROLLBAR_MAX) {
      width += windowScrollbarX;
    }
    return {
      width,
      height,
      x: x2,
      y: y2
    };
  }
  __name(getViewportRect, "getViewportRect");
  const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
  function getInnerBoundingClientRect(element, strategy) {
    const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
    const top = clientRect.top + element.clientTop;
    const left = clientRect.left + element.clientLeft;
    const scale = isHTMLElement$1(element) ? getScale(element) : createCoords(1);
    const width = element.clientWidth * scale.x;
    const height = element.clientHeight * scale.y;
    const x2 = left * scale.x;
    const y2 = top * scale.y;
    return {
      width,
      height,
      x: x2,
      y: y2
    };
  }
  __name(getInnerBoundingClientRect, "getInnerBoundingClientRect");
  function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
    let rect;
    if (clippingAncestor === "viewport") {
      rect = getViewportRect(element, strategy);
    } else if (clippingAncestor === "document") {
      rect = getDocumentRect(getDocumentElement(element));
    } else if (isElement(clippingAncestor)) {
      rect = getInnerBoundingClientRect(clippingAncestor, strategy);
    } else {
      const visualOffsets = getVisualOffsets(element);
      rect = {
        x: clippingAncestor.x - visualOffsets.x,
        y: clippingAncestor.y - visualOffsets.y,
        width: clippingAncestor.width,
        height: clippingAncestor.height
      };
    }
    return rectToClientRect(rect);
  }
  __name(getClientRectFromClippingAncestor, "getClientRectFromClippingAncestor");
  function hasFixedPositionAncestor(element, stopNode) {
    const parentNode = getParentNode(element);
    if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
      return false;
    }
    return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
  }
  __name(hasFixedPositionAncestor, "hasFixedPositionAncestor");
  function getClippingElementAncestors(element, cache) {
    const cachedResult = cache.get(element);
    if (cachedResult) {
      return cachedResult;
    }
    let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
    let currentContainingBlockComputedStyle = null;
    const elementIsFixed = getComputedStyle$1(element).position === "fixed";
    let currentNode = elementIsFixed ? getParentNode(element) : element;
    while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
      const computedStyle = getComputedStyle$1(currentNode);
      const currentNodeIsContaining = isContainingBlock(currentNode);
      if (!currentNodeIsContaining && computedStyle.position === "fixed") {
        currentContainingBlockComputedStyle = null;
      }
      const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
      if (shouldDropCurrentNode) {
        result = result.filter((ancestor) => ancestor !== currentNode);
      } else {
        currentContainingBlockComputedStyle = computedStyle;
      }
      currentNode = getParentNode(currentNode);
    }
    cache.set(element, result);
    return result;
  }
  __name(getClippingElementAncestors, "getClippingElementAncestors");
  function getClippingRect(_ref) {
    let {
      element,
      boundary,
      rootBoundary,
      strategy
    } = _ref;
    const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
    const clippingAncestors = [...elementClippingAncestors, rootBoundary];
    const firstClippingAncestor = clippingAncestors[0];
    const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
      const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
      accRect.top = max$2(rect.top, accRect.top);
      accRect.right = min$2(rect.right, accRect.right);
      accRect.bottom = min$2(rect.bottom, accRect.bottom);
      accRect.left = max$2(rect.left, accRect.left);
      return accRect;
    }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
    return {
      width: clippingRect.right - clippingRect.left,
      height: clippingRect.bottom - clippingRect.top,
      x: clippingRect.left,
      y: clippingRect.top
    };
  }
  __name(getClippingRect, "getClippingRect");
  function getDimensions(element) {
    const {
      width,
      height
    } = getCssDimensions(element);
    return {
      width,
      height
    };
  }
  __name(getDimensions, "getDimensions");
  function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
    const isOffsetParentAnElement = isHTMLElement$1(offsetParent);
    const documentElement = getDocumentElement(offsetParent);
    const isFixed = strategy === "fixed";
    const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
    let scroll = {
      scrollLeft: 0,
      scrollTop: 0
    };
    const offsets = createCoords(0);
    function setLeftRTLScrollbarOffset() {
      offsets.x = getWindowScrollBarX(documentElement);
    }
    __name(setLeftRTLScrollbarOffset, "setLeftRTLScrollbarOffset");
    if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
      if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
        scroll = getNodeScroll(offsetParent);
      }
      if (isOffsetParentAnElement) {
        const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
        offsets.x = offsetRect.x + offsetParent.clientLeft;
        offsets.y = offsetRect.y + offsetParent.clientTop;
      } else if (documentElement) {
        setLeftRTLScrollbarOffset();
      }
    }
    if (isFixed && !isOffsetParentAnElement && documentElement) {
      setLeftRTLScrollbarOffset();
    }
    const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
    const x2 = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
    const y2 = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
    return {
      x: x2,
      y: y2,
      width: rect.width,
      height: rect.height
    };
  }
  __name(getRectRelativeToOffsetParent, "getRectRelativeToOffsetParent");
  function isStaticPositioned(element) {
    return getComputedStyle$1(element).position === "static";
  }
  __name(isStaticPositioned, "isStaticPositioned");
  function getTrueOffsetParent(element, polyfill) {
    if (!isHTMLElement$1(element) || getComputedStyle$1(element).position === "fixed") {
      return null;
    }
    if (polyfill) {
      return polyfill(element);
    }
    let rawOffsetParent = element.offsetParent;
    if (getDocumentElement(element) === rawOffsetParent) {
      rawOffsetParent = rawOffsetParent.ownerDocument.body;
    }
    return rawOffsetParent;
  }
  __name(getTrueOffsetParent, "getTrueOffsetParent");
  function getOffsetParent(element, polyfill) {
    const win2 = getWindow(element);
    if (isTopLayer(element)) {
      return win2;
    }
    if (!isHTMLElement$1(element)) {
      let svgOffsetParent = getParentNode(element);
      while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
        if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
          return svgOffsetParent;
        }
        svgOffsetParent = getParentNode(svgOffsetParent);
      }
      return win2;
    }
    let offsetParent = getTrueOffsetParent(element, polyfill);
    while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
      offsetParent = getTrueOffsetParent(offsetParent, polyfill);
    }
    if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
      return win2;
    }
    return offsetParent || getContainingBlock(element) || win2;
  }
  __name(getOffsetParent, "getOffsetParent");
  const getElementRects = /* @__PURE__ */ __name(function(data) {
    return __async(this, null, function* () {
      const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
      const getDimensionsFn = this.getDimensions;
      const floatingDimensions = yield getDimensionsFn(data.floating);
      return {
        reference: getRectRelativeToOffsetParent(data.reference, yield getOffsetParentFn(data.floating), data.strategy),
        floating: {
          x: 0,
          y: 0,
          width: floatingDimensions.width,
          height: floatingDimensions.height
        }
      };
    });
  }, "getElementRects");
  function isRTL(element) {
    return getComputedStyle$1(element).direction === "rtl";
  }
  __name(isRTL, "isRTL");
  const platform = {
    convertOffsetParentRelativeRectToViewportRelativeRect,
    getDocumentElement,
    getClippingRect,
    getOffsetParent,
    getElementRects,
    getClientRects,
    getDimensions,
    getScale,
    isElement,
    isRTL
  };
  function rectsAreEqual(a2, b) {
    return a2.x === b.x && a2.y === b.y && a2.width === b.width && a2.height === b.height;
  }
  __name(rectsAreEqual, "rectsAreEqual");
  function observeMove(element, onMove) {
    let io = null;
    let timeoutId;
    const root2 = getDocumentElement(element);
    function cleanup() {
      var _io;
      clearTimeout(timeoutId);
      (_io = io) == null || _io.disconnect();
      io = null;
    }
    __name(cleanup, "cleanup");
    function refresh(skip, threshold2) {
      if (skip === void 0) {
        skip = false;
      }
      if (threshold2 === void 0) {
        threshold2 = 1;
      }
      cleanup();
      const elementRectForRootMargin = element.getBoundingClientRect();
      const {
        left,
        top,
        width,
        height
      } = elementRectForRootMargin;
      if (!skip) {
        onMove();
      }
      if (!width || !height) {
        return;
      }
      const insetTop = floor(top);
      const insetRight = floor(root2.clientWidth - (left + width));
      const insetBottom = floor(root2.clientHeight - (top + height));
      const insetLeft = floor(left);
      const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
      const options2 = {
        rootMargin,
        threshold: max$2(0, min$2(1, threshold2)) || 1
      };
      let isFirstUpdate = true;
      function handleObserve(entries) {
        const ratio = entries[0].intersectionRatio;
        if (ratio !== threshold2) {
          if (!isFirstUpdate) {
            return refresh();
          }
          if (!ratio) {
            timeoutId = setTimeout(() => {
              refresh(false, 1e-7);
            }, 1e3);
          } else {
            refresh(false, ratio);
          }
        }
        if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
          refresh();
        }
        isFirstUpdate = false;
      }
      __name(handleObserve, "handleObserve");
      try {
        io = new IntersectionObserver(handleObserve, __spreadProps(__spreadValues({}, options2), {
          // Handle <iframe>s
          root: root2.ownerDocument
        }));
      } catch (_e2) {
        io = new IntersectionObserver(handleObserve, options2);
      }
      io.observe(element);
    }
    __name(refresh, "refresh");
    refresh(true);
    return cleanup;
  }
  __name(observeMove, "observeMove");
  function autoUpdate(reference, floating, update, options2) {
    if (options2 === void 0) {
      options2 = {};
    }
    const {
      ancestorScroll = true,
      ancestorResize = true,
      elementResize = typeof ResizeObserver === "function",
      layoutShift = typeof IntersectionObserver === "function",
      animationFrame = false
    } = options2;
    const referenceEl = unwrapElement(reference);
    const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
    ancestors.forEach((ancestor) => {
      ancestorScroll && ancestor.addEventListener("scroll", update, {
        passive: true
      });
      ancestorResize && ancestor.addEventListener("resize", update);
    });
    const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
    let reobserveFrame = -1;
    let resizeObserver = null;
    if (elementResize) {
      resizeObserver = new ResizeObserver((_ref) => {
        let [firstEntry] = _ref;
        if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
          resizeObserver.unobserve(floating);
          cancelAnimationFrame(reobserveFrame);
          reobserveFrame = requestAnimationFrame(() => {
            var _resizeObserver;
            (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
          });
        }
        update();
      });
      if (referenceEl && !animationFrame) {
        resizeObserver.observe(referenceEl);
      }
      resizeObserver.observe(floating);
    }
    let frameId;
    let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
    if (animationFrame) {
      frameLoop();
    }
    function frameLoop() {
      const nextRefRect = getBoundingClientRect(reference);
      if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
        update();
      }
      prevRefRect = nextRefRect;
      frameId = requestAnimationFrame(frameLoop);
    }
    __name(frameLoop, "frameLoop");
    update();
    return () => {
      var _resizeObserver2;
      ancestors.forEach((ancestor) => {
        ancestorScroll && ancestor.removeEventListener("scroll", update);
        ancestorResize && ancestor.removeEventListener("resize", update);
      });
      cleanupIo == null || cleanupIo();
      (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
      resizeObserver = null;
      if (animationFrame) {
        cancelAnimationFrame(frameId);
      }
    };
  }
  __name(autoUpdate, "autoUpdate");
  const offset$1 = offset$2;
  const shift$1 = shift$2;
  const flip$1 = flip$2;
  const size$1 = size$2;
  const hide$1 = hide$2;
  const arrow$2 = arrow$3;
  const limitShift$1 = limitShift$2;
  const computePosition = /* @__PURE__ */ __name((reference, floating, options2) => {
    const cache = /* @__PURE__ */ new Map();
    const mergedOptions = __spreadValues({
      platform
    }, options2);
    const platformWithCache = __spreadProps(__spreadValues({}, mergedOptions.platform), {
      _c: cache
    });
    return computePosition$1(reference, floating, __spreadProps(__spreadValues({}, mergedOptions), {
      platform: platformWithCache
    }));
  }, "computePosition");
  var isClient = typeof document !== "undefined";
  var noop$1 = /* @__PURE__ */ __name(function noop2() {
  }, "noop");
  var index = isClient ? reactExports.useLayoutEffect : noop$1;
  function deepEqual$2(a2, b) {
    if (a2 === b) {
      return true;
    }
    if (typeof a2 !== typeof b) {
      return false;
    }
    if (typeof a2 === "function" && a2.toString() === b.toString()) {
      return true;
    }
    let length;
    let i2;
    let keys2;
    if (a2 && b && typeof a2 === "object") {
      if (Array.isArray(a2)) {
        length = a2.length;
        if (length !== b.length) return false;
        for (i2 = length; i2-- !== 0; ) {
          if (!deepEqual$2(a2[i2], b[i2])) {
            return false;
          }
        }
        return true;
      }
      keys2 = Object.keys(a2);
      length = keys2.length;
      if (length !== Object.keys(b).length) {
        return false;
      }
      for (i2 = length; i2-- !== 0; ) {
        if (!{}.hasOwnProperty.call(b, keys2[i2])) {
          return false;
        }
      }
      for (i2 = length; i2-- !== 0; ) {
        const key = keys2[i2];
        if (key === "_owner" && a2.$$typeof) {
          continue;
        }
        if (!deepEqual$2(a2[key], b[key])) {
          return false;
        }
      }
      return true;
    }
    return a2 !== a2 && b !== b;
  }
  __name(deepEqual$2, "deepEqual$2");
  function getDPR(element) {
    if (typeof window === "undefined") {
      return 1;
    }
    const win2 = element.ownerDocument.defaultView || window;
    return win2.devicePixelRatio || 1;
  }
  __name(getDPR, "getDPR");
  function roundByDPR(element, value) {
    const dpr = getDPR(element);
    return Math.round(value * dpr) / dpr;
  }
  __name(roundByDPR, "roundByDPR");
  function useLatestRef(value) {
    const ref = reactExports.useRef(value);
    index(() => {
      ref.current = value;
    });
    return ref;
  }
  __name(useLatestRef, "useLatestRef");
  function useFloating(options2) {
    if (options2 === void 0) {
      options2 = {};
    }
    const {
      placement = "bottom",
      strategy = "absolute",
      middleware = [],
      platform: platform2,
      elements: {
        reference: externalReference,
        floating: externalFloating
      } = {},
      transform = true,
      whileElementsMounted,
      open
    } = options2;
    const [data, setData] = reactExports.useState({
      x: 0,
      y: 0,
      strategy,
      placement,
      middlewareData: {},
      isPositioned: false
    });
    const [latestMiddleware, setLatestMiddleware] = reactExports.useState(middleware);
    if (!deepEqual$2(latestMiddleware, middleware)) {
      setLatestMiddleware(middleware);
    }
    const [_reference, _setReference] = reactExports.useState(null);
    const [_floating, _setFloating] = reactExports.useState(null);
    const setReference = reactExports.useCallback((node) => {
      if (node !== referenceRef.current) {
        referenceRef.current = node;
        _setReference(node);
      }
    }, []);
    const setFloating = reactExports.useCallback((node) => {
      if (node !== floatingRef.current) {
        floatingRef.current = node;
        _setFloating(node);
      }
    }, []);
    const referenceEl = externalReference || _reference;
    const floatingEl = externalFloating || _floating;
    const referenceRef = reactExports.useRef(null);
    const floatingRef = reactExports.useRef(null);
    const dataRef = reactExports.useRef(data);
    const hasWhileElementsMounted = whileElementsMounted != null;
    const whileElementsMountedRef = useLatestRef(whileElementsMounted);
    const platformRef = useLatestRef(platform2);
    const openRef = useLatestRef(open);
    const update = reactExports.useCallback(() => {
      if (!referenceRef.current || !floatingRef.current) {
        return;
      }
      const config2 = {
        placement,
        strategy,
        middleware: latestMiddleware
      };
      if (platformRef.current) {
        config2.platform = platformRef.current;
      }
      computePosition(referenceRef.current, floatingRef.current, config2).then((data2) => {
        const fullData = __spreadProps(__spreadValues({}, data2), {
          // The floating element's position may be recomputed while it's closed
          // but still mounted (such as when transitioning out). To ensure
          // `isPositioned` will be `false` initially on the next open, avoid
          // setting it to `true` when `open === false` (must be specified).
          isPositioned: openRef.current !== false
        });
        if (isMountedRef.current && !deepEqual$2(dataRef.current, fullData)) {
          dataRef.current = fullData;
          reactDomExports.flushSync(() => {
            setData(fullData);
          });
        }
      });
    }, [latestMiddleware, placement, strategy, platformRef, openRef]);
    index(() => {
      if (open === false && dataRef.current.isPositioned) {
        dataRef.current.isPositioned = false;
        setData((data2) => __spreadProps(__spreadValues({}, data2), {
          isPositioned: false
        }));
      }
    }, [open]);
    const isMountedRef = reactExports.useRef(false);
    index(() => {
      isMountedRef.current = true;
      return () => {
        isMountedRef.current = false;
      };
    }, []);
    index(() => {
      if (referenceEl) referenceRef.current = referenceEl;
      if (floatingEl) floatingRef.current = floatingEl;
      if (referenceEl && floatingEl) {
        if (whileElementsMountedRef.current) {
          return whileElementsMountedRef.current(referenceEl, floatingEl, update);
        }
        update();
      }
    }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
    const refs = reactExports.useMemo(() => ({
      reference: referenceRef,
      floating: floatingRef,
      setReference,
      setFloating
    }), [setReference, setFloating]);
    const elements = reactExports.useMemo(() => ({
      reference: referenceEl,
      floating: floatingEl
    }), [referenceEl, floatingEl]);
    const floatingStyles = reactExports.useMemo(() => {
      const initialStyles = {
        position: strategy,
        left: 0,
        top: 0
      };
      if (!elements.floating) {
        return initialStyles;
      }
      const x2 = roundByDPR(elements.floating, data.x);
      const y2 = roundByDPR(elements.floating, data.y);
      if (transform) {
        return __spreadValues(__spreadProps(__spreadValues({}, initialStyles), {
          transform: "translate(" + x2 + "px, " + y2 + "px)"
        }), getDPR(elements.floating) >= 1.5 && {
          willChange: "transform"
        });
      }
      return {
        position: strategy,
        left: x2,
        top: y2
      };
    }, [strategy, transform, elements.floating, data.x, data.y]);
    return reactExports.useMemo(() => __spreadProps(__spreadValues({}, data), {
      update,
      refs,
      elements,
      floatingStyles
    }), [data, update, refs, elements, floatingStyles]);
  }
  __name(useFloating, "useFloating");
  const arrow$1 = /* @__PURE__ */ __name((options2) => {
    function isRef(value) {
      return {}.hasOwnProperty.call(value, "current");
    }
    __name(isRef, "isRef");
    return {
      name: "arrow",
      options: options2,
      fn(state) {
        const {
          element,
          padding
        } = typeof options2 === "function" ? options2(state) : options2;
        if (element && isRef(element)) {
          if (element.current != null) {
            return arrow$2({
              element: element.current,
              padding
            }).fn(state);
          }
          return {};
        }
        if (element) {
          return arrow$2({
            element,
            padding
          }).fn(state);
        }
        return {};
      }
    };
  }, "arrow$1");
  const offset = /* @__PURE__ */ __name((options2, deps) => __spreadProps(__spreadValues({}, offset$1(options2)), {
    options: [options2, deps]
  }), "offset");
  const shift = /* @__PURE__ */ __name((options2, deps) => __spreadProps(__spreadValues({}, shift$1(options2)), {
    options: [options2, deps]
  }), "shift");
  const limitShift = /* @__PURE__ */ __name((options2, deps) => __spreadProps(__spreadValues({}, limitShift$1(options2)), {
    options: [options2, deps]
  }), "limitShift");
  const flip = /* @__PURE__ */ __name((options2, deps) => __spreadProps(__spreadValues({}, flip$1(options2)), {
    options: [options2, deps]
  }), "flip");
  const size = /* @__PURE__ */ __name((options2, deps) => __spreadProps(__spreadValues({}, size$1(options2)), {
    options: [options2, deps]
  }), "size");
  const hide = /* @__PURE__ */ __name((options2, deps) => __spreadProps(__spreadValues({}, hide$1(options2)), {
    options: [options2, deps]
  }), "hide");
  const arrow = /* @__PURE__ */ __name((options2, deps) => __spreadProps(__spreadValues({}, arrow$1(options2)), {
    options: [options2, deps]
  }), "arrow");
  var NAME$2 = "Arrow";
  var Arrow$1 = reactExports.forwardRef((props, forwardedRef) => {
    const _a2 = props, { children, width = 10, height = 5 } = _a2, arrowProps = __objRest(_a2, ["children", "width", "height"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Primitive$1.svg,
      __spreadProps(__spreadValues({}, arrowProps), {
        ref: forwardedRef,
        width,
        height,
        viewBox: "0 0 30 10",
        preserveAspectRatio: "none",
        children: props.asChild ? children : /* @__PURE__ */ jsxRuntimeExports.jsx("polygon", { points: "0,0 30,0 15,10" })
      })
    );
  });
  Arrow$1.displayName = NAME$2;
  var Root$6 = Arrow$1;
  function useSize(element) {
    const [size2, setSize] = reactExports.useState(void 0);
    useLayoutEffect2(() => {
      if (element) {
        setSize({ width: element.offsetWidth, height: element.offsetHeight });
        const resizeObserver = new ResizeObserver((entries) => {
          if (!Array.isArray(entries)) {
            return;
          }
          if (!entries.length) {
            return;
          }
          const entry = entries[0];
          let width;
          let height;
          if ("borderBoxSize" in entry) {
            const borderSizeEntry = entry["borderBoxSize"];
            const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
            width = borderSize["inlineSize"];
            height = borderSize["blockSize"];
          } else {
            width = element.offsetWidth;
            height = element.offsetHeight;
          }
          setSize({ width, height });
        });
        resizeObserver.observe(element, { box: "border-box" });
        return () => resizeObserver.unobserve(element);
      } else {
        setSize(void 0);
      }
    }, [element]);
    return size2;
  }
  __name(useSize, "useSize");
  var POPPER_NAME = "Popper";
  var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
  var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
  var Popper = /* @__PURE__ */ __name((props) => {
    const { __scopePopper, children } = props;
    const [anchor, setAnchor] = reactExports.useState(null);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
  }, "Popper");
  Popper.displayName = POPPER_NAME;
  var ANCHOR_NAME$1 = "PopperAnchor";
  var PopperAnchor = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopePopper, virtualRef } = _a2, anchorProps = __objRest(_a2, ["__scopePopper", "virtualRef"]);
      const context = usePopperContext(ANCHOR_NAME$1, __scopePopper);
      const ref = reactExports.useRef(null);
      const composedRefs = useComposedRefs(forwardedRef, ref);
      const anchorRef = reactExports.useRef(null);
      reactExports.useEffect(() => {
        const previousAnchor = anchorRef.current;
        anchorRef.current = (virtualRef == null ? void 0 : virtualRef.current) || ref.current;
        if (previousAnchor !== anchorRef.current) {
          context.onAnchorChange(anchorRef.current);
        }
      });
      return virtualRef ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, __spreadProps(__spreadValues({}, anchorProps), { ref: composedRefs }));
    }
  );
  PopperAnchor.displayName = ANCHOR_NAME$1;
  var CONTENT_NAME$8 = "PopperContent";
  var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$8);
  var PopperContent = reactExports.forwardRef(
    (props, forwardedRef) => {
      var _b2, _c2, _d, _e2, _f, _g, _h, _i;
      const _a2 = props, {
        __scopePopper,
        side = "bottom",
        sideOffset = 0,
        align = "center",
        alignOffset = 0,
        arrowPadding = 0,
        avoidCollisions = true,
        collisionBoundary = [],
        collisionPadding: collisionPaddingProp = 0,
        sticky = "partial",
        hideWhenDetached = false,
        updatePositionStrategy = "optimized",
        onPlaced
      } = _a2, contentProps = __objRest(_a2, [
        "__scopePopper",
        "side",
        "sideOffset",
        "align",
        "alignOffset",
        "arrowPadding",
        "avoidCollisions",
        "collisionBoundary",
        "collisionPadding",
        "sticky",
        "hideWhenDetached",
        "updatePositionStrategy",
        "onPlaced"
      ]);
      const context = usePopperContext(CONTENT_NAME$8, __scopePopper);
      const [content, setContent] = reactExports.useState(null);
      const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
      const [arrow$12, setArrow] = reactExports.useState(null);
      const arrowSize = useSize(arrow$12);
      const arrowWidth = (_b2 = arrowSize == null ? void 0 : arrowSize.width) != null ? _b2 : 0;
      const arrowHeight = (_c2 = arrowSize == null ? void 0 : arrowSize.height) != null ? _c2 : 0;
      const desiredPlacement = side + (align !== "center" ? "-" + align : "");
      const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : __spreadValues({ top: 0, right: 0, bottom: 0, left: 0 }, collisionPaddingProp);
      const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
      const hasExplicitBoundaries = boundary.length > 0;
      const detectOverflowOptions = {
        padding: collisionPadding,
        boundary: boundary.filter(isNotNull),
        // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
        altBoundary: hasExplicitBoundaries
      };
      const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
        // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
        strategy: "fixed",
        placement: desiredPlacement,
        whileElementsMounted: /* @__PURE__ */ __name((...args) => {
          const cleanup = autoUpdate(...args, {
            animationFrame: updatePositionStrategy === "always"
          });
          return cleanup;
        }, "whileElementsMounted"),
        elements: {
          reference: context.anchor
        },
        middleware: [
          offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
          avoidCollisions && shift(__spreadValues({
            mainAxis: true,
            crossAxis: false,
            limiter: sticky === "partial" ? limitShift() : void 0
          }, detectOverflowOptions)),
          avoidCollisions && flip(__spreadValues({}, detectOverflowOptions)),
          size(__spreadProps(__spreadValues({}, detectOverflowOptions), {
            apply: /* @__PURE__ */ __name(({ elements, rects, availableWidth, availableHeight }) => {
              const { width: anchorWidth, height: anchorHeight } = rects.reference;
              const contentStyle = elements.floating.style;
              contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
              contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
              contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
              contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
            }, "apply")
          })),
          arrow$12 && arrow({ element: arrow$12, padding: arrowPadding }),
          transformOrigin({ arrowWidth, arrowHeight }),
          hideWhenDetached && hide(__spreadValues({ strategy: "referenceHidden" }, detectOverflowOptions))
        ]
      });
      const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
      const handlePlaced = useCallbackRef$1(onPlaced);
      useLayoutEffect2(() => {
        if (isPositioned) {
          handlePlaced == null ? void 0 : handlePlaced();
        }
      }, [isPositioned, handlePlaced]);
      const arrowX = (_d = middlewareData.arrow) == null ? void 0 : _d.x;
      const arrowY = (_e2 = middlewareData.arrow) == null ? void 0 : _e2.y;
      const cannotCenterArrow = ((_f = middlewareData.arrow) == null ? void 0 : _f.centerOffset) !== 0;
      const [contentZIndex, setContentZIndex] = reactExports.useState();
      useLayoutEffect2(() => {
        if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
      }, [content]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          ref: refs.setFloating,
          "data-radix-popper-content-wrapper": "",
          style: __spreadValues(__spreadProps(__spreadValues({}, floatingStyles), {
            transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
            // keep off the page when measuring
            minWidth: "max-content",
            zIndex: contentZIndex,
            ["--radix-popper-transform-origin"]: [
              (_g = middlewareData.transformOrigin) == null ? void 0 : _g.x,
              (_h = middlewareData.transformOrigin) == null ? void 0 : _h.y
            ].join(" ")
          }), ((_i = middlewareData.hide) == null ? void 0 : _i.referenceHidden) && {
            visibility: "hidden",
            pointerEvents: "none"
          }),
          dir: props.dir,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            PopperContentProvider,
            {
              scope: __scopePopper,
              placedSide,
              onArrowChange: setArrow,
              arrowX,
              arrowY,
              shouldHideArrow: cannotCenterArrow,
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                Primitive$1.div,
                __spreadProps(__spreadValues({
                  "data-side": placedSide,
                  "data-align": placedAlign
                }, contentProps), {
                  ref: composedRefs,
                  style: __spreadProps(__spreadValues({}, contentProps.style), {
                    // if the PopperContent hasn't been placed yet (not all measurements done)
                    // we prevent animations so that users's animation don't kick in too early referring wrong sides
                    animation: !isPositioned ? "none" : void 0
                  })
                })
              )
            }
          )
        }
      );
    }
  );
  PopperContent.displayName = CONTENT_NAME$8;
  var ARROW_NAME$4 = "PopperArrow";
  var OPPOSITE_SIDE = {
    top: "bottom",
    right: "left",
    bottom: "top",
    left: "right"
  };
  var PopperArrow = reactExports.forwardRef(/* @__PURE__ */ __name(function PopperArrow2(props, forwardedRef) {
    const _a2 = props, { __scopePopper } = _a2, arrowProps = __objRest(_a2, ["__scopePopper"]);
    const contentContext = useContentContext(ARROW_NAME$4, __scopePopper);
    const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
    return (
      // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
      // doesn't report size as we'd expect on SVG elements.
      // it reports their bounding box which is effectively the largest path inside the SVG.
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "span",
        {
          ref: contentContext.onArrowChange,
          style: {
            position: "absolute",
            left: contentContext.arrowX,
            top: contentContext.arrowY,
            [baseSide]: 0,
            transformOrigin: {
              top: "",
              right: "0 0",
              bottom: "center 0",
              left: "100% 0"
            }[contentContext.placedSide],
            transform: {
              top: "translateY(100%)",
              right: "translateY(50%) rotate(90deg) translateX(-50%)",
              bottom: `rotate(180deg)`,
              left: "translateY(50%) rotate(-90deg) translateX(50%)"
            }[contentContext.placedSide],
            visibility: contentContext.shouldHideArrow ? "hidden" : void 0
          },
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Root$6,
            __spreadProps(__spreadValues({}, arrowProps), {
              ref: forwardedRef,
              style: __spreadProps(__spreadValues({}, arrowProps.style), {
                // ensures the element can be measured correctly (mostly for if SVG)
                display: "block"
              })
            })
          )
        }
      )
    );
  }, "PopperArrow2"));
  PopperArrow.displayName = ARROW_NAME$4;
  function isNotNull(value) {
    return value !== null;
  }
  __name(isNotNull, "isNotNull");
  var transformOrigin = /* @__PURE__ */ __name((options2) => ({
    name: "transformOrigin",
    options: options2,
    fn(data) {
      var _a2, _b2, _c2, _d, _e2;
      const { placement, rects, middlewareData } = data;
      const cannotCenterArrow = ((_a2 = middlewareData.arrow) == null ? void 0 : _a2.centerOffset) !== 0;
      const isArrowHidden = cannotCenterArrow;
      const arrowWidth = isArrowHidden ? 0 : options2.arrowWidth;
      const arrowHeight = isArrowHidden ? 0 : options2.arrowHeight;
      const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
      const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
      const arrowXCenter = ((_c2 = (_b2 = middlewareData.arrow) == null ? void 0 : _b2.x) != null ? _c2 : 0) + arrowWidth / 2;
      const arrowYCenter = ((_e2 = (_d = middlewareData.arrow) == null ? void 0 : _d.y) != null ? _e2 : 0) + arrowHeight / 2;
      let x2 = "";
      let y2 = "";
      if (placedSide === "bottom") {
        x2 = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
        y2 = `${-arrowHeight}px`;
      } else if (placedSide === "top") {
        x2 = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
        y2 = `${rects.floating.height + arrowHeight}px`;
      } else if (placedSide === "right") {
        x2 = `${-arrowHeight}px`;
        y2 = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
      } else if (placedSide === "left") {
        x2 = `${rects.floating.width + arrowHeight}px`;
        y2 = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
      }
      return { data: { x: x2, y: y2 } };
    }
  }), "transformOrigin");
  function getSideAndAlignFromPlacement(placement) {
    const [side, align = "center"] = placement.split("-");
    return [side, align];
  }
  __name(getSideAndAlignFromPlacement, "getSideAndAlignFromPlacement");
  var Root2$5 = Popper;
  var Anchor = PopperAnchor;
  var Content$3 = PopperContent;
  var Arrow = PopperArrow;
  var PORTAL_NAME$5 = "Portal";
  var Portal$3 = reactExports.forwardRef((props, forwardedRef) => {
    var _b2;
    const _a2 = props, { container: containerProp } = _a2, portalProps = __objRest(_a2, ["container"]);
    const [mounted, setMounted] = reactExports.useState(false);
    useLayoutEffect2(() => setMounted(true), []);
    const container = containerProp || mounted && ((_b2 = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _b2.body);
    return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, __spreadProps(__spreadValues({}, portalProps), { ref: forwardedRef })), container) : null;
  });
  Portal$3.displayName = PORTAL_NAME$5;
  function useStateMachine(initialState, machine) {
    return reactExports.useReducer((state, event) => {
      const nextState = machine[state][event];
      return nextState != null ? nextState : state;
    }, initialState);
  }
  __name(useStateMachine, "useStateMachine");
  var Presence = /* @__PURE__ */ __name((props) => {
    const { present, children } = props;
    const presence = usePresence(present);
    const child = typeof children === "function" ? children({ present: presence.isPresent }) : reactExports.Children.only(children);
    const ref = useComposedRefs(presence.ref, getElementRef$4(child));
    const forceMount = typeof children === "function";
    return forceMount || presence.isPresent ? reactExports.cloneElement(child, { ref }) : null;
  }, "Presence");
  Presence.displayName = "Presence";
  function usePresence(present) {
    const [node, setNode] = reactExports.useState();
    const stylesRef = reactExports.useRef(null);
    const prevPresentRef = reactExports.useRef(present);
    const prevAnimationNameRef = reactExports.useRef("none");
    const initialState = present ? "mounted" : "unmounted";
    const [state, send] = useStateMachine(initialState, {
      mounted: {
        UNMOUNT: "unmounted",
        ANIMATION_OUT: "unmountSuspended"
      },
      unmountSuspended: {
        MOUNT: "mounted",
        ANIMATION_END: "unmounted"
      },
      unmounted: {
        MOUNT: "mounted"
      }
    });
    reactExports.useEffect(() => {
      const currentAnimationName = getAnimationName(stylesRef.current);
      prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
    }, [state]);
    useLayoutEffect2(() => {
      const styles = stylesRef.current;
      const wasPresent = prevPresentRef.current;
      const hasPresentChanged = wasPresent !== present;
      if (hasPresentChanged) {
        const prevAnimationName = prevAnimationNameRef.current;
        const currentAnimationName = getAnimationName(styles);
        if (present) {
          send("MOUNT");
        } else if (currentAnimationName === "none" || (styles == null ? void 0 : styles.display) === "none") {
          send("UNMOUNT");
        } else {
          const isAnimating = prevAnimationName !== currentAnimationName;
          if (wasPresent && isAnimating) {
            send("ANIMATION_OUT");
          } else {
            send("UNMOUNT");
          }
        }
        prevPresentRef.current = present;
      }
    }, [present, send]);
    useLayoutEffect2(() => {
      var _a2;
      if (node) {
        let timeoutId;
        const ownerWindow = (_a2 = node.ownerDocument.defaultView) != null ? _a2 : window;
        const handleAnimationEnd = /* @__PURE__ */ __name((event) => {
          const currentAnimationName = getAnimationName(stylesRef.current);
          const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
          if (event.target === node && isCurrentAnimation) {
            send("ANIMATION_END");
            if (!prevPresentRef.current) {
              const currentFillMode = node.style.animationFillMode;
              node.style.animationFillMode = "forwards";
              timeoutId = ownerWindow.setTimeout(() => {
                if (node.style.animationFillMode === "forwards") {
                  node.style.animationFillMode = currentFillMode;
                }
              });
            }
          }
        }, "handleAnimationEnd");
        const handleAnimationStart = /* @__PURE__ */ __name((event) => {
          if (event.target === node) {
            prevAnimationNameRef.current = getAnimationName(stylesRef.current);
          }
        }, "handleAnimationStart");
        node.addEventListener("animationstart", handleAnimationStart);
        node.addEventListener("animationcancel", handleAnimationEnd);
        node.addEventListener("animationend", handleAnimationEnd);
        return () => {
          ownerWindow.clearTimeout(timeoutId);
          node.removeEventListener("animationstart", handleAnimationStart);
          node.removeEventListener("animationcancel", handleAnimationEnd);
          node.removeEventListener("animationend", handleAnimationEnd);
        };
      } else {
        send("ANIMATION_END");
      }
    }, [node, send]);
    return {
      isPresent: ["mounted", "unmountSuspended"].includes(state),
      ref: reactExports.useCallback((node2) => {
        stylesRef.current = node2 ? getComputedStyle(node2) : null;
        setNode(node2);
      }, [])
    };
  }
  __name(usePresence, "usePresence");
  function getAnimationName(styles) {
    return (styles == null ? void 0 : styles.animationName) || "none";
  }
  __name(getAnimationName, "getAnimationName");
  function getElementRef$4(element) {
    var _a2, _b2;
    let getter = (_a2 = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a2.get;
    let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
    if (mayWarn) {
      return element.ref;
    }
    getter = (_b2 = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b2.get;
    mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
    if (mayWarn) {
      return element.props.ref;
    }
    return element.props.ref || element.ref;
  }
  __name(getElementRef$4, "getElementRef$4");
  var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
  var EVENT_OPTIONS = { bubbles: false, cancelable: true };
  var GROUP_NAME$3 = "RovingFocusGroup";
  var [Collection$3, useCollection$3, createCollectionScope$3] = createCollection(GROUP_NAME$3);
  var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
    GROUP_NAME$3,
    [createCollectionScope$3]
  );
  var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME$3);
  var RovingFocusGroup = reactExports.forwardRef(
    (props, forwardedRef) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Collection$3.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Collection$3.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntimeExports.jsx(RovingFocusGroupImpl, __spreadProps(__spreadValues({}, props), { ref: forwardedRef })) }) });
    }
  );
  RovingFocusGroup.displayName = GROUP_NAME$3;
  var RovingFocusGroupImpl = reactExports.forwardRef((props, forwardedRef) => {
    const _a2 = props, {
      __scopeRovingFocusGroup,
      orientation,
      loop = false,
      dir,
      currentTabStopId: currentTabStopIdProp,
      defaultCurrentTabStopId,
      onCurrentTabStopIdChange,
      onEntryFocus,
      preventScrollOnEntryFocus = false
    } = _a2, groupProps = __objRest(_a2, [
      "__scopeRovingFocusGroup",
      "orientation",
      "loop",
      "dir",
      "currentTabStopId",
      "defaultCurrentTabStopId",
      "onCurrentTabStopIdChange",
      "onEntryFocus",
      "preventScrollOnEntryFocus"
    ]);
    const ref = reactExports.useRef(null);
    const composedRefs = useComposedRefs(forwardedRef, ref);
    const direction = useDirection(dir);
    const [currentTabStopId, setCurrentTabStopId] = useControllableState({
      prop: currentTabStopIdProp,
      defaultProp: defaultCurrentTabStopId != null ? defaultCurrentTabStopId : null,
      onChange: onCurrentTabStopIdChange,
      caller: GROUP_NAME$3
    });
    const [isTabbingBackOut, setIsTabbingBackOut] = reactExports.useState(false);
    const handleEntryFocus = useCallbackRef$1(onEntryFocus);
    const getItems = useCollection$3(__scopeRovingFocusGroup);
    const isClickFocusRef = reactExports.useRef(false);
    const [focusableItemsCount, setFocusableItemsCount] = reactExports.useState(0);
    reactExports.useEffect(() => {
      const node = ref.current;
      if (node) {
        node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
        return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
      }
    }, [handleEntryFocus]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      RovingFocusProvider,
      {
        scope: __scopeRovingFocusGroup,
        orientation,
        dir: direction,
        loop,
        currentTabStopId,
        onItemFocus: reactExports.useCallback(
          (tabStopId) => setCurrentTabStopId(tabStopId),
          [setCurrentTabStopId]
        ),
        onItemShiftTab: reactExports.useCallback(() => setIsTabbingBackOut(true), []),
        onFocusableItemAdd: reactExports.useCallback(
          () => setFocusableItemsCount((prevCount) => prevCount + 1),
          []
        ),
        onFocusableItemRemove: reactExports.useCallback(
          () => setFocusableItemsCount((prevCount) => prevCount - 1),
          []
        ),
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Primitive$1.div,
          __spreadProps(__spreadValues({
            tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
            "data-orientation": orientation
          }, groupProps), {
            ref: composedRefs,
            style: __spreadValues({ outline: "none" }, props.style),
            onMouseDown: composeEventHandlers(props.onMouseDown, () => {
              isClickFocusRef.current = true;
            }),
            onFocus: composeEventHandlers(props.onFocus, (event) => {
              const isKeyboardFocus = !isClickFocusRef.current;
              if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
                const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
                event.currentTarget.dispatchEvent(entryFocusEvent);
                if (!entryFocusEvent.defaultPrevented) {
                  const items = getItems().filter((item) => item.focusable);
                  const activeItem = items.find((item) => item.active);
                  const currentItem = items.find((item) => item.id === currentTabStopId);
                  const candidateItems = [activeItem, currentItem, ...items].filter(
                    Boolean
                  );
                  const candidateNodes = candidateItems.map((item) => item.ref.current);
                  focusFirst$1(candidateNodes, preventScrollOnEntryFocus);
                }
              }
              isClickFocusRef.current = false;
            }),
            onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
          })
        )
      }
    );
  });
  var ITEM_NAME$5 = "RovingFocusGroupItem";
  var RovingFocusGroupItem = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, {
        __scopeRovingFocusGroup,
        focusable = true,
        active = false,
        tabStopId,
        children
      } = _a2, itemProps = __objRest(_a2, [
        "__scopeRovingFocusGroup",
        "focusable",
        "active",
        "tabStopId",
        "children"
      ]);
      const autoId = useId();
      const id = tabStopId || autoId;
      const context = useRovingFocusContext(ITEM_NAME$5, __scopeRovingFocusGroup);
      const isCurrentTabStop = context.currentTabStopId === id;
      const getItems = useCollection$3(__scopeRovingFocusGroup);
      const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
      reactExports.useEffect(() => {
        if (focusable) {
          onFocusableItemAdd();
          return () => onFocusableItemRemove();
        }
      }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Collection$3.ItemSlot,
        {
          scope: __scopeRovingFocusGroup,
          id,
          focusable,
          active,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Primitive$1.span,
            __spreadProps(__spreadValues({
              tabIndex: isCurrentTabStop ? 0 : -1,
              "data-orientation": context.orientation
            }, itemProps), {
              ref: forwardedRef,
              onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
                if (!focusable) event.preventDefault();
                else context.onItemFocus(id);
              }),
              onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
              onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
                if (event.key === "Tab" && event.shiftKey) {
                  context.onItemShiftTab();
                  return;
                }
                if (event.target !== event.currentTarget) return;
                const focusIntent = getFocusIntent(event, context.orientation, context.dir);
                if (focusIntent !== void 0) {
                  if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
                  event.preventDefault();
                  const items = getItems().filter((item) => item.focusable);
                  let candidateNodes = items.map((item) => item.ref.current);
                  if (focusIntent === "last") candidateNodes.reverse();
                  else if (focusIntent === "prev" || focusIntent === "next") {
                    if (focusIntent === "prev") candidateNodes.reverse();
                    const currentIndex = candidateNodes.indexOf(event.currentTarget);
                    candidateNodes = context.loop ? wrapArray$2(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
                  }
                  setTimeout(() => focusFirst$1(candidateNodes));
                }
              }),
              children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children
            })
          )
        }
      );
    }
  );
  RovingFocusGroupItem.displayName = ITEM_NAME$5;
  var MAP_KEY_TO_FOCUS_INTENT = {
    ArrowLeft: "prev",
    ArrowUp: "prev",
    ArrowRight: "next",
    ArrowDown: "next",
    PageUp: "first",
    Home: "first",
    PageDown: "last",
    End: "last"
  };
  function getDirectionAwareKey(key, dir) {
    if (dir !== "rtl") return key;
    return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
  }
  __name(getDirectionAwareKey, "getDirectionAwareKey");
  function getFocusIntent(event, orientation, dir) {
    const key = getDirectionAwareKey(event.key, dir);
    if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
    if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
    return MAP_KEY_TO_FOCUS_INTENT[key];
  }
  __name(getFocusIntent, "getFocusIntent");
  function focusFirst$1(candidates, preventScroll = false) {
    const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
    for (const candidate of candidates) {
      if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
      candidate.focus({ preventScroll });
      if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
    }
  }
  __name(focusFirst$1, "focusFirst$1");
  function wrapArray$2(array2, startIndex) {
    return array2.map((_, index2) => array2[(startIndex + index2) % array2.length]);
  }
  __name(wrapArray$2, "wrapArray$2");
  var Root$5 = RovingFocusGroup;
  var Item$2 = RovingFocusGroupItem;
  // @__NO_SIDE_EFFECTS__
  function createSlot$3(ownerName) {
    const SlotClone = /* @__PURE__ */ createSlotClone$3(ownerName);
    const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
      const _a2 = props, { children } = _a2, slotProps = __objRest(_a2, ["children"]);
      const childrenArray = reactExports.Children.toArray(children);
      const slottable = childrenArray.find(isSlottable$3);
      if (slottable) {
        const newElement = slottable.props.children;
        const newChildren = childrenArray.map((child) => {
          if (child === slottable) {
            if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
            return reactExports.isValidElement(newElement) ? newElement.props.children : null;
          } else {
            return child;
          }
        });
        return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null }));
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children }));
    });
    Slot2.displayName = `${ownerName}.Slot`;
    return Slot2;
  }
  __name(createSlot$3, "createSlot$3");
  // @__NO_SIDE_EFFECTS__
  function createSlotClone$3(ownerName) {
    const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
      const _a2 = props, { children } = _a2, slotProps = __objRest(_a2, ["children"]);
      if (reactExports.isValidElement(children)) {
        const childrenRef = getElementRef$3(children);
        const props2 = mergeProps$3(slotProps, children.props);
        if (children.type !== reactExports.Fragment) {
          props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
        }
        return reactExports.cloneElement(children, props2);
      }
      return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null;
    });
    SlotClone.displayName = `${ownerName}.SlotClone`;
    return SlotClone;
  }
  __name(createSlotClone$3, "createSlotClone$3");
  var SLOTTABLE_IDENTIFIER$4 = Symbol("radix.slottable");
  function isSlottable$3(child) {
    return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$4;
  }
  __name(isSlottable$3, "isSlottable$3");
  function mergeProps$3(slotProps, childProps) {
    const overrideProps = __spreadValues({}, childProps);
    for (const propName in childProps) {
      const slotPropValue = slotProps[propName];
      const childPropValue = childProps[propName];
      const isHandler = /^on[A-Z]/.test(propName);
      if (isHandler) {
        if (slotPropValue && childPropValue) {
          overrideProps[propName] = (...args) => {
            const result = childPropValue(...args);
            slotPropValue(...args);
            return result;
          };
        } else if (slotPropValue) {
          overrideProps[propName] = slotPropValue;
        }
      } else if (propName === "style") {
        overrideProps[propName] = __spreadValues(__spreadValues({}, slotPropValue), childPropValue);
      } else if (propName === "className") {
        overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
      }
    }
    return __spreadValues(__spreadValues({}, slotProps), overrideProps);
  }
  __name(mergeProps$3, "mergeProps$3");
  function getElementRef$3(element) {
    var _a2, _b2;
    let getter = (_a2 = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a2.get;
    let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
    if (mayWarn) {
      return element.ref;
    }
    getter = (_b2 = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b2.get;
    mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
    if (mayWarn) {
      return element.props.ref;
    }
    return element.props.ref || element.ref;
  }
  __name(getElementRef$3, "getElementRef$3");
  var getDefaultParent = /* @__PURE__ */ __name(function(originalTarget) {
    if (typeof document === "undefined") {
      return null;
    }
    var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
    return sampleTarget.ownerDocument.body;
  }, "getDefaultParent");
  var counterMap = /* @__PURE__ */ new WeakMap();
  var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
  var markerMap = {};
  var lockCount = 0;
  var unwrapHost = /* @__PURE__ */ __name(function(node) {
    return node && (node.host || unwrapHost(node.parentNode));
  }, "unwrapHost");
  var correctTargets = /* @__PURE__ */ __name(function(parent, targets) {
    return targets.map(function(target) {
      if (parent.contains(target)) {
        return target;
      }
      var correctedTarget = unwrapHost(target);
      if (correctedTarget && parent.contains(correctedTarget)) {
        return correctedTarget;
      }
      console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
      return null;
    }).filter(function(x2) {
      return Boolean(x2);
    });
  }, "correctTargets");
  var applyAttributeToOthers = /* @__PURE__ */ __name(function(originalTarget, parentNode, markerName, controlAttribute) {
    var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
    if (!markerMap[markerName]) {
      markerMap[markerName] = /* @__PURE__ */ new WeakMap();
    }
    var markerCounter = markerMap[markerName];
    var hiddenNodes = [];
    var elementsToKeep = /* @__PURE__ */ new Set();
    var elementsToStop = new Set(targets);
    var keep = /* @__PURE__ */ __name(function(el) {
      if (!el || elementsToKeep.has(el)) {
        return;
      }
      elementsToKeep.add(el);
      keep(el.parentNode);
    }, "keep");
    targets.forEach(keep);
    var deep = /* @__PURE__ */ __name(function(parent) {
      if (!parent || elementsToStop.has(parent)) {
        return;
      }
      Array.prototype.forEach.call(parent.children, function(node) {
        if (elementsToKeep.has(node)) {
          deep(node);
        } else {
          try {
            var attr = node.getAttribute(controlAttribute);
            var alreadyHidden = attr !== null && attr !== "false";
            var counterValue = (counterMap.get(node) || 0) + 1;
            var markerValue = (markerCounter.get(node) || 0) + 1;
            counterMap.set(node, counterValue);
            markerCounter.set(node, markerValue);
            hiddenNodes.push(node);
            if (counterValue === 1 && alreadyHidden) {
              uncontrolledNodes.set(node, true);
            }
            if (markerValue === 1) {
              node.setAttribute(markerName, "true");
            }
            if (!alreadyHidden) {
              node.setAttribute(controlAttribute, "true");
            }
          } catch (e) {
            console.error("aria-hidden: cannot operate on ", node, e);
          }
        }
      });
    }, "deep");
    deep(parentNode);
    elementsToKeep.clear();
    lockCount++;
    return function() {
      hiddenNodes.forEach(function(node) {
        var counterValue = counterMap.get(node) - 1;
        var markerValue = markerCounter.get(node) - 1;
        counterMap.set(node, counterValue);
        markerCounter.set(node, markerValue);
        if (!counterValue) {
          if (!uncontrolledNodes.has(node)) {
            node.removeAttribute(controlAttribute);
          }
          uncontrolledNodes.delete(node);
        }
        if (!markerValue) {
          node.removeAttribute(markerName);
        }
      });
      lockCount--;
      if (!lockCount) {
        counterMap = /* @__PURE__ */ new WeakMap();
        counterMap = /* @__PURE__ */ new WeakMap();
        uncontrolledNodes = /* @__PURE__ */ new WeakMap();
        markerMap = {};
      }
    };
  }, "applyAttributeToOthers");
  var hideOthers = /* @__PURE__ */ __name(function(originalTarget, parentNode, markerName) {
    if (markerName === void 0) {
      markerName = "data-aria-hidden";
    }
    var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
    var activeParentNode = getDefaultParent(originalTarget);
    if (!activeParentNode) {
      return function() {
        return null;
      };
    }
    targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
    return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
  }, "hideOthers");
  var __assign = /* @__PURE__ */ __name(function() {
    __assign = Object.assign || /* @__PURE__ */ __name(function __assign2(t2) {
      for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) {
        s2 = arguments[i2];
        for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t2[p2] = s2[p2];
      }
      return t2;
    }, "__assign");
    return __assign.apply(this, arguments);
  }, "__assign");
  function __rest(s2, e) {
    var t2 = {};
    for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2) && e.indexOf(p2) < 0)
      t2[p2] = s2[p2];
    if (s2 != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i2 = 0, p2 = Object.getOwnPropertySymbols(s2); i2 < p2.length; i2++) {
        if (e.indexOf(p2[i2]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p2[i2]))
          t2[p2[i2]] = s2[p2[i2]];
      }
    return t2;
  }
  __name(__rest, "__rest");
  function __spreadArray(to, from, pack) {
    if (pack || arguments.length === 2) for (var i2 = 0, l = from.length, ar; i2 < l; i2++) {
      if (ar || !(i2 in from)) {
        if (!ar) ar = Array.prototype.slice.call(from, 0, i2);
        ar[i2] = from[i2];
      }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
  }
  __name(__spreadArray, "__spreadArray");
  typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
    var e = new Error(message);
    return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
  };
  var zeroRightClassName = "right-scroll-bar-position";
  var fullWidthClassName = "width-before-scroll-bar";
  var noScrollbarsClassName = "with-scroll-bars-hidden";
  var removedBarSizeVariable = "--removed-body-scroll-bar-size";
  function assignRef(ref, value) {
    if (typeof ref === "function") {
      ref(value);
    } else if (ref) {
      ref.current = value;
    }
    return ref;
  }
  __name(assignRef, "assignRef");
  function useCallbackRef(initialValue, callback) {
    var ref = reactExports.useState(function() {
      return {
        // value
        value: initialValue,
        // last callback
        callback,
        // "memoized" public interface
        facade: {
          get current() {
            return ref.value;
          },
          set current(value) {
            var last2 = ref.value;
            if (last2 !== value) {
              ref.value = value;
              ref.callback(value, last2);
            }
          }
        }
      };
    })[0];
    ref.callback = callback;
    return ref.facade;
  }
  __name(useCallbackRef, "useCallbackRef");
  var useIsomorphicLayoutEffect$1 = typeof window !== "undefined" ? reactExports.useLayoutEffect : reactExports.useEffect;
  var currentValues = /* @__PURE__ */ new WeakMap();
  function useMergeRefs(refs, defaultValue) {
    var callbackRef = useCallbackRef(null, function(newValue) {
      return refs.forEach(function(ref) {
        return assignRef(ref, newValue);
      });
    });
    useIsomorphicLayoutEffect$1(function() {
      var oldValue = currentValues.get(callbackRef);
      if (oldValue) {
        var prevRefs_1 = new Set(oldValue);
        var nextRefs_1 = new Set(refs);
        var current_1 = callbackRef.current;
        prevRefs_1.forEach(function(ref) {
          if (!nextRefs_1.has(ref)) {
            assignRef(ref, null);
          }
        });
        nextRefs_1.forEach(function(ref) {
          if (!prevRefs_1.has(ref)) {
            assignRef(ref, current_1);
          }
        });
      }
      currentValues.set(callbackRef, refs);
    }, [refs]);
    return callbackRef;
  }
  __name(useMergeRefs, "useMergeRefs");
  function ItoI(a2) {
    return a2;
  }
  __name(ItoI, "ItoI");
  function innerCreateMedium(defaults2, middleware) {
    if (middleware === void 0) {
      middleware = ItoI;
    }
    var buffer = [];
    var assigned = false;
    var medium = {
      read: /* @__PURE__ */ __name(function() {
        if (assigned) {
          throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
        }
        if (buffer.length) {
          return buffer[buffer.length - 1];
        }
        return defaults2;
      }, "read"),
      useMedium: /* @__PURE__ */ __name(function(data) {
        var item = middleware(data, assigned);
        buffer.push(item);
        return function() {
          buffer = buffer.filter(function(x2) {
            return x2 !== item;
          });
        };
      }, "useMedium"),
      assignSyncMedium: /* @__PURE__ */ __name(function(cb) {
        assigned = true;
        while (buffer.length) {
          var cbs = buffer;
          buffer = [];
          cbs.forEach(cb);
        }
        buffer = {
          push: /* @__PURE__ */ __name(function(x2) {
            return cb(x2);
          }, "push"),
          filter: /* @__PURE__ */ __name(function() {
            return buffer;
          }, "filter")
        };
      }, "assignSyncMedium"),
      assignMedium: /* @__PURE__ */ __name(function(cb) {
        assigned = true;
        var pendingQueue = [];
        if (buffer.length) {
          var cbs = buffer;
          buffer = [];
          cbs.forEach(cb);
          pendingQueue = buffer;
        }
        var executeQueue = /* @__PURE__ */ __name(function() {
          var cbs2 = pendingQueue;
          pendingQueue = [];
          cbs2.forEach(cb);
        }, "executeQueue");
        var cycle = /* @__PURE__ */ __name(function() {
          return Promise.resolve().then(executeQueue);
        }, "cycle");
        cycle();
        buffer = {
          push: /* @__PURE__ */ __name(function(x2) {
            pendingQueue.push(x2);
            cycle();
          }, "push"),
          filter: /* @__PURE__ */ __name(function(filter) {
            pendingQueue = pendingQueue.filter(filter);
            return buffer;
          }, "filter")
        };
      }, "assignMedium")
    };
    return medium;
  }
  __name(innerCreateMedium, "innerCreateMedium");
  function createSidecarMedium(options2) {
    if (options2 === void 0) {
      options2 = {};
    }
    var medium = innerCreateMedium(null);
    medium.options = __assign({ async: true, ssr: false }, options2);
    return medium;
  }
  __name(createSidecarMedium, "createSidecarMedium");
  var SideCar$1 = /* @__PURE__ */ __name(function(_a2) {
    var sideCar = _a2.sideCar, rest = __rest(_a2, ["sideCar"]);
    if (!sideCar) {
      throw new Error("Sidecar: please provide `sideCar` property to import the right car");
    }
    var Target = sideCar.read();
    if (!Target) {
      throw new Error("Sidecar medium not found");
    }
    return reactExports.createElement(Target, __assign({}, rest));
  }, "SideCar$1");
  SideCar$1.isSideCarExport = true;
  function exportSidecar(medium, exported) {
    medium.useMedium(exported);
    return SideCar$1;
  }
  __name(exportSidecar, "exportSidecar");
  var effectCar = createSidecarMedium();
  var nothing = /* @__PURE__ */ __name(function() {
    return;
  }, "nothing");
  var RemoveScroll = reactExports.forwardRef(function(props, parentRef) {
    var ref = reactExports.useRef(null);
    var _a2 = reactExports.useState({
      onScrollCapture: nothing,
      onWheelCapture: nothing,
      onTouchMoveCapture: nothing
    }), callbacks = _a2[0], setCallbacks = _a2[1];
    var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b2 = props.as, Container = _b2 === void 0 ? "div" : _b2, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
    var SideCar2 = sideCar;
    var containerRef = useMergeRefs([ref, parentRef]);
    var containerProps = __assign(__assign({}, rest), callbacks);
    return reactExports.createElement(
      reactExports.Fragment,
      null,
      enabled && reactExports.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
      forwardProps ? reactExports.cloneElement(reactExports.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : reactExports.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
    );
  });
  RemoveScroll.defaultProps = {
    enabled: true,
    removeScrollBar: true,
    inert: false
  };
  RemoveScroll.classNames = {
    fullWidth: fullWidthClassName,
    zeroRight: zeroRightClassName
  };
  var getNonce$1 = /* @__PURE__ */ __name(function() {
    if (typeof __webpack_nonce__ !== "undefined") {
      return __webpack_nonce__;
    }
    return void 0;
  }, "getNonce$1");
  function makeStyleTag() {
    if (!document)
      return null;
    var tag = document.createElement("style");
    tag.type = "text/css";
    var nonce = getNonce$1();
    if (nonce) {
      tag.setAttribute("nonce", nonce);
    }
    return tag;
  }
  __name(makeStyleTag, "makeStyleTag");
  function injectStyles(tag, css) {
    if (tag.styleSheet) {
      tag.styleSheet.cssText = css;
    } else {
      tag.appendChild(document.createTextNode(css));
    }
  }
  __name(injectStyles, "injectStyles");
  function insertStyleTag(tag) {
    var head = document.head || document.getElementsByTagName("head")[0];
    head.appendChild(tag);
  }
  __name(insertStyleTag, "insertStyleTag");
  var stylesheetSingleton = /* @__PURE__ */ __name(function() {
    var counter = 0;
    var stylesheet = null;
    return {
      add: /* @__PURE__ */ __name(function(style) {
        if (counter == 0) {
          if (stylesheet = makeStyleTag()) {
            injectStyles(stylesheet, style);
            insertStyleTag(stylesheet);
          }
        }
        counter++;
      }, "add"),
      remove: /* @__PURE__ */ __name(function() {
        counter--;
        if (!counter && stylesheet) {
          stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
          stylesheet = null;
        }
      }, "remove")
    };
  }, "stylesheetSingleton");
  var styleHookSingleton = /* @__PURE__ */ __name(function() {
    var sheet = stylesheetSingleton();
    return function(styles, isDynamic) {
      reactExports.useEffect(function() {
        sheet.add(styles);
        return function() {
          sheet.remove();
        };
      }, [styles && isDynamic]);
    };
  }, "styleHookSingleton");
  var styleSingleton = /* @__PURE__ */ __name(function() {
    var useStyle = styleHookSingleton();
    var Sheet = /* @__PURE__ */ __name(function(_a2) {
      var styles = _a2.styles, dynamic = _a2.dynamic;
      useStyle(styles, dynamic);
      return null;
    }, "Sheet");
    return Sheet;
  }, "styleSingleton");
  var zeroGap = {
    left: 0,
    top: 0,
    right: 0,
    gap: 0
  };
  var parse = /* @__PURE__ */ __name(function(x2) {
    return parseInt(x2 || "", 10) || 0;
  }, "parse");
  var getOffset$1 = /* @__PURE__ */ __name(function(gapMode) {
    var cs = window.getComputedStyle(document.body);
    var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
    var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
    var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
    return [parse(left), parse(top), parse(right)];
  }, "getOffset$1");
  var getGapWidth = /* @__PURE__ */ __name(function(gapMode) {
    if (gapMode === void 0) {
      gapMode = "margin";
    }
    if (typeof window === "undefined") {
      return zeroGap;
    }
    var offsets = getOffset$1(gapMode);
    var documentWidth = document.documentElement.clientWidth;
    var windowWidth = window.innerWidth;
    return {
      left: offsets[0],
      top: offsets[1],
      right: offsets[2],
      gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
    };
  }, "getGapWidth");
  var Style = styleSingleton();
  var lockAttribute = "data-scroll-locked";
  var getStyles = /* @__PURE__ */ __name(function(_a2, allowRelative, gapMode, important) {
    var left = _a2.left, top = _a2.top, right = _a2.right, gap = _a2.gap;
    if (gapMode === void 0) {
      gapMode = "margin";
    }
    return "\n  .".concat(noScrollbarsClassName, " {\n   overflow: hidden ").concat(important, ";\n   padding-right: ").concat(gap, "px ").concat(important, ";\n  }\n  body[").concat(lockAttribute, "] {\n    overflow: hidden ").concat(important, ";\n    overscroll-behavior: contain;\n    ").concat([
      allowRelative && "position: relative ".concat(important, ";"),
      gapMode === "margin" && "\n    padding-left: ".concat(left, "px;\n    padding-top: ").concat(top, "px;\n    padding-right: ").concat(right, "px;\n    margin-left:0;\n    margin-top:0;\n    margin-right: ").concat(gap, "px ").concat(important, ";\n    "),
      gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
    ].filter(Boolean).join(""), "\n  }\n  \n  .").concat(zeroRightClassName, " {\n    right: ").concat(gap, "px ").concat(important, ";\n  }\n  \n  .").concat(fullWidthClassName, " {\n    margin-right: ").concat(gap, "px ").concat(important, ";\n  }\n  \n  .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n    right: 0 ").concat(important, ";\n  }\n  \n  .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n    margin-right: 0 ").concat(important, ";\n  }\n  \n  body[").concat(lockAttribute, "] {\n    ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n  }\n");
  }, "getStyles");
  var getCurrentUseCounter = /* @__PURE__ */ __name(function() {
    var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
    return isFinite(counter) ? counter : 0;
  }, "getCurrentUseCounter");
  var useLockAttribute = /* @__PURE__ */ __name(function() {
    reactExports.useEffect(function() {
      document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
      return function() {
        var newCounter = getCurrentUseCounter() - 1;
        if (newCounter <= 0) {
          document.body.removeAttribute(lockAttribute);
        } else {
          document.body.setAttribute(lockAttribute, newCounter.toString());
        }
      };
    }, []);
  }, "useLockAttribute");
  var RemoveScrollBar = /* @__PURE__ */ __name(function(_a2) {
    var noRelative = _a2.noRelative, noImportant = _a2.noImportant, _b2 = _a2.gapMode, gapMode = _b2 === void 0 ? "margin" : _b2;
    useLockAttribute();
    var gap = reactExports.useMemo(function() {
      return getGapWidth(gapMode);
    }, [gapMode]);
    return reactExports.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
  }, "RemoveScrollBar");
  var passiveSupported = false;
  if (typeof window !== "undefined") {
    try {
      var options = Object.defineProperty({}, "passive", {
        get: /* @__PURE__ */ __name(function() {
          passiveSupported = true;
          return true;
        }, "get")
      });
      window.addEventListener("test", options, options);
      window.removeEventListener("test", options, options);
    } catch (err) {
      passiveSupported = false;
    }
  }
  var nonPassive = passiveSupported ? { passive: false } : false;
  var alwaysContainsScroll = /* @__PURE__ */ __name(function(node) {
    return node.tagName === "TEXTAREA";
  }, "alwaysContainsScroll");
  var elementCanBeScrolled = /* @__PURE__ */ __name(function(node, overflow) {
    if (!(node instanceof Element)) {
      return false;
    }
    var styles = window.getComputedStyle(node);
    return (
      // not-not-scrollable
      styles[overflow] !== "hidden" && // contains scroll inside self
      !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
    );
  }, "elementCanBeScrolled");
  var elementCouldBeVScrolled = /* @__PURE__ */ __name(function(node) {
    return elementCanBeScrolled(node, "overflowY");
  }, "elementCouldBeVScrolled");
  var elementCouldBeHScrolled = /* @__PURE__ */ __name(function(node) {
    return elementCanBeScrolled(node, "overflowX");
  }, "elementCouldBeHScrolled");
  var locationCouldBeScrolled = /* @__PURE__ */ __name(function(axis, node) {
    var ownerDocument = node.ownerDocument;
    var current = node;
    do {
      if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) {
        current = current.host;
      }
      var isScrollable = elementCouldBeScrolled(axis, current);
      if (isScrollable) {
        var _a2 = getScrollVariables(axis, current), scrollHeight = _a2[1], clientHeight = _a2[2];
        if (scrollHeight > clientHeight) {
          return true;
        }
      }
      current = current.parentNode;
    } while (current && current !== ownerDocument.body);
    return false;
  }, "locationCouldBeScrolled");
  var getVScrollVariables = /* @__PURE__ */ __name(function(_a2) {
    var scrollTop = _a2.scrollTop, scrollHeight = _a2.scrollHeight, clientHeight = _a2.clientHeight;
    return [
      scrollTop,
      scrollHeight,
      clientHeight
    ];
  }, "getVScrollVariables");
  var getHScrollVariables = /* @__PURE__ */ __name(function(_a2) {
    var scrollLeft = _a2.scrollLeft, scrollWidth = _a2.scrollWidth, clientWidth = _a2.clientWidth;
    return [
      scrollLeft,
      scrollWidth,
      clientWidth
    ];
  }, "getHScrollVariables");
  var elementCouldBeScrolled = /* @__PURE__ */ __name(function(axis, node) {
    return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
  }, "elementCouldBeScrolled");
  var getScrollVariables = /* @__PURE__ */ __name(function(axis, node) {
    return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
  }, "getScrollVariables");
  var getDirectionFactor = /* @__PURE__ */ __name(function(axis, direction) {
    return axis === "h" && direction === "rtl" ? -1 : 1;
  }, "getDirectionFactor");
  var handleScroll = /* @__PURE__ */ __name(function(axis, endTarget, event, sourceDelta, noOverscroll) {
    var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
    var delta = directionFactor * sourceDelta;
    var target = event.target;
    var targetInLock = endTarget.contains(target);
    var shouldCancelScroll = false;
    var isDeltaPositive = delta > 0;
    var availableScroll = 0;
    var availableScrollTop = 0;
    do {
      if (!target) {
        break;
      }
      var _a2 = getScrollVariables(axis, target), position = _a2[0], scroll_1 = _a2[1], capacity = _a2[2];
      var elementScroll = scroll_1 - capacity - directionFactor * position;
      if (position || elementScroll) {
        if (elementCouldBeScrolled(axis, target)) {
          availableScroll += elementScroll;
          availableScrollTop += position;
        }
      }
      var parent_1 = target.parentNode;
      target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
    } while (
      // portaled content
      !targetInLock && target !== document.body || // self content
      targetInLock && (endTarget.contains(target) || endTarget === target)
    );
    if (isDeltaPositive && (Math.abs(availableScroll) < 1 || false)) {
      shouldCancelScroll = true;
    } else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || false)) {
      shouldCancelScroll = true;
    }
    return shouldCancelScroll;
  }, "handleScroll");
  var getTouchXY = /* @__PURE__ */ __name(function(event) {
    return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
  }, "getTouchXY");
  var getDeltaXY = /* @__PURE__ */ __name(function(event) {
    return [event.deltaX, event.deltaY];
  }, "getDeltaXY");
  var extractRef = /* @__PURE__ */ __name(function(ref) {
    return ref && "current" in ref ? ref.current : ref;
  }, "extractRef");
  var deltaCompare = /* @__PURE__ */ __name(function(x2, y2) {
    return x2[0] === y2[0] && x2[1] === y2[1];
  }, "deltaCompare");
  var generateStyle = /* @__PURE__ */ __name(function(id) {
    return "\n  .block-interactivity-".concat(id, " {pointer-events: none;}\n  .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
  }, "generateStyle");
  var idCounter$1 = 0;
  var lockStack = [];
  function RemoveScrollSideCar(props) {
    var shouldPreventQueue = reactExports.useRef([]);
    var touchStartRef = reactExports.useRef([0, 0]);
    var activeAxis = reactExports.useRef();
    var id = reactExports.useState(idCounter$1++)[0];
    var Style2 = reactExports.useState(styleSingleton)[0];
    var lastProps = reactExports.useRef(props);
    reactExports.useEffect(function() {
      lastProps.current = props;
    }, [props]);
    reactExports.useEffect(function() {
      if (props.inert) {
        document.body.classList.add("block-interactivity-".concat(id));
        var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
        allow_1.forEach(function(el) {
          return el.classList.add("allow-interactivity-".concat(id));
        });
        return function() {
          document.body.classList.remove("block-interactivity-".concat(id));
          allow_1.forEach(function(el) {
            return el.classList.remove("allow-interactivity-".concat(id));
          });
        };
      }
      return;
    }, [props.inert, props.lockRef.current, props.shards]);
    var shouldCancelEvent = reactExports.useCallback(function(event, parent) {
      if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
        return !lastProps.current.allowPinchZoom;
      }
      var touch = getTouchXY(event);
      var touchStart = touchStartRef.current;
      var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
      var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
      var currentAxis;
      var target = event.target;
      var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
      if ("touches" in event && moveDirection === "h" && target.type === "range") {
        return false;
      }
      var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
      if (!canBeScrolledInMainDirection) {
        return true;
      }
      if (canBeScrolledInMainDirection) {
        currentAxis = moveDirection;
      } else {
        currentAxis = moveDirection === "v" ? "h" : "v";
        canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
      }
      if (!canBeScrolledInMainDirection) {
        return false;
      }
      if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) {
        activeAxis.current = currentAxis;
      }
      if (!currentAxis) {
        return true;
      }
      var cancelingAxis = activeAxis.current || currentAxis;
      return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
    }, []);
    var shouldPrevent = reactExports.useCallback(function(_event) {
      var event = _event;
      if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
        return;
      }
      var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
      var sourceEvent = shouldPreventQueue.current.filter(function(e) {
        return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
      })[0];
      if (sourceEvent && sourceEvent.should) {
        if (event.cancelable) {
          event.preventDefault();
        }
        return;
      }
      if (!sourceEvent) {
        var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
          return node.contains(event.target);
        });
        var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
        if (shouldStop) {
          if (event.cancelable) {
            event.preventDefault();
          }
        }
      }
    }, []);
    var shouldCancel = reactExports.useCallback(function(name, delta, target, should) {
      var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
      shouldPreventQueue.current.push(event);
      setTimeout(function() {
        shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
          return e !== event;
        });
      }, 1);
    }, []);
    var scrollTouchStart = reactExports.useCallback(function(event) {
      touchStartRef.current = getTouchXY(event);
      activeAxis.current = void 0;
    }, []);
    var scrollWheel = reactExports.useCallback(function(event) {
      shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
    }, []);
    var scrollTouchMove = reactExports.useCallback(function(event) {
      shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
    }, []);
    reactExports.useEffect(function() {
      lockStack.push(Style2);
      props.setCallbacks({
        onScrollCapture: scrollWheel,
        onWheelCapture: scrollWheel,
        onTouchMoveCapture: scrollTouchMove
      });
      document.addEventListener("wheel", shouldPrevent, nonPassive);
      document.addEventListener("touchmove", shouldPrevent, nonPassive);
      document.addEventListener("touchstart", scrollTouchStart, nonPassive);
      return function() {
        lockStack = lockStack.filter(function(inst) {
          return inst !== Style2;
        });
        document.removeEventListener("wheel", shouldPrevent, nonPassive);
        document.removeEventListener("touchmove", shouldPrevent, nonPassive);
        document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
      };
    }, []);
    var removeScrollBar = props.removeScrollBar, inert = props.inert;
    return reactExports.createElement(
      reactExports.Fragment,
      null,
      inert ? reactExports.createElement(Style2, { styles: generateStyle(id) }) : null,
      removeScrollBar ? reactExports.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
    );
  }
  __name(RemoveScrollSideCar, "RemoveScrollSideCar");
  function getOutermostShadowParent(node) {
    var shadowParent = null;
    while (node !== null) {
      if (node instanceof ShadowRoot) {
        shadowParent = node.host;
        node = node.host;
      }
      node = node.parentNode;
    }
    return shadowParent;
  }
  __name(getOutermostShadowParent, "getOutermostShadowParent");
  const SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
  var ReactRemoveScroll = reactExports.forwardRef(function(props, ref) {
    return reactExports.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: SideCar }));
  });
  ReactRemoveScroll.classNames = RemoveScroll.classNames;
  var SELECTION_KEYS$1 = ["Enter", " "];
  var FIRST_KEYS = ["ArrowDown", "PageUp", "Home"];
  var LAST_KEYS = ["ArrowUp", "PageDown", "End"];
  var FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];
  var SUB_OPEN_KEYS = {
    ltr: [...SELECTION_KEYS$1, "ArrowRight"],
    rtl: [...SELECTION_KEYS$1, "ArrowLeft"]
  };
  var SUB_CLOSE_KEYS = {
    ltr: ["ArrowLeft"],
    rtl: ["ArrowRight"]
  };
  var MENU_NAME = "Menu";
  var [Collection$2, useCollection$2, createCollectionScope$2] = createCollection(MENU_NAME);
  var [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [
    createCollectionScope$2,
    createPopperScope,
    createRovingFocusGroupScope
  ]);
  var usePopperScope$2 = createPopperScope();
  var useRovingFocusGroupScope$2 = createRovingFocusGroupScope();
  var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);
  var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
  var Menu = /* @__PURE__ */ __name((props) => {
    const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;
    const popperScope = usePopperScope$2(__scopeMenu);
    const [content, setContent] = reactExports.useState(null);
    const isUsingKeyboardRef = reactExports.useRef(false);
    const handleOpenChange = useCallbackRef$1(onOpenChange);
    const direction = useDirection(dir);
    reactExports.useEffect(() => {
      const handleKeyDown = /* @__PURE__ */ __name(() => {
        isUsingKeyboardRef.current = true;
        document.addEventListener("pointerdown", handlePointer, { capture: true, once: true });
        document.addEventListener("pointermove", handlePointer, { capture: true, once: true });
      }, "handleKeyDown");
      const handlePointer = /* @__PURE__ */ __name(() => isUsingKeyboardRef.current = false, "handlePointer");
      document.addEventListener("keydown", handleKeyDown, { capture: true });
      return () => {
        document.removeEventListener("keydown", handleKeyDown, { capture: true });
        document.removeEventListener("pointerdown", handlePointer, { capture: true });
        document.removeEventListener("pointermove", handlePointer, { capture: true });
      };
    }, []);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Root2$5, __spreadProps(__spreadValues({}, popperScope), { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      MenuProvider,
      {
        scope: __scopeMenu,
        open,
        onOpenChange: handleOpenChange,
        content,
        onContentChange: setContent,
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          MenuRootProvider,
          {
            scope: __scopeMenu,
            onClose: reactExports.useCallback(() => handleOpenChange(false), [handleOpenChange]),
            isUsingKeyboardRef,
            dir: direction,
            modal,
            children
          }
        )
      }
    ) }));
  }, "Menu");
  Menu.displayName = MENU_NAME;
  var ANCHOR_NAME = "MenuAnchor";
  var MenuAnchor = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeMenu } = _a2, anchorProps = __objRest(_a2, ["__scopeMenu"]);
      const popperScope = usePopperScope$2(__scopeMenu);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor, __spreadProps(__spreadValues(__spreadValues({}, popperScope), anchorProps), { ref: forwardedRef }));
    }
  );
  MenuAnchor.displayName = ANCHOR_NAME;
  var PORTAL_NAME$4 = "MenuPortal";
  var [PortalProvider$2, usePortalContext$2] = createMenuContext(PORTAL_NAME$4, {
    forceMount: void 0
  });
  var MenuPortal = /* @__PURE__ */ __name((props) => {
    const { __scopeMenu, forceMount, children, container } = props;
    const context = useMenuContext(PORTAL_NAME$4, __scopeMenu);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(PortalProvider$2, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Portal$3, { asChild: true, container, children }) }) });
  }, "MenuPortal");
  MenuPortal.displayName = PORTAL_NAME$4;
  var CONTENT_NAME$7 = "MenuContent";
  var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME$7);
  var MenuContent = reactExports.forwardRef(
    (props, forwardedRef) => {
      const portalContext = usePortalContext$2(CONTENT_NAME$7, props.__scopeMenu);
      const _a2 = props, { forceMount = portalContext.forceMount } = _a2, contentProps = __objRest(_a2, ["forceMount"]);
      const context = useMenuContext(CONTENT_NAME$7, props.__scopeMenu);
      const rootContext = useMenuRootContext(CONTENT_NAME$7, props.__scopeMenu);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Collection$2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Collection$2.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsxRuntimeExports.jsx(MenuRootContentModal, __spreadProps(__spreadValues({}, contentProps), { ref: forwardedRef })) : /* @__PURE__ */ jsxRuntimeExports.jsx(MenuRootContentNonModal, __spreadProps(__spreadValues({}, contentProps), { ref: forwardedRef })) }) }) });
    }
  );
  var MenuRootContentModal = reactExports.forwardRef(
    (props, forwardedRef) => {
      const context = useMenuContext(CONTENT_NAME$7, props.__scopeMenu);
      const ref = reactExports.useRef(null);
      const composedRefs = useComposedRefs(forwardedRef, ref);
      reactExports.useEffect(() => {
        const content = ref.current;
        if (content) return hideOthers(content);
      }, []);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        MenuContentImpl,
        __spreadProps(__spreadValues({}, props), {
          ref: composedRefs,
          trapFocus: context.open,
          disableOutsidePointerEvents: context.open,
          disableOutsideScroll: true,
          onFocusOutside: composeEventHandlers(
            props.onFocusOutside,
            (event) => event.preventDefault(),
            { checkForDefaultPrevented: false }
          ),
          onDismiss: /* @__PURE__ */ __name(() => context.onOpenChange(false), "onDismiss")
        })
      );
    }
  );
  var MenuRootContentNonModal = reactExports.forwardRef((props, forwardedRef) => {
    const context = useMenuContext(CONTENT_NAME$7, props.__scopeMenu);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      MenuContentImpl,
      __spreadProps(__spreadValues({}, props), {
        ref: forwardedRef,
        trapFocus: false,
        disableOutsidePointerEvents: false,
        disableOutsideScroll: false,
        onDismiss: /* @__PURE__ */ __name(() => context.onOpenChange(false), "onDismiss")
      })
    );
  });
  var Slot$3 = /* @__PURE__ */ createSlot$3("MenuContent.ScrollLock");
  var MenuContentImpl = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, {
        __scopeMenu,
        loop = false,
        trapFocus,
        onOpenAutoFocus,
        onCloseAutoFocus,
        disableOutsidePointerEvents,
        onEntryFocus,
        onEscapeKeyDown,
        onPointerDownOutside,
        onFocusOutside,
        onInteractOutside,
        onDismiss,
        disableOutsideScroll
      } = _a2, contentProps = __objRest(_a2, [
        "__scopeMenu",
        "loop",
        "trapFocus",
        "onOpenAutoFocus",
        "onCloseAutoFocus",
        "disableOutsidePointerEvents",
        "onEntryFocus",
        "onEscapeKeyDown",
        "onPointerDownOutside",
        "onFocusOutside",
        "onInteractOutside",
        "onDismiss",
        "disableOutsideScroll"
      ]);
      const context = useMenuContext(CONTENT_NAME$7, __scopeMenu);
      const rootContext = useMenuRootContext(CONTENT_NAME$7, __scopeMenu);
      const popperScope = usePopperScope$2(__scopeMenu);
      const rovingFocusGroupScope = useRovingFocusGroupScope$2(__scopeMenu);
      const getItems = useCollection$2(__scopeMenu);
      const [currentItemId, setCurrentItemId] = reactExports.useState(null);
      const contentRef = reactExports.useRef(null);
      const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);
      const timerRef = reactExports.useRef(0);
      const searchRef = reactExports.useRef("");
      const pointerGraceTimerRef = reactExports.useRef(0);
      const pointerGraceIntentRef = reactExports.useRef(null);
      const pointerDirRef = reactExports.useRef("right");
      const lastPointerXRef = reactExports.useRef(0);
      const ScrollLockWrapper = disableOutsideScroll ? ReactRemoveScroll : reactExports.Fragment;
      const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot$3, allowPinchZoom: true } : void 0;
      const handleTypeaheadSearch = /* @__PURE__ */ __name((key) => {
        var _a3, _b2;
        const search = searchRef.current + key;
        const items = getItems().filter((item) => !item.disabled);
        const currentItem = document.activeElement;
        const currentMatch = (_a3 = items.find((item) => item.ref.current === currentItem)) == null ? void 0 : _a3.textValue;
        const values = items.map((item) => item.textValue);
        const nextMatch = getNextMatch(values, search, currentMatch);
        const newItem = (_b2 = items.find((item) => item.textValue === nextMatch)) == null ? void 0 : _b2.ref.current;
        (/* @__PURE__ */ __name((function updateSearch(value) {
          searchRef.current = value;
          window.clearTimeout(timerRef.current);
          if (value !== "") timerRef.current = window.setTimeout(() => updateSearch(""), 1e3);
        }), "updateSearch"))(search);
        if (newItem) {
          setTimeout(() => newItem.focus());
        }
      }, "handleTypeaheadSearch");
      reactExports.useEffect(() => {
        return () => window.clearTimeout(timerRef.current);
      }, []);
      useFocusGuards();
      const isPointerMovingToSubmenu = reactExports.useCallback((event) => {
        var _a3, _b2;
        const isMovingTowards = pointerDirRef.current === ((_a3 = pointerGraceIntentRef.current) == null ? void 0 : _a3.side);
        return isMovingTowards && isPointerInGraceArea(event, (_b2 = pointerGraceIntentRef.current) == null ? void 0 : _b2.area);
      }, []);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        MenuContentProvider,
        {
          scope: __scopeMenu,
          searchRef,
          onItemEnter: reactExports.useCallback(
            (event) => {
              if (isPointerMovingToSubmenu(event)) event.preventDefault();
            },
            [isPointerMovingToSubmenu]
          ),
          onItemLeave: reactExports.useCallback(
            (event) => {
              var _a3;
              if (isPointerMovingToSubmenu(event)) return;
              (_a3 = contentRef.current) == null ? void 0 : _a3.focus();
              setCurrentItemId(null);
            },
            [isPointerMovingToSubmenu]
          ),
          onTriggerLeave: reactExports.useCallback(
            (event) => {
              if (isPointerMovingToSubmenu(event)) event.preventDefault();
            },
            [isPointerMovingToSubmenu]
          ),
          pointerGraceTimerRef,
          onPointerGraceIntentChange: reactExports.useCallback((intent) => {
            pointerGraceIntentRef.current = intent;
          }, []),
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollLockWrapper, __spreadProps(__spreadValues({}, scrollLockWrapperProps), { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            FocusScope,
            {
              asChild: true,
              trapped: trapFocus,
              onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {
                var _a3;
                event.preventDefault();
                (_a3 = contentRef.current) == null ? void 0 : _a3.focus({ preventScroll: true });
              }),
              onUnmountAutoFocus: onCloseAutoFocus,
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                DismissableLayer,
                {
                  asChild: true,
                  disableOutsidePointerEvents,
                  onEscapeKeyDown,
                  onPointerDownOutside,
                  onFocusOutside,
                  onInteractOutside,
                  onDismiss,
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                    Root$5,
                    __spreadProps(__spreadValues({
                      asChild: true
                    }, rovingFocusGroupScope), {
                      dir: rootContext.dir,
                      orientation: "vertical",
                      loop,
                      currentTabStopId: currentItemId,
                      onCurrentTabStopIdChange: setCurrentItemId,
                      onEntryFocus: composeEventHandlers(onEntryFocus, (event) => {
                        if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
                      }),
                      preventScrollOnEntryFocus: true,
                      children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                        Content$3,
                        __spreadProps(__spreadValues(__spreadValues({
                          role: "menu",
                          "aria-orientation": "vertical",
                          "data-state": getOpenState(context.open),
                          "data-radix-menu-content": "",
                          dir: rootContext.dir
                        }, popperScope), contentProps), {
                          ref: composedRefs,
                          style: __spreadValues({ outline: "none" }, contentProps.style),
                          onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {
                            const target = event.target;
                            const isKeyDownInside = target.closest("[data-radix-menu-content]") === event.currentTarget;
                            const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
                            const isCharacterKey = event.key.length === 1;
                            if (isKeyDownInside) {
                              if (event.key === "Tab") event.preventDefault();
                              if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);
                            }
                            const content = contentRef.current;
                            if (event.target !== content) return;
                            if (!FIRST_LAST_KEYS.includes(event.key)) return;
                            event.preventDefault();
                            const items = getItems().filter((item) => !item.disabled);
                            const candidateNodes = items.map((item) => item.ref.current);
                            if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();
                            focusFirst(candidateNodes);
                          }),
                          onBlur: composeEventHandlers(props.onBlur, (event) => {
                            if (!event.currentTarget.contains(event.target)) {
                              window.clearTimeout(timerRef.current);
                              searchRef.current = "";
                            }
                          }),
                          onPointerMove: composeEventHandlers(
                            props.onPointerMove,
                            whenMouse((event) => {
                              const target = event.target;
                              const pointerXHasChanged = lastPointerXRef.current !== event.clientX;
                              if (event.currentTarget.contains(target) && pointerXHasChanged) {
                                const newDir = event.clientX > lastPointerXRef.current ? "right" : "left";
                                pointerDirRef.current = newDir;
                                lastPointerXRef.current = event.clientX;
                              }
                            })
                          )
                        })
                      )
                    })
                  )
                }
              )
            }
          ) }))
        }
      );
    }
  );
  MenuContent.displayName = CONTENT_NAME$7;
  var GROUP_NAME$2 = "MenuGroup";
  var MenuGroup = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeMenu } = _a2, groupProps = __objRest(_a2, ["__scopeMenu"]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, __spreadProps(__spreadValues({ role: "group" }, groupProps), { ref: forwardedRef }));
    }
  );
  MenuGroup.displayName = GROUP_NAME$2;
  var LABEL_NAME$2 = "MenuLabel";
  var MenuLabel = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeMenu } = _a2, labelProps = __objRest(_a2, ["__scopeMenu"]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, __spreadProps(__spreadValues({}, labelProps), { ref: forwardedRef }));
    }
  );
  MenuLabel.displayName = LABEL_NAME$2;
  var ITEM_NAME$4 = "MenuItem";
  var ITEM_SELECT = "menu.itemSelect";
  var MenuItem = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { disabled = false, onSelect } = _a2, itemProps = __objRest(_a2, ["disabled", "onSelect"]);
      const ref = reactExports.useRef(null);
      const rootContext = useMenuRootContext(ITEM_NAME$4, props.__scopeMenu);
      const contentContext = useMenuContentContext(ITEM_NAME$4, props.__scopeMenu);
      const composedRefs = useComposedRefs(forwardedRef, ref);
      const isPointerDownRef = reactExports.useRef(false);
      const handleSelect = /* @__PURE__ */ __name(() => {
        const menuItem = ref.current;
        if (!disabled && menuItem) {
          const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });
          menuItem.addEventListener(ITEM_SELECT, (event) => onSelect == null ? void 0 : onSelect(event), { once: true });
          dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);
          if (itemSelectEvent.defaultPrevented) {
            isPointerDownRef.current = false;
          } else {
            rootContext.onClose();
          }
        }
      }, "handleSelect");
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        MenuItemImpl,
        __spreadProps(__spreadValues({}, itemProps), {
          ref: composedRefs,
          disabled,
          onClick: composeEventHandlers(props.onClick, handleSelect),
          onPointerDown: /* @__PURE__ */ __name((event) => {
            var _a3;
            (_a3 = props.onPointerDown) == null ? void 0 : _a3.call(props, event);
            isPointerDownRef.current = true;
          }, "onPointerDown"),
          onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
            var _a3;
            if (!isPointerDownRef.current) (_a3 = event.currentTarget) == null ? void 0 : _a3.click();
          }),
          onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
            const isTypingAhead = contentContext.searchRef.current !== "";
            if (disabled || isTypingAhead && event.key === " ") return;
            if (SELECTION_KEYS$1.includes(event.key)) {
              event.currentTarget.click();
              event.preventDefault();
            }
          })
        })
      );
    }
  );
  MenuItem.displayName = ITEM_NAME$4;
  var MenuItemImpl = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeMenu, disabled = false, textValue } = _a2, itemProps = __objRest(_a2, ["__scopeMenu", "disabled", "textValue"]);
      const contentContext = useMenuContentContext(ITEM_NAME$4, __scopeMenu);
      const rovingFocusGroupScope = useRovingFocusGroupScope$2(__scopeMenu);
      const ref = reactExports.useRef(null);
      const composedRefs = useComposedRefs(forwardedRef, ref);
      const [isFocused, setIsFocused] = reactExports.useState(false);
      const [textContent, setTextContent] = reactExports.useState("");
      reactExports.useEffect(() => {
        var _a3;
        const menuItem = ref.current;
        if (menuItem) {
          setTextContent(((_a3 = menuItem.textContent) != null ? _a3 : "").trim());
        }
      }, [itemProps.children]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Collection$2.ItemSlot,
        {
          scope: __scopeMenu,
          disabled,
          textValue: textValue != null ? textValue : textContent,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(Item$2, __spreadProps(__spreadValues({ asChild: true }, rovingFocusGroupScope), { focusable: !disabled, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Primitive$1.div,
            __spreadProps(__spreadValues({
              role: "menuitem",
              "data-highlighted": isFocused ? "" : void 0,
              "aria-disabled": disabled || void 0,
              "data-disabled": disabled ? "" : void 0
            }, itemProps), {
              ref: composedRefs,
              onPointerMove: composeEventHandlers(
                props.onPointerMove,
                whenMouse((event) => {
                  if (disabled) {
                    contentContext.onItemLeave(event);
                  } else {
                    contentContext.onItemEnter(event);
                    if (!event.defaultPrevented) {
                      const item = event.currentTarget;
                      item.focus({ preventScroll: true });
                    }
                  }
                })
              ),
              onPointerLeave: composeEventHandlers(
                props.onPointerLeave,
                whenMouse((event) => contentContext.onItemLeave(event))
              ),
              onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)),
              onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false))
            })
          ) }))
        }
      );
    }
  );
  var CHECKBOX_ITEM_NAME$1 = "MenuCheckboxItem";
  var MenuCheckboxItem = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { checked = false, onCheckedChange } = _a2, checkboxItemProps = __objRest(_a2, ["checked", "onCheckedChange"]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        MenuItem,
        __spreadProps(__spreadValues({
          role: "menuitemcheckbox",
          "aria-checked": isIndeterminate$1(checked) ? "mixed" : checked
        }, checkboxItemProps), {
          ref: forwardedRef,
          "data-state": getCheckedState(checked),
          onSelect: composeEventHandlers(
            checkboxItemProps.onSelect,
            () => onCheckedChange == null ? void 0 : onCheckedChange(isIndeterminate$1(checked) ? true : !checked),
            { checkForDefaultPrevented: false }
          )
        })
      ) });
    }
  );
  MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME$1;
  var RADIO_GROUP_NAME$2 = "MenuRadioGroup";
  var [RadioGroupProvider$1, useRadioGroupContext$1] = createMenuContext(
    RADIO_GROUP_NAME$2,
    { value: void 0, onValueChange: /* @__PURE__ */ __name(() => {
    }, "onValueChange") }
  );
  var MenuRadioGroup = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { value, onValueChange } = _a2, groupProps = __objRest(_a2, ["value", "onValueChange"]);
      const handleValueChange = useCallbackRef$1(onValueChange);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(RadioGroupProvider$1, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MenuGroup, __spreadProps(__spreadValues({}, groupProps), { ref: forwardedRef })) });
    }
  );
  MenuRadioGroup.displayName = RADIO_GROUP_NAME$2;
  var RADIO_ITEM_NAME$1 = "MenuRadioItem";
  var MenuRadioItem = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { value } = _a2, radioItemProps = __objRest(_a2, ["value"]);
      const context = useRadioGroupContext$1(RADIO_ITEM_NAME$1, props.__scopeMenu);
      const checked = value === context.value;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        MenuItem,
        __spreadProps(__spreadValues({
          role: "menuitemradio",
          "aria-checked": checked
        }, radioItemProps), {
          ref: forwardedRef,
          "data-state": getCheckedState(checked),
          onSelect: composeEventHandlers(
            radioItemProps.onSelect,
            () => {
              var _a3;
              return (_a3 = context.onValueChange) == null ? void 0 : _a3.call(context, value);
            },
            { checkForDefaultPrevented: false }
          )
        })
      ) });
    }
  );
  MenuRadioItem.displayName = RADIO_ITEM_NAME$1;
  var ITEM_INDICATOR_NAME$1 = "MenuItemIndicator";
  var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(
    ITEM_INDICATOR_NAME$1,
    { checked: false }
  );
  var MenuItemIndicator = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeMenu, forceMount } = _a2, itemIndicatorProps = __objRest(_a2, ["__scopeMenu", "forceMount"]);
      const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME$1, __scopeMenu);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Presence,
        {
          present: forceMount || isIndeterminate$1(indicatorContext.checked) || indicatorContext.checked === true,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Primitive$1.span,
            __spreadProps(__spreadValues({}, itemIndicatorProps), {
              ref: forwardedRef,
              "data-state": getCheckedState(indicatorContext.checked)
            })
          )
        }
      );
    }
  );
  MenuItemIndicator.displayName = ITEM_INDICATOR_NAME$1;
  var SEPARATOR_NAME$2 = "MenuSeparator";
  var MenuSeparator = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeMenu } = _a2, separatorProps = __objRest(_a2, ["__scopeMenu"]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.div,
        __spreadProps(__spreadValues({
          role: "separator",
          "aria-orientation": "horizontal"
        }, separatorProps), {
          ref: forwardedRef
        })
      );
    }
  );
  MenuSeparator.displayName = SEPARATOR_NAME$2;
  var ARROW_NAME$3 = "MenuArrow";
  var MenuArrow = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeMenu } = _a2, arrowProps = __objRest(_a2, ["__scopeMenu"]);
      const popperScope = usePopperScope$2(__scopeMenu);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Arrow, __spreadProps(__spreadValues(__spreadValues({}, popperScope), arrowProps), { ref: forwardedRef }));
    }
  );
  MenuArrow.displayName = ARROW_NAME$3;
  var SUB_NAME = "MenuSub";
  var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);
  var SUB_TRIGGER_NAME$1 = "MenuSubTrigger";
  var MenuSubTrigger = reactExports.forwardRef(
    (props, forwardedRef) => {
      const context = useMenuContext(SUB_TRIGGER_NAME$1, props.__scopeMenu);
      const rootContext = useMenuRootContext(SUB_TRIGGER_NAME$1, props.__scopeMenu);
      const subContext = useMenuSubContext(SUB_TRIGGER_NAME$1, props.__scopeMenu);
      const contentContext = useMenuContentContext(SUB_TRIGGER_NAME$1, props.__scopeMenu);
      const openTimerRef = reactExports.useRef(null);
      const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;
      const scope = { __scopeMenu: props.__scopeMenu };
      const clearOpenTimer = reactExports.useCallback(() => {
        if (openTimerRef.current) window.clearTimeout(openTimerRef.current);
        openTimerRef.current = null;
      }, []);
      reactExports.useEffect(() => clearOpenTimer, [clearOpenTimer]);
      reactExports.useEffect(() => {
        const pointerGraceTimer = pointerGraceTimerRef.current;
        return () => {
          window.clearTimeout(pointerGraceTimer);
          onPointerGraceIntentChange(null);
        };
      }, [pointerGraceTimerRef, onPointerGraceIntentChange]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(MenuAnchor, __spreadProps(__spreadValues({ asChild: true }, scope), { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        MenuItemImpl,
        __spreadProps(__spreadValues({
          id: subContext.triggerId,
          "aria-haspopup": "menu",
          "aria-expanded": context.open,
          "aria-controls": subContext.contentId,
          "data-state": getOpenState(context.open)
        }, props), {
          ref: composeRefs(forwardedRef, subContext.onTriggerChange),
          onClick: /* @__PURE__ */ __name((event) => {
            var _a2;
            (_a2 = props.onClick) == null ? void 0 : _a2.call(props, event);
            if (props.disabled || event.defaultPrevented) return;
            event.currentTarget.focus();
            if (!context.open) context.onOpenChange(true);
          }, "onClick"),
          onPointerMove: composeEventHandlers(
            props.onPointerMove,
            whenMouse((event) => {
              contentContext.onItemEnter(event);
              if (event.defaultPrevented) return;
              if (!props.disabled && !context.open && !openTimerRef.current) {
                contentContext.onPointerGraceIntentChange(null);
                openTimerRef.current = window.setTimeout(() => {
                  context.onOpenChange(true);
                  clearOpenTimer();
                }, 100);
              }
            })
          ),
          onPointerLeave: composeEventHandlers(
            props.onPointerLeave,
            whenMouse((event) => {
              var _a2, _b2;
              clearOpenTimer();
              const contentRect = (_a2 = context.content) == null ? void 0 : _a2.getBoundingClientRect();
              if (contentRect) {
                const side = (_b2 = context.content) == null ? void 0 : _b2.dataset.side;
                const rightSide = side === "right";
                const bleed = rightSide ? -5 : 5;
                const contentNearEdge = contentRect[rightSide ? "left" : "right"];
                const contentFarEdge = contentRect[rightSide ? "right" : "left"];
                contentContext.onPointerGraceIntentChange({
                  area: [
                    // Apply a bleed on clientX to ensure that our exit point is
                    // consistently within polygon bounds
                    { x: event.clientX + bleed, y: event.clientY },
                    { x: contentNearEdge, y: contentRect.top },
                    { x: contentFarEdge, y: contentRect.top },
                    { x: contentFarEdge, y: contentRect.bottom },
                    { x: contentNearEdge, y: contentRect.bottom }
                  ],
                  side
                });
                window.clearTimeout(pointerGraceTimerRef.current);
                pointerGraceTimerRef.current = window.setTimeout(
                  () => contentContext.onPointerGraceIntentChange(null),
                  300
                );
              } else {
                contentContext.onTriggerLeave(event);
                if (event.defaultPrevented) return;
                contentContext.onPointerGraceIntentChange(null);
              }
            })
          ),
          onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
            var _a2;
            const isTypingAhead = contentContext.searchRef.current !== "";
            if (props.disabled || isTypingAhead && event.key === " ") return;
            if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {
              context.onOpenChange(true);
              (_a2 = context.content) == null ? void 0 : _a2.focus();
              event.preventDefault();
            }
          })
        })
      ) }));
    }
  );
  MenuSubTrigger.displayName = SUB_TRIGGER_NAME$1;
  var SUB_CONTENT_NAME$1 = "MenuSubContent";
  var MenuSubContent = reactExports.forwardRef(
    (props, forwardedRef) => {
      const portalContext = usePortalContext$2(CONTENT_NAME$7, props.__scopeMenu);
      const _a2 = props, { forceMount = portalContext.forceMount } = _a2, subContentProps = __objRest(_a2, ["forceMount"]);
      const context = useMenuContext(CONTENT_NAME$7, props.__scopeMenu);
      const rootContext = useMenuRootContext(CONTENT_NAME$7, props.__scopeMenu);
      const subContext = useMenuSubContext(SUB_CONTENT_NAME$1, props.__scopeMenu);
      const ref = reactExports.useRef(null);
      const composedRefs = useComposedRefs(forwardedRef, ref);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Collection$2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Collection$2.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        MenuContentImpl,
        __spreadProps(__spreadValues({
          id: subContext.contentId,
          "aria-labelledby": subContext.triggerId
        }, subContentProps), {
          ref: composedRefs,
          align: "start",
          side: rootContext.dir === "rtl" ? "left" : "right",
          disableOutsidePointerEvents: false,
          disableOutsideScroll: false,
          trapFocus: false,
          onOpenAutoFocus: /* @__PURE__ */ __name((event) => {
            var _a3;
            if (rootContext.isUsingKeyboardRef.current) (_a3 = ref.current) == null ? void 0 : _a3.focus();
            event.preventDefault();
          }, "onOpenAutoFocus"),
          onCloseAutoFocus: /* @__PURE__ */ __name((event) => event.preventDefault(), "onCloseAutoFocus"),
          onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => {
            if (event.target !== subContext.trigger) context.onOpenChange(false);
          }),
          onEscapeKeyDown: composeEventHandlers(props.onEscapeKeyDown, (event) => {
            rootContext.onClose();
            event.preventDefault();
          }),
          onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
            var _a3;
            const isKeyDownInside = event.currentTarget.contains(event.target);
            const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);
            if (isKeyDownInside && isCloseKey) {
              context.onOpenChange(false);
              (_a3 = subContext.trigger) == null ? void 0 : _a3.focus();
              event.preventDefault();
            }
          })
        })
      ) }) }) });
    }
  );
  MenuSubContent.displayName = SUB_CONTENT_NAME$1;
  function getOpenState(open) {
    return open ? "open" : "closed";
  }
  __name(getOpenState, "getOpenState");
  function isIndeterminate$1(checked) {
    return checked === "indeterminate";
  }
  __name(isIndeterminate$1, "isIndeterminate$1");
  function getCheckedState(checked) {
    return isIndeterminate$1(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
  }
  __name(getCheckedState, "getCheckedState");
  function focusFirst(candidates) {
    const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
    for (const candidate of candidates) {
      if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
      candidate.focus();
      if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
    }
  }
  __name(focusFirst, "focusFirst");
  function wrapArray$1(array2, startIndex) {
    return array2.map((_, index2) => array2[(startIndex + index2) % array2.length]);
  }
  __name(wrapArray$1, "wrapArray$1");
  function getNextMatch(values, search, currentMatch) {
    const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);
    const normalizedSearch = isRepeated ? search[0] : search;
    const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;
    let wrappedValues = wrapArray$1(values, Math.max(currentMatchIndex, 0));
    const excludeCurrentMatch = normalizedSearch.length === 1;
    if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);
    const nextMatch = wrappedValues.find(
      (value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())
    );
    return nextMatch !== currentMatch ? nextMatch : void 0;
  }
  __name(getNextMatch, "getNextMatch");
  function isPointInPolygon$1(point2, polygon) {
    const { x: x2, y: y2 } = point2;
    let inside = false;
    for (let i2 = 0, j = polygon.length - 1; i2 < polygon.length; j = i2++) {
      const ii = polygon[i2];
      const jj = polygon[j];
      const xi = ii.x;
      const yi = ii.y;
      const xj = jj.x;
      const yj = jj.y;
      const intersect = yi > y2 !== yj > y2 && x2 < (xj - xi) * (y2 - yi) / (yj - yi) + xi;
      if (intersect) inside = !inside;
    }
    return inside;
  }
  __name(isPointInPolygon$1, "isPointInPolygon$1");
  function isPointerInGraceArea(event, area) {
    if (!area) return false;
    const cursorPos = { x: event.clientX, y: event.clientY };
    return isPointInPolygon$1(cursorPos, area);
  }
  __name(isPointerInGraceArea, "isPointerInGraceArea");
  function whenMouse(handler) {
    return (event) => event.pointerType === "mouse" ? handler(event) : void 0;
  }
  __name(whenMouse, "whenMouse");
  var Root3$1 = Menu;
  var Anchor2 = MenuAnchor;
  var Portal$2 = MenuPortal;
  var Content2$4 = MenuContent;
  var Group = MenuGroup;
  var Label$5 = MenuLabel;
  var Item2$2 = MenuItem;
  var CheckboxItem = MenuCheckboxItem;
  var RadioGroup$2 = MenuRadioGroup;
  var RadioItem = MenuRadioItem;
  var ItemIndicator$1 = MenuItemIndicator;
  var Separator$1 = MenuSeparator;
  var Arrow2$1 = MenuArrow;
  var SubTrigger = MenuSubTrigger;
  var SubContent = MenuSubContent;
  var DROPDOWN_MENU_NAME = "DropdownMenu";
  var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(
    DROPDOWN_MENU_NAME,
    [createMenuScope]
  );
  var useMenuScope = createMenuScope();
  var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
  var DropdownMenu$1 = /* @__PURE__ */ __name((props) => {
    const {
      __scopeDropdownMenu,
      children,
      dir,
      open: openProp,
      defaultOpen,
      onOpenChange,
      modal = true
    } = props;
    const menuScope = useMenuScope(__scopeDropdownMenu);
    const triggerRef = reactExports.useRef(null);
    const [open, setOpen] = useControllableState({
      prop: openProp,
      defaultProp: defaultOpen != null ? defaultOpen : false,
      onChange: onOpenChange,
      caller: DROPDOWN_MENU_NAME
    });
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      DropdownMenuProvider,
      {
        scope: __scopeDropdownMenu,
        triggerId: useId(),
        triggerRef,
        contentId: useId(),
        open,
        onOpenChange: setOpen,
        onOpenToggle: reactExports.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
        modal,
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(Root3$1, __spreadProps(__spreadValues({}, menuScope), { open, onOpenChange: setOpen, dir, modal, children }))
      }
    );
  }, "DropdownMenu$1");
  DropdownMenu$1.displayName = DROPDOWN_MENU_NAME;
  var TRIGGER_NAME$7 = "DropdownMenuTrigger";
  var DropdownMenuTrigger$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeDropdownMenu, disabled = false } = _a2, triggerProps = __objRest(_a2, ["__scopeDropdownMenu", "disabled"]);
      const context = useDropdownMenuContext(TRIGGER_NAME$7, __scopeDropdownMenu);
      const menuScope = useMenuScope(__scopeDropdownMenu);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor2, __spreadProps(__spreadValues({ asChild: true }, menuScope), { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.button,
        __spreadProps(__spreadValues({
          type: "button",
          id: context.triggerId,
          "aria-haspopup": "menu",
          "aria-expanded": context.open,
          "aria-controls": context.open ? context.contentId : void 0,
          "data-state": context.open ? "open" : "closed",
          "data-disabled": disabled ? "" : void 0,
          disabled
        }, triggerProps), {
          ref: composeRefs(forwardedRef, context.triggerRef),
          onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
            if (!disabled && event.button === 0 && event.ctrlKey === false) {
              context.onOpenToggle();
              if (!context.open) event.preventDefault();
            }
          }),
          onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
            if (disabled) return;
            if (["Enter", " "].includes(event.key)) context.onOpenToggle();
            if (event.key === "ArrowDown") context.onOpenChange(true);
            if (["Enter", " ", "ArrowDown"].includes(event.key)) event.preventDefault();
          })
        })
      ) }));
    }
  );
  DropdownMenuTrigger$1.displayName = TRIGGER_NAME$7;
  var PORTAL_NAME$3 = "DropdownMenuPortal";
  var DropdownMenuPortal = /* @__PURE__ */ __name((props) => {
    const _a2 = props, { __scopeDropdownMenu } = _a2, portalProps = __objRest(_a2, ["__scopeDropdownMenu"]);
    const menuScope = useMenuScope(__scopeDropdownMenu);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Portal$2, __spreadValues(__spreadValues({}, menuScope), portalProps));
  }, "DropdownMenuPortal");
  DropdownMenuPortal.displayName = PORTAL_NAME$3;
  var CONTENT_NAME$6 = "DropdownMenuContent";
  var DropdownMenuContent$2 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeDropdownMenu } = _a2, contentProps = __objRest(_a2, ["__scopeDropdownMenu"]);
      const context = useDropdownMenuContext(CONTENT_NAME$6, __scopeDropdownMenu);
      const menuScope = useMenuScope(__scopeDropdownMenu);
      const hasInteractedOutsideRef = reactExports.useRef(false);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Content2$4,
        __spreadProps(__spreadValues(__spreadValues({
          id: context.contentId,
          "aria-labelledby": context.triggerId
        }, menuScope), contentProps), {
          ref: forwardedRef,
          onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
            var _a3;
            if (!hasInteractedOutsideRef.current) (_a3 = context.triggerRef.current) == null ? void 0 : _a3.focus();
            hasInteractedOutsideRef.current = false;
            event.preventDefault();
          }),
          onInteractOutside: composeEventHandlers(props.onInteractOutside, (event) => {
            const originalEvent = event.detail.originalEvent;
            const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
            const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
            if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;
          }),
          style: __spreadValues(__spreadValues({}, props.style), {
            "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
            "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
            "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
            "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
            "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
          })
        })
      );
    }
  );
  DropdownMenuContent$2.displayName = CONTENT_NAME$6;
  var GROUP_NAME$1 = "DropdownMenuGroup";
  var DropdownMenuGroup = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeDropdownMenu } = _a2, groupProps = __objRest(_a2, ["__scopeDropdownMenu"]);
      const menuScope = useMenuScope(__scopeDropdownMenu);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Group, __spreadProps(__spreadValues(__spreadValues({}, menuScope), groupProps), { ref: forwardedRef }));
    }
  );
  DropdownMenuGroup.displayName = GROUP_NAME$1;
  var LABEL_NAME$1 = "DropdownMenuLabel";
  var DropdownMenuLabel$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeDropdownMenu } = _a2, labelProps = __objRest(_a2, ["__scopeDropdownMenu"]);
      const menuScope = useMenuScope(__scopeDropdownMenu);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Label$5, __spreadProps(__spreadValues(__spreadValues({}, menuScope), labelProps), { ref: forwardedRef }));
    }
  );
  DropdownMenuLabel$1.displayName = LABEL_NAME$1;
  var ITEM_NAME$3 = "DropdownMenuItem";
  var DropdownMenuItem$2 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeDropdownMenu } = _a2, itemProps = __objRest(_a2, ["__scopeDropdownMenu"]);
      const menuScope = useMenuScope(__scopeDropdownMenu);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Item2$2, __spreadProps(__spreadValues(__spreadValues({}, menuScope), itemProps), { ref: forwardedRef }));
    }
  );
  DropdownMenuItem$2.displayName = ITEM_NAME$3;
  var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
  var DropdownMenuCheckboxItem$1 = reactExports.forwardRef((props, forwardedRef) => {
    const _a2 = props, { __scopeDropdownMenu } = _a2, checkboxItemProps = __objRest(_a2, ["__scopeDropdownMenu"]);
    const menuScope = useMenuScope(__scopeDropdownMenu);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(CheckboxItem, __spreadProps(__spreadValues(__spreadValues({}, menuScope), checkboxItemProps), { ref: forwardedRef }));
  });
  DropdownMenuCheckboxItem$1.displayName = CHECKBOX_ITEM_NAME;
  var RADIO_GROUP_NAME$1 = "DropdownMenuRadioGroup";
  var DropdownMenuRadioGroup = reactExports.forwardRef((props, forwardedRef) => {
    const _a2 = props, { __scopeDropdownMenu } = _a2, radioGroupProps = __objRest(_a2, ["__scopeDropdownMenu"]);
    const menuScope = useMenuScope(__scopeDropdownMenu);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(RadioGroup$2, __spreadProps(__spreadValues(__spreadValues({}, menuScope), radioGroupProps), { ref: forwardedRef }));
  });
  DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME$1;
  var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
  var DropdownMenuRadioItem$1 = reactExports.forwardRef((props, forwardedRef) => {
    const _a2 = props, { __scopeDropdownMenu } = _a2, radioItemProps = __objRest(_a2, ["__scopeDropdownMenu"]);
    const menuScope = useMenuScope(__scopeDropdownMenu);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(RadioItem, __spreadProps(__spreadValues(__spreadValues({}, menuScope), radioItemProps), { ref: forwardedRef }));
  });
  DropdownMenuRadioItem$1.displayName = RADIO_ITEM_NAME;
  var INDICATOR_NAME$2 = "DropdownMenuItemIndicator";
  var DropdownMenuItemIndicator = reactExports.forwardRef((props, forwardedRef) => {
    const _a2 = props, { __scopeDropdownMenu } = _a2, itemIndicatorProps = __objRest(_a2, ["__scopeDropdownMenu"]);
    const menuScope = useMenuScope(__scopeDropdownMenu);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(ItemIndicator$1, __spreadProps(__spreadValues(__spreadValues({}, menuScope), itemIndicatorProps), { ref: forwardedRef }));
  });
  DropdownMenuItemIndicator.displayName = INDICATOR_NAME$2;
  var SEPARATOR_NAME$1 = "DropdownMenuSeparator";
  var DropdownMenuSeparator$1 = reactExports.forwardRef((props, forwardedRef) => {
    const _a2 = props, { __scopeDropdownMenu } = _a2, separatorProps = __objRest(_a2, ["__scopeDropdownMenu"]);
    const menuScope = useMenuScope(__scopeDropdownMenu);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Separator$1, __spreadProps(__spreadValues(__spreadValues({}, menuScope), separatorProps), { ref: forwardedRef }));
  });
  DropdownMenuSeparator$1.displayName = SEPARATOR_NAME$1;
  var ARROW_NAME$2 = "DropdownMenuArrow";
  var DropdownMenuArrow = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeDropdownMenu } = _a2, arrowProps = __objRest(_a2, ["__scopeDropdownMenu"]);
      const menuScope = useMenuScope(__scopeDropdownMenu);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Arrow2$1, __spreadProps(__spreadValues(__spreadValues({}, menuScope), arrowProps), { ref: forwardedRef }));
    }
  );
  DropdownMenuArrow.displayName = ARROW_NAME$2;
  var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
  var DropdownMenuSubTrigger$1 = reactExports.forwardRef((props, forwardedRef) => {
    const _a2 = props, { __scopeDropdownMenu } = _a2, subTriggerProps = __objRest(_a2, ["__scopeDropdownMenu"]);
    const menuScope = useMenuScope(__scopeDropdownMenu);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(SubTrigger, __spreadProps(__spreadValues(__spreadValues({}, menuScope), subTriggerProps), { ref: forwardedRef }));
  });
  DropdownMenuSubTrigger$1.displayName = SUB_TRIGGER_NAME;
  var SUB_CONTENT_NAME = "DropdownMenuSubContent";
  var DropdownMenuSubContent$1 = reactExports.forwardRef((props, forwardedRef) => {
    const _a2 = props, { __scopeDropdownMenu } = _a2, subContentProps = __objRest(_a2, ["__scopeDropdownMenu"]);
    const menuScope = useMenuScope(__scopeDropdownMenu);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      SubContent,
      __spreadProps(__spreadValues(__spreadValues({}, menuScope), subContentProps), {
        ref: forwardedRef,
        style: __spreadValues(__spreadValues({}, props.style), {
          "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
          "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
          "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
          "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
          "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
        })
      })
    );
  });
  DropdownMenuSubContent$1.displayName = SUB_CONTENT_NAME;
  var Root2$4 = DropdownMenu$1;
  var Trigger$4 = DropdownMenuTrigger$1;
  var Portal2 = DropdownMenuPortal;
  var Content2$3 = DropdownMenuContent$2;
  var Label2 = DropdownMenuLabel$1;
  var Item2$1 = DropdownMenuItem$2;
  var CheckboxItem2 = DropdownMenuCheckboxItem$1;
  var RadioItem2 = DropdownMenuRadioItem$1;
  var ItemIndicator2 = DropdownMenuItemIndicator;
  var Separator2 = DropdownMenuSeparator$1;
  var SubTrigger2 = DropdownMenuSubTrigger$1;
  var SubContent2 = DropdownMenuSubContent$1;
  function r$1(e) {
    var t2, f, n2 = "";
    if ("string" == typeof e || "number" == typeof e) n2 += e;
    else if ("object" == typeof e) if (Array.isArray(e)) {
      var o2 = e.length;
      for (t2 = 0; t2 < o2; t2++) e[t2] && (f = r$1(e[t2])) && (n2 && (n2 += " "), n2 += f);
    } else for (f in e) e[f] && (n2 && (n2 += " "), n2 += f);
    return n2;
  }
  __name(r$1, "r$1");
  function clsx() {
    for (var e, t2, f = 0, n2 = "", o2 = arguments.length; f < o2; f++) (e = arguments[f]) && (t2 = r$1(e)) && (n2 && (n2 += " "), n2 += t2);
    return n2;
  }
  __name(clsx, "clsx");
  const CLASS_PART_SEPARATOR = "-";
  const createClassGroupUtils = /* @__PURE__ */ __name((config2) => {
    const classMap = createClassMap(config2);
    const {
      conflictingClassGroups,
      conflictingClassGroupModifiers
    } = config2;
    const getClassGroupId = /* @__PURE__ */ __name((className) => {
      const classParts = className.split(CLASS_PART_SEPARATOR);
      if (classParts[0] === "" && classParts.length !== 1) {
        classParts.shift();
      }
      return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
    }, "getClassGroupId");
    const getConflictingClassGroupIds = /* @__PURE__ */ __name((classGroupId, hasPostfixModifier) => {
      const conflicts = conflictingClassGroups[classGroupId] || [];
      if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
        return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
      }
      return conflicts;
    }, "getConflictingClassGroupIds");
    return {
      getClassGroupId,
      getConflictingClassGroupIds
    };
  }, "createClassGroupUtils");
  const getGroupRecursive = /* @__PURE__ */ __name((classParts, classPartObject) => {
    var _a2;
    if (classParts.length === 0) {
      return classPartObject.classGroupId;
    }
    const currentClassPart = classParts[0];
    const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
    const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : void 0;
    if (classGroupFromNextClassPart) {
      return classGroupFromNextClassPart;
    }
    if (classPartObject.validators.length === 0) {
      return void 0;
    }
    const classRest = classParts.join(CLASS_PART_SEPARATOR);
    return (_a2 = classPartObject.validators.find(({
      validator
    }) => validator(classRest))) == null ? void 0 : _a2.classGroupId;
  }, "getGroupRecursive");
  const arbitraryPropertyRegex = /^\[(.+)\]$/;
  const getGroupIdForArbitraryProperty = /* @__PURE__ */ __name((className) => {
    if (arbitraryPropertyRegex.test(className)) {
      const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
      const property = arbitraryPropertyClassName == null ? void 0 : arbitraryPropertyClassName.substring(0, arbitraryPropertyClassName.indexOf(":"));
      if (property) {
        return "arbitrary.." + property;
      }
    }
  }, "getGroupIdForArbitraryProperty");
  const createClassMap = /* @__PURE__ */ __name((config2) => {
    const {
      theme,
      classGroups
    } = config2;
    const classMap = {
      nextPart: /* @__PURE__ */ new Map(),
      validators: []
    };
    for (const classGroupId in classGroups) {
      processClassesRecursively(classGroups[classGroupId], classMap, classGroupId, theme);
    }
    return classMap;
  }, "createClassMap");
  const processClassesRecursively = /* @__PURE__ */ __name((classGroup, classPartObject, classGroupId, theme) => {
    classGroup.forEach((classDefinition) => {
      if (typeof classDefinition === "string") {
        const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
        classPartObjectToEdit.classGroupId = classGroupId;
        return;
      }
      if (typeof classDefinition === "function") {
        if (isThemeGetter(classDefinition)) {
          processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
          return;
        }
        classPartObject.validators.push({
          validator: classDefinition,
          classGroupId
        });
        return;
      }
      Object.entries(classDefinition).forEach(([key, classGroup2]) => {
        processClassesRecursively(classGroup2, getPart(classPartObject, key), classGroupId, theme);
      });
    });
  }, "processClassesRecursively");
  const getPart = /* @__PURE__ */ __name((classPartObject, path) => {
    let currentClassPartObject = classPartObject;
    path.split(CLASS_PART_SEPARATOR).forEach((pathPart) => {
      if (!currentClassPartObject.nextPart.has(pathPart)) {
        currentClassPartObject.nextPart.set(pathPart, {
          nextPart: /* @__PURE__ */ new Map(),
          validators: []
        });
      }
      currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
    });
    return currentClassPartObject;
  }, "getPart");
  const isThemeGetter = /* @__PURE__ */ __name((func) => func.isThemeGetter, "isThemeGetter");
  const createLruCache = /* @__PURE__ */ __name((maxCacheSize) => {
    if (maxCacheSize < 1) {
      return {
        get: /* @__PURE__ */ __name(() => void 0, "get"),
        set: /* @__PURE__ */ __name(() => {
        }, "set")
      };
    }
    let cacheSize = 0;
    let cache = /* @__PURE__ */ new Map();
    let previousCache = /* @__PURE__ */ new Map();
    const update = /* @__PURE__ */ __name((key, value) => {
      cache.set(key, value);
      cacheSize++;
      if (cacheSize > maxCacheSize) {
        cacheSize = 0;
        previousCache = cache;
        cache = /* @__PURE__ */ new Map();
      }
    }, "update");
    return {
      get(key) {
        let value = cache.get(key);
        if (value !== void 0) {
          return value;
        }
        if ((value = previousCache.get(key)) !== void 0) {
          update(key, value);
          return value;
        }
      },
      set(key, value) {
        if (cache.has(key)) {
          cache.set(key, value);
        } else {
          update(key, value);
        }
      }
    };
  }, "createLruCache");
  const IMPORTANT_MODIFIER = "!";
  const MODIFIER_SEPARATOR = ":";
  const MODIFIER_SEPARATOR_LENGTH = MODIFIER_SEPARATOR.length;
  const createParseClassName = /* @__PURE__ */ __name((config2) => {
    const {
      prefix: prefix2,
      experimentalParseClassName
    } = config2;
    let parseClassName = /* @__PURE__ */ __name((className) => {
      const modifiers = [];
      let bracketDepth = 0;
      let parenDepth = 0;
      let modifierStart = 0;
      let postfixModifierPosition;
      for (let index2 = 0; index2 < className.length; index2++) {
        let currentCharacter = className[index2];
        if (bracketDepth === 0 && parenDepth === 0) {
          if (currentCharacter === MODIFIER_SEPARATOR) {
            modifiers.push(className.slice(modifierStart, index2));
            modifierStart = index2 + MODIFIER_SEPARATOR_LENGTH;
            continue;
          }
          if (currentCharacter === "/") {
            postfixModifierPosition = index2;
            continue;
          }
        }
        if (currentCharacter === "[") {
          bracketDepth++;
        } else if (currentCharacter === "]") {
          bracketDepth--;
        } else if (currentCharacter === "(") {
          parenDepth++;
        } else if (currentCharacter === ")") {
          parenDepth--;
        }
      }
      const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
      const baseClassName = stripImportantModifier(baseClassNameWithImportantModifier);
      const hasImportantModifier = baseClassName !== baseClassNameWithImportantModifier;
      const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0;
      return {
        modifiers,
        hasImportantModifier,
        baseClassName,
        maybePostfixModifierPosition
      };
    }, "parseClassName");
    if (prefix2) {
      const fullPrefix = prefix2 + MODIFIER_SEPARATOR;
      const parseClassNameOriginal = parseClassName;
      parseClassName = /* @__PURE__ */ __name((className) => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.substring(fullPrefix.length)) : {
        isExternal: true,
        modifiers: [],
        hasImportantModifier: false,
        baseClassName: className,
        maybePostfixModifierPosition: void 0
      }, "parseClassName");
    }
    if (experimentalParseClassName) {
      const parseClassNameOriginal = parseClassName;
      parseClassName = /* @__PURE__ */ __name((className) => experimentalParseClassName({
        className,
        parseClassName: parseClassNameOriginal
      }), "parseClassName");
    }
    return parseClassName;
  }, "createParseClassName");
  const stripImportantModifier = /* @__PURE__ */ __name((baseClassName) => {
    if (baseClassName.endsWith(IMPORTANT_MODIFIER)) {
      return baseClassName.substring(0, baseClassName.length - 1);
    }
    if (baseClassName.startsWith(IMPORTANT_MODIFIER)) {
      return baseClassName.substring(1);
    }
    return baseClassName;
  }, "stripImportantModifier");
  const createSortModifiers = /* @__PURE__ */ __name((config2) => {
    const orderSensitiveModifiers = Object.fromEntries(config2.orderSensitiveModifiers.map((modifier) => [modifier, true]));
    const sortModifiers = /* @__PURE__ */ __name((modifiers) => {
      if (modifiers.length <= 1) {
        return modifiers;
      }
      const sortedModifiers = [];
      let unsortedModifiers = [];
      modifiers.forEach((modifier) => {
        const isPositionSensitive = modifier[0] === "[" || orderSensitiveModifiers[modifier];
        if (isPositionSensitive) {
          sortedModifiers.push(...unsortedModifiers.sort(), modifier);
          unsortedModifiers = [];
        } else {
          unsortedModifiers.push(modifier);
        }
      });
      sortedModifiers.push(...unsortedModifiers.sort());
      return sortedModifiers;
    }, "sortModifiers");
    return sortModifiers;
  }, "createSortModifiers");
  const createConfigUtils = /* @__PURE__ */ __name((config2) => __spreadValues({
    cache: createLruCache(config2.cacheSize),
    parseClassName: createParseClassName(config2),
    sortModifiers: createSortModifiers(config2)
  }, createClassGroupUtils(config2)), "createConfigUtils");
  const SPLIT_CLASSES_REGEX = /\s+/;
  const mergeClassList = /* @__PURE__ */ __name((classList, configUtils) => {
    const {
      parseClassName,
      getClassGroupId,
      getConflictingClassGroupIds,
      sortModifiers
    } = configUtils;
    const classGroupsInConflict = [];
    const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
    let result = "";
    for (let index2 = classNames.length - 1; index2 >= 0; index2 -= 1) {
      const originalClassName = classNames[index2];
      const {
        isExternal,
        modifiers,
        hasImportantModifier,
        baseClassName,
        maybePostfixModifierPosition
      } = parseClassName(originalClassName);
      if (isExternal) {
        result = originalClassName + (result.length > 0 ? " " + result : result);
        continue;
      }
      let hasPostfixModifier = !!maybePostfixModifierPosition;
      let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
      if (!classGroupId) {
        if (!hasPostfixModifier) {
          result = originalClassName + (result.length > 0 ? " " + result : result);
          continue;
        }
        classGroupId = getClassGroupId(baseClassName);
        if (!classGroupId) {
          result = originalClassName + (result.length > 0 ? " " + result : result);
          continue;
        }
        hasPostfixModifier = false;
      }
      const variantModifier = sortModifiers(modifiers).join(":");
      const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
      const classId = modifierId + classGroupId;
      if (classGroupsInConflict.includes(classId)) {
        continue;
      }
      classGroupsInConflict.push(classId);
      const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
      for (let i2 = 0; i2 < conflictGroups.length; ++i2) {
        const group = conflictGroups[i2];
        classGroupsInConflict.push(modifierId + group);
      }
      result = originalClassName + (result.length > 0 ? " " + result : result);
    }
    return result;
  }, "mergeClassList");
  function twJoin() {
    let index2 = 0;
    let argument;
    let resolvedValue;
    let string2 = "";
    while (index2 < arguments.length) {
      if (argument = arguments[index2++]) {
        if (resolvedValue = toValue(argument)) {
          string2 && (string2 += " ");
          string2 += resolvedValue;
        }
      }
    }
    return string2;
  }
  __name(twJoin, "twJoin");
  const toValue = /* @__PURE__ */ __name((mix) => {
    if (typeof mix === "string") {
      return mix;
    }
    let resolvedValue;
    let string2 = "";
    for (let k2 = 0; k2 < mix.length; k2++) {
      if (mix[k2]) {
        if (resolvedValue = toValue(mix[k2])) {
          string2 && (string2 += " ");
          string2 += resolvedValue;
        }
      }
    }
    return string2;
  }, "toValue");
  function createTailwindMerge(createConfigFirst, ...createConfigRest) {
    let configUtils;
    let cacheGet;
    let cacheSet;
    let functionToCall = initTailwindMerge;
    function initTailwindMerge(classList) {
      const config2 = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
      configUtils = createConfigUtils(config2);
      cacheGet = configUtils.cache.get;
      cacheSet = configUtils.cache.set;
      functionToCall = tailwindMerge;
      return tailwindMerge(classList);
    }
    __name(initTailwindMerge, "initTailwindMerge");
    function tailwindMerge(classList) {
      const cachedResult = cacheGet(classList);
      if (cachedResult) {
        return cachedResult;
      }
      const result = mergeClassList(classList, configUtils);
      cacheSet(classList, result);
      return result;
    }
    __name(tailwindMerge, "tailwindMerge");
    return /* @__PURE__ */ __name(function callTailwindMerge() {
      return functionToCall(twJoin.apply(null, arguments));
    }, "callTailwindMerge");
  }
  __name(createTailwindMerge, "createTailwindMerge");
  const fromTheme = /* @__PURE__ */ __name((key) => {
    const themeGetter = /* @__PURE__ */ __name((theme) => theme[key] || [], "themeGetter");
    themeGetter.isThemeGetter = true;
    return themeGetter;
  }, "fromTheme");
  const arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
  const arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
  const fractionRegex = /^\d+\/\d+$/;
  const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
  const lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
  const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
  const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
  const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
  const isFraction = /* @__PURE__ */ __name((value) => fractionRegex.test(value), "isFraction");
  const isNumber$2 = /* @__PURE__ */ __name((value) => !!value && !Number.isNaN(Number(value)), "isNumber$2");
  const isInteger = /* @__PURE__ */ __name((value) => !!value && Number.isInteger(Number(value)), "isInteger");
  const isPercent$1 = /* @__PURE__ */ __name((value) => value.endsWith("%") && isNumber$2(value.slice(0, -1)), "isPercent$1");
  const isTshirtSize = /* @__PURE__ */ __name((value) => tshirtUnitRegex.test(value), "isTshirtSize");
  const isAny = /* @__PURE__ */ __name(() => true, "isAny");
  const isLengthOnly = /* @__PURE__ */ __name((value) => (
    // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
    // For example, `hsl(0 0% 0%)` would be classified as a length without this check.
    // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
    lengthUnitRegex.test(value) && !colorFunctionRegex.test(value)
  ), "isLengthOnly");
  const isNever = /* @__PURE__ */ __name(() => false, "isNever");
  const isShadow = /* @__PURE__ */ __name((value) => shadowRegex.test(value), "isShadow");
  const isImage = /* @__PURE__ */ __name((value) => imageRegex.test(value), "isImage");
  const isAnyNonArbitrary = /* @__PURE__ */ __name((value) => !isArbitraryValue(value) && !isArbitraryVariable(value), "isAnyNonArbitrary");
  const isArbitrarySize = /* @__PURE__ */ __name((value) => getIsArbitraryValue(value, isLabelSize, isNever), "isArbitrarySize");
  const isArbitraryValue = /* @__PURE__ */ __name((value) => arbitraryValueRegex.test(value), "isArbitraryValue");
  const isArbitraryLength = /* @__PURE__ */ __name((value) => getIsArbitraryValue(value, isLabelLength, isLengthOnly), "isArbitraryLength");
  const isArbitraryNumber = /* @__PURE__ */ __name((value) => getIsArbitraryValue(value, isLabelNumber, isNumber$2), "isArbitraryNumber");
  const isArbitraryPosition = /* @__PURE__ */ __name((value) => getIsArbitraryValue(value, isLabelPosition, isNever), "isArbitraryPosition");
  const isArbitraryImage = /* @__PURE__ */ __name((value) => getIsArbitraryValue(value, isLabelImage, isImage), "isArbitraryImage");
  const isArbitraryShadow = /* @__PURE__ */ __name((value) => getIsArbitraryValue(value, isLabelShadow, isShadow), "isArbitraryShadow");
  const isArbitraryVariable = /* @__PURE__ */ __name((value) => arbitraryVariableRegex.test(value), "isArbitraryVariable");
  const isArbitraryVariableLength = /* @__PURE__ */ __name((value) => getIsArbitraryVariable(value, isLabelLength), "isArbitraryVariableLength");
  const isArbitraryVariableFamilyName = /* @__PURE__ */ __name((value) => getIsArbitraryVariable(value, isLabelFamilyName), "isArbitraryVariableFamilyName");
  const isArbitraryVariablePosition = /* @__PURE__ */ __name((value) => getIsArbitraryVariable(value, isLabelPosition), "isArbitraryVariablePosition");
  const isArbitraryVariableSize = /* @__PURE__ */ __name((value) => getIsArbitraryVariable(value, isLabelSize), "isArbitraryVariableSize");
  const isArbitraryVariableImage = /* @__PURE__ */ __name((value) => getIsArbitraryVariable(value, isLabelImage), "isArbitraryVariableImage");
  const isArbitraryVariableShadow = /* @__PURE__ */ __name((value) => getIsArbitraryVariable(value, isLabelShadow, true), "isArbitraryVariableShadow");
  const getIsArbitraryValue = /* @__PURE__ */ __name((value, testLabel, testValue) => {
    const result = arbitraryValueRegex.exec(value);
    if (result) {
      if (result[1]) {
        return testLabel(result[1]);
      }
      return testValue(result[2]);
    }
    return false;
  }, "getIsArbitraryValue");
  const getIsArbitraryVariable = /* @__PURE__ */ __name((value, testLabel, shouldMatchNoLabel = false) => {
    const result = arbitraryVariableRegex.exec(value);
    if (result) {
      if (result[1]) {
        return testLabel(result[1]);
      }
      return shouldMatchNoLabel;
    }
    return false;
  }, "getIsArbitraryVariable");
  const isLabelPosition = /* @__PURE__ */ __name((label) => label === "position" || label === "percentage", "isLabelPosition");
  const isLabelImage = /* @__PURE__ */ __name((label) => label === "image" || label === "url", "isLabelImage");
  const isLabelSize = /* @__PURE__ */ __name((label) => label === "length" || label === "size" || label === "bg-size", "isLabelSize");
  const isLabelLength = /* @__PURE__ */ __name((label) => label === "length", "isLabelLength");
  const isLabelNumber = /* @__PURE__ */ __name((label) => label === "number", "isLabelNumber");
  const isLabelFamilyName = /* @__PURE__ */ __name((label) => label === "family-name", "isLabelFamilyName");
  const isLabelShadow = /* @__PURE__ */ __name((label) => label === "shadow", "isLabelShadow");
  const getDefaultConfig = /* @__PURE__ */ __name(() => {
    const themeColor = fromTheme("color");
    const themeFont = fromTheme("font");
    const themeText = fromTheme("text");
    const themeFontWeight = fromTheme("font-weight");
    const themeTracking = fromTheme("tracking");
    const themeLeading = fromTheme("leading");
    const themeBreakpoint = fromTheme("breakpoint");
    const themeContainer = fromTheme("container");
    const themeSpacing = fromTheme("spacing");
    const themeRadius = fromTheme("radius");
    const themeShadow = fromTheme("shadow");
    const themeInsetShadow = fromTheme("inset-shadow");
    const themeTextShadow = fromTheme("text-shadow");
    const themeDropShadow = fromTheme("drop-shadow");
    const themeBlur = fromTheme("blur");
    const themePerspective = fromTheme("perspective");
    const themeAspect = fromTheme("aspect");
    const themeEase = fromTheme("ease");
    const themeAnimate = fromTheme("animate");
    const scaleBreak = /* @__PURE__ */ __name(() => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], "scaleBreak");
    const scalePosition = /* @__PURE__ */ __name(() => [
      "center",
      "top",
      "bottom",
      "left",
      "right",
      "top-left",
      // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
      "left-top",
      "top-right",
      // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
      "right-top",
      "bottom-right",
      // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
      "right-bottom",
      "bottom-left",
      // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
      "left-bottom"
    ], "scalePosition");
    const scalePositionWithArbitrary = /* @__PURE__ */ __name(() => [...scalePosition(), isArbitraryVariable, isArbitraryValue], "scalePositionWithArbitrary");
    const scaleOverflow = /* @__PURE__ */ __name(() => ["auto", "hidden", "clip", "visible", "scroll"], "scaleOverflow");
    const scaleOverscroll = /* @__PURE__ */ __name(() => ["auto", "contain", "none"], "scaleOverscroll");
    const scaleUnambiguousSpacing = /* @__PURE__ */ __name(() => [isArbitraryVariable, isArbitraryValue, themeSpacing], "scaleUnambiguousSpacing");
    const scaleInset = /* @__PURE__ */ __name(() => [isFraction, "full", "auto", ...scaleUnambiguousSpacing()], "scaleInset");
    const scaleGridTemplateColsRows = /* @__PURE__ */ __name(() => [isInteger, "none", "subgrid", isArbitraryVariable, isArbitraryValue], "scaleGridTemplateColsRows");
    const scaleGridColRowStartAndEnd = /* @__PURE__ */ __name(() => ["auto", {
      span: ["full", isInteger, isArbitraryVariable, isArbitraryValue]
    }, isInteger, isArbitraryVariable, isArbitraryValue], "scaleGridColRowStartAndEnd");
    const scaleGridColRowStartOrEnd = /* @__PURE__ */ __name(() => [isInteger, "auto", isArbitraryVariable, isArbitraryValue], "scaleGridColRowStartOrEnd");
    const scaleGridAutoColsRows = /* @__PURE__ */ __name(() => ["auto", "min", "max", "fr", isArbitraryVariable, isArbitraryValue], "scaleGridAutoColsRows");
    const scaleAlignPrimaryAxis = /* @__PURE__ */ __name(() => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], "scaleAlignPrimaryAxis");
    const scaleAlignSecondaryAxis = /* @__PURE__ */ __name(() => ["start", "end", "center", "stretch", "center-safe", "end-safe"], "scaleAlignSecondaryAxis");
    const scaleMargin = /* @__PURE__ */ __name(() => ["auto", ...scaleUnambiguousSpacing()], "scaleMargin");
    const scaleSizing = /* @__PURE__ */ __name(() => [isFraction, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...scaleUnambiguousSpacing()], "scaleSizing");
    const scaleColor = /* @__PURE__ */ __name(() => [themeColor, isArbitraryVariable, isArbitraryValue], "scaleColor");
    const scaleBgPosition = /* @__PURE__ */ __name(() => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, {
      position: [isArbitraryVariable, isArbitraryValue]
    }], "scaleBgPosition");
    const scaleBgRepeat = /* @__PURE__ */ __name(() => ["no-repeat", {
      repeat: ["", "x", "y", "space", "round"]
    }], "scaleBgRepeat");
    const scaleBgSize = /* @__PURE__ */ __name(() => ["auto", "cover", "contain", isArbitraryVariableSize, isArbitrarySize, {
      size: [isArbitraryVariable, isArbitraryValue]
    }], "scaleBgSize");
    const scaleGradientStopPosition = /* @__PURE__ */ __name(() => [isPercent$1, isArbitraryVariableLength, isArbitraryLength], "scaleGradientStopPosition");
    const scaleRadius = /* @__PURE__ */ __name(() => [
      // Deprecated since Tailwind CSS v4.0.0
      "",
      "none",
      "full",
      themeRadius,
      isArbitraryVariable,
      isArbitraryValue
    ], "scaleRadius");
    const scaleBorderWidth = /* @__PURE__ */ __name(() => ["", isNumber$2, isArbitraryVariableLength, isArbitraryLength], "scaleBorderWidth");
    const scaleLineStyle = /* @__PURE__ */ __name(() => ["solid", "dashed", "dotted", "double"], "scaleLineStyle");
    const scaleBlendMode = /* @__PURE__ */ __name(() => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], "scaleBlendMode");
    const scaleMaskImagePosition = /* @__PURE__ */ __name(() => [isNumber$2, isPercent$1, isArbitraryVariablePosition, isArbitraryPosition], "scaleMaskImagePosition");
    const scaleBlur = /* @__PURE__ */ __name(() => [
      // Deprecated since Tailwind CSS v4.0.0
      "",
      "none",
      themeBlur,
      isArbitraryVariable,
      isArbitraryValue
    ], "scaleBlur");
    const scaleRotate = /* @__PURE__ */ __name(() => ["none", isNumber$2, isArbitraryVariable, isArbitraryValue], "scaleRotate");
    const scaleScale = /* @__PURE__ */ __name(() => ["none", isNumber$2, isArbitraryVariable, isArbitraryValue], "scaleScale");
    const scaleSkew = /* @__PURE__ */ __name(() => [isNumber$2, isArbitraryVariable, isArbitraryValue], "scaleSkew");
    const scaleTranslate = /* @__PURE__ */ __name(() => [isFraction, "full", ...scaleUnambiguousSpacing()], "scaleTranslate");
    return {
      cacheSize: 500,
      theme: {
        animate: ["spin", "ping", "pulse", "bounce"],
        aspect: ["video"],
        blur: [isTshirtSize],
        breakpoint: [isTshirtSize],
        color: [isAny],
        container: [isTshirtSize],
        "drop-shadow": [isTshirtSize],
        ease: ["in", "out", "in-out"],
        font: [isAnyNonArbitrary],
        "font-weight": ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black"],
        "inset-shadow": [isTshirtSize],
        leading: ["none", "tight", "snug", "normal", "relaxed", "loose"],
        perspective: ["dramatic", "near", "normal", "midrange", "distant", "none"],
        radius: [isTshirtSize],
        shadow: [isTshirtSize],
        spacing: ["px", isNumber$2],
        text: [isTshirtSize],
        "text-shadow": [isTshirtSize],
        tracking: ["tighter", "tight", "normal", "wide", "wider", "widest"]
      },
      classGroups: {
        // --------------
        // --- Layout ---
        // --------------
        /**
         * Aspect Ratio
         * @see https://tailwindcss.com/docs/aspect-ratio
         */
        aspect: [{
          aspect: ["auto", "square", isFraction, isArbitraryValue, isArbitraryVariable, themeAspect]
        }],
        /**
         * Container
         * @see https://tailwindcss.com/docs/container
         * @deprecated since Tailwind CSS v4.0.0
         */
        container: ["container"],
        /**
         * Columns
         * @see https://tailwindcss.com/docs/columns
         */
        columns: [{
          columns: [isNumber$2, isArbitraryValue, isArbitraryVariable, themeContainer]
        }],
        /**
         * Break After
         * @see https://tailwindcss.com/docs/break-after
         */
        "break-after": [{
          "break-after": scaleBreak()
        }],
        /**
         * Break Before
         * @see https://tailwindcss.com/docs/break-before
         */
        "break-before": [{
          "break-before": scaleBreak()
        }],
        /**
         * Break Inside
         * @see https://tailwindcss.com/docs/break-inside
         */
        "break-inside": [{
          "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"]
        }],
        /**
         * Box Decoration Break
         * @see https://tailwindcss.com/docs/box-decoration-break
         */
        "box-decoration": [{
          "box-decoration": ["slice", "clone"]
        }],
        /**
         * Box Sizing
         * @see https://tailwindcss.com/docs/box-sizing
         */
        box: [{
          box: ["border", "content"]
        }],
        /**
         * Display
         * @see https://tailwindcss.com/docs/display
         */
        display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"],
        /**
         * Screen Reader Only
         * @see https://tailwindcss.com/docs/display#screen-reader-only
         */
        sr: ["sr-only", "not-sr-only"],
        /**
         * Floats
         * @see https://tailwindcss.com/docs/float
         */
        float: [{
          float: ["right", "left", "none", "start", "end"]
        }],
        /**
         * Clear
         * @see https://tailwindcss.com/docs/clear
         */
        clear: [{
          clear: ["left", "right", "both", "none", "start", "end"]
        }],
        /**
         * Isolation
         * @see https://tailwindcss.com/docs/isolation
         */
        isolation: ["isolate", "isolation-auto"],
        /**
         * Object Fit
         * @see https://tailwindcss.com/docs/object-fit
         */
        "object-fit": [{
          object: ["contain", "cover", "fill", "none", "scale-down"]
        }],
        /**
         * Object Position
         * @see https://tailwindcss.com/docs/object-position
         */
        "object-position": [{
          object: scalePositionWithArbitrary()
        }],
        /**
         * Overflow
         * @see https://tailwindcss.com/docs/overflow
         */
        overflow: [{
          overflow: scaleOverflow()
        }],
        /**
         * Overflow X
         * @see https://tailwindcss.com/docs/overflow
         */
        "overflow-x": [{
          "overflow-x": scaleOverflow()
        }],
        /**
         * Overflow Y
         * @see https://tailwindcss.com/docs/overflow
         */
        "overflow-y": [{
          "overflow-y": scaleOverflow()
        }],
        /**
         * Overscroll Behavior
         * @see https://tailwindcss.com/docs/overscroll-behavior
         */
        overscroll: [{
          overscroll: scaleOverscroll()
        }],
        /**
         * Overscroll Behavior X
         * @see https://tailwindcss.com/docs/overscroll-behavior
         */
        "overscroll-x": [{
          "overscroll-x": scaleOverscroll()
        }],
        /**
         * Overscroll Behavior Y
         * @see https://tailwindcss.com/docs/overscroll-behavior
         */
        "overscroll-y": [{
          "overscroll-y": scaleOverscroll()
        }],
        /**
         * Position
         * @see https://tailwindcss.com/docs/position
         */
        position: ["static", "fixed", "absolute", "relative", "sticky"],
        /**
         * Top / Right / Bottom / Left
         * @see https://tailwindcss.com/docs/top-right-bottom-left
         */
        inset: [{
          inset: scaleInset()
        }],
        /**
         * Right / Left
         * @see https://tailwindcss.com/docs/top-right-bottom-left
         */
        "inset-x": [{
          "inset-x": scaleInset()
        }],
        /**
         * Top / Bottom
         * @see https://tailwindcss.com/docs/top-right-bottom-left
         */
        "inset-y": [{
          "inset-y": scaleInset()
        }],
        /**
         * Start
         * @see https://tailwindcss.com/docs/top-right-bottom-left
         */
        start: [{
          start: scaleInset()
        }],
        /**
         * End
         * @see https://tailwindcss.com/docs/top-right-bottom-left
         */
        end: [{
          end: scaleInset()
        }],
        /**
         * Top
         * @see https://tailwindcss.com/docs/top-right-bottom-left
         */
        top: [{
          top: scaleInset()
        }],
        /**
         * Right
         * @see https://tailwindcss.com/docs/top-right-bottom-left
         */
        right: [{
          right: scaleInset()
        }],
        /**
         * Bottom
         * @see https://tailwindcss.com/docs/top-right-bottom-left
         */
        bottom: [{
          bottom: scaleInset()
        }],
        /**
         * Left
         * @see https://tailwindcss.com/docs/top-right-bottom-left
         */
        left: [{
          left: scaleInset()
        }],
        /**
         * Visibility
         * @see https://tailwindcss.com/docs/visibility
         */
        visibility: ["visible", "invisible", "collapse"],
        /**
         * Z-Index
         * @see https://tailwindcss.com/docs/z-index
         */
        z: [{
          z: [isInteger, "auto", isArbitraryVariable, isArbitraryValue]
        }],
        // ------------------------
        // --- Flexbox and Grid ---
        // ------------------------
        /**
         * Flex Basis
         * @see https://tailwindcss.com/docs/flex-basis
         */
        basis: [{
          basis: [isFraction, "full", "auto", themeContainer, ...scaleUnambiguousSpacing()]
        }],
        /**
         * Flex Direction
         * @see https://tailwindcss.com/docs/flex-direction
         */
        "flex-direction": [{
          flex: ["row", "row-reverse", "col", "col-reverse"]
        }],
        /**
         * Flex Wrap
         * @see https://tailwindcss.com/docs/flex-wrap
         */
        "flex-wrap": [{
          flex: ["nowrap", "wrap", "wrap-reverse"]
        }],
        /**
         * Flex
         * @see https://tailwindcss.com/docs/flex
         */
        flex: [{
          flex: [isNumber$2, isFraction, "auto", "initial", "none", isArbitraryValue]
        }],
        /**
         * Flex Grow
         * @see https://tailwindcss.com/docs/flex-grow
         */
        grow: [{
          grow: ["", isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Flex Shrink
         * @see https://tailwindcss.com/docs/flex-shrink
         */
        shrink: [{
          shrink: ["", isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Order
         * @see https://tailwindcss.com/docs/order
         */
        order: [{
          order: [isInteger, "first", "last", "none", isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Grid Template Columns
         * @see https://tailwindcss.com/docs/grid-template-columns
         */
        "grid-cols": [{
          "grid-cols": scaleGridTemplateColsRows()
        }],
        /**
         * Grid Column Start / End
         * @see https://tailwindcss.com/docs/grid-column
         */
        "col-start-end": [{
          col: scaleGridColRowStartAndEnd()
        }],
        /**
         * Grid Column Start
         * @see https://tailwindcss.com/docs/grid-column
         */
        "col-start": [{
          "col-start": scaleGridColRowStartOrEnd()
        }],
        /**
         * Grid Column End
         * @see https://tailwindcss.com/docs/grid-column
         */
        "col-end": [{
          "col-end": scaleGridColRowStartOrEnd()
        }],
        /**
         * Grid Template Rows
         * @see https://tailwindcss.com/docs/grid-template-rows
         */
        "grid-rows": [{
          "grid-rows": scaleGridTemplateColsRows()
        }],
        /**
         * Grid Row Start / End
         * @see https://tailwindcss.com/docs/grid-row
         */
        "row-start-end": [{
          row: scaleGridColRowStartAndEnd()
        }],
        /**
         * Grid Row Start
         * @see https://tailwindcss.com/docs/grid-row
         */
        "row-start": [{
          "row-start": scaleGridColRowStartOrEnd()
        }],
        /**
         * Grid Row End
         * @see https://tailwindcss.com/docs/grid-row
         */
        "row-end": [{
          "row-end": scaleGridColRowStartOrEnd()
        }],
        /**
         * Grid Auto Flow
         * @see https://tailwindcss.com/docs/grid-auto-flow
         */
        "grid-flow": [{
          "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"]
        }],
        /**
         * Grid Auto Columns
         * @see https://tailwindcss.com/docs/grid-auto-columns
         */
        "auto-cols": [{
          "auto-cols": scaleGridAutoColsRows()
        }],
        /**
         * Grid Auto Rows
         * @see https://tailwindcss.com/docs/grid-auto-rows
         */
        "auto-rows": [{
          "auto-rows": scaleGridAutoColsRows()
        }],
        /**
         * Gap
         * @see https://tailwindcss.com/docs/gap
         */
        gap: [{
          gap: scaleUnambiguousSpacing()
        }],
        /**
         * Gap X
         * @see https://tailwindcss.com/docs/gap
         */
        "gap-x": [{
          "gap-x": scaleUnambiguousSpacing()
        }],
        /**
         * Gap Y
         * @see https://tailwindcss.com/docs/gap
         */
        "gap-y": [{
          "gap-y": scaleUnambiguousSpacing()
        }],
        /**
         * Justify Content
         * @see https://tailwindcss.com/docs/justify-content
         */
        "justify-content": [{
          justify: [...scaleAlignPrimaryAxis(), "normal"]
        }],
        /**
         * Justify Items
         * @see https://tailwindcss.com/docs/justify-items
         */
        "justify-items": [{
          "justify-items": [...scaleAlignSecondaryAxis(), "normal"]
        }],
        /**
         * Justify Self
         * @see https://tailwindcss.com/docs/justify-self
         */
        "justify-self": [{
          "justify-self": ["auto", ...scaleAlignSecondaryAxis()]
        }],
        /**
         * Align Content
         * @see https://tailwindcss.com/docs/align-content
         */
        "align-content": [{
          content: ["normal", ...scaleAlignPrimaryAxis()]
        }],
        /**
         * Align Items
         * @see https://tailwindcss.com/docs/align-items
         */
        "align-items": [{
          items: [...scaleAlignSecondaryAxis(), {
            baseline: ["", "last"]
          }]
        }],
        /**
         * Align Self
         * @see https://tailwindcss.com/docs/align-self
         */
        "align-self": [{
          self: ["auto", ...scaleAlignSecondaryAxis(), {
            baseline: ["", "last"]
          }]
        }],
        /**
         * Place Content
         * @see https://tailwindcss.com/docs/place-content
         */
        "place-content": [{
          "place-content": scaleAlignPrimaryAxis()
        }],
        /**
         * Place Items
         * @see https://tailwindcss.com/docs/place-items
         */
        "place-items": [{
          "place-items": [...scaleAlignSecondaryAxis(), "baseline"]
        }],
        /**
         * Place Self
         * @see https://tailwindcss.com/docs/place-self
         */
        "place-self": [{
          "place-self": ["auto", ...scaleAlignSecondaryAxis()]
        }],
        // Spacing
        /**
         * Padding
         * @see https://tailwindcss.com/docs/padding
         */
        p: [{
          p: scaleUnambiguousSpacing()
        }],
        /**
         * Padding X
         * @see https://tailwindcss.com/docs/padding
         */
        px: [{
          px: scaleUnambiguousSpacing()
        }],
        /**
         * Padding Y
         * @see https://tailwindcss.com/docs/padding
         */
        py: [{
          py: scaleUnambiguousSpacing()
        }],
        /**
         * Padding Start
         * @see https://tailwindcss.com/docs/padding
         */
        ps: [{
          ps: scaleUnambiguousSpacing()
        }],
        /**
         * Padding End
         * @see https://tailwindcss.com/docs/padding
         */
        pe: [{
          pe: scaleUnambiguousSpacing()
        }],
        /**
         * Padding Top
         * @see https://tailwindcss.com/docs/padding
         */
        pt: [{
          pt: scaleUnambiguousSpacing()
        }],
        /**
         * Padding Right
         * @see https://tailwindcss.com/docs/padding
         */
        pr: [{
          pr: scaleUnambiguousSpacing()
        }],
        /**
         * Padding Bottom
         * @see https://tailwindcss.com/docs/padding
         */
        pb: [{
          pb: scaleUnambiguousSpacing()
        }],
        /**
         * Padding Left
         * @see https://tailwindcss.com/docs/padding
         */
        pl: [{
          pl: scaleUnambiguousSpacing()
        }],
        /**
         * Margin
         * @see https://tailwindcss.com/docs/margin
         */
        m: [{
          m: scaleMargin()
        }],
        /**
         * Margin X
         * @see https://tailwindcss.com/docs/margin
         */
        mx: [{
          mx: scaleMargin()
        }],
        /**
         * Margin Y
         * @see https://tailwindcss.com/docs/margin
         */
        my: [{
          my: scaleMargin()
        }],
        /**
         * Margin Start
         * @see https://tailwindcss.com/docs/margin
         */
        ms: [{
          ms: scaleMargin()
        }],
        /**
         * Margin End
         * @see https://tailwindcss.com/docs/margin
         */
        me: [{
          me: scaleMargin()
        }],
        /**
         * Margin Top
         * @see https://tailwindcss.com/docs/margin
         */
        mt: [{
          mt: scaleMargin()
        }],
        /**
         * Margin Right
         * @see https://tailwindcss.com/docs/margin
         */
        mr: [{
          mr: scaleMargin()
        }],
        /**
         * Margin Bottom
         * @see https://tailwindcss.com/docs/margin
         */
        mb: [{
          mb: scaleMargin()
        }],
        /**
         * Margin Left
         * @see https://tailwindcss.com/docs/margin
         */
        ml: [{
          ml: scaleMargin()
        }],
        /**
         * Space Between X
         * @see https://tailwindcss.com/docs/margin#adding-space-between-children
         */
        "space-x": [{
          "space-x": scaleUnambiguousSpacing()
        }],
        /**
         * Space Between X Reverse
         * @see https://tailwindcss.com/docs/margin#adding-space-between-children
         */
        "space-x-reverse": ["space-x-reverse"],
        /**
         * Space Between Y
         * @see https://tailwindcss.com/docs/margin#adding-space-between-children
         */
        "space-y": [{
          "space-y": scaleUnambiguousSpacing()
        }],
        /**
         * Space Between Y Reverse
         * @see https://tailwindcss.com/docs/margin#adding-space-between-children
         */
        "space-y-reverse": ["space-y-reverse"],
        // --------------
        // --- Sizing ---
        // --------------
        /**
         * Size
         * @see https://tailwindcss.com/docs/width#setting-both-width-and-height
         */
        size: [{
          size: scaleSizing()
        }],
        /**
         * Width
         * @see https://tailwindcss.com/docs/width
         */
        w: [{
          w: [themeContainer, "screen", ...scaleSizing()]
        }],
        /**
         * Min-Width
         * @see https://tailwindcss.com/docs/min-width
         */
        "min-w": [{
          "min-w": [
            themeContainer,
            "screen",
            /** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
            "none",
            ...scaleSizing()
          ]
        }],
        /**
         * Max-Width
         * @see https://tailwindcss.com/docs/max-width
         */
        "max-w": [{
          "max-w": [
            themeContainer,
            "screen",
            "none",
            /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
            "prose",
            /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
            {
              screen: [themeBreakpoint]
            },
            ...scaleSizing()
          ]
        }],
        /**
         * Height
         * @see https://tailwindcss.com/docs/height
         */
        h: [{
          h: ["screen", "lh", ...scaleSizing()]
        }],
        /**
         * Min-Height
         * @see https://tailwindcss.com/docs/min-height
         */
        "min-h": [{
          "min-h": ["screen", "lh", "none", ...scaleSizing()]
        }],
        /**
         * Max-Height
         * @see https://tailwindcss.com/docs/max-height
         */
        "max-h": [{
          "max-h": ["screen", "lh", ...scaleSizing()]
        }],
        // ------------------
        // --- Typography ---
        // ------------------
        /**
         * Font Size
         * @see https://tailwindcss.com/docs/font-size
         */
        "font-size": [{
          text: ["base", themeText, isArbitraryVariableLength, isArbitraryLength]
        }],
        /**
         * Font Smoothing
         * @see https://tailwindcss.com/docs/font-smoothing
         */
        "font-smoothing": ["antialiased", "subpixel-antialiased"],
        /**
         * Font Style
         * @see https://tailwindcss.com/docs/font-style
         */
        "font-style": ["italic", "not-italic"],
        /**
         * Font Weight
         * @see https://tailwindcss.com/docs/font-weight
         */
        "font-weight": [{
          font: [themeFontWeight, isArbitraryVariable, isArbitraryNumber]
        }],
        /**
         * Font Stretch
         * @see https://tailwindcss.com/docs/font-stretch
         */
        "font-stretch": [{
          "font-stretch": ["ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "normal", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded", isPercent$1, isArbitraryValue]
        }],
        /**
         * Font Family
         * @see https://tailwindcss.com/docs/font-family
         */
        "font-family": [{
          font: [isArbitraryVariableFamilyName, isArbitraryValue, themeFont]
        }],
        /**
         * Font Variant Numeric
         * @see https://tailwindcss.com/docs/font-variant-numeric
         */
        "fvn-normal": ["normal-nums"],
        /**
         * Font Variant Numeric
         * @see https://tailwindcss.com/docs/font-variant-numeric
         */
        "fvn-ordinal": ["ordinal"],
        /**
         * Font Variant Numeric
         * @see https://tailwindcss.com/docs/font-variant-numeric
         */
        "fvn-slashed-zero": ["slashed-zero"],
        /**
         * Font Variant Numeric
         * @see https://tailwindcss.com/docs/font-variant-numeric
         */
        "fvn-figure": ["lining-nums", "oldstyle-nums"],
        /**
         * Font Variant Numeric
         * @see https://tailwindcss.com/docs/font-variant-numeric
         */
        "fvn-spacing": ["proportional-nums", "tabular-nums"],
        /**
         * Font Variant Numeric
         * @see https://tailwindcss.com/docs/font-variant-numeric
         */
        "fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
        /**
         * Letter Spacing
         * @see https://tailwindcss.com/docs/letter-spacing
         */
        tracking: [{
          tracking: [themeTracking, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Line Clamp
         * @see https://tailwindcss.com/docs/line-clamp
         */
        "line-clamp": [{
          "line-clamp": [isNumber$2, "none", isArbitraryVariable, isArbitraryNumber]
        }],
        /**
         * Line Height
         * @see https://tailwindcss.com/docs/line-height
         */
        leading: [{
          leading: [
            /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
            themeLeading,
            ...scaleUnambiguousSpacing()
          ]
        }],
        /**
         * List Style Image
         * @see https://tailwindcss.com/docs/list-style-image
         */
        "list-image": [{
          "list-image": ["none", isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * List Style Position
         * @see https://tailwindcss.com/docs/list-style-position
         */
        "list-style-position": [{
          list: ["inside", "outside"]
        }],
        /**
         * List Style Type
         * @see https://tailwindcss.com/docs/list-style-type
         */
        "list-style-type": [{
          list: ["disc", "decimal", "none", isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Text Alignment
         * @see https://tailwindcss.com/docs/text-align
         */
        "text-alignment": [{
          text: ["left", "center", "right", "justify", "start", "end"]
        }],
        /**
         * Placeholder Color
         * @deprecated since Tailwind CSS v3.0.0
         * @see https://v3.tailwindcss.com/docs/placeholder-color
         */
        "placeholder-color": [{
          placeholder: scaleColor()
        }],
        /**
         * Text Color
         * @see https://tailwindcss.com/docs/text-color
         */
        "text-color": [{
          text: scaleColor()
        }],
        /**
         * Text Decoration
         * @see https://tailwindcss.com/docs/text-decoration
         */
        "text-decoration": ["underline", "overline", "line-through", "no-underline"],
        /**
         * Text Decoration Style
         * @see https://tailwindcss.com/docs/text-decoration-style
         */
        "text-decoration-style": [{
          decoration: [...scaleLineStyle(), "wavy"]
        }],
        /**
         * Text Decoration Thickness
         * @see https://tailwindcss.com/docs/text-decoration-thickness
         */
        "text-decoration-thickness": [{
          decoration: [isNumber$2, "from-font", "auto", isArbitraryVariable, isArbitraryLength]
        }],
        /**
         * Text Decoration Color
         * @see https://tailwindcss.com/docs/text-decoration-color
         */
        "text-decoration-color": [{
          decoration: scaleColor()
        }],
        /**
         * Text Underline Offset
         * @see https://tailwindcss.com/docs/text-underline-offset
         */
        "underline-offset": [{
          "underline-offset": [isNumber$2, "auto", isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Text Transform
         * @see https://tailwindcss.com/docs/text-transform
         */
        "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"],
        /**
         * Text Overflow
         * @see https://tailwindcss.com/docs/text-overflow
         */
        "text-overflow": ["truncate", "text-ellipsis", "text-clip"],
        /**
         * Text Wrap
         * @see https://tailwindcss.com/docs/text-wrap
         */
        "text-wrap": [{
          text: ["wrap", "nowrap", "balance", "pretty"]
        }],
        /**
         * Text Indent
         * @see https://tailwindcss.com/docs/text-indent
         */
        indent: [{
          indent: scaleUnambiguousSpacing()
        }],
        /**
         * Vertical Alignment
         * @see https://tailwindcss.com/docs/vertical-align
         */
        "vertical-align": [{
          align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Whitespace
         * @see https://tailwindcss.com/docs/whitespace
         */
        whitespace: [{
          whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"]
        }],
        /**
         * Word Break
         * @see https://tailwindcss.com/docs/word-break
         */
        break: [{
          break: ["normal", "words", "all", "keep"]
        }],
        /**
         * Overflow Wrap
         * @see https://tailwindcss.com/docs/overflow-wrap
         */
        wrap: [{
          wrap: ["break-word", "anywhere", "normal"]
        }],
        /**
         * Hyphens
         * @see https://tailwindcss.com/docs/hyphens
         */
        hyphens: [{
          hyphens: ["none", "manual", "auto"]
        }],
        /**
         * Content
         * @see https://tailwindcss.com/docs/content
         */
        content: [{
          content: ["none", isArbitraryVariable, isArbitraryValue]
        }],
        // -------------------
        // --- Backgrounds ---
        // -------------------
        /**
         * Background Attachment
         * @see https://tailwindcss.com/docs/background-attachment
         */
        "bg-attachment": [{
          bg: ["fixed", "local", "scroll"]
        }],
        /**
         * Background Clip
         * @see https://tailwindcss.com/docs/background-clip
         */
        "bg-clip": [{
          "bg-clip": ["border", "padding", "content", "text"]
        }],
        /**
         * Background Origin
         * @see https://tailwindcss.com/docs/background-origin
         */
        "bg-origin": [{
          "bg-origin": ["border", "padding", "content"]
        }],
        /**
         * Background Position
         * @see https://tailwindcss.com/docs/background-position
         */
        "bg-position": [{
          bg: scaleBgPosition()
        }],
        /**
         * Background Repeat
         * @see https://tailwindcss.com/docs/background-repeat
         */
        "bg-repeat": [{
          bg: scaleBgRepeat()
        }],
        /**
         * Background Size
         * @see https://tailwindcss.com/docs/background-size
         */
        "bg-size": [{
          bg: scaleBgSize()
        }],
        /**
         * Background Image
         * @see https://tailwindcss.com/docs/background-image
         */
        "bg-image": [{
          bg: ["none", {
            linear: [{
              to: ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
            }, isInteger, isArbitraryVariable, isArbitraryValue],
            radial: ["", isArbitraryVariable, isArbitraryValue],
            conic: [isInteger, isArbitraryVariable, isArbitraryValue]
          }, isArbitraryVariableImage, isArbitraryImage]
        }],
        /**
         * Background Color
         * @see https://tailwindcss.com/docs/background-color
         */
        "bg-color": [{
          bg: scaleColor()
        }],
        /**
         * Gradient Color Stops From Position
         * @see https://tailwindcss.com/docs/gradient-color-stops
         */
        "gradient-from-pos": [{
          from: scaleGradientStopPosition()
        }],
        /**
         * Gradient Color Stops Via Position
         * @see https://tailwindcss.com/docs/gradient-color-stops
         */
        "gradient-via-pos": [{
          via: scaleGradientStopPosition()
        }],
        /**
         * Gradient Color Stops To Position
         * @see https://tailwindcss.com/docs/gradient-color-stops
         */
        "gradient-to-pos": [{
          to: scaleGradientStopPosition()
        }],
        /**
         * Gradient Color Stops From
         * @see https://tailwindcss.com/docs/gradient-color-stops
         */
        "gradient-from": [{
          from: scaleColor()
        }],
        /**
         * Gradient Color Stops Via
         * @see https://tailwindcss.com/docs/gradient-color-stops
         */
        "gradient-via": [{
          via: scaleColor()
        }],
        /**
         * Gradient Color Stops To
         * @see https://tailwindcss.com/docs/gradient-color-stops
         */
        "gradient-to": [{
          to: scaleColor()
        }],
        // ---------------
        // --- Borders ---
        // ---------------
        /**
         * Border Radius
         * @see https://tailwindcss.com/docs/border-radius
         */
        rounded: [{
          rounded: scaleRadius()
        }],
        /**
         * Border Radius Start
         * @see https://tailwindcss.com/docs/border-radius
         */
        "rounded-s": [{
          "rounded-s": scaleRadius()
        }],
        /**
         * Border Radius End
         * @see https://tailwindcss.com/docs/border-radius
         */
        "rounded-e": [{
          "rounded-e": scaleRadius()
        }],
        /**
         * Border Radius Top
         * @see https://tailwindcss.com/docs/border-radius
         */
        "rounded-t": [{
          "rounded-t": scaleRadius()
        }],
        /**
         * Border Radius Right
         * @see https://tailwindcss.com/docs/border-radius
         */
        "rounded-r": [{
          "rounded-r": scaleRadius()
        }],
        /**
         * Border Radius Bottom
         * @see https://tailwindcss.com/docs/border-radius
         */
        "rounded-b": [{
          "rounded-b": scaleRadius()
        }],
        /**
         * Border Radius Left
         * @see https://tailwindcss.com/docs/border-radius
         */
        "rounded-l": [{
          "rounded-l": scaleRadius()
        }],
        /**
         * Border Radius Start Start
         * @see https://tailwindcss.com/docs/border-radius
         */
        "rounded-ss": [{
          "rounded-ss": scaleRadius()
        }],
        /**
         * Border Radius Start End
         * @see https://tailwindcss.com/docs/border-radius
         */
        "rounded-se": [{
          "rounded-se": scaleRadius()
        }],
        /**
         * Border Radius End End
         * @see https://tailwindcss.com/docs/border-radius
         */
        "rounded-ee": [{
          "rounded-ee": scaleRadius()
        }],
        /**
         * Border Radius End Start
         * @see https://tailwindcss.com/docs/border-radius
         */
        "rounded-es": [{
          "rounded-es": scaleRadius()
        }],
        /**
         * Border Radius Top Left
         * @see https://tailwindcss.com/docs/border-radius
         */
        "rounded-tl": [{
          "rounded-tl": scaleRadius()
        }],
        /**
         * Border Radius Top Right
         * @see https://tailwindcss.com/docs/border-radius
         */
        "rounded-tr": [{
          "rounded-tr": scaleRadius()
        }],
        /**
         * Border Radius Bottom Right
         * @see https://tailwindcss.com/docs/border-radius
         */
        "rounded-br": [{
          "rounded-br": scaleRadius()
        }],
        /**
         * Border Radius Bottom Left
         * @see https://tailwindcss.com/docs/border-radius
         */
        "rounded-bl": [{
          "rounded-bl": scaleRadius()
        }],
        /**
         * Border Width
         * @see https://tailwindcss.com/docs/border-width
         */
        "border-w": [{
          border: scaleBorderWidth()
        }],
        /**
         * Border Width X
         * @see https://tailwindcss.com/docs/border-width
         */
        "border-w-x": [{
          "border-x": scaleBorderWidth()
        }],
        /**
         * Border Width Y
         * @see https://tailwindcss.com/docs/border-width
         */
        "border-w-y": [{
          "border-y": scaleBorderWidth()
        }],
        /**
         * Border Width Start
         * @see https://tailwindcss.com/docs/border-width
         */
        "border-w-s": [{
          "border-s": scaleBorderWidth()
        }],
        /**
         * Border Width End
         * @see https://tailwindcss.com/docs/border-width
         */
        "border-w-e": [{
          "border-e": scaleBorderWidth()
        }],
        /**
         * Border Width Top
         * @see https://tailwindcss.com/docs/border-width
         */
        "border-w-t": [{
          "border-t": scaleBorderWidth()
        }],
        /**
         * Border Width Right
         * @see https://tailwindcss.com/docs/border-width
         */
        "border-w-r": [{
          "border-r": scaleBorderWidth()
        }],
        /**
         * Border Width Bottom
         * @see https://tailwindcss.com/docs/border-width
         */
        "border-w-b": [{
          "border-b": scaleBorderWidth()
        }],
        /**
         * Border Width Left
         * @see https://tailwindcss.com/docs/border-width
         */
        "border-w-l": [{
          "border-l": scaleBorderWidth()
        }],
        /**
         * Divide Width X
         * @see https://tailwindcss.com/docs/border-width#between-children
         */
        "divide-x": [{
          "divide-x": scaleBorderWidth()
        }],
        /**
         * Divide Width X Reverse
         * @see https://tailwindcss.com/docs/border-width#between-children
         */
        "divide-x-reverse": ["divide-x-reverse"],
        /**
         * Divide Width Y
         * @see https://tailwindcss.com/docs/border-width#between-children
         */
        "divide-y": [{
          "divide-y": scaleBorderWidth()
        }],
        /**
         * Divide Width Y Reverse
         * @see https://tailwindcss.com/docs/border-width#between-children
         */
        "divide-y-reverse": ["divide-y-reverse"],
        /**
         * Border Style
         * @see https://tailwindcss.com/docs/border-style
         */
        "border-style": [{
          border: [...scaleLineStyle(), "hidden", "none"]
        }],
        /**
         * Divide Style
         * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style
         */
        "divide-style": [{
          divide: [...scaleLineStyle(), "hidden", "none"]
        }],
        /**
         * Border Color
         * @see https://tailwindcss.com/docs/border-color
         */
        "border-color": [{
          border: scaleColor()
        }],
        /**
         * Border Color X
         * @see https://tailwindcss.com/docs/border-color
         */
        "border-color-x": [{
          "border-x": scaleColor()
        }],
        /**
         * Border Color Y
         * @see https://tailwindcss.com/docs/border-color
         */
        "border-color-y": [{
          "border-y": scaleColor()
        }],
        /**
         * Border Color S
         * @see https://tailwindcss.com/docs/border-color
         */
        "border-color-s": [{
          "border-s": scaleColor()
        }],
        /**
         * Border Color E
         * @see https://tailwindcss.com/docs/border-color
         */
        "border-color-e": [{
          "border-e": scaleColor()
        }],
        /**
         * Border Color Top
         * @see https://tailwindcss.com/docs/border-color
         */
        "border-color-t": [{
          "border-t": scaleColor()
        }],
        /**
         * Border Color Right
         * @see https://tailwindcss.com/docs/border-color
         */
        "border-color-r": [{
          "border-r": scaleColor()
        }],
        /**
         * Border Color Bottom
         * @see https://tailwindcss.com/docs/border-color
         */
        "border-color-b": [{
          "border-b": scaleColor()
        }],
        /**
         * Border Color Left
         * @see https://tailwindcss.com/docs/border-color
         */
        "border-color-l": [{
          "border-l": scaleColor()
        }],
        /**
         * Divide Color
         * @see https://tailwindcss.com/docs/divide-color
         */
        "divide-color": [{
          divide: scaleColor()
        }],
        /**
         * Outline Style
         * @see https://tailwindcss.com/docs/outline-style
         */
        "outline-style": [{
          outline: [...scaleLineStyle(), "none", "hidden"]
        }],
        /**
         * Outline Offset
         * @see https://tailwindcss.com/docs/outline-offset
         */
        "outline-offset": [{
          "outline-offset": [isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Outline Width
         * @see https://tailwindcss.com/docs/outline-width
         */
        "outline-w": [{
          outline: ["", isNumber$2, isArbitraryVariableLength, isArbitraryLength]
        }],
        /**
         * Outline Color
         * @see https://tailwindcss.com/docs/outline-color
         */
        "outline-color": [{
          outline: scaleColor()
        }],
        // ---------------
        // --- Effects ---
        // ---------------
        /**
         * Box Shadow
         * @see https://tailwindcss.com/docs/box-shadow
         */
        shadow: [{
          shadow: [
            // Deprecated since Tailwind CSS v4.0.0
            "",
            "none",
            themeShadow,
            isArbitraryVariableShadow,
            isArbitraryShadow
          ]
        }],
        /**
         * Box Shadow Color
         * @see https://tailwindcss.com/docs/box-shadow#setting-the-shadow-color
         */
        "shadow-color": [{
          shadow: scaleColor()
        }],
        /**
         * Inset Box Shadow
         * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow
         */
        "inset-shadow": [{
          "inset-shadow": ["none", themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow]
        }],
        /**
         * Inset Box Shadow Color
         * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-shadow-color
         */
        "inset-shadow-color": [{
          "inset-shadow": scaleColor()
        }],
        /**
         * Ring Width
         * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring
         */
        "ring-w": [{
          ring: scaleBorderWidth()
        }],
        /**
         * Ring Width Inset
         * @see https://v3.tailwindcss.com/docs/ring-width#inset-rings
         * @deprecated since Tailwind CSS v4.0.0
         * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
         */
        "ring-w-inset": ["ring-inset"],
        /**
         * Ring Color
         * @see https://tailwindcss.com/docs/box-shadow#setting-the-ring-color
         */
        "ring-color": [{
          ring: scaleColor()
        }],
        /**
         * Ring Offset Width
         * @see https://v3.tailwindcss.com/docs/ring-offset-width
         * @deprecated since Tailwind CSS v4.0.0
         * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
         */
        "ring-offset-w": [{
          "ring-offset": [isNumber$2, isArbitraryLength]
        }],
        /**
         * Ring Offset Color
         * @see https://v3.tailwindcss.com/docs/ring-offset-color
         * @deprecated since Tailwind CSS v4.0.0
         * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
         */
        "ring-offset-color": [{
          "ring-offset": scaleColor()
        }],
        /**
         * Inset Ring Width
         * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring
         */
        "inset-ring-w": [{
          "inset-ring": scaleBorderWidth()
        }],
        /**
         * Inset Ring Color
         * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-ring-color
         */
        "inset-ring-color": [{
          "inset-ring": scaleColor()
        }],
        /**
         * Text Shadow
         * @see https://tailwindcss.com/docs/text-shadow
         */
        "text-shadow": [{
          "text-shadow": ["none", themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow]
        }],
        /**
         * Text Shadow Color
         * @see https://tailwindcss.com/docs/text-shadow#setting-the-shadow-color
         */
        "text-shadow-color": [{
          "text-shadow": scaleColor()
        }],
        /**
         * Opacity
         * @see https://tailwindcss.com/docs/opacity
         */
        opacity: [{
          opacity: [isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Mix Blend Mode
         * @see https://tailwindcss.com/docs/mix-blend-mode
         */
        "mix-blend": [{
          "mix-blend": [...scaleBlendMode(), "plus-darker", "plus-lighter"]
        }],
        /**
         * Background Blend Mode
         * @see https://tailwindcss.com/docs/background-blend-mode
         */
        "bg-blend": [{
          "bg-blend": scaleBlendMode()
        }],
        /**
         * Mask Clip
         * @see https://tailwindcss.com/docs/mask-clip
         */
        "mask-clip": [{
          "mask-clip": ["border", "padding", "content", "fill", "stroke", "view"]
        }, "mask-no-clip"],
        /**
         * Mask Composite
         * @see https://tailwindcss.com/docs/mask-composite
         */
        "mask-composite": [{
          mask: ["add", "subtract", "intersect", "exclude"]
        }],
        /**
         * Mask Image
         * @see https://tailwindcss.com/docs/mask-image
         */
        "mask-image-linear-pos": [{
          "mask-linear": [isNumber$2]
        }],
        "mask-image-linear-from-pos": [{
          "mask-linear-from": scaleMaskImagePosition()
        }],
        "mask-image-linear-to-pos": [{
          "mask-linear-to": scaleMaskImagePosition()
        }],
        "mask-image-linear-from-color": [{
          "mask-linear-from": scaleColor()
        }],
        "mask-image-linear-to-color": [{
          "mask-linear-to": scaleColor()
        }],
        "mask-image-t-from-pos": [{
          "mask-t-from": scaleMaskImagePosition()
        }],
        "mask-image-t-to-pos": [{
          "mask-t-to": scaleMaskImagePosition()
        }],
        "mask-image-t-from-color": [{
          "mask-t-from": scaleColor()
        }],
        "mask-image-t-to-color": [{
          "mask-t-to": scaleColor()
        }],
        "mask-image-r-from-pos": [{
          "mask-r-from": scaleMaskImagePosition()
        }],
        "mask-image-r-to-pos": [{
          "mask-r-to": scaleMaskImagePosition()
        }],
        "mask-image-r-from-color": [{
          "mask-r-from": scaleColor()
        }],
        "mask-image-r-to-color": [{
          "mask-r-to": scaleColor()
        }],
        "mask-image-b-from-pos": [{
          "mask-b-from": scaleMaskImagePosition()
        }],
        "mask-image-b-to-pos": [{
          "mask-b-to": scaleMaskImagePosition()
        }],
        "mask-image-b-from-color": [{
          "mask-b-from": scaleColor()
        }],
        "mask-image-b-to-color": [{
          "mask-b-to": scaleColor()
        }],
        "mask-image-l-from-pos": [{
          "mask-l-from": scaleMaskImagePosition()
        }],
        "mask-image-l-to-pos": [{
          "mask-l-to": scaleMaskImagePosition()
        }],
        "mask-image-l-from-color": [{
          "mask-l-from": scaleColor()
        }],
        "mask-image-l-to-color": [{
          "mask-l-to": scaleColor()
        }],
        "mask-image-x-from-pos": [{
          "mask-x-from": scaleMaskImagePosition()
        }],
        "mask-image-x-to-pos": [{
          "mask-x-to": scaleMaskImagePosition()
        }],
        "mask-image-x-from-color": [{
          "mask-x-from": scaleColor()
        }],
        "mask-image-x-to-color": [{
          "mask-x-to": scaleColor()
        }],
        "mask-image-y-from-pos": [{
          "mask-y-from": scaleMaskImagePosition()
        }],
        "mask-image-y-to-pos": [{
          "mask-y-to": scaleMaskImagePosition()
        }],
        "mask-image-y-from-color": [{
          "mask-y-from": scaleColor()
        }],
        "mask-image-y-to-color": [{
          "mask-y-to": scaleColor()
        }],
        "mask-image-radial": [{
          "mask-radial": [isArbitraryVariable, isArbitraryValue]
        }],
        "mask-image-radial-from-pos": [{
          "mask-radial-from": scaleMaskImagePosition()
        }],
        "mask-image-radial-to-pos": [{
          "mask-radial-to": scaleMaskImagePosition()
        }],
        "mask-image-radial-from-color": [{
          "mask-radial-from": scaleColor()
        }],
        "mask-image-radial-to-color": [{
          "mask-radial-to": scaleColor()
        }],
        "mask-image-radial-shape": [{
          "mask-radial": ["circle", "ellipse"]
        }],
        "mask-image-radial-size": [{
          "mask-radial": [{
            closest: ["side", "corner"],
            farthest: ["side", "corner"]
          }]
        }],
        "mask-image-radial-pos": [{
          "mask-radial-at": scalePosition()
        }],
        "mask-image-conic-pos": [{
          "mask-conic": [isNumber$2]
        }],
        "mask-image-conic-from-pos": [{
          "mask-conic-from": scaleMaskImagePosition()
        }],
        "mask-image-conic-to-pos": [{
          "mask-conic-to": scaleMaskImagePosition()
        }],
        "mask-image-conic-from-color": [{
          "mask-conic-from": scaleColor()
        }],
        "mask-image-conic-to-color": [{
          "mask-conic-to": scaleColor()
        }],
        /**
         * Mask Mode
         * @see https://tailwindcss.com/docs/mask-mode
         */
        "mask-mode": [{
          mask: ["alpha", "luminance", "match"]
        }],
        /**
         * Mask Origin
         * @see https://tailwindcss.com/docs/mask-origin
         */
        "mask-origin": [{
          "mask-origin": ["border", "padding", "content", "fill", "stroke", "view"]
        }],
        /**
         * Mask Position
         * @see https://tailwindcss.com/docs/mask-position
         */
        "mask-position": [{
          mask: scaleBgPosition()
        }],
        /**
         * Mask Repeat
         * @see https://tailwindcss.com/docs/mask-repeat
         */
        "mask-repeat": [{
          mask: scaleBgRepeat()
        }],
        /**
         * Mask Size
         * @see https://tailwindcss.com/docs/mask-size
         */
        "mask-size": [{
          mask: scaleBgSize()
        }],
        /**
         * Mask Type
         * @see https://tailwindcss.com/docs/mask-type
         */
        "mask-type": [{
          "mask-type": ["alpha", "luminance"]
        }],
        /**
         * Mask Image
         * @see https://tailwindcss.com/docs/mask-image
         */
        "mask-image": [{
          mask: ["none", isArbitraryVariable, isArbitraryValue]
        }],
        // ---------------
        // --- Filters ---
        // ---------------
        /**
         * Filter
         * @see https://tailwindcss.com/docs/filter
         */
        filter: [{
          filter: [
            // Deprecated since Tailwind CSS v3.0.0
            "",
            "none",
            isArbitraryVariable,
            isArbitraryValue
          ]
        }],
        /**
         * Blur
         * @see https://tailwindcss.com/docs/blur
         */
        blur: [{
          blur: scaleBlur()
        }],
        /**
         * Brightness
         * @see https://tailwindcss.com/docs/brightness
         */
        brightness: [{
          brightness: [isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Contrast
         * @see https://tailwindcss.com/docs/contrast
         */
        contrast: [{
          contrast: [isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Drop Shadow
         * @see https://tailwindcss.com/docs/drop-shadow
         */
        "drop-shadow": [{
          "drop-shadow": [
            // Deprecated since Tailwind CSS v4.0.0
            "",
            "none",
            themeDropShadow,
            isArbitraryVariableShadow,
            isArbitraryShadow
          ]
        }],
        /**
         * Drop Shadow Color
         * @see https://tailwindcss.com/docs/filter-drop-shadow#setting-the-shadow-color
         */
        "drop-shadow-color": [{
          "drop-shadow": scaleColor()
        }],
        /**
         * Grayscale
         * @see https://tailwindcss.com/docs/grayscale
         */
        grayscale: [{
          grayscale: ["", isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Hue Rotate
         * @see https://tailwindcss.com/docs/hue-rotate
         */
        "hue-rotate": [{
          "hue-rotate": [isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Invert
         * @see https://tailwindcss.com/docs/invert
         */
        invert: [{
          invert: ["", isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Saturate
         * @see https://tailwindcss.com/docs/saturate
         */
        saturate: [{
          saturate: [isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Sepia
         * @see https://tailwindcss.com/docs/sepia
         */
        sepia: [{
          sepia: ["", isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Backdrop Filter
         * @see https://tailwindcss.com/docs/backdrop-filter
         */
        "backdrop-filter": [{
          "backdrop-filter": [
            // Deprecated since Tailwind CSS v3.0.0
            "",
            "none",
            isArbitraryVariable,
            isArbitraryValue
          ]
        }],
        /**
         * Backdrop Blur
         * @see https://tailwindcss.com/docs/backdrop-blur
         */
        "backdrop-blur": [{
          "backdrop-blur": scaleBlur()
        }],
        /**
         * Backdrop Brightness
         * @see https://tailwindcss.com/docs/backdrop-brightness
         */
        "backdrop-brightness": [{
          "backdrop-brightness": [isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Backdrop Contrast
         * @see https://tailwindcss.com/docs/backdrop-contrast
         */
        "backdrop-contrast": [{
          "backdrop-contrast": [isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Backdrop Grayscale
         * @see https://tailwindcss.com/docs/backdrop-grayscale
         */
        "backdrop-grayscale": [{
          "backdrop-grayscale": ["", isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Backdrop Hue Rotate
         * @see https://tailwindcss.com/docs/backdrop-hue-rotate
         */
        "backdrop-hue-rotate": [{
          "backdrop-hue-rotate": [isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Backdrop Invert
         * @see https://tailwindcss.com/docs/backdrop-invert
         */
        "backdrop-invert": [{
          "backdrop-invert": ["", isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Backdrop Opacity
         * @see https://tailwindcss.com/docs/backdrop-opacity
         */
        "backdrop-opacity": [{
          "backdrop-opacity": [isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Backdrop Saturate
         * @see https://tailwindcss.com/docs/backdrop-saturate
         */
        "backdrop-saturate": [{
          "backdrop-saturate": [isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Backdrop Sepia
         * @see https://tailwindcss.com/docs/backdrop-sepia
         */
        "backdrop-sepia": [{
          "backdrop-sepia": ["", isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        // --------------
        // --- Tables ---
        // --------------
        /**
         * Border Collapse
         * @see https://tailwindcss.com/docs/border-collapse
         */
        "border-collapse": [{
          border: ["collapse", "separate"]
        }],
        /**
         * Border Spacing
         * @see https://tailwindcss.com/docs/border-spacing
         */
        "border-spacing": [{
          "border-spacing": scaleUnambiguousSpacing()
        }],
        /**
         * Border Spacing X
         * @see https://tailwindcss.com/docs/border-spacing
         */
        "border-spacing-x": [{
          "border-spacing-x": scaleUnambiguousSpacing()
        }],
        /**
         * Border Spacing Y
         * @see https://tailwindcss.com/docs/border-spacing
         */
        "border-spacing-y": [{
          "border-spacing-y": scaleUnambiguousSpacing()
        }],
        /**
         * Table Layout
         * @see https://tailwindcss.com/docs/table-layout
         */
        "table-layout": [{
          table: ["auto", "fixed"]
        }],
        /**
         * Caption Side
         * @see https://tailwindcss.com/docs/caption-side
         */
        caption: [{
          caption: ["top", "bottom"]
        }],
        // ---------------------------------
        // --- Transitions and Animation ---
        // ---------------------------------
        /**
         * Transition Property
         * @see https://tailwindcss.com/docs/transition-property
         */
        transition: [{
          transition: ["", "all", "colors", "opacity", "shadow", "transform", "none", isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Transition Behavior
         * @see https://tailwindcss.com/docs/transition-behavior
         */
        "transition-behavior": [{
          transition: ["normal", "discrete"]
        }],
        /**
         * Transition Duration
         * @see https://tailwindcss.com/docs/transition-duration
         */
        duration: [{
          duration: [isNumber$2, "initial", isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Transition Timing Function
         * @see https://tailwindcss.com/docs/transition-timing-function
         */
        ease: [{
          ease: ["linear", "initial", themeEase, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Transition Delay
         * @see https://tailwindcss.com/docs/transition-delay
         */
        delay: [{
          delay: [isNumber$2, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Animation
         * @see https://tailwindcss.com/docs/animation
         */
        animate: [{
          animate: ["none", themeAnimate, isArbitraryVariable, isArbitraryValue]
        }],
        // ------------------
        // --- Transforms ---
        // ------------------
        /**
         * Backface Visibility
         * @see https://tailwindcss.com/docs/backface-visibility
         */
        backface: [{
          backface: ["hidden", "visible"]
        }],
        /**
         * Perspective
         * @see https://tailwindcss.com/docs/perspective
         */
        perspective: [{
          perspective: [themePerspective, isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Perspective Origin
         * @see https://tailwindcss.com/docs/perspective-origin
         */
        "perspective-origin": [{
          "perspective-origin": scalePositionWithArbitrary()
        }],
        /**
         * Rotate
         * @see https://tailwindcss.com/docs/rotate
         */
        rotate: [{
          rotate: scaleRotate()
        }],
        /**
         * Rotate X
         * @see https://tailwindcss.com/docs/rotate
         */
        "rotate-x": [{
          "rotate-x": scaleRotate()
        }],
        /**
         * Rotate Y
         * @see https://tailwindcss.com/docs/rotate
         */
        "rotate-y": [{
          "rotate-y": scaleRotate()
        }],
        /**
         * Rotate Z
         * @see https://tailwindcss.com/docs/rotate
         */
        "rotate-z": [{
          "rotate-z": scaleRotate()
        }],
        /**
         * Scale
         * @see https://tailwindcss.com/docs/scale
         */
        scale: [{
          scale: scaleScale()
        }],
        /**
         * Scale X
         * @see https://tailwindcss.com/docs/scale
         */
        "scale-x": [{
          "scale-x": scaleScale()
        }],
        /**
         * Scale Y
         * @see https://tailwindcss.com/docs/scale
         */
        "scale-y": [{
          "scale-y": scaleScale()
        }],
        /**
         * Scale Z
         * @see https://tailwindcss.com/docs/scale
         */
        "scale-z": [{
          "scale-z": scaleScale()
        }],
        /**
         * Scale 3D
         * @see https://tailwindcss.com/docs/scale
         */
        "scale-3d": ["scale-3d"],
        /**
         * Skew
         * @see https://tailwindcss.com/docs/skew
         */
        skew: [{
          skew: scaleSkew()
        }],
        /**
         * Skew X
         * @see https://tailwindcss.com/docs/skew
         */
        "skew-x": [{
          "skew-x": scaleSkew()
        }],
        /**
         * Skew Y
         * @see https://tailwindcss.com/docs/skew
         */
        "skew-y": [{
          "skew-y": scaleSkew()
        }],
        /**
         * Transform
         * @see https://tailwindcss.com/docs/transform
         */
        transform: [{
          transform: [isArbitraryVariable, isArbitraryValue, "", "none", "gpu", "cpu"]
        }],
        /**
         * Transform Origin
         * @see https://tailwindcss.com/docs/transform-origin
         */
        "transform-origin": [{
          origin: scalePositionWithArbitrary()
        }],
        /**
         * Transform Style
         * @see https://tailwindcss.com/docs/transform-style
         */
        "transform-style": [{
          transform: ["3d", "flat"]
        }],
        /**
         * Translate
         * @see https://tailwindcss.com/docs/translate
         */
        translate: [{
          translate: scaleTranslate()
        }],
        /**
         * Translate X
         * @see https://tailwindcss.com/docs/translate
         */
        "translate-x": [{
          "translate-x": scaleTranslate()
        }],
        /**
         * Translate Y
         * @see https://tailwindcss.com/docs/translate
         */
        "translate-y": [{
          "translate-y": scaleTranslate()
        }],
        /**
         * Translate Z
         * @see https://tailwindcss.com/docs/translate
         */
        "translate-z": [{
          "translate-z": scaleTranslate()
        }],
        /**
         * Translate None
         * @see https://tailwindcss.com/docs/translate
         */
        "translate-none": ["translate-none"],
        // ---------------------
        // --- Interactivity ---
        // ---------------------
        /**
         * Accent Color
         * @see https://tailwindcss.com/docs/accent-color
         */
        accent: [{
          accent: scaleColor()
        }],
        /**
         * Appearance
         * @see https://tailwindcss.com/docs/appearance
         */
        appearance: [{
          appearance: ["none", "auto"]
        }],
        /**
         * Caret Color
         * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
         */
        "caret-color": [{
          caret: scaleColor()
        }],
        /**
         * Color Scheme
         * @see https://tailwindcss.com/docs/color-scheme
         */
        "color-scheme": [{
          scheme: ["normal", "dark", "light", "light-dark", "only-dark", "only-light"]
        }],
        /**
         * Cursor
         * @see https://tailwindcss.com/docs/cursor
         */
        cursor: [{
          cursor: ["auto", "default", "pointer", "wait", "text", "move", "help", "not-allowed", "none", "context-menu", "progress", "cell", "crosshair", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out", isArbitraryVariable, isArbitraryValue]
        }],
        /**
         * Field Sizing
         * @see https://tailwindcss.com/docs/field-sizing
         */
        "field-sizing": [{
          "field-sizing": ["fixed", "content"]
        }],
        /**
         * Pointer Events
         * @see https://tailwindcss.com/docs/pointer-events
         */
        "pointer-events": [{
          "pointer-events": ["auto", "none"]
        }],
        /**
         * Resize
         * @see https://tailwindcss.com/docs/resize
         */
        resize: [{
          resize: ["none", "", "y", "x"]
        }],
        /**
         * Scroll Behavior
         * @see https://tailwindcss.com/docs/scroll-behavior
         */
        "scroll-behavior": [{
          scroll: ["auto", "smooth"]
        }],
        /**
         * Scroll Margin
         * @see https://tailwindcss.com/docs/scroll-margin
         */
        "scroll-m": [{
          "scroll-m": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Margin X
         * @see https://tailwindcss.com/docs/scroll-margin
         */
        "scroll-mx": [{
          "scroll-mx": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Margin Y
         * @see https://tailwindcss.com/docs/scroll-margin
         */
        "scroll-my": [{
          "scroll-my": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Margin Start
         * @see https://tailwindcss.com/docs/scroll-margin
         */
        "scroll-ms": [{
          "scroll-ms": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Margin End
         * @see https://tailwindcss.com/docs/scroll-margin
         */
        "scroll-me": [{
          "scroll-me": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Margin Top
         * @see https://tailwindcss.com/docs/scroll-margin
         */
        "scroll-mt": [{
          "scroll-mt": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Margin Right
         * @see https://tailwindcss.com/docs/scroll-margin
         */
        "scroll-mr": [{
          "scroll-mr": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Margin Bottom
         * @see https://tailwindcss.com/docs/scroll-margin
         */
        "scroll-mb": [{
          "scroll-mb": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Margin Left
         * @see https://tailwindcss.com/docs/scroll-margin
         */
        "scroll-ml": [{
          "scroll-ml": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Padding
         * @see https://tailwindcss.com/docs/scroll-padding
         */
        "scroll-p": [{
          "scroll-p": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Padding X
         * @see https://tailwindcss.com/docs/scroll-padding
         */
        "scroll-px": [{
          "scroll-px": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Padding Y
         * @see https://tailwindcss.com/docs/scroll-padding
         */
        "scroll-py": [{
          "scroll-py": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Padding Start
         * @see https://tailwindcss.com/docs/scroll-padding
         */
        "scroll-ps": [{
          "scroll-ps": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Padding End
         * @see https://tailwindcss.com/docs/scroll-padding
         */
        "scroll-pe": [{
          "scroll-pe": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Padding Top
         * @see https://tailwindcss.com/docs/scroll-padding
         */
        "scroll-pt": [{
          "scroll-pt": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Padding Right
         * @see https://tailwindcss.com/docs/scroll-padding
         */
        "scroll-pr": [{
          "scroll-pr": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Padding Bottom
         * @see https://tailwindcss.com/docs/scroll-padding
         */
        "scroll-pb": [{
          "scroll-pb": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Padding Left
         * @see https://tailwindcss.com/docs/scroll-padding
         */
        "scroll-pl": [{
          "scroll-pl": scaleUnambiguousSpacing()
        }],
        /**
         * Scroll Snap Align
         * @see https://tailwindcss.com/docs/scroll-snap-align
         */
        "snap-align": [{
          snap: ["start", "end", "center", "align-none"]
        }],
        /**
         * Scroll Snap Stop
         * @see https://tailwindcss.com/docs/scroll-snap-stop
         */
        "snap-stop": [{
          snap: ["normal", "always"]
        }],
        /**
         * Scroll Snap Type
         * @see https://tailwindcss.com/docs/scroll-snap-type
         */
        "snap-type": [{
          snap: ["none", "x", "y", "both"]
        }],
        /**
         * Scroll Snap Type Strictness
         * @see https://tailwindcss.com/docs/scroll-snap-type
         */
        "snap-strictness": [{
          snap: ["mandatory", "proximity"]
        }],
        /**
         * Touch Action
         * @see https://tailwindcss.com/docs/touch-action
         */
        touch: [{
          touch: ["auto", "none", "manipulation"]
        }],
        /**
         * Touch Action X
         * @see https://tailwindcss.com/docs/touch-action
         */
        "touch-x": [{
          "touch-pan": ["x", "left", "right"]
        }],
        /**
         * Touch Action Y
         * @see https://tailwindcss.com/docs/touch-action
         */
        "touch-y": [{
          "touch-pan": ["y", "up", "down"]
        }],
        /**
         * Touch Action Pinch Zoom
         * @see https://tailwindcss.com/docs/touch-action
         */
        "touch-pz": ["touch-pinch-zoom"],
        /**
         * User Select
         * @see https://tailwindcss.com/docs/user-select
         */
        select: [{
          select: ["none", "text", "all", "auto"]
        }],
        /**
         * Will Change
         * @see https://tailwindcss.com/docs/will-change
         */
        "will-change": [{
          "will-change": ["auto", "scroll", "contents", "transform", isArbitraryVariable, isArbitraryValue]
        }],
        // -----------
        // --- SVG ---
        // -----------
        /**
         * Fill
         * @see https://tailwindcss.com/docs/fill
         */
        fill: [{
          fill: ["none", ...scaleColor()]
        }],
        /**
         * Stroke Width
         * @see https://tailwindcss.com/docs/stroke-width
         */
        "stroke-w": [{
          stroke: [isNumber$2, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber]
        }],
        /**
         * Stroke
         * @see https://tailwindcss.com/docs/stroke
         */
        stroke: [{
          stroke: ["none", ...scaleColor()]
        }],
        // ---------------------
        // --- Accessibility ---
        // ---------------------
        /**
         * Forced Color Adjust
         * @see https://tailwindcss.com/docs/forced-color-adjust
         */
        "forced-color-adjust": [{
          "forced-color-adjust": ["auto", "none"]
        }]
      },
      conflictingClassGroups: {
        overflow: ["overflow-x", "overflow-y"],
        overscroll: ["overscroll-x", "overscroll-y"],
        inset: ["inset-x", "inset-y", "start", "end", "top", "right", "bottom", "left"],
        "inset-x": ["right", "left"],
        "inset-y": ["top", "bottom"],
        flex: ["basis", "grow", "shrink"],
        gap: ["gap-x", "gap-y"],
        p: ["px", "py", "ps", "pe", "pt", "pr", "pb", "pl"],
        px: ["pr", "pl"],
        py: ["pt", "pb"],
        m: ["mx", "my", "ms", "me", "mt", "mr", "mb", "ml"],
        mx: ["mr", "ml"],
        my: ["mt", "mb"],
        size: ["w", "h"],
        "font-size": ["leading"],
        "fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"],
        "fvn-ordinal": ["fvn-normal"],
        "fvn-slashed-zero": ["fvn-normal"],
        "fvn-figure": ["fvn-normal"],
        "fvn-spacing": ["fvn-normal"],
        "fvn-fraction": ["fvn-normal"],
        "line-clamp": ["display", "overflow"],
        rounded: ["rounded-s", "rounded-e", "rounded-t", "rounded-r", "rounded-b", "rounded-l", "rounded-ss", "rounded-se", "rounded-ee", "rounded-es", "rounded-tl", "rounded-tr", "rounded-br", "rounded-bl"],
        "rounded-s": ["rounded-ss", "rounded-es"],
        "rounded-e": ["rounded-se", "rounded-ee"],
        "rounded-t": ["rounded-tl", "rounded-tr"],
        "rounded-r": ["rounded-tr", "rounded-br"],
        "rounded-b": ["rounded-br", "rounded-bl"],
        "rounded-l": ["rounded-tl", "rounded-bl"],
        "border-spacing": ["border-spacing-x", "border-spacing-y"],
        "border-w": ["border-w-x", "border-w-y", "border-w-s", "border-w-e", "border-w-t", "border-w-r", "border-w-b", "border-w-l"],
        "border-w-x": ["border-w-r", "border-w-l"],
        "border-w-y": ["border-w-t", "border-w-b"],
        "border-color": ["border-color-x", "border-color-y", "border-color-s", "border-color-e", "border-color-t", "border-color-r", "border-color-b", "border-color-l"],
        "border-color-x": ["border-color-r", "border-color-l"],
        "border-color-y": ["border-color-t", "border-color-b"],
        translate: ["translate-x", "translate-y", "translate-none"],
        "translate-none": ["translate", "translate-x", "translate-y", "translate-z"],
        "scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"],
        "scroll-mx": ["scroll-mr", "scroll-ml"],
        "scroll-my": ["scroll-mt", "scroll-mb"],
        "scroll-p": ["scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"],
        "scroll-px": ["scroll-pr", "scroll-pl"],
        "scroll-py": ["scroll-pt", "scroll-pb"],
        touch: ["touch-x", "touch-y", "touch-pz"],
        "touch-x": ["touch"],
        "touch-y": ["touch"],
        "touch-pz": ["touch"]
      },
      conflictingClassGroupModifiers: {
        "font-size": ["leading"]
      },
      orderSensitiveModifiers: ["*", "**", "after", "backdrop", "before", "details-content", "file", "first-letter", "first-line", "marker", "placeholder", "selection"]
    };
  }, "getDefaultConfig");
  const twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
  function cn$1(...inputs) {
    return twMerge(clsx(inputs));
  }
  __name(cn$1, "cn$1");
  const DropdownMenu = Root2$4;
  const DropdownMenuTrigger = Trigger$4;
  const DropdownMenuSubTrigger = reactExports.forwardRef((_n2, ref) => {
    var _o = _n2, { className, inset, children } = _o, props = __objRest(_o, ["className", "inset", "children"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      SubTrigger2,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(
          "cky:flex cky:cursor-default cky:select-none cky:items-center cky:gap-2 cky:rounded-sm cky:px-2 cky:py-1.5 cky:text-sm cky:outline-none cky:focus:bg-accent cky:data-[state=open]:bg-accent cky:[&_svg]:pointer-events-none cky:[&_svg]:size-4 cky:[&_svg]:shrink-0",
          inset && "cky:pl-8",
          className
        )
      }, props), {
        children: [
          children,
          /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "cky:ml-auto" })
        ]
      })
    );
  });
  DropdownMenuSubTrigger.displayName = SubTrigger2.displayName;
  const DropdownMenuSubContent = reactExports.forwardRef((_p, ref) => {
    var _q = _p, { className } = _q, props = __objRest(_q, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      SubContent2,
      __spreadValues({
        ref,
        className: cn$1(
          "cky:z-50 cky:min-w-[8rem] cky:overflow-hidden cky:rounded-md cky:border cky:bg-popover cky:p-1 cky:text-popover-foreground cky:shadow-lg cky:data-[state=open]:animate-in cky:data-[state=closed]:animate-out cky:data-[state=closed]:fade-out-0 cky:data-[state=open]:fade-in-0 cky:data-[state=closed]:zoom-out-95 cky:data-[state=open]:zoom-in-95 cky:data-[side=bottom]:slide-in-from-top-2 cky:data-[side=left]:slide-in-from-right-2 cky:data-[side=right]:slide-in-from-left-2 cky:data-[side=top]:slide-in-from-bottom-2 cky:origin-[--radix-dropdown-menu-content-transform-origin]",
          className
        )
      }, props)
    );
  });
  DropdownMenuSubContent.displayName = SubContent2.displayName;
  const DropdownMenuContent$1 = reactExports.forwardRef((_r, ref) => {
    var _s = _r, { className, sideOffset = 4 } = _s, props = __objRest(_s, ["className", "sideOffset"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Portal2, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      Content2$3,
      __spreadValues({
        ref,
        sideOffset,
        className: cn$1(
          "cky:z-50 cky:max-h-[var(--radix-dropdown-menu-content-available-height)] cky:min-w-[8rem] cky:overflow-y-auto cky:overflow-x-hidden cky:rounded-md cky:border cky:bg-popover cky:p-1 cky:text-popover-foreground cky:shadow-md cky:data-[state=open]:animate-in cky:data-[state=closed]:animate-out cky:data-[state=closed]:fade-out-0 cky:data-[state=open]:fade-in-0 cky:data-[state=closed]:zoom-out-95 cky:data-[state=open]:zoom-in-95 cky:data-[side=bottom]:slide-in-from-top-2 cky:data-[side=left]:slide-in-from-right-2 cky:data-[side=right]:slide-in-from-left-2 cky:data-[side=top]:slide-in-from-bottom-2 cky:origin-[--radix-dropdown-menu-content-transform-origin]",
          className
        )
      }, props)
    ) });
  });
  DropdownMenuContent$1.displayName = Content2$3.displayName;
  const DropdownMenuItem$1 = reactExports.forwardRef((_t, ref) => {
    var _u = _t, { className, inset } = _u, props = __objRest(_u, ["className", "inset"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Item2$1,
      __spreadValues({
        ref,
        className: cn$1(
          "cky:relative cky:flex cky:cursor-default cky:select-none cky:items-center cky:gap-2 cky:rounded-sm cky:px-2 cky:py-1.5 cky:text-sm cky:outline-none cky:transition-colors cky:focus:bg-accent cky:focus:text-accent-foreground cky:data-[disabled]:pointer-events-none cky:data-[disabled]:opacity-50 cky:[&>svg]:pointer-events-none cky:[&>svg]:size-4 cky:[&>svg]:shrink-0",
          inset && "cky:pl-8",
          className
        )
      }, props)
    );
  });
  DropdownMenuItem$1.displayName = Item2$1.displayName;
  const DropdownMenuCheckboxItem = reactExports.forwardRef((_v, ref) => {
    var _w = _v, { className, children, checked } = _w, props = __objRest(_w, ["className", "children", "checked"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      CheckboxItem2,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(
          "cky:relative cky:flex cky:cursor-default cky:select-none cky:items-center cky:rounded-sm cky:py-1.5 cky:pl-8 cky:pr-2 cky:text-sm cky:outline-none cky:transition-colors cky:focus:bg-accent cky:focus:text-accent-foreground cky:data-[disabled]:pointer-events-none cky:data-[disabled]:opacity-50",
          className
        ),
        checked
      }, props), {
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:absolute cky:left-2 cky:flex cky:h-3.5 cky:w-3.5 cky:items-center cky:justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ItemIndicator2, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "cky:h-4 cky:w-4" }) }) }),
          children
        ]
      })
    );
  });
  DropdownMenuCheckboxItem.displayName = CheckboxItem2.displayName;
  const DropdownMenuRadioItem = reactExports.forwardRef((_x2, ref) => {
    var _y = _x2, { className, children } = _y, props = __objRest(_y, ["className", "children"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      RadioItem2,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(
          "cky:relative cky:flex cky:cursor-default cky:select-none cky:items-center cky:rounded-sm cky:py-1.5 cky:pl-8 cky:pr-2 cky:text-sm cky:outline-none cky:transition-colors cky:focus:bg-accent cky:focus:text-accent-foreground cky:data-[disabled]:pointer-events-none cky:data-[disabled]:opacity-50",
          className
        )
      }, props), {
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:absolute cky:left-2 cky:flex cky:h-3.5 cky:w-3.5 cky:items-center cky:justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ItemIndicator2, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Circle, { className: "cky:h-2 cky:w-2 cky:fill-current" }) }) }),
          children
        ]
      })
    );
  });
  DropdownMenuRadioItem.displayName = RadioItem2.displayName;
  const DropdownMenuLabel = reactExports.forwardRef((_z, ref) => {
    var _A = _z, { className, inset } = _A, props = __objRest(_A, ["className", "inset"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Label2,
      __spreadValues({
        ref,
        className: cn$1(
          "cky:px-2 cky:py-1.5 cky:text-sm cky:font-semibold",
          inset && "cky:pl-8",
          className
        )
      }, props)
    );
  });
  DropdownMenuLabel.displayName = Label2.displayName;
  const DropdownMenuSeparator = reactExports.forwardRef((_B, ref) => {
    var _C = _B, { className } = _C, props = __objRest(_C, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Separator2,
      __spreadValues({
        ref,
        className: cn$1("cky:-mx-1 cky:my-1 cky:h-px cky:bg-muted", className)
      }, props)
    );
  });
  DropdownMenuSeparator.displayName = Separator2.displayName;
  const CKY_DROPDOWN_CONTENT_CLASS = "cky:z-[100050] cky:min-w-[130px] cky:overflow-hidden cky:rounded-[3px] cky:border cky:border-[#c9d0d6] cky:bg-white cky:p-0 cky:shadow-[0_3px_7px_0_rgba(0,0,0,0.07)]";
  const CKY_DROPDOWN_ITEM_CLASS = "cky:cursor-pointer cky:rounded-none cky:p-2.5 cky:text-sm cky:font-medium cky:text-[#3c434a] cky:outline-none cky:transition-colors cky:focus:bg-[#f8f9fa] cky:focus:text-[#3c434a] cky:data-[disabled]:pointer-events-none cky:data-[disabled]:opacity-60";
  function DropdownMenuContent(_D) {
    var _E = _D, { className } = _E, props = __objRest(_E, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      DropdownMenuContent$1,
      __spreadValues({
        className: cn$1(CKY_DROPDOWN_CONTENT_CLASS, className)
      }, props)
    );
  }
  __name(DropdownMenuContent, "DropdownMenuContent");
  DropdownMenuContent.displayName = "DropdownMenuContent";
  function DropdownMenuItem(_F) {
    var _G = _F, { className } = _G, props = __objRest(_G, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      DropdownMenuItem$1,
      __spreadValues({
        className: cn$1(CKY_DROPDOWN_ITEM_CLASS, className)
      }, props)
    );
  }
  __name(DropdownMenuItem, "DropdownMenuItem");
  DropdownMenuItem.displayName = "DropdownMenuItem";
  var COLLAPSIBLE_NAME = "Collapsible";
  var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
  var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
  var Collapsible = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, {
        __scopeCollapsible,
        open: openProp,
        defaultOpen,
        disabled,
        onOpenChange
      } = _a2, collapsibleProps = __objRest(_a2, [
        "__scopeCollapsible",
        "open",
        "defaultOpen",
        "disabled",
        "onOpenChange"
      ]);
      const [open, setOpen] = useControllableState({
        prop: openProp,
        defaultProp: defaultOpen != null ? defaultOpen : false,
        onChange: onOpenChange,
        caller: COLLAPSIBLE_NAME
      });
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        CollapsibleProvider,
        {
          scope: __scopeCollapsible,
          disabled,
          contentId: useId(),
          open,
          onOpenToggle: reactExports.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Primitive$1.div,
            __spreadProps(__spreadValues({
              "data-state": getState$5(open),
              "data-disabled": disabled ? "" : void 0
            }, collapsibleProps), {
              ref: forwardedRef
            })
          )
        }
      );
    }
  );
  Collapsible.displayName = COLLAPSIBLE_NAME;
  var TRIGGER_NAME$6 = "CollapsibleTrigger";
  var CollapsibleTrigger = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeCollapsible } = _a2, triggerProps = __objRest(_a2, ["__scopeCollapsible"]);
      const context = useCollapsibleContext(TRIGGER_NAME$6, __scopeCollapsible);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.button,
        __spreadProps(__spreadValues({
          type: "button",
          "aria-controls": context.contentId,
          "aria-expanded": context.open || false,
          "data-state": getState$5(context.open),
          "data-disabled": context.disabled ? "" : void 0,
          disabled: context.disabled
        }, triggerProps), {
          ref: forwardedRef,
          onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
        })
      );
    }
  );
  CollapsibleTrigger.displayName = TRIGGER_NAME$6;
  var CONTENT_NAME$5 = "CollapsibleContent";
  var CollapsibleContent = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { forceMount } = _a2, contentProps = __objRest(_a2, ["forceMount"]);
      const context = useCollapsibleContext(CONTENT_NAME$5, props.__scopeCollapsible);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ __name(({ present }) => /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleContentImpl, __spreadProps(__spreadValues({}, contentProps), { ref: forwardedRef, present })), "children") });
    }
  );
  CollapsibleContent.displayName = CONTENT_NAME$5;
  var CollapsibleContentImpl = reactExports.forwardRef((props, forwardedRef) => {
    const _a2 = props, { __scopeCollapsible, present, children } = _a2, contentProps = __objRest(_a2, ["__scopeCollapsible", "present", "children"]);
    const context = useCollapsibleContext(CONTENT_NAME$5, __scopeCollapsible);
    const [isPresent, setIsPresent] = reactExports.useState(present);
    const ref = reactExports.useRef(null);
    const composedRefs = useComposedRefs(forwardedRef, ref);
    const heightRef = reactExports.useRef(0);
    const height = heightRef.current;
    const widthRef = reactExports.useRef(0);
    const width = widthRef.current;
    const isOpen = context.open || isPresent;
    const isMountAnimationPreventedRef = reactExports.useRef(isOpen);
    const originalStylesRef = reactExports.useRef(void 0);
    reactExports.useEffect(() => {
      const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
      return () => cancelAnimationFrame(rAF);
    }, []);
    useLayoutEffect2(() => {
      const node = ref.current;
      if (node) {
        originalStylesRef.current = originalStylesRef.current || {
          transitionDuration: node.style.transitionDuration,
          animationName: node.style.animationName
        };
        node.style.transitionDuration = "0s";
        node.style.animationName = "none";
        const rect = node.getBoundingClientRect();
        heightRef.current = rect.height;
        widthRef.current = rect.width;
        if (!isMountAnimationPreventedRef.current) {
          node.style.transitionDuration = originalStylesRef.current.transitionDuration;
          node.style.animationName = originalStylesRef.current.animationName;
        }
        setIsPresent(present);
      }
    }, [context.open, present]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Primitive$1.div,
      __spreadProps(__spreadValues({
        "data-state": getState$5(context.open),
        "data-disabled": context.disabled ? "" : void 0,
        id: context.contentId,
        hidden: !isOpen
      }, contentProps), {
        ref: composedRefs,
        style: __spreadValues({
          [`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,
          [`--radix-collapsible-content-width`]: width ? `${width}px` : void 0
        }, props.style),
        children: isOpen && children
      })
    );
  });
  function getState$5(open) {
    return open ? "open" : "closed";
  }
  __name(getState$5, "getState$5");
  var Root$4 = Collapsible;
  var Trigger$3 = CollapsibleTrigger;
  var Content$2 = CollapsibleContent;
  var ACCORDION_NAME = "Accordion";
  var ACCORDION_KEYS = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"];
  var [Collection$1, useCollection$1, createCollectionScope$1] = createCollection(ACCORDION_NAME);
  var [createAccordionContext, createAccordionScope] = createContextScope(ACCORDION_NAME, [
    createCollectionScope$1,
    createCollapsibleScope
  ]);
  var useCollapsibleScope = createCollapsibleScope();
  var Accordion$1 = React.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { type } = _a2, accordionProps = __objRest(_a2, ["type"]);
      const singleProps = accordionProps;
      const multipleProps = accordionProps;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Collection$1.Provider, { scope: props.__scopeAccordion, children: type === "multiple" ? /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionImplMultiple, __spreadProps(__spreadValues({}, multipleProps), { ref: forwardedRef })) : /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionImplSingle, __spreadProps(__spreadValues({}, singleProps), { ref: forwardedRef })) });
    }
  );
  Accordion$1.displayName = ACCORDION_NAME;
  var [AccordionValueProvider, useAccordionValueContext] = createAccordionContext(ACCORDION_NAME);
  var [AccordionCollapsibleProvider, useAccordionCollapsibleContext] = createAccordionContext(
    ACCORDION_NAME,
    { collapsible: false }
  );
  var AccordionImplSingle = React.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, {
        value: valueProp,
        defaultValue,
        onValueChange = /* @__PURE__ */ __name(() => {
        }, "onValueChange"),
        collapsible = false
      } = _a2, accordionSingleProps = __objRest(_a2, [
        "value",
        "defaultValue",
        "onValueChange",
        "collapsible"
      ]);
      const [value, setValue] = useControllableState({
        prop: valueProp,
        defaultProp: defaultValue != null ? defaultValue : "",
        onChange: onValueChange,
        caller: ACCORDION_NAME
      });
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        AccordionValueProvider,
        {
          scope: props.__scopeAccordion,
          value: React.useMemo(() => value ? [value] : [], [value]),
          onItemOpen: setValue,
          onItemClose: React.useCallback(() => collapsible && setValue(""), [collapsible, setValue]),
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionImpl, __spreadProps(__spreadValues({}, accordionSingleProps), { ref: forwardedRef })) })
        }
      );
    }
  );
  var AccordionImplMultiple = React.forwardRef((props, forwardedRef) => {
    const _a2 = props, {
      value: valueProp,
      defaultValue,
      onValueChange = /* @__PURE__ */ __name(() => {
      }, "onValueChange")
    } = _a2, accordionMultipleProps = __objRest(_a2, [
      "value",
      "defaultValue",
      "onValueChange"
    ]);
    const [value, setValue] = useControllableState({
      prop: valueProp,
      defaultProp: defaultValue != null ? defaultValue : [],
      onChange: onValueChange,
      caller: ACCORDION_NAME
    });
    const handleItemOpen = React.useCallback(
      (itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),
      [setValue]
    );
    const handleItemClose = React.useCallback(
      (itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)),
      [setValue]
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      AccordionValueProvider,
      {
        scope: props.__scopeAccordion,
        value,
        onItemOpen: handleItemOpen,
        onItemClose: handleItemClose,
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionImpl, __spreadProps(__spreadValues({}, accordionMultipleProps), { ref: forwardedRef })) })
      }
    );
  });
  var [AccordionImplProvider, useAccordionContext] = createAccordionContext(ACCORDION_NAME);
  var AccordionImpl = React.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeAccordion, disabled, dir, orientation = "vertical" } = _a2, accordionProps = __objRest(_a2, ["__scopeAccordion", "disabled", "dir", "orientation"]);
      const accordionRef = React.useRef(null);
      const composedRefs = useComposedRefs(accordionRef, forwardedRef);
      const getItems = useCollection$1(__scopeAccordion);
      const direction = useDirection(dir);
      const isDirectionLTR = direction === "ltr";
      const handleKeyDown = composeEventHandlers(props.onKeyDown, (event) => {
        var _a3;
        if (!ACCORDION_KEYS.includes(event.key)) return;
        const target = event.target;
        const triggerCollection = getItems().filter((item) => {
          var _a4;
          return !((_a4 = item.ref.current) == null ? void 0 : _a4.disabled);
        });
        const triggerIndex = triggerCollection.findIndex((item) => item.ref.current === target);
        const triggerCount = triggerCollection.length;
        if (triggerIndex === -1) return;
        event.preventDefault();
        let nextIndex = triggerIndex;
        const homeIndex = 0;
        const endIndex = triggerCount - 1;
        const moveNext = /* @__PURE__ */ __name(() => {
          nextIndex = triggerIndex + 1;
          if (nextIndex > endIndex) {
            nextIndex = homeIndex;
          }
        }, "moveNext");
        const movePrev = /* @__PURE__ */ __name(() => {
          nextIndex = triggerIndex - 1;
          if (nextIndex < homeIndex) {
            nextIndex = endIndex;
          }
        }, "movePrev");
        switch (event.key) {
          case "Home":
            nextIndex = homeIndex;
            break;
          case "End":
            nextIndex = endIndex;
            break;
          case "ArrowRight":
            if (orientation === "horizontal") {
              if (isDirectionLTR) {
                moveNext();
              } else {
                movePrev();
              }
            }
            break;
          case "ArrowDown":
            if (orientation === "vertical") {
              moveNext();
            }
            break;
          case "ArrowLeft":
            if (orientation === "horizontal") {
              if (isDirectionLTR) {
                movePrev();
              } else {
                moveNext();
              }
            }
            break;
          case "ArrowUp":
            if (orientation === "vertical") {
              movePrev();
            }
            break;
        }
        const clampedIndex = nextIndex % triggerCount;
        (_a3 = triggerCollection[clampedIndex].ref.current) == null ? void 0 : _a3.focus();
      });
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        AccordionImplProvider,
        {
          scope: __scopeAccordion,
          disabled,
          direction: dir,
          orientation,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(Collection$1.Slot, { scope: __scopeAccordion, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Primitive$1.div,
            __spreadProps(__spreadValues({}, accordionProps), {
              "data-orientation": orientation,
              ref: composedRefs,
              onKeyDown: disabled ? void 0 : handleKeyDown
            })
          ) })
        }
      );
    }
  );
  var ITEM_NAME$2 = "AccordionItem";
  var [AccordionItemProvider, useAccordionItemContext] = createAccordionContext(ITEM_NAME$2);
  var AccordionItem$1 = React.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeAccordion, value } = _a2, accordionItemProps = __objRest(_a2, ["__scopeAccordion", "value"]);
      const accordionContext = useAccordionContext(ITEM_NAME$2, __scopeAccordion);
      const valueContext = useAccordionValueContext(ITEM_NAME$2, __scopeAccordion);
      const collapsibleScope = useCollapsibleScope(__scopeAccordion);
      const triggerId = useId();
      const open = value && valueContext.value.includes(value) || false;
      const disabled = accordionContext.disabled || props.disabled;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        AccordionItemProvider,
        {
          scope: __scopeAccordion,
          open,
          disabled,
          triggerId,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Root$4,
            __spreadProps(__spreadValues(__spreadValues({
              "data-orientation": accordionContext.orientation,
              "data-state": getState$4(open)
            }, collapsibleScope), accordionItemProps), {
              ref: forwardedRef,
              disabled,
              open,
              onOpenChange: /* @__PURE__ */ __name((open2) => {
                if (open2) {
                  valueContext.onItemOpen(value);
                } else {
                  valueContext.onItemClose(value);
                }
              }, "onOpenChange")
            })
          )
        }
      );
    }
  );
  AccordionItem$1.displayName = ITEM_NAME$2;
  var HEADER_NAME = "AccordionHeader";
  var AccordionHeader = React.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeAccordion } = _a2, headerProps = __objRest(_a2, ["__scopeAccordion"]);
      const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
      const itemContext = useAccordionItemContext(HEADER_NAME, __scopeAccordion);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.h3,
        __spreadProps(__spreadValues({
          "data-orientation": accordionContext.orientation,
          "data-state": getState$4(itemContext.open),
          "data-disabled": itemContext.disabled ? "" : void 0
        }, headerProps), {
          ref: forwardedRef
        })
      );
    }
  );
  AccordionHeader.displayName = HEADER_NAME;
  var TRIGGER_NAME$5 = "AccordionTrigger";
  var AccordionTrigger$2 = React.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeAccordion } = _a2, triggerProps = __objRest(_a2, ["__scopeAccordion"]);
      const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
      const itemContext = useAccordionItemContext(TRIGGER_NAME$5, __scopeAccordion);
      const collapsibleContext = useAccordionCollapsibleContext(TRIGGER_NAME$5, __scopeAccordion);
      const collapsibleScope = useCollapsibleScope(__scopeAccordion);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Collection$1.ItemSlot, { scope: __scopeAccordion, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        Trigger$3,
        __spreadProps(__spreadValues(__spreadValues({
          "aria-disabled": itemContext.open && !collapsibleContext.collapsible || void 0,
          "data-orientation": accordionContext.orientation,
          id: itemContext.triggerId
        }, collapsibleScope), triggerProps), {
          ref: forwardedRef
        })
      ) });
    }
  );
  AccordionTrigger$2.displayName = TRIGGER_NAME$5;
  var CONTENT_NAME$4 = "AccordionContent";
  var AccordionContent$1 = React.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeAccordion } = _a2, contentProps = __objRest(_a2, ["__scopeAccordion"]);
      const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
      const itemContext = useAccordionItemContext(CONTENT_NAME$4, __scopeAccordion);
      const collapsibleScope = useCollapsibleScope(__scopeAccordion);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Content$2,
        __spreadProps(__spreadValues(__spreadValues({
          role: "region",
          "aria-labelledby": itemContext.triggerId,
          "data-orientation": accordionContext.orientation
        }, collapsibleScope), contentProps), {
          ref: forwardedRef,
          style: __spreadValues({
            ["--radix-accordion-content-height"]: "var(--radix-collapsible-content-height)",
            ["--radix-accordion-content-width"]: "var(--radix-collapsible-content-width)"
          }, props.style)
        })
      );
    }
  );
  AccordionContent$1.displayName = CONTENT_NAME$4;
  function getState$4(open) {
    return open ? "open" : "closed";
  }
  __name(getState$4, "getState$4");
  var Root2$3 = Accordion$1;
  var Item$1 = AccordionItem$1;
  var Header = AccordionHeader;
  var Trigger2 = AccordionTrigger$2;
  var Content2$2 = AccordionContent$1;
  const Accordion = Root2$3;
  const AccordionItem = reactExports.forwardRef((_H, ref) => {
    var _I = _H, { className } = _I, props = __objRest(_I, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Item$1,
      __spreadValues({
        ref,
        className: cn$1("cky:border-b", className)
      }, props)
    );
  });
  AccordionItem.displayName = "AccordionItem";
  const AccordionTrigger$1 = reactExports.forwardRef((_J, ref) => {
    var _K = _J, { className, children } = _K, props = __objRest(_K, ["className", "children"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Header, { className: "cky:flex", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      Trigger2,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(
          "cky:flex cky:flex-1 cky:items-center cky:justify-between cky:py-4 cky:font-medium cky:transition-all cky:hover:underline cky:[&[data-state=open]>svg]:rotate-180",
          className
        )
      }, props), {
        children: [
          children,
          /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "cky:h-4 cky:w-4 cky:shrink-0 cky:transition-transform cky:duration-200" })
        ]
      })
    ) });
  });
  AccordionTrigger$1.displayName = Trigger2.displayName;
  const AccordionContent = reactExports.forwardRef((_L, ref) => {
    var _M = _L, { className, children } = _M, props = __objRest(_M, ["className", "children"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Content2$2,
      __spreadProps(__spreadValues({
        ref,
        className: "cky:overflow-hidden cky:text-sm cky:transition-all cky:data-[state=closed]:animate-accordion-up cky:data-[state=open]:animate-accordion-down"
      }, props), {
        children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn$1("cky:pb-4 cky:pt-0", className), children })
      })
    );
  });
  AccordionContent.displayName = Content2$2.displayName;
  function AccordionTrigger(_N) {
    var _O = _N, {
      className,
      children,
      iconPosition = "right",
      hideChevron = false,
      ref
    } = _O, props = __objRest(_O, [
      "className",
      "children",
      "iconPosition",
      "hideChevron",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Header, { className: "cky:m-0! cky:flex", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      Trigger2,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(
          "cky:flex cky:flex-1 cky:items-center cky:py-4 cky:font-medium cky:transition-all",
          iconPosition === "right" && "cky:justify-between cky:hover:underline cky:[&[data-state=open]>svg]:rotate-180",
          iconPosition === "left" && cn$1(
            "cky:justify-start cky:hover:no-underline",
            !hideChevron && "cky:[&[data-state=open]>svg]:rotate-90"
          ),
          className
        )
      }, props), {
        children: [
          iconPosition === "left" && !hideChevron && /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "cky:h-[11px] cky:w-[11px] cky:shrink-0 cky:transition-transform cky:duration-200 cky:mr-[10px]" }),
          children,
          iconPosition === "right" && !hideChevron && /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "cky:h-4 cky:w-4 cky:shrink-0 cky:transition-transform cky:duration-200" })
        ]
      })
    ) });
  }
  __name(AccordionTrigger, "AccordionTrigger");
  var REACT_LAZY_TYPE = Symbol.for("react.lazy");
  var use = React$1[" use ".trim().toString()];
  function isPromiseLike(value) {
    return typeof value === "object" && value !== null && "then" in value;
  }
  __name(isPromiseLike, "isPromiseLike");
  function isLazyComponent(element) {
    return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
  }
  __name(isLazyComponent, "isLazyComponent");
  // @__NO_SIDE_EFFECTS__
  function createSlot$2(ownerName) {
    const SlotClone = /* @__PURE__ */ createSlotClone$2(ownerName);
    const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
      let _a2 = props, { children } = _a2, slotProps = __objRest(_a2, ["children"]);
      if (isLazyComponent(children) && typeof use === "function") {
        children = use(children._payload);
      }
      const childrenArray = reactExports.Children.toArray(children);
      const slottable = childrenArray.find(isSlottable$2);
      if (slottable) {
        const newElement = slottable.props.children;
        const newChildren = childrenArray.map((child) => {
          if (child === slottable) {
            if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
            return reactExports.isValidElement(newElement) ? newElement.props.children : null;
          } else {
            return child;
          }
        });
        return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null }));
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children }));
    });
    Slot2.displayName = `${ownerName}.Slot`;
    return Slot2;
  }
  __name(createSlot$2, "createSlot$2");
  var Slot$2 = /* @__PURE__ */ createSlot$2("Slot");
  // @__NO_SIDE_EFFECTS__
  function createSlotClone$2(ownerName) {
    const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
      let _a2 = props, { children } = _a2, slotProps = __objRest(_a2, ["children"]);
      if (isLazyComponent(children) && typeof use === "function") {
        children = use(children._payload);
      }
      if (reactExports.isValidElement(children)) {
        const childrenRef = getElementRef$2(children);
        const props2 = mergeProps$2(slotProps, children.props);
        if (children.type !== reactExports.Fragment) {
          props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
        }
        return reactExports.cloneElement(children, props2);
      }
      return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null;
    });
    SlotClone.displayName = `${ownerName}.SlotClone`;
    return SlotClone;
  }
  __name(createSlotClone$2, "createSlotClone$2");
  var SLOTTABLE_IDENTIFIER$3 = Symbol("radix.slottable");
  function isSlottable$2(child) {
    return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$3;
  }
  __name(isSlottable$2, "isSlottable$2");
  function mergeProps$2(slotProps, childProps) {
    const overrideProps = __spreadValues({}, childProps);
    for (const propName in childProps) {
      const slotPropValue = slotProps[propName];
      const childPropValue = childProps[propName];
      const isHandler = /^on[A-Z]/.test(propName);
      if (isHandler) {
        if (slotPropValue && childPropValue) {
          overrideProps[propName] = (...args) => {
            const result = childPropValue(...args);
            slotPropValue(...args);
            return result;
          };
        } else if (slotPropValue) {
          overrideProps[propName] = slotPropValue;
        }
      } else if (propName === "style") {
        overrideProps[propName] = __spreadValues(__spreadValues({}, slotPropValue), childPropValue);
      } else if (propName === "className") {
        overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
      }
    }
    return __spreadValues(__spreadValues({}, slotProps), overrideProps);
  }
  __name(mergeProps$2, "mergeProps$2");
  function getElementRef$2(element) {
    var _a2, _b2;
    let getter = (_a2 = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a2.get;
    let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
    if (mayWarn) {
      return element.ref;
    }
    getter = (_b2 = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b2.get;
    mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
    if (mayWarn) {
      return element.props.ref;
    }
    return element.props.ref || element.ref;
  }
  __name(getElementRef$2, "getElementRef$2");
  const falsyToString = /* @__PURE__ */ __name((value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value, "falsyToString");
  const cx = clsx;
  const cva = /* @__PURE__ */ __name((base, config2) => (props) => {
    var _config_compoundVariants;
    if ((config2 === null || config2 === void 0 ? void 0 : config2.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
    const { variants, defaultVariants } = config2;
    const getVariantClassNames = Object.keys(variants).map((variant) => {
      const variantProp = props === null || props === void 0 ? void 0 : props[variant];
      const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
      if (variantProp === null) return null;
      const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
      return variants[variant][variantKey];
    });
    const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
      let [key, value] = param;
      if (value === void 0) {
        return acc;
      }
      acc[key] = value;
      return acc;
    }, {});
    const getCompoundVariantClassNames = config2 === null || config2 === void 0 ? void 0 : (_config_compoundVariants = config2.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
      let _a2 = param, { class: cvClass, className: cvClassName } = _a2, compoundVariantOptions = __objRest(_a2, ["class", "className"]);
      return Object.entries(compoundVariantOptions).every((param2) => {
        let [key, value] = param2;
        return Array.isArray(value) ? value.includes(__spreadValues(__spreadValues({}, defaultVariants), propsWithoutUndefined)[key]) : __spreadValues(__spreadValues({}, defaultVariants), propsWithoutUndefined)[key] === value;
      }) ? [
        ...acc,
        cvClass,
        cvClassName
      ] : acc;
    }, []);
    return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
  }, "cva");
  const buttonVariants = cva(
    "cky:inline-flex cky:items-center cky:justify-center cky:whitespace-nowrap cky:rounded-sm cky:text-sm cky:font-medium! cky:transition-all cky:duration-200 cky:ease-in-out cky:focus-visible:outline-none cky:disabled:pointer-events-none cky:disabled:opacity-50 cky:disabled:cursor-not-allowed cky:cursor-pointer cky:w-auto cky:px-[15px] cky:text-white cky:border cky:leading-4",
    {
      variants: {
        variant: {
          default: "cky:bg-[var(--cky-primary)] cky:hover:bg-[var(--cky-primary-dark)] cky:border-[var(--cky-primary)]",
          primary: "cky:border cky:bg-white cky:border-[var(--cky-primary)] cky:text-primary cky:hover:text-white cky:hover:bg-[var(--cky-primary)]",
          destructive: "cky:bg-red-600 cky:text-white cky:hover:bg-red-700 cky:border cky:border-red-600",
          outline: "cky:border cky:border-gray-300 cky:bg-gray-50 cky:text-gray-700",
          secondary: "cky:bg-gray-100 cky:text-gray-700 cky:hover:bg-gray-200 cky:border cky:border-gray-300",
          ghost: "cky:hover:bg-gray-100 cky:hover:text-gray-900 cky:text-gray-700",
          link: "cky:text-primary cky:border cky:border-transparent cky:hover:border-blue-600 cky:p-0 cky:h-auto",
          green: "cky:bg-green-600 cky:text-white cky:hover:bg-green-700 cky:border cky:border-green-600",
          danger: "cky:bg-red-600 cky:text-white cky:hover:bg-red-700 cky:border cky:border-red-600",
          dangerOutline: "cky:border cky:border-red-600 cky:bg-transparent cky:text-red-600 cky:hover:bg-red-600 cky:hover:text-white",
          upgrade: "cky:border-0 cky:bg-[linear-gradient(90deg,#f83600,#f9d423)] cky:px-5 cky:py-2 cky:font-medium cky:text-sm cky:leading-4 cky:text-white cky:shadow-none cky:hover:bg-[linear-gradient(45deg,#f83600,#f9d423)]",
          yellow: "cky:bg-[var(--cky-yellow)] cky:border-[var(--cky-yellow)] cky:text-[var(--cky-yellow-foreground)] cky:hover:bg-[var(--cky-yellow-dark)] cky:hover:border-[var(--cky-yellow-dark)]",
          toggle: "cky:bg-white cky:text-[#6e7191] cky:border-none! cky:font-semibold cky:text-sm cky:leading-5 cky:text-center",
          toggleActive: "cky:bg-[#1863dc] cky:text-white cky:border-none! cky:font-semibold cky:text-sm cky:leading-5 cky:text-center"
        },
        size: {
          default: "cky:h-auto cky:px-[15px] cky:py-2",
          sm: "cky:rounded-[3px] cky:px-3 cky:text-xs cky:py-1.5",
          lg: "cky:h-11 cky:rounded-md cky:px-8 cky:text-base",
          icon: "cky:h-10 cky:w-10 cky:p-0",
          xs: "cky:h-8 cky:px-2 cky:py-1 cky:text-xs",
          toggle: "cky:px-4 cky:py-[6px] cky:flex-1"
        }
      },
      defaultVariants: {
        variant: "default",
        size: "default"
      }
    }
  );
  function ButtonSpinner() {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:inline-flex cky:items-center cky:justify-center cky:relative cky:w-4 cky:h-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "svg",
      {
        className: "cky:animate-spin cky:h-4 cky:w-4 cky:text-current",
        xmlns: "http://www.w3.org/2000/svg",
        fill: "none",
        viewBox: "0 0 24 24",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "circle",
            {
              className: "cky:opacity-25",
              cx: "12",
              cy: "12",
              r: "10",
              stroke: "currentColor",
              strokeWidth: "4"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "path",
            {
              className: "cky:opacity-75",
              fill: "currentColor",
              d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
            }
          )
        ]
      }
    ) });
  }
  __name(ButtonSpinner, "ButtonSpinner");
  function Button(_P) {
    var _Q = _P, {
      className,
      variant,
      size: size2,
      asChild = false,
      loading = false,
      loadingText = "Loading...",
      external: external2 = false,
      disabled,
      children,
      ref
    } = _Q, props = __objRest(_Q, [
      "className",
      "variant",
      "size",
      "asChild",
      "loading",
      "loadingText",
      "external",
      "disabled",
      "children",
      "ref"
    ]);
    const Comp = asChild ? Slot$2 : "button";
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Comp,
      __spreadProps(__spreadValues({
        className: cn$1(
          buttonVariants({ variant, size: size2, className }),
          loading && "cky:pointer-events-none",
          external2 && "cky-external-link"
        ),
        ref,
        disabled: disabled || loading
      }, props), {
        children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:mr-2", children: loadingText }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonSpinner, {})
        ] }) : children
      })
    );
  }
  __name(Button, "Button");
  Button.displayName = "Button";
  const Card$1 = reactExports.forwardRef((_R, ref) => {
    var _S = _R, { className } = _S, props = __objRest(_S, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      __spreadValues({
        ref,
        className: cn$1(
          "cky:rounded-lg cky:border cky:bg-card cky:text-card-foreground cky:shadow-sm",
          className
        )
      }, props)
    );
  });
  Card$1.displayName = "Card";
  const CardHeader$1 = reactExports.forwardRef((_T, ref) => {
    var _U = _T, { className } = _U, props = __objRest(_U, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      __spreadValues({
        ref,
        className: cn$1("cky:flex cky:flex-col cky:space-y-1.5 cky:p-6", className)
      }, props)
    );
  });
  CardHeader$1.displayName = "CardHeader";
  const CardTitle$1 = reactExports.forwardRef((_V, ref) => {
    var _W = _V, { className } = _W, props = __objRest(_W, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      __spreadValues({
        ref,
        className: cn$1(
          "cky:text-2xl cky:font-semibold cky:leading-none cky:tracking-tight",
          className
        )
      }, props)
    );
  });
  CardTitle$1.displayName = "CardTitle";
  const CardDescription = reactExports.forwardRef((_X, ref) => {
    var _Y = _X, { className } = _Y, props = __objRest(_Y, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      __spreadValues({
        ref,
        className: cn$1("cky:text-sm cky:text-muted-foreground", className)
      }, props)
    );
  });
  CardDescription.displayName = "CardDescription";
  const CardContent$1 = reactExports.forwardRef((_Z, ref) => {
    var __2 = _Z, { className } = __2, props = __objRest(__2, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", __spreadValues({ ref, className: cn$1("cky:p-6 cky:pt-0", className) }, props));
  });
  CardContent$1.displayName = "CardContent";
  const CardFooter$1 = reactExports.forwardRef((_$, ref) => {
    var _aa = _$, { className } = _aa, props = __objRest(_aa, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      __spreadValues({
        ref,
        className: cn$1("cky:flex cky:items-center cky:p-6 cky:pt-0", className)
      }, props)
    );
  });
  CardFooter$1.displayName = "CardFooter";
  function Skeleton(_ba) {
    var _ca = _ba, {
      className
    } = _ca, props = __objRest(_ca, [
      "className"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      __spreadValues({
        className: cn$1("cky:animate-pulse cky:rounded-md cky:bg-muted", className)
      }, props)
    );
  }
  __name(Skeleton, "Skeleton");
  function Card(_da) {
    var _ea = _da, {
      className,
      loading = false,
      fullWidth = false,
      ref
    } = _ea, props = __objRest(_ea, [
      "className",
      "loading",
      "fullWidth",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Card$1,
      __spreadValues({
        ref,
        className: cn$1(
          "cky:rounded cky-card",
          loading && "cky-loading",
          fullWidth && "cky:w-full",
          className
        )
      }, props)
    );
  }
  __name(Card, "Card");
  Card.displayName = "Card";
  function CardHeader(_fa) {
    var _ga = _fa, {
      className,
      ref
    } = _ga, props = __objRest(_ga, [
      "className",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", __spreadValues({ ref, className: cn$1("cky-card-header", className) }, props));
  }
  __name(CardHeader, "CardHeader");
  CardHeader.displayName = "CardHeader";
  function CardTitle(_ha) {
    var _ia = _ha, {
      className,
      ref
    } = _ia, props = __objRest(_ia, [
      "className",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "h5",
      __spreadValues({
        ref,
        className: cn$1(
          "cky:text-base! cky:leading-6 cky:block cky:m-0! cky:p-0! cky:text-text-primary",
          className
        )
      }, props)
    );
  }
  __name(CardTitle, "CardTitle");
  CardTitle.displayName = "CardTitle";
  function CardSubtitle(_ja) {
    var _ka = _ja, {
      ref,
      className
    } = _ka, props = __objRest(_ka, [
      "ref",
      "className"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "p",
      __spreadValues({
        ref,
        className: cn$1("cky-card-subtitle cky:text-sm cky:text-muted-foreground cky:m-0!", className)
      }, props)
    );
  }
  __name(CardSubtitle, "CardSubtitle");
  CardSubtitle.displayName = "CardSubtitle";
  function CardContent(_la) {
    var _ma = _la, {
      className,
      fullWidth = false,
      ref
    } = _ma, props = __objRest(_ma, [
      "className",
      "fullWidth",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      __spreadValues({
        ref,
        className: cn$1(
          "cky-card-body",
          fullWidth && "cky-card-body--full",
          className
        )
      }, props)
    );
  }
  __name(CardContent, "CardContent");
  CardContent.displayName = "CardContent";
  function CardFooter(_na) {
    var _oa = _na, {
      className,
      ref
    } = _oa, props = __objRest(_oa, [
      "className",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      __spreadValues({
        ref,
        className: cn$1(
          "cky-card-footer cky:flex cky:items-center cky:px-5 cky:py-2",
          className
        )
      }, props)
    );
  }
  __name(CardFooter, "CardFooter");
  CardFooter.displayName = "CardFooter";
  function CardLoader(_pa) {
    var _qa = _pa, {
      className,
      ref
    } = _qa, props = __objRest(_qa, [
      "className",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", __spreadProps(__spreadValues({ ref, className: cn$1("cky:space-y-3 cky:p-6", className) }, props), { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "cky:h-4 cky:w-3/4" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "cky:h-4 cky:w-1/2" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "cky:h-4 cky:w-5/6" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "cky:h-20 cky:w-full" })
    ] }));
  }
  __name(CardLoader, "CardLoader");
  CardLoader.displayName = "CardLoader";
  const alertVariants$1 = cva(
    "cky:relative cky:w-full cky:rounded-lg cky:border cky:p-4 cky:[&>svg~*]:pl-7 cky:[&>svg+div]:translate-y-[-3px] cky:[&>svg]:absolute cky:[&>svg]:left-4 cky:[&>svg]:top-4 cky:[&>svg]:text-foreground",
    {
      variants: {
        variant: {
          default: "cky:bg-background cky:text-foreground",
          destructive: "cky:border-destructive/50 cky:text-destructive cky:dark:border-destructive cky:[&>svg]:text-destructive"
        }
      },
      defaultVariants: {
        variant: "default"
      }
    }
  );
  const Alert$1 = reactExports.forwardRef((_ra, ref) => {
    var _sa = _ra, { className, variant } = _sa, props = __objRest(_sa, ["className", "variant"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      __spreadValues({
        ref,
        role: "alert",
        className: cn$1(alertVariants$1({ variant }), className)
      }, props)
    );
  });
  Alert$1.displayName = "Alert";
  const AlertTitle$1 = reactExports.forwardRef((_ta, ref) => {
    var _ua = _ta, { className } = _ua, props = __objRest(_ua, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "h5",
      __spreadValues({
        ref,
        className: cn$1("cky:mb-1 cky:font-medium cky:leading-none cky:tracking-tight", className)
      }, props)
    );
  });
  AlertTitle$1.displayName = "AlertTitle";
  const AlertDescription = reactExports.forwardRef((_va, ref) => {
    var _wa = _va, { className } = _wa, props = __objRest(_wa, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      __spreadValues({
        ref,
        className: cn$1("cky:text-sm cky:[&_p]:leading-relaxed", className)
      }, props)
    );
  });
  AlertDescription.displayName = "AlertDescription";
  const alertVariants = cva(
    "cky:relative cky:w-full cky:rounded cky:py-2.5 cky:px-[15px] cky:text-foreground",
    {
      variants: {
        variant: {
          default: "cky:bg-background cky:text-foreground",
          destructive: "cky:border-destructive/50 cky:text-destructive cky:dark:border-destructive cky:[&>svg]:text-destructive",
          warning: "cky:bg-[#FFE8C6] cky:text-gray-800 cky:border-[#FFE8C6] cky:[&>svg]:text-orange-600",
          success: "cky:border-green-200 cky:bg-green-50 cky:text-green-800 cky:dark:border-green-800 cky:dark:bg-green-900/20 cky:dark:text-green-200 cky:[&>svg]:text-green-600",
          info: "cky:bg-blue-200 cky:text-gray-800 cky:border-blue-200 cky:[&>svg]:text-blue-700"
        }
      },
      defaultVariants: {
        variant: "default"
      }
    }
  );
  function Alert(_xa) {
    var _ya = _xa, { className, variant, ref } = _ya, props = __objRest(_ya, ["className", "variant", "ref"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      __spreadValues({
        ref,
        role: "alert",
        className: cn$1(alertVariants({ variant }), className)
      }, props)
    );
  }
  __name(Alert, "Alert");
  Alert.displayName = "Alert";
  function AlertTitle(_za) {
    var _Aa = _za, {
      className,
      ref
    } = _Aa, props = __objRest(_Aa, [
      "className",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "h4",
      __spreadValues({
        ref,
        className: cn$1("cky:mt-[5px]! cky:mr-4! cky:mb-4! cky:font-medium cky:leading-none cky:tracking-tight cky:text-[15px]!", className)
      }, props)
    );
  }
  __name(AlertTitle, "AlertTitle");
  AlertTitle.displayName = "AlertTitle";
  const badgeVariants$1 = cva(
    "cky:inline-flex cky:items-center cky:rounded-full cky:border cky:px-2.5 cky:py-0.5 cky:text-xs cky:font-semibold cky:transition-colors cky:focus:outline-none cky:focus:ring-2 cky:focus:ring-ring cky:focus:ring-offset-2",
    {
      variants: {
        variant: {
          default: "cky:border-transparent cky:bg-primary cky:text-primary-foreground cky:hover:bg-primary/80",
          secondary: "cky:border-transparent cky:bg-secondary cky:text-secondary-foreground cky:hover:bg-secondary/80",
          destructive: "cky:border-transparent cky:bg-destructive cky:text-destructive-foreground cky:hover:bg-destructive/80",
          outline: "cky:text-foreground"
        }
      },
      defaultVariants: {
        variant: "default"
      }
    }
  );
  function Badge$1(_Ba) {
    var _Ca = _Ba, { className, variant, ref } = _Ca, props = __objRest(_Ca, ["className", "variant", "ref"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      __spreadValues({
        ref,
        className: cn$1(badgeVariants$1({ variant }), className)
      }, props)
    );
  }
  __name(Badge$1, "Badge$1");
  const badgeVariants = cva(
    "cky:inline-flex cky:items-center cky:justify-center cky:rounded-full cky:border cky:px-2.5 cky:py-0.5 cky:text-xs cky:font-semibold cky:transition-colors cky:focus:outline-none cky:focus:ring-2 cky:focus:ring-ring cky:focus:ring-offset-2",
    {
      variants: {
        variant: {
          default: "cky:border-transparent cky:bg-primary cky:text-primary-foreground cky:hover:bg-primary/80",
          secondary: "cky:border-transparent cky:bg-secondary cky:text-secondary-foreground cky:hover:bg-secondary/80",
          destructive: "cky:border-transparent cky:bg-destructive cky:text-destructive-foreground cky:hover:bg-destructive/80",
          outline: "cky:text-foreground",
          premium: "cky:border-transparent cky:bg-[#FFE8C6] cky:text-[#FFB240] cky:py-1.5 cky:px-1"
        }
      },
      defaultVariants: {
        variant: "default"
      }
    }
  );
  function Badge(_Da) {
    var _Ea = _Da, { className, variant, ref } = _Ea, props = __objRest(_Ea, ["className", "variant", "ref"]);
    if (variant === "premium") {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        __spreadValues({
          ref,
          className: cn$1(badgeVariants({ variant: "premium" }), className)
        }, props)
      );
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Badge$1,
      __spreadValues({
        ref,
        variant,
        className: cn$1("cky:justify-center", className)
      }, props)
    );
  }
  __name(Badge, "Badge");
  Badge.displayName = "Badge";
  function Table(_Fa) {
    var _Ga = _Fa, {
      className,
      ref
    } = _Ga, props = __objRest(_Ga, [
      "className",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "table",
      __spreadValues({
        ref,
        className: cn$1(
          "cky:w-full cky:border cky:border-gray-300 cky:caption-bottom cky:text-sm cky:border-collapse",
          className
        )
      }, props)
    );
  }
  __name(Table, "Table");
  Table.displayName = "Table";
  function TableHeader(_Ha) {
    var _Ia = _Ha, {
      className,
      ref
    } = _Ia, props = __objRest(_Ia, [
      "className",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "thead",
      __spreadValues({
        ref,
        className: cn$1("cky:[&_tr]:border-b", className)
      }, props)
    );
  }
  __name(TableHeader, "TableHeader");
  TableHeader.displayName = "TableHeader";
  function TableBody(_Ja) {
    var _Ka = _Ja, {
      className,
      ref
    } = _Ka, props = __objRest(_Ka, [
      "className",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "tbody",
      __spreadValues({
        ref,
        className: cn$1("cky:[&_tr:last-child]:border-0", className)
      }, props)
    );
  }
  __name(TableBody, "TableBody");
  TableBody.displayName = "TableBody";
  function TableRow(_La) {
    var _Ma = _La, {
      className,
      ref
    } = _Ma, props = __objRest(_Ma, [
      "className",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "tr",
      __spreadValues({
        ref,
        className: cn$1(
          "cky:border-b cky:border-gray-300 cky:transition-colors cky:data-[state=selected]:bg-gray-50",
          className
        )
      }, props)
    );
  }
  __name(TableRow, "TableRow");
  TableRow.displayName = "TableRow";
  function TableHead(_Na) {
    var _Oa = _Na, {
      className,
      ref
    } = _Oa, props = __objRest(_Oa, [
      "className",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "th",
      __spreadValues({
        ref,
        className: cn$1(
          "cky:py-3 cky:px-2.5 cky:text-left cky:align-middle cky:font-medium cky:text-sm cky:text-primary cky:[&:has([role=checkbox])]:pr-0",
          className
        )
      }, props)
    );
  }
  __name(TableHead, "TableHead");
  TableHead.displayName = "TableHead";
  function TableCell(_Pa) {
    var _Qa = _Pa, {
      className,
      ref
    } = _Qa, props = __objRest(_Qa, [
      "className",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "td",
      __spreadValues({
        ref,
        className: cn$1(
          "cky:py-2 cky:px-2.5 cky:align-middle cky:[&:has([role=checkbox])]:pr-0",
          className
        )
      }, props)
    );
  }
  __name(TableCell, "TableCell");
  TableCell.displayName = "TableCell";
  // @__NO_SIDE_EFFECTS__
  function createSlot$1(ownerName) {
    const SlotClone = /* @__PURE__ */ createSlotClone$1(ownerName);
    const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
      const _a2 = props, { children } = _a2, slotProps = __objRest(_a2, ["children"]);
      const childrenArray = reactExports.Children.toArray(children);
      const slottable = childrenArray.find(isSlottable$1);
      if (slottable) {
        const newElement = slottable.props.children;
        const newChildren = childrenArray.map((child) => {
          if (child === slottable) {
            if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
            return reactExports.isValidElement(newElement) ? newElement.props.children : null;
          } else {
            return child;
          }
        });
        return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null }));
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children }));
    });
    Slot2.displayName = `${ownerName}.Slot`;
    return Slot2;
  }
  __name(createSlot$1, "createSlot$1");
  // @__NO_SIDE_EFFECTS__
  function createSlotClone$1(ownerName) {
    const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
      const _a2 = props, { children } = _a2, slotProps = __objRest(_a2, ["children"]);
      if (reactExports.isValidElement(children)) {
        const childrenRef = getElementRef$1(children);
        const props2 = mergeProps$1(slotProps, children.props);
        if (children.type !== reactExports.Fragment) {
          props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
        }
        return reactExports.cloneElement(children, props2);
      }
      return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null;
    });
    SlotClone.displayName = `${ownerName}.SlotClone`;
    return SlotClone;
  }
  __name(createSlotClone$1, "createSlotClone$1");
  var SLOTTABLE_IDENTIFIER$2 = Symbol("radix.slottable");
  function isSlottable$1(child) {
    return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$2;
  }
  __name(isSlottable$1, "isSlottable$1");
  function mergeProps$1(slotProps, childProps) {
    const overrideProps = __spreadValues({}, childProps);
    for (const propName in childProps) {
      const slotPropValue = slotProps[propName];
      const childPropValue = childProps[propName];
      const isHandler = /^on[A-Z]/.test(propName);
      if (isHandler) {
        if (slotPropValue && childPropValue) {
          overrideProps[propName] = (...args) => {
            const result = childPropValue(...args);
            slotPropValue(...args);
            return result;
          };
        } else if (slotPropValue) {
          overrideProps[propName] = slotPropValue;
        }
      } else if (propName === "style") {
        overrideProps[propName] = __spreadValues(__spreadValues({}, slotPropValue), childPropValue);
      } else if (propName === "className") {
        overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
      }
    }
    return __spreadValues(__spreadValues({}, slotProps), overrideProps);
  }
  __name(mergeProps$1, "mergeProps$1");
  function getElementRef$1(element) {
    var _a2, _b2;
    let getter = (_a2 = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a2.get;
    let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
    if (mayWarn) {
      return element.ref;
    }
    getter = (_b2 = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b2.get;
    mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
    if (mayWarn) {
      return element.props.ref;
    }
    return element.props.ref || element.ref;
  }
  __name(getElementRef$1, "getElementRef$1");
  var DIALOG_NAME = "Dialog";
  var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
  var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
  var Dialog$1 = /* @__PURE__ */ __name((props) => {
    const {
      __scopeDialog,
      children,
      open: openProp,
      defaultOpen,
      onOpenChange,
      modal = true
    } = props;
    const triggerRef = reactExports.useRef(null);
    const contentRef = reactExports.useRef(null);
    const [open, setOpen] = useControllableState({
      prop: openProp,
      defaultProp: defaultOpen != null ? defaultOpen : false,
      onChange: onOpenChange,
      caller: DIALOG_NAME
    });
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      DialogProvider,
      {
        scope: __scopeDialog,
        triggerRef,
        contentRef,
        contentId: useId(),
        titleId: useId(),
        descriptionId: useId(),
        open,
        onOpenChange: setOpen,
        onOpenToggle: reactExports.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
        modal,
        children
      }
    );
  }, "Dialog$1");
  Dialog$1.displayName = DIALOG_NAME;
  var TRIGGER_NAME$4 = "DialogTrigger";
  var DialogTrigger = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeDialog } = _a2, triggerProps = __objRest(_a2, ["__scopeDialog"]);
      const context = useDialogContext(TRIGGER_NAME$4, __scopeDialog);
      const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.button,
        __spreadProps(__spreadValues({
          type: "button",
          "aria-haspopup": "dialog",
          "aria-expanded": context.open,
          "aria-controls": context.contentId,
          "data-state": getState$3(context.open)
        }, triggerProps), {
          ref: composedTriggerRef,
          onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
        })
      );
    }
  );
  DialogTrigger.displayName = TRIGGER_NAME$4;
  var PORTAL_NAME$2 = "DialogPortal";
  var [PortalProvider$1, usePortalContext$1] = createDialogContext(PORTAL_NAME$2, {
    forceMount: void 0
  });
  var DialogPortal$1 = /* @__PURE__ */ __name((props) => {
    const { __scopeDialog, forceMount, children, container } = props;
    const context = useDialogContext(PORTAL_NAME$2, __scopeDialog);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(PortalProvider$1, { scope: __scopeDialog, forceMount, children: reactExports.Children.map(children, (child) => /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Portal$3, { asChild: true, container, children: child }) })) });
  }, "DialogPortal$1");
  DialogPortal$1.displayName = PORTAL_NAME$2;
  var OVERLAY_NAME = "DialogOverlay";
  var DialogOverlay$2 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const portalContext = usePortalContext$1(OVERLAY_NAME, props.__scopeDialog);
      const _a2 = props, { forceMount = portalContext.forceMount } = _a2, overlayProps = __objRest(_a2, ["forceMount"]);
      const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
      return context.modal ? /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DialogOverlayImpl, __spreadProps(__spreadValues({}, overlayProps), { ref: forwardedRef })) }) : null;
    }
  );
  DialogOverlay$2.displayName = OVERLAY_NAME;
  var Slot$1 = /* @__PURE__ */ createSlot$1("DialogOverlay.RemoveScroll");
  var DialogOverlayImpl = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeDialog } = _a2, overlayProps = __objRest(_a2, ["__scopeDialog"]);
      const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
      return (
        // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
        // ie. when `Overlay` and `Content` are siblings
        /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { as: Slot$1, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Primitive$1.div,
          __spreadProps(__spreadValues({
            "data-state": getState$3(context.open)
          }, overlayProps), {
            ref: forwardedRef,
            style: __spreadValues({ pointerEvents: "auto" }, overlayProps.style)
          })
        ) })
      );
    }
  );
  var CONTENT_NAME$3 = "DialogContent";
  var DialogContent$2 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const portalContext = usePortalContext$1(CONTENT_NAME$3, props.__scopeDialog);
      const _a2 = props, { forceMount = portalContext.forceMount } = _a2, contentProps = __objRest(_a2, ["forceMount"]);
      const context = useDialogContext(CONTENT_NAME$3, props.__scopeDialog);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsxRuntimeExports.jsx(DialogContentModal, __spreadProps(__spreadValues({}, contentProps), { ref: forwardedRef })) : /* @__PURE__ */ jsxRuntimeExports.jsx(DialogContentNonModal, __spreadProps(__spreadValues({}, contentProps), { ref: forwardedRef })) });
    }
  );
  DialogContent$2.displayName = CONTENT_NAME$3;
  var DialogContentModal = reactExports.forwardRef(
    (props, forwardedRef) => {
      const context = useDialogContext(CONTENT_NAME$3, props.__scopeDialog);
      const contentRef = reactExports.useRef(null);
      const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
      reactExports.useEffect(() => {
        const content = contentRef.current;
        if (content) return hideOthers(content);
      }, []);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        DialogContentImpl,
        __spreadProps(__spreadValues({}, props), {
          ref: composedRefs,
          trapFocus: context.open,
          disableOutsidePointerEvents: true,
          onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
            var _a2;
            event.preventDefault();
            (_a2 = context.triggerRef.current) == null ? void 0 : _a2.focus();
          }),
          onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
            const originalEvent = event.detail.originalEvent;
            const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
            const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
            if (isRightClick) event.preventDefault();
          }),
          onFocusOutside: composeEventHandlers(
            props.onFocusOutside,
            (event) => event.preventDefault()
          )
        })
      );
    }
  );
  var DialogContentNonModal = reactExports.forwardRef(
    (props, forwardedRef) => {
      const context = useDialogContext(CONTENT_NAME$3, props.__scopeDialog);
      const hasInteractedOutsideRef = reactExports.useRef(false);
      const hasPointerDownOutsideRef = reactExports.useRef(false);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        DialogContentImpl,
        __spreadProps(__spreadValues({}, props), {
          ref: forwardedRef,
          trapFocus: false,
          disableOutsidePointerEvents: false,
          onCloseAutoFocus: /* @__PURE__ */ __name((event) => {
            var _a2, _b2;
            (_a2 = props.onCloseAutoFocus) == null ? void 0 : _a2.call(props, event);
            if (!event.defaultPrevented) {
              if (!hasInteractedOutsideRef.current) (_b2 = context.triggerRef.current) == null ? void 0 : _b2.focus();
              event.preventDefault();
            }
            hasInteractedOutsideRef.current = false;
            hasPointerDownOutsideRef.current = false;
          }, "onCloseAutoFocus"),
          onInteractOutside: /* @__PURE__ */ __name((event) => {
            var _a2, _b2;
            (_a2 = props.onInteractOutside) == null ? void 0 : _a2.call(props, event);
            if (!event.defaultPrevented) {
              hasInteractedOutsideRef.current = true;
              if (event.detail.originalEvent.type === "pointerdown") {
                hasPointerDownOutsideRef.current = true;
              }
            }
            const target = event.target;
            const targetIsTrigger = (_b2 = context.triggerRef.current) == null ? void 0 : _b2.contains(target);
            if (targetIsTrigger) event.preventDefault();
            if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
              event.preventDefault();
            }
          }, "onInteractOutside")
        })
      );
    }
  );
  var DialogContentImpl = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus } = _a2, contentProps = __objRest(_a2, ["__scopeDialog", "trapFocus", "onOpenAutoFocus", "onCloseAutoFocus"]);
      const context = useDialogContext(CONTENT_NAME$3, __scopeDialog);
      const contentRef = reactExports.useRef(null);
      const composedRefs = useComposedRefs(forwardedRef, contentRef);
      useFocusGuards();
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          FocusScope,
          {
            asChild: true,
            loop: true,
            trapped: trapFocus,
            onMountAutoFocus: onOpenAutoFocus,
            onUnmountAutoFocus: onCloseAutoFocus,
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              DismissableLayer,
              __spreadProps(__spreadValues({
                role: "dialog",
                id: context.contentId,
                "aria-describedby": context.descriptionId,
                "aria-labelledby": context.titleId,
                "data-state": getState$3(context.open)
              }, contentProps), {
                ref: composedRefs,
                onDismiss: /* @__PURE__ */ __name(() => context.onOpenChange(false), "onDismiss")
              })
            )
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(TitleWarning, { titleId: context.titleId }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
        ] })
      ] });
    }
  );
  var TITLE_NAME = "DialogTitle";
  var DialogTitle$2 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeDialog } = _a2, titleProps = __objRest(_a2, ["__scopeDialog"]);
      const context = useDialogContext(TITLE_NAME, __scopeDialog);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.h2, __spreadProps(__spreadValues({ id: context.titleId }, titleProps), { ref: forwardedRef }));
    }
  );
  DialogTitle$2.displayName = TITLE_NAME;
  var DESCRIPTION_NAME = "DialogDescription";
  var DialogDescription$2 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeDialog } = _a2, descriptionProps = __objRest(_a2, ["__scopeDialog"]);
      const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.p, __spreadProps(__spreadValues({ id: context.descriptionId }, descriptionProps), { ref: forwardedRef }));
    }
  );
  DialogDescription$2.displayName = DESCRIPTION_NAME;
  var CLOSE_NAME = "DialogClose";
  var DialogClose$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeDialog } = _a2, closeProps = __objRest(_a2, ["__scopeDialog"]);
      const context = useDialogContext(CLOSE_NAME, __scopeDialog);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.button,
        __spreadProps(__spreadValues({
          type: "button"
        }, closeProps), {
          ref: forwardedRef,
          onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
        })
      );
    }
  );
  DialogClose$1.displayName = CLOSE_NAME;
  function getState$3(open) {
    return open ? "open" : "closed";
  }
  __name(getState$3, "getState$3");
  var TITLE_WARNING_NAME = "DialogTitleWarning";
  var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
    contentName: CONTENT_NAME$3,
    titleName: TITLE_NAME,
    docsSlug: "dialog"
  });
  var TitleWarning = /* @__PURE__ */ __name(({ titleId }) => {
    const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
    const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
    reactExports.useEffect(() => {
      if (titleId) {
        const hasTitle = document.getElementById(titleId);
        if (!hasTitle) console.error(MESSAGE);
      }
    }, [MESSAGE, titleId]);
    return null;
  }, "TitleWarning");
  var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
  var DescriptionWarning = /* @__PURE__ */ __name(({ contentRef, descriptionId }) => {
    const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
    const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
    reactExports.useEffect(() => {
      var _a2;
      const describedById = (_a2 = contentRef.current) == null ? void 0 : _a2.getAttribute("aria-describedby");
      if (descriptionId && describedById) {
        const hasDescription = document.getElementById(descriptionId);
        if (!hasDescription) console.warn(MESSAGE);
      }
    }, [MESSAGE, contentRef, descriptionId]);
    return null;
  }, "DescriptionWarning");
  var Root$3 = Dialog$1;
  var Portal$1 = DialogPortal$1;
  var Overlay = DialogOverlay$2;
  var Content$1 = DialogContent$2;
  var Title = DialogTitle$2;
  var Description = DialogDescription$2;
  var Close = DialogClose$1;
  const Dialog = Root$3;
  const DialogPortal = Portal$1;
  const DialogOverlay$1 = reactExports.forwardRef((_Ra, ref) => {
    var _Sa = _Ra, { className } = _Sa, props = __objRest(_Sa, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Overlay,
      __spreadValues({
        ref,
        className: cn$1(
          "cky:fixed cky:inset-0 cky:z-50 cky:bg-black/80 cky:data-[state=open]:animate-in cky:data-[state=closed]:animate-out cky:data-[state=closed]:fade-out-0 cky:data-[state=open]:fade-in-0",
          className
        )
      }, props)
    );
  });
  DialogOverlay$1.displayName = Overlay.displayName;
  const DialogContent$1 = reactExports.forwardRef((_Ta, ref) => {
    var _Ua = _Ta, { className, children } = _Ua, props = __objRest(_Ua, ["className", "children"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogPortal, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(DialogOverlay$1, {}),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        Content$1,
        __spreadProps(__spreadValues({
          ref,
          className: cn$1(
            "cky:fixed cky:left-[50%] cky:top-[50%] cky:z-50 cky:grid cky:w-full cky:max-w-lg cky:translate-x-[-50%] cky:translate-y-[-50%] cky:gap-4 cky:border cky:bg-background cky:p-6 cky:shadow-lg cky:duration-200 cky:data-[state=open]:animate-in cky:data-[state=closed]:animate-out cky:data-[state=closed]:fade-out-0 cky:data-[state=open]:fade-in-0 cky:data-[state=closed]:zoom-out-95 cky:data-[state=open]:zoom-in-95 cky:data-[state=closed]:slide-out-to-left-1/2 cky:data-[state=closed]:slide-out-to-top-[48%] cky:data-[state=open]:slide-in-from-left-1/2 cky:data-[state=open]:slide-in-from-top-[48%] cky:sm:rounded-lg",
            className
          )
        }, props), {
          children: [
            children,
            /* @__PURE__ */ jsxRuntimeExports.jsxs(Close, { className: "cky:absolute cky:right-4 cky:top-4 cky:rounded-sm cky:opacity-70 cky:ring-offset-background cky:transition-opacity cky:hover:opacity-100 cky:focus:outline-none cky:focus:ring-2 cky:focus:ring-ring cky:focus:ring-offset-2 cky:disabled:pointer-events-none cky:data-[state=open]:bg-accent cky:data-[state=open]:text-muted-foreground", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(X$1, { className: "cky:h-4 cky:w-4" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:sr-only", children: "Close" })
            ] })
          ]
        })
      )
    ] });
  });
  DialogContent$1.displayName = Content$1.displayName;
  const DialogTitle$1 = reactExports.forwardRef((_Va, ref) => {
    var _Wa = _Va, { className } = _Wa, props = __objRest(_Wa, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Title,
      __spreadValues({
        ref,
        className: cn$1(
          "cky:text-lg cky:font-semibold cky:leading-none cky:tracking-tight",
          className
        )
      }, props)
    );
  });
  DialogTitle$1.displayName = Title.displayName;
  const DialogDescription$1 = reactExports.forwardRef((_Xa, ref) => {
    var _Ya = _Xa, { className } = _Ya, props = __objRest(_Ya, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Description,
      __spreadValues({
        ref,
        className: cn$1("cky:text-sm cky:text-muted-foreground", className)
      }, props)
    );
  });
  DialogDescription$1.displayName = Description.displayName;
  const DIALOG_CONTENT_CLASSES = "cky:relative cky:z-50 cky:flex cky:flex-col cky:gap-4 cky:w-full cky:max-w-lg cky:border cky:bg-background cky:shadow-lg cky:duration-200 cky:data-[state=open]:animate-in cky:data-[state=closed]:animate-out cky:data-[state=closed]:fade-out-0 cky:data-[state=open]:fade-in-0 cky:data-[state=closed]:zoom-out-95 cky:data-[state=open]:zoom-in-95 cky:data-[state=closed]:slide-out-to-left-1/2 cky:data-[state=closed]:slide-out-to-top-[48%] cky:data-[state=open]:slide-in-from-left-1/2 cky:data-[state=open]:slide-in-from-top-[48%] cky:sm:rounded-lg";
  const CKY_DIALOG_FOOTER_CLASS = "cky:p-[0_30px_20px_30px] cky:flex cky:flex-row cky:justify-end cky:gap-2";
  const CKY_DIALOG_CONTENT_CLASS = "cky:max-w-[660px] cky:rounded-[2px] cky:max-h-[calc(100%-3.5rem)] cky:transition-all cky:duration-[0.4s] cky:ease-[ease]";
  function DialogOverlay(_Za) {
    var __a = _Za, { className, children, ref } = __a, props = __objRest(__a, ["className", "children", "ref"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Overlay,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(
          "cky-dialog-overlay cky:flex cky:items-center cky:justify-center cky:overflow-x-hidden cky:overflow-y-auto cky:bg-[rgba(51,51,51,0.75)] cky:z-[99999999] cky:data-[state=open]:animate-in cky:data-[state=closed]:animate-out cky:data-[state=closed]:fade-out-0 cky:data-[state=open]:fade-in-0",
          className
        )
      }, props), {
        children
      })
    );
  }
  __name(DialogOverlay, "DialogOverlay");
  DialogOverlay.displayName = "DialogOverlay";
  function DialogClose(_$a) {
    var _ab = _$a, { className } = _ab, props = __objRest(_ab, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      Close,
      __spreadProps(__spreadValues({
        className: cn$1(
          "cky:absolute cky:right-4 cky:top-4 cky:rounded-sm cky:opacity-70 cky:cursor-pointer cky:ring-offset-background cky:transition-opacity cky:hover:opacity-100 cky:focus:outline-none cky:focus:ring-2 cky:focus:ring-ring cky:focus:ring-offset-2 cky:disabled:pointer-events-none cky:data-[state=open]:bg-accent cky:data-[state=open]:text-muted-foreground",
          className
        )
      }, props), {
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "close", width: "15px", height: "15px", color: "#8893a1" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:sr-only", children: __$2("Close", "cookie-law-info") })
        ]
      })
    );
  }
  __name(DialogClose, "DialogClose");
  DialogClose.displayName = "DialogClose";
  const DialogHeader = /* @__PURE__ */ __name((_bb) => {
    var _cb = _bb, {
      className,
      children,
      showClose = true,
      closeClassName
    } = _cb, props = __objRest(_cb, [
      "className",
      "children",
      "showClose",
      "closeClassName"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      __spreadProps(__spreadValues({
        className: cn$1(
          "cky:flex cky:flex-col cky:text-center cky:sm:text-left cky:relative cky:pr-10 cky:space-y-1.5",
          !showClose && "cky:pr-0",
          className
        )
      }, props), {
        children: [
          children,
          showClose && /* @__PURE__ */ jsxRuntimeExports.jsx(DialogClose, { className: cn$1("cky:!right-4 cky:!top-4", closeClassName) })
        ]
      })
    );
  }, "DialogHeader");
  DialogHeader.displayName = "DialogHeader";
  const DialogFooter = /* @__PURE__ */ __name((_db) => {
    var _eb = _db, {
      className
    } = _eb, props = __objRest(_eb, [
      "className"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      __spreadValues({
        className: cn$1(
          "cky:flex cky:flex-col-reverse cky:sm:justify-end cky:gap-2 cky:pt-2",
          className
        )
      }, props)
    );
  }, "DialogFooter");
  DialogFooter.displayName = "DialogFooter";
  function DialogTitle(_fb) {
    var _gb = _fb, { className, ref } = _gb, props = __objRest(_gb, ["className", "ref"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Title,
      __spreadValues({
        ref,
        className: cn$1("cky:flex cky:justify-center cky:items-center cky:my-0!", className)
      }, props)
    );
  }
  __name(DialogTitle, "DialogTitle");
  DialogTitle.displayName = "DialogTitle";
  function DialogDescription(_hb) {
    var _ib = _hb, { className, ref } = _ib, props = __objRest(_ib, ["className", "ref"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Description,
      __spreadValues({
        ref,
        className: cn$1("cky:text-sm cky:text-muted-foreground", className)
      }, props)
    );
  }
  __name(DialogDescription, "DialogDescription");
  DialogDescription.displayName = "DialogDescription";
  function DialogContent(_jb) {
    var _kb = _jb, {
      className,
      overlayClassName,
      hideOverlay,
      container,
      children,
      ref
    } = _kb, props = __objRest(_kb, [
      "className",
      "overlayClassName",
      "hideOverlay",
      "container",
      "children",
      "ref"
    ]);
    const content = /* @__PURE__ */ jsxRuntimeExports.jsx(
      Content$1,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(DIALOG_CONTENT_CLASSES, className)
      }, props), {
        children
      })
    );
    if (hideOverlay) {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(DialogPortal, { container, children: content });
    }
    if (container) {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogPortal, { container, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(DialogOverlay, { className: overlayClassName }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Content$1,
          __spreadProps(__spreadValues({
            ref,
            className: cn$1(DIALOG_CONTENT_CLASSES, "cky:z-[100000000]", className)
          }, props), {
            children
          })
        )
      ] });
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx(DialogPortal, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(DialogOverlay, { className: overlayClassName, children: content }) });
  }
  __name(DialogContent, "DialogContent");
  DialogContent.displayName = "DialogContent";
  var SLOTTABLE_IDENTIFIER$1 = Symbol("radix.slottable");
  // @__NO_SIDE_EFFECTS__
  function createSlottable(ownerName) {
    const Slottable2 = /* @__PURE__ */ __name(({ children }) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children });
    }, "Slottable2");
    Slottable2.displayName = `${ownerName}.Slottable`;
    Slottable2.__radixId = SLOTTABLE_IDENTIFIER$1;
    return Slottable2;
  }
  __name(createSlottable, "createSlottable");
  var VISUALLY_HIDDEN_STYLES = Object.freeze({
    // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
    position: "absolute",
    border: 0,
    width: 1,
    height: 1,
    padding: 0,
    margin: -1,
    overflow: "hidden",
    clip: "rect(0, 0, 0, 0)",
    whiteSpace: "nowrap",
    wordWrap: "normal"
  });
  var NAME$1 = "VisuallyHidden";
  var VisuallyHidden = reactExports.forwardRef(
    (props, forwardedRef) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.span,
        __spreadProps(__spreadValues({}, props), {
          ref: forwardedRef,
          style: __spreadValues(__spreadValues({}, VISUALLY_HIDDEN_STYLES), props.style)
        })
      );
    }
  );
  VisuallyHidden.displayName = NAME$1;
  var Root$2 = VisuallyHidden;
  var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [
    createPopperScope
  ]);
  var usePopperScope$1 = createPopperScope();
  var PROVIDER_NAME = "TooltipProvider";
  var DEFAULT_DELAY_DURATION = 700;
  var TOOLTIP_OPEN = "tooltip.open";
  var [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME);
  var TooltipProvider$1 = /* @__PURE__ */ __name((props) => {
    const {
      __scopeTooltip,
      delayDuration = DEFAULT_DELAY_DURATION,
      skipDelayDuration = 300,
      disableHoverableContent = false,
      children
    } = props;
    const isOpenDelayedRef = reactExports.useRef(true);
    const isPointerInTransitRef = reactExports.useRef(false);
    const skipDelayTimerRef = reactExports.useRef(0);
    reactExports.useEffect(() => {
      const skipDelayTimer = skipDelayTimerRef.current;
      return () => window.clearTimeout(skipDelayTimer);
    }, []);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      TooltipProviderContextProvider,
      {
        scope: __scopeTooltip,
        isOpenDelayedRef,
        delayDuration,
        onOpen: reactExports.useCallback(() => {
          window.clearTimeout(skipDelayTimerRef.current);
          isOpenDelayedRef.current = false;
        }, []),
        onClose: reactExports.useCallback(() => {
          window.clearTimeout(skipDelayTimerRef.current);
          skipDelayTimerRef.current = window.setTimeout(
            () => isOpenDelayedRef.current = true,
            skipDelayDuration
          );
        }, [skipDelayDuration]),
        isPointerInTransitRef,
        onPointerInTransitChange: reactExports.useCallback((inTransit) => {
          isPointerInTransitRef.current = inTransit;
        }, []),
        disableHoverableContent,
        children
      }
    );
  }, "TooltipProvider$1");
  TooltipProvider$1.displayName = PROVIDER_NAME;
  var TOOLTIP_NAME = "Tooltip";
  var [TooltipContextProvider, useTooltipContext] = createTooltipContext(TOOLTIP_NAME);
  var Tooltip$2 = /* @__PURE__ */ __name((props) => {
    const {
      __scopeTooltip,
      children,
      open: openProp,
      defaultOpen,
      onOpenChange,
      disableHoverableContent: disableHoverableContentProp,
      delayDuration: delayDurationProp
    } = props;
    const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);
    const popperScope = usePopperScope$1(__scopeTooltip);
    const [trigger, setTrigger] = reactExports.useState(null);
    const contentId = useId();
    const openTimerRef = reactExports.useRef(0);
    const disableHoverableContent = disableHoverableContentProp != null ? disableHoverableContentProp : providerContext.disableHoverableContent;
    const delayDuration = delayDurationProp != null ? delayDurationProp : providerContext.delayDuration;
    const wasOpenDelayedRef = reactExports.useRef(false);
    const [open, setOpen] = useControllableState({
      prop: openProp,
      defaultProp: defaultOpen != null ? defaultOpen : false,
      onChange: /* @__PURE__ */ __name((open2) => {
        if (open2) {
          providerContext.onOpen();
          document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN));
        } else {
          providerContext.onClose();
        }
        onOpenChange == null ? void 0 : onOpenChange(open2);
      }, "onChange"),
      caller: TOOLTIP_NAME
    });
    const stateAttribute = reactExports.useMemo(() => {
      return open ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
    }, [open]);
    const handleOpen = reactExports.useCallback(() => {
      window.clearTimeout(openTimerRef.current);
      openTimerRef.current = 0;
      wasOpenDelayedRef.current = false;
      setOpen(true);
    }, [setOpen]);
    const handleClose = reactExports.useCallback(() => {
      window.clearTimeout(openTimerRef.current);
      openTimerRef.current = 0;
      setOpen(false);
    }, [setOpen]);
    const handleDelayedOpen = reactExports.useCallback(() => {
      window.clearTimeout(openTimerRef.current);
      openTimerRef.current = window.setTimeout(() => {
        wasOpenDelayedRef.current = true;
        setOpen(true);
        openTimerRef.current = 0;
      }, delayDuration);
    }, [delayDuration, setOpen]);
    reactExports.useEffect(() => {
      return () => {
        if (openTimerRef.current) {
          window.clearTimeout(openTimerRef.current);
          openTimerRef.current = 0;
        }
      };
    }, []);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Root2$5, __spreadProps(__spreadValues({}, popperScope), { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      TooltipContextProvider,
      {
        scope: __scopeTooltip,
        contentId,
        open,
        stateAttribute,
        trigger,
        onTriggerChange: setTrigger,
        onTriggerEnter: reactExports.useCallback(() => {
          if (providerContext.isOpenDelayedRef.current) handleDelayedOpen();
          else handleOpen();
        }, [providerContext.isOpenDelayedRef, handleDelayedOpen, handleOpen]),
        onTriggerLeave: reactExports.useCallback(() => {
          if (disableHoverableContent) {
            handleClose();
          } else {
            window.clearTimeout(openTimerRef.current);
            openTimerRef.current = 0;
          }
        }, [handleClose, disableHoverableContent]),
        onOpen: handleOpen,
        onClose: handleClose,
        disableHoverableContent,
        children
      }
    ) }));
  }, "Tooltip$2");
  Tooltip$2.displayName = TOOLTIP_NAME;
  var TRIGGER_NAME$3 = "TooltipTrigger";
  var TooltipTrigger$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeTooltip } = _a2, triggerProps = __objRest(_a2, ["__scopeTooltip"]);
      const context = useTooltipContext(TRIGGER_NAME$3, __scopeTooltip);
      const providerContext = useTooltipProviderContext(TRIGGER_NAME$3, __scopeTooltip);
      const popperScope = usePopperScope$1(__scopeTooltip);
      const ref = reactExports.useRef(null);
      const composedRefs = useComposedRefs(forwardedRef, ref, context.onTriggerChange);
      const isPointerDownRef = reactExports.useRef(false);
      const hasPointerMoveOpenedRef = reactExports.useRef(false);
      const handlePointerUp = reactExports.useCallback(() => isPointerDownRef.current = false, []);
      reactExports.useEffect(() => {
        return () => document.removeEventListener("pointerup", handlePointerUp);
      }, [handlePointerUp]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor, __spreadProps(__spreadValues({ asChild: true }, popperScope), { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.button,
        __spreadProps(__spreadValues({
          "aria-describedby": context.open ? context.contentId : void 0,
          "data-state": context.stateAttribute
        }, triggerProps), {
          ref: composedRefs,
          onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {
            if (event.pointerType === "touch") return;
            if (!hasPointerMoveOpenedRef.current && !providerContext.isPointerInTransitRef.current) {
              context.onTriggerEnter();
              hasPointerMoveOpenedRef.current = true;
            }
          }),
          onPointerLeave: composeEventHandlers(props.onPointerLeave, () => {
            context.onTriggerLeave();
            hasPointerMoveOpenedRef.current = false;
          }),
          onPointerDown: composeEventHandlers(props.onPointerDown, () => {
            if (context.open) {
              context.onClose();
            }
            isPointerDownRef.current = true;
            document.addEventListener("pointerup", handlePointerUp, { once: true });
          }),
          onFocus: composeEventHandlers(props.onFocus, () => {
            if (!isPointerDownRef.current) context.onOpen();
          }),
          onBlur: composeEventHandlers(props.onBlur, context.onClose),
          onClick: composeEventHandlers(props.onClick, context.onClose)
        })
      ) }));
    }
  );
  TooltipTrigger$1.displayName = TRIGGER_NAME$3;
  var PORTAL_NAME$1 = "TooltipPortal";
  var [PortalProvider, usePortalContext] = createTooltipContext(PORTAL_NAME$1, {
    forceMount: void 0
  });
  var CONTENT_NAME$2 = "TooltipContent";
  var TooltipContent$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const portalContext = usePortalContext(CONTENT_NAME$2, props.__scopeTooltip);
      const _a2 = props, { forceMount = portalContext.forceMount, side = "top" } = _a2, contentProps = __objRest(_a2, ["forceMount", "side"]);
      const context = useTooltipContext(CONTENT_NAME$2, props.__scopeTooltip);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContentImpl, __spreadProps(__spreadValues({ side }, contentProps), { ref: forwardedRef })) : /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContentHoverable, __spreadProps(__spreadValues({ side }, contentProps), { ref: forwardedRef })) });
    }
  );
  var TooltipContentHoverable = reactExports.forwardRef((props, forwardedRef) => {
    const context = useTooltipContext(CONTENT_NAME$2, props.__scopeTooltip);
    const providerContext = useTooltipProviderContext(CONTENT_NAME$2, props.__scopeTooltip);
    const ref = reactExports.useRef(null);
    const composedRefs = useComposedRefs(forwardedRef, ref);
    const [pointerGraceArea, setPointerGraceArea] = reactExports.useState(null);
    const { trigger, onClose } = context;
    const content = ref.current;
    const { onPointerInTransitChange } = providerContext;
    const handleRemoveGraceArea = reactExports.useCallback(() => {
      setPointerGraceArea(null);
      onPointerInTransitChange(false);
    }, [onPointerInTransitChange]);
    const handleCreateGraceArea = reactExports.useCallback(
      (event, hoverTarget) => {
        const currentTarget = event.currentTarget;
        const exitPoint = { x: event.clientX, y: event.clientY };
        const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());
        const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);
        const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());
        const graceArea = getHull([...paddedExitPoints, ...hoverTargetPoints]);
        setPointerGraceArea(graceArea);
        onPointerInTransitChange(true);
      },
      [onPointerInTransitChange]
    );
    reactExports.useEffect(() => {
      return () => handleRemoveGraceArea();
    }, [handleRemoveGraceArea]);
    reactExports.useEffect(() => {
      if (trigger && content) {
        const handleTriggerLeave = /* @__PURE__ */ __name((event) => handleCreateGraceArea(event, content), "handleTriggerLeave");
        const handleContentLeave = /* @__PURE__ */ __name((event) => handleCreateGraceArea(event, trigger), "handleContentLeave");
        trigger.addEventListener("pointerleave", handleTriggerLeave);
        content.addEventListener("pointerleave", handleContentLeave);
        return () => {
          trigger.removeEventListener("pointerleave", handleTriggerLeave);
          content.removeEventListener("pointerleave", handleContentLeave);
        };
      }
    }, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]);
    reactExports.useEffect(() => {
      if (pointerGraceArea) {
        const handleTrackPointerGrace = /* @__PURE__ */ __name((event) => {
          const target = event.target;
          const pointerPosition = { x: event.clientX, y: event.clientY };
          const hasEnteredTarget = (trigger == null ? void 0 : trigger.contains(target)) || (content == null ? void 0 : content.contains(target));
          const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);
          if (hasEnteredTarget) {
            handleRemoveGraceArea();
          } else if (isPointerOutsideGraceArea) {
            handleRemoveGraceArea();
            onClose();
          }
        }, "handleTrackPointerGrace");
        document.addEventListener("pointermove", handleTrackPointerGrace);
        return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
      }
    }, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContentImpl, __spreadProps(__spreadValues({}, props), { ref: composedRefs }));
  });
  var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
  var Slottable = /* @__PURE__ */ createSlottable("TooltipContent");
  var TooltipContentImpl = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, {
        __scopeTooltip,
        children,
        "aria-label": ariaLabel,
        onEscapeKeyDown,
        onPointerDownOutside
      } = _a2, contentProps = __objRest(_a2, [
        "__scopeTooltip",
        "children",
        "aria-label",
        "onEscapeKeyDown",
        "onPointerDownOutside"
      ]);
      const context = useTooltipContext(CONTENT_NAME$2, __scopeTooltip);
      const popperScope = usePopperScope$1(__scopeTooltip);
      const { onClose } = context;
      reactExports.useEffect(() => {
        document.addEventListener(TOOLTIP_OPEN, onClose);
        return () => document.removeEventListener(TOOLTIP_OPEN, onClose);
      }, [onClose]);
      reactExports.useEffect(() => {
        if (context.trigger) {
          const handleScroll2 = /* @__PURE__ */ __name((event) => {
            const target = event.target;
            if (target == null ? void 0 : target.contains(context.trigger)) onClose();
          }, "handleScroll");
          window.addEventListener("scroll", handleScroll2, { capture: true });
          return () => window.removeEventListener("scroll", handleScroll2, { capture: true });
        }
      }, [context.trigger, onClose]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        DismissableLayer,
        {
          asChild: true,
          disableOutsidePointerEvents: false,
          onEscapeKeyDown,
          onPointerDownOutside,
          onFocusOutside: /* @__PURE__ */ __name((event) => event.preventDefault(), "onFocusOutside"),
          onDismiss: onClose,
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
            Content$3,
            __spreadProps(__spreadValues(__spreadValues({
              "data-state": context.stateAttribute
            }, popperScope), contentProps), {
              ref: forwardedRef,
              style: __spreadValues(__spreadValues({}, contentProps.style), {
                "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
                "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
                "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
                "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
                "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
              }),
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(Slottable, { children }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Root$2, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
              ]
            })
          )
        }
      );
    }
  );
  TooltipContent$1.displayName = CONTENT_NAME$2;
  var ARROW_NAME$1 = "TooltipArrow";
  var TooltipArrow$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeTooltip } = _a2, arrowProps = __objRest(_a2, ["__scopeTooltip"]);
      const popperScope = usePopperScope$1(__scopeTooltip);
      const visuallyHiddenContentContext = useVisuallyHiddenContentContext(
        ARROW_NAME$1,
        __scopeTooltip
      );
      return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(Arrow, __spreadProps(__spreadValues(__spreadValues({}, popperScope), arrowProps), { ref: forwardedRef }));
    }
  );
  TooltipArrow$1.displayName = ARROW_NAME$1;
  function getExitSideFromRect(point2, rect) {
    const top = Math.abs(rect.top - point2.y);
    const bottom = Math.abs(rect.bottom - point2.y);
    const right = Math.abs(rect.right - point2.x);
    const left = Math.abs(rect.left - point2.x);
    switch (Math.min(top, bottom, right, left)) {
      case left:
        return "left";
      case right:
        return "right";
      case top:
        return "top";
      case bottom:
        return "bottom";
      default:
        throw new Error("unreachable");
    }
  }
  __name(getExitSideFromRect, "getExitSideFromRect");
  function getPaddedExitPoints(exitPoint, exitSide, padding = 5) {
    const paddedExitPoints = [];
    switch (exitSide) {
      case "top":
        paddedExitPoints.push(
          { x: exitPoint.x - padding, y: exitPoint.y + padding },
          { x: exitPoint.x + padding, y: exitPoint.y + padding }
        );
        break;
      case "bottom":
        paddedExitPoints.push(
          { x: exitPoint.x - padding, y: exitPoint.y - padding },
          { x: exitPoint.x + padding, y: exitPoint.y - padding }
        );
        break;
      case "left":
        paddedExitPoints.push(
          { x: exitPoint.x + padding, y: exitPoint.y - padding },
          { x: exitPoint.x + padding, y: exitPoint.y + padding }
        );
        break;
      case "right":
        paddedExitPoints.push(
          { x: exitPoint.x - padding, y: exitPoint.y - padding },
          { x: exitPoint.x - padding, y: exitPoint.y + padding }
        );
        break;
    }
    return paddedExitPoints;
  }
  __name(getPaddedExitPoints, "getPaddedExitPoints");
  function getPointsFromRect(rect) {
    const { top, right, bottom, left } = rect;
    return [
      { x: left, y: top },
      { x: right, y: top },
      { x: right, y: bottom },
      { x: left, y: bottom }
    ];
  }
  __name(getPointsFromRect, "getPointsFromRect");
  function isPointInPolygon(point2, polygon) {
    const { x: x2, y: y2 } = point2;
    let inside = false;
    for (let i2 = 0, j = polygon.length - 1; i2 < polygon.length; j = i2++) {
      const ii = polygon[i2];
      const jj = polygon[j];
      const xi = ii.x;
      const yi = ii.y;
      const xj = jj.x;
      const yj = jj.y;
      const intersect = yi > y2 !== yj > y2 && x2 < (xj - xi) * (y2 - yi) / (yj - yi) + xi;
      if (intersect) inside = !inside;
    }
    return inside;
  }
  __name(isPointInPolygon, "isPointInPolygon");
  function getHull(points) {
    const newPoints = points.slice();
    newPoints.sort((a2, b) => {
      if (a2.x < b.x) return -1;
      else if (a2.x > b.x) return 1;
      else if (a2.y < b.y) return -1;
      else if (a2.y > b.y) return 1;
      else return 0;
    });
    return getHullPresorted(newPoints);
  }
  __name(getHull, "getHull");
  function getHullPresorted(points) {
    if (points.length <= 1) return points.slice();
    const upperHull = [];
    for (let i2 = 0; i2 < points.length; i2++) {
      const p2 = points[i2];
      while (upperHull.length >= 2) {
        const q = upperHull[upperHull.length - 1];
        const r2 = upperHull[upperHull.length - 2];
        if ((q.x - r2.x) * (p2.y - r2.y) >= (q.y - r2.y) * (p2.x - r2.x)) upperHull.pop();
        else break;
      }
      upperHull.push(p2);
    }
    upperHull.pop();
    const lowerHull = [];
    for (let i2 = points.length - 1; i2 >= 0; i2--) {
      const p2 = points[i2];
      while (lowerHull.length >= 2) {
        const q = lowerHull[lowerHull.length - 1];
        const r2 = lowerHull[lowerHull.length - 2];
        if ((q.x - r2.x) * (p2.y - r2.y) >= (q.y - r2.y) * (p2.x - r2.x)) lowerHull.pop();
        else break;
      }
      lowerHull.push(p2);
    }
    lowerHull.pop();
    if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y) {
      return upperHull;
    } else {
      return upperHull.concat(lowerHull);
    }
  }
  __name(getHullPresorted, "getHullPresorted");
  var Provider = TooltipProvider$1;
  var Root3 = Tooltip$2;
  var Trigger$2 = TooltipTrigger$1;
  var Content2$1 = TooltipContent$1;
  var Arrow2 = TooltipArrow$1;
  const TooltipProvider = Provider;
  const Tooltip$1 = Root3;
  const TooltipTrigger = Trigger$2;
  const TooltipContent = reactExports.forwardRef((_lb, ref) => {
    var _mb = _lb, { className, sideOffset = 4 } = _mb, props = __objRest(_mb, ["className", "sideOffset"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Content2$1,
      __spreadValues({
        ref,
        sideOffset,
        className: cn$1(
          "cky:z-50 cky:overflow-hidden cky:rounded-md cky:border cky:bg-popover cky:px-3 cky:py-1.5 cky:text-sm cky:text-popover-foreground cky:shadow-md cky:animate-in cky:fade-in-0 cky:zoom-in-95 cky:data-[state=closed]:animate-out cky:data-[state=closed]:fade-out-0 cky:data-[state=closed]:zoom-out-95 cky:data-[side=bottom]:slide-in-from-top-2 cky:data-[side=left]:slide-in-from-right-2 cky:data-[side=right]:slide-in-from-left-2 cky:data-[side=top]:slide-in-from-bottom-2 cky:origin-[--radix-tooltip-content-transform-origin]",
          className
        )
      }, props)
    );
  });
  TooltipContent.displayName = Content2$1.displayName;
  const CKY_TOOLTIP_CONTENT_CLASS = "cky-tooltip-content";
  const CKY_TOOLTIP_CONSENT_ACTIONS_CLASS = "cky-tooltip-consent-actions";
  const TOOLTIP_ARROW_FILL = "cky:fill-[var(--cky-tooltip-bg)]";
  const TOOLTIP_ARROW_BOX = "cky:!w-[10px] cky:!h-[5px] cky:max-w-none cky:max-h-none cky:shrink-0";
  const TooltipArrow = reactExports.memo(/* @__PURE__ */ __name(function TooltipArrow2(_nb) {
    var _ob = _nb, {
      className,
      ref
    } = _ob, props = __objRest(_ob, [
      "className",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Arrow2,
      __spreadValues({
        ref,
        className: cn$1(TOOLTIP_ARROW_FILL, TOOLTIP_ARROW_BOX, className)
      }, props)
    );
  }, "TooltipArrow2"));
  TooltipArrow.displayName = "TooltipArrow";
  const TooltipWithContent = reactExports.memo(/* @__PURE__ */ __name(function TooltipWithContent2({
    content,
    children,
    className,
    side = "top",
    sideOffset = 4,
    align
  }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip$1, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, className, children }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        TooltipContent,
        {
          side,
          sideOffset,
          align,
          className: CKY_TOOLTIP_CONTENT_CLASS,
          children: [
            content,
            /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipArrow, {})
          ]
        }
      )
    ] });
  }, "TooltipWithContent2"));
  function TooltipContentWithArrow(_pb) {
    var _qb = _pb, {
      ref,
      className,
      children
    } = _qb, props = __objRest(_qb, [
      "ref",
      "className",
      "children"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      TooltipContent,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(CKY_TOOLTIP_CONTENT_CLASS, className)
      }, props), {
        children: [
          children,
          /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipArrow, {})
        ]
      })
    );
  }
  __name(TooltipContentWithArrow, "TooltipContentWithArrow");
  TooltipContentWithArrow.displayName = "TooltipContentWithArrow";
  function clamp(value, [min2, max2]) {
    return Math.min(max2, Math.max(min2, value));
  }
  __name(clamp, "clamp");
  // @__NO_SIDE_EFFECTS__
  function createSlot(ownerName) {
    const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
    const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
      const _a2 = props, { children } = _a2, slotProps = __objRest(_a2, ["children"]);
      const childrenArray = reactExports.Children.toArray(children);
      const slottable = childrenArray.find(isSlottable);
      if (slottable) {
        const newElement = slottable.props.children;
        const newChildren = childrenArray.map((child) => {
          if (child === slottable) {
            if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
            return reactExports.isValidElement(newElement) ? newElement.props.children : null;
          } else {
            return child;
          }
        });
        return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null }));
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children }));
    });
    Slot2.displayName = `${ownerName}.Slot`;
    return Slot2;
  }
  __name(createSlot, "createSlot");
  // @__NO_SIDE_EFFECTS__
  function createSlotClone(ownerName) {
    const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
      const _a2 = props, { children } = _a2, slotProps = __objRest(_a2, ["children"]);
      if (reactExports.isValidElement(children)) {
        const childrenRef = getElementRef(children);
        const props2 = mergeProps(slotProps, children.props);
        if (children.type !== reactExports.Fragment) {
          props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
        }
        return reactExports.cloneElement(children, props2);
      }
      return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null;
    });
    SlotClone.displayName = `${ownerName}.SlotClone`;
    return SlotClone;
  }
  __name(createSlotClone, "createSlotClone");
  var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
  function isSlottable(child) {
    return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
  }
  __name(isSlottable, "isSlottable");
  function mergeProps(slotProps, childProps) {
    const overrideProps = __spreadValues({}, childProps);
    for (const propName in childProps) {
      const slotPropValue = slotProps[propName];
      const childPropValue = childProps[propName];
      const isHandler = /^on[A-Z]/.test(propName);
      if (isHandler) {
        if (slotPropValue && childPropValue) {
          overrideProps[propName] = (...args) => {
            const result = childPropValue(...args);
            slotPropValue(...args);
            return result;
          };
        } else if (slotPropValue) {
          overrideProps[propName] = slotPropValue;
        }
      } else if (propName === "style") {
        overrideProps[propName] = __spreadValues(__spreadValues({}, slotPropValue), childPropValue);
      } else if (propName === "className") {
        overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
      }
    }
    return __spreadValues(__spreadValues({}, slotProps), overrideProps);
  }
  __name(mergeProps, "mergeProps");
  function getElementRef(element) {
    var _a2, _b2;
    let getter = (_a2 = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a2.get;
    let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
    if (mayWarn) {
      return element.ref;
    }
    getter = (_b2 = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b2.get;
    mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
    if (mayWarn) {
      return element.props.ref;
    }
    return element.props.ref || element.ref;
  }
  __name(getElementRef, "getElementRef");
  function usePrevious(value) {
    const ref = reactExports.useRef({ value, previous: value });
    return reactExports.useMemo(() => {
      if (ref.current.value !== value) {
        ref.current.previous = ref.current.value;
        ref.current.value = value;
      }
      return ref.current.previous;
    }, [value]);
  }
  __name(usePrevious, "usePrevious");
  var OPEN_KEYS = [" ", "Enter", "ArrowUp", "ArrowDown"];
  var SELECTION_KEYS = [" ", "Enter"];
  var SELECT_NAME = "Select";
  var [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME);
  var [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [
    createCollectionScope,
    createPopperScope
  ]);
  var usePopperScope = createPopperScope();
  var [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME);
  var [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME);
  var Select$1 = /* @__PURE__ */ __name((props) => {
    const {
      __scopeSelect,
      children,
      open: openProp,
      defaultOpen,
      onOpenChange,
      value: valueProp,
      defaultValue,
      onValueChange,
      dir,
      name,
      autoComplete,
      disabled,
      required,
      form
    } = props;
    const popperScope = usePopperScope(__scopeSelect);
    const [trigger, setTrigger] = reactExports.useState(null);
    const [valueNode, setValueNode] = reactExports.useState(null);
    const [valueNodeHasChildren, setValueNodeHasChildren] = reactExports.useState(false);
    const direction = useDirection(dir);
    const [open, setOpen] = useControllableState({
      prop: openProp,
      defaultProp: defaultOpen != null ? defaultOpen : false,
      onChange: onOpenChange,
      caller: SELECT_NAME
    });
    const [value, setValue] = useControllableState({
      prop: valueProp,
      defaultProp: defaultValue,
      onChange: onValueChange,
      caller: SELECT_NAME
    });
    const triggerPointerDownPosRef = reactExports.useRef(null);
    const isFormControl = trigger ? form || !!trigger.closest("form") : true;
    const [nativeOptionsSet, setNativeOptionsSet] = reactExports.useState(/* @__PURE__ */ new Set());
    const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Root2$5, __spreadProps(__spreadValues({}, popperScope), { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      SelectProvider,
      {
        required,
        scope: __scopeSelect,
        trigger,
        onTriggerChange: setTrigger,
        valueNode,
        onValueNodeChange: setValueNode,
        valueNodeHasChildren,
        onValueNodeHasChildrenChange: setValueNodeHasChildren,
        contentId: useId(),
        value,
        onValueChange: setValue,
        open,
        onOpenChange: setOpen,
        dir: direction,
        triggerPointerDownPosRef,
        disabled,
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            SelectNativeOptionsProvider,
            {
              scope: props.__scopeSelect,
              onNativeOptionAdd: reactExports.useCallback((option) => {
                setNativeOptionsSet((prev) => new Set(prev).add(option));
              }, []),
              onNativeOptionRemove: reactExports.useCallback((option) => {
                setNativeOptionsSet((prev) => {
                  const optionsSet = new Set(prev);
                  optionsSet.delete(option);
                  return optionsSet;
                });
              }, []),
              children
            }
          ) }),
          isFormControl ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
            SelectBubbleInput,
            {
              "aria-hidden": true,
              required,
              tabIndex: -1,
              name,
              autoComplete,
              value,
              onChange: /* @__PURE__ */ __name((event) => setValue(event.target.value), "onChange"),
              disabled,
              form,
              children: [
                value === void 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "" }) : null,
                Array.from(nativeOptionsSet)
              ]
            },
            nativeSelectKey
          ) : null
        ]
      }
    ) }));
  }, "Select$1");
  Select$1.displayName = SELECT_NAME;
  var TRIGGER_NAME$2 = "SelectTrigger";
  var SelectTrigger$2 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeSelect, disabled = false } = _a2, triggerProps = __objRest(_a2, ["__scopeSelect", "disabled"]);
      const popperScope = usePopperScope(__scopeSelect);
      const context = useSelectContext(TRIGGER_NAME$2, __scopeSelect);
      const isDisabled = context.disabled || disabled;
      const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);
      const getItems = useCollection(__scopeSelect);
      const pointerTypeRef = reactExports.useRef("touch");
      const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {
        const enabledItems = getItems().filter((item) => !item.disabled);
        const currentItem = enabledItems.find((item) => item.value === context.value);
        const nextItem = findNextItem(enabledItems, search, currentItem);
        if (nextItem !== void 0) {
          context.onValueChange(nextItem.value);
        }
      });
      const handleOpen = /* @__PURE__ */ __name((pointerEvent) => {
        if (!isDisabled) {
          context.onOpenChange(true);
          resetTypeahead();
        }
        if (pointerEvent) {
          context.triggerPointerDownPosRef.current = {
            x: Math.round(pointerEvent.pageX),
            y: Math.round(pointerEvent.pageY)
          };
        }
      }, "handleOpen");
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor, __spreadProps(__spreadValues({ asChild: true }, popperScope), { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.button,
        __spreadProps(__spreadValues({
          type: "button",
          role: "combobox",
          "aria-controls": context.contentId,
          "aria-expanded": context.open,
          "aria-required": context.required,
          "aria-autocomplete": "none",
          dir: context.dir,
          "data-state": context.open ? "open" : "closed",
          disabled: isDisabled,
          "data-disabled": isDisabled ? "" : void 0,
          "data-placeholder": shouldShowPlaceholder(context.value) ? "" : void 0
        }, triggerProps), {
          ref: composedRefs,
          onClick: composeEventHandlers(triggerProps.onClick, (event) => {
            event.currentTarget.focus();
            if (pointerTypeRef.current !== "mouse") {
              handleOpen(event);
            }
          }),
          onPointerDown: composeEventHandlers(triggerProps.onPointerDown, (event) => {
            pointerTypeRef.current = event.pointerType;
            const target = event.target;
            if (target.hasPointerCapture(event.pointerId)) {
              target.releasePointerCapture(event.pointerId);
            }
            if (event.button === 0 && event.ctrlKey === false && event.pointerType === "mouse") {
              handleOpen(event);
              event.preventDefault();
            }
          }),
          onKeyDown: composeEventHandlers(triggerProps.onKeyDown, (event) => {
            const isTypingAhead = searchRef.current !== "";
            const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
            if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
            if (isTypingAhead && event.key === " ") return;
            if (OPEN_KEYS.includes(event.key)) {
              handleOpen();
              event.preventDefault();
            }
          })
        })
      ) }));
    }
  );
  SelectTrigger$2.displayName = TRIGGER_NAME$2;
  var VALUE_NAME = "SelectValue";
  var SelectValue$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeSelect, className, style, children, placeholder = "" } = _a2, valueProps = __objRest(_a2, ["__scopeSelect", "className", "style", "children", "placeholder"]);
      const context = useSelectContext(VALUE_NAME, __scopeSelect);
      const { onValueNodeHasChildrenChange } = context;
      const hasChildren = children !== void 0;
      const composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange);
      useLayoutEffect2(() => {
        onValueNodeHasChildrenChange(hasChildren);
      }, [onValueNodeHasChildrenChange, hasChildren]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.span,
        __spreadProps(__spreadValues({}, valueProps), {
          ref: composedRefs,
          style: { pointerEvents: "none" },
          children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: placeholder }) : children
        })
      );
    }
  );
  SelectValue$1.displayName = VALUE_NAME;
  var ICON_NAME = "SelectIcon";
  var SelectIcon = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeSelect, children } = _a2, iconProps = __objRest(_a2, ["__scopeSelect", "children"]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.span, __spreadProps(__spreadValues({ "aria-hidden": true }, iconProps), { ref: forwardedRef, children: children || "▼" }));
    }
  );
  SelectIcon.displayName = ICON_NAME;
  var PORTAL_NAME = "SelectPortal";
  var SelectPortal = /* @__PURE__ */ __name((props) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Portal$3, __spreadValues({ asChild: true }, props));
  }, "SelectPortal");
  SelectPortal.displayName = PORTAL_NAME;
  var CONTENT_NAME$1 = "SelectContent";
  var SelectContent$2 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const context = useSelectContext(CONTENT_NAME$1, props.__scopeSelect);
      const [fragment, setFragment] = reactExports.useState();
      useLayoutEffect2(() => {
        setFragment(new DocumentFragment());
      }, []);
      if (!context.open) {
        const frag = fragment;
        return frag ? reactDomExports.createPortal(
          /* @__PURE__ */ jsxRuntimeExports.jsx(SelectContentProvider, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Collection.Slot, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: props.children }) }) }),
          frag
        ) : null;
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(SelectContentImpl, __spreadProps(__spreadValues({}, props), { ref: forwardedRef }));
    }
  );
  SelectContent$2.displayName = CONTENT_NAME$1;
  var CONTENT_MARGIN = 10;
  var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME$1);
  var CONTENT_IMPL_NAME = "SelectContentImpl";
  var Slot = /* @__PURE__ */ createSlot("SelectContent.RemoveScroll");
  var SelectContentImpl = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, {
        __scopeSelect,
        position = "item-aligned",
        onCloseAutoFocus,
        onEscapeKeyDown,
        onPointerDownOutside,
        side: side,
        sideOffset,
        align,
        alignOffset,
        arrowPadding,
        collisionBoundary,
        collisionPadding,
        sticky,
        hideWhenDetached,
        avoidCollisions
      } = _a2, contentProps = __objRest(_a2, [
        "__scopeSelect",
        "position",
        "onCloseAutoFocus",
        "onEscapeKeyDown",
        "onPointerDownOutside",
        //
        // PopperContent props
        "side",
        "sideOffset",
        "align",
        "alignOffset",
        "arrowPadding",
        "collisionBoundary",
        "collisionPadding",
        "sticky",
        "hideWhenDetached",
        "avoidCollisions"
      ]);
      const context = useSelectContext(CONTENT_NAME$1, __scopeSelect);
      const [content, setContent] = reactExports.useState(null);
      const [viewport, setViewport] = reactExports.useState(null);
      const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
      const [selectedItem, setSelectedItem] = reactExports.useState(null);
      const [selectedItemText, setSelectedItemText] = reactExports.useState(
        null
      );
      const getItems = useCollection(__scopeSelect);
      const [isPositioned, setIsPositioned] = reactExports.useState(false);
      const firstValidItemFoundRef = reactExports.useRef(false);
      reactExports.useEffect(() => {
        if (content) return hideOthers(content);
      }, [content]);
      useFocusGuards();
      const focusFirst2 = reactExports.useCallback(
        (candidates) => {
          const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);
          const [lastItem] = restItems.slice(-1);
          const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
          for (const candidate of candidates) {
            if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
            candidate == null ? void 0 : candidate.scrollIntoView({ block: "nearest" });
            if (candidate === firstItem && viewport) viewport.scrollTop = 0;
            if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight;
            candidate == null ? void 0 : candidate.focus();
            if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
          }
        },
        [getItems, viewport]
      );
      const focusSelectedItem = reactExports.useCallback(
        () => focusFirst2([selectedItem, content]),
        [focusFirst2, selectedItem, content]
      );
      reactExports.useEffect(() => {
        if (isPositioned) {
          focusSelectedItem();
        }
      }, [isPositioned, focusSelectedItem]);
      const { onOpenChange, triggerPointerDownPosRef } = context;
      reactExports.useEffect(() => {
        if (content) {
          let pointerMoveDelta = { x: 0, y: 0 };
          const handlePointerMove = /* @__PURE__ */ __name((event) => {
            var _a3, _b2, _c2, _d;
            pointerMoveDelta = {
              x: Math.abs(Math.round(event.pageX) - ((_b2 = (_a3 = triggerPointerDownPosRef.current) == null ? void 0 : _a3.x) != null ? _b2 : 0)),
              y: Math.abs(Math.round(event.pageY) - ((_d = (_c2 = triggerPointerDownPosRef.current) == null ? void 0 : _c2.y) != null ? _d : 0))
            };
          }, "handlePointerMove");
          const handlePointerUp = /* @__PURE__ */ __name((event) => {
            if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10) {
              event.preventDefault();
            } else {
              if (!content.contains(event.target)) {
                onOpenChange(false);
              }
            }
            document.removeEventListener("pointermove", handlePointerMove);
            triggerPointerDownPosRef.current = null;
          }, "handlePointerUp");
          if (triggerPointerDownPosRef.current !== null) {
            document.addEventListener("pointermove", handlePointerMove);
            document.addEventListener("pointerup", handlePointerUp, { capture: true, once: true });
          }
          return () => {
            document.removeEventListener("pointermove", handlePointerMove);
            document.removeEventListener("pointerup", handlePointerUp, { capture: true });
          };
        }
      }, [content, onOpenChange, triggerPointerDownPosRef]);
      reactExports.useEffect(() => {
        const close = /* @__PURE__ */ __name(() => onOpenChange(false), "close");
        window.addEventListener("blur", close);
        window.addEventListener("resize", close);
        return () => {
          window.removeEventListener("blur", close);
          window.removeEventListener("resize", close);
        };
      }, [onOpenChange]);
      const [searchRef, handleTypeaheadSearch] = useTypeaheadSearch((search) => {
        const enabledItems = getItems().filter((item) => !item.disabled);
        const currentItem = enabledItems.find((item) => item.ref.current === document.activeElement);
        const nextItem = findNextItem(enabledItems, search, currentItem);
        if (nextItem) {
          setTimeout(() => nextItem.ref.current.focus());
        }
      });
      const itemRefCallback = reactExports.useCallback(
        (node, value, disabled) => {
          const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
          const isSelectedItem = context.value !== void 0 && context.value === value;
          if (isSelectedItem || isFirstValidItem) {
            setSelectedItem(node);
            if (isFirstValidItem) firstValidItemFoundRef.current = true;
          }
        },
        [context.value]
      );
      const handleItemLeave = reactExports.useCallback(() => content == null ? void 0 : content.focus(), [content]);
      const itemTextRefCallback = reactExports.useCallback(
        (node, value, disabled) => {
          const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
          const isSelectedItem = context.value !== void 0 && context.value === value;
          if (isSelectedItem || isFirstValidItem) {
            setSelectedItemText(node);
          }
        },
        [context.value]
      );
      const SelectPosition = position === "popper" ? SelectPopperPosition : SelectItemAlignedPosition;
      const popperContentProps = SelectPosition === SelectPopperPosition ? {
        side,
        sideOffset,
        align,
        alignOffset,
        arrowPadding,
        collisionBoundary,
        collisionPadding,
        sticky,
        hideWhenDetached,
        avoidCollisions
      } : {};
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        SelectContentProvider,
        {
          scope: __scopeSelect,
          content,
          viewport,
          onViewportChange: setViewport,
          itemRefCallback,
          selectedItem,
          onItemLeave: handleItemLeave,
          itemTextRefCallback,
          focusSelectedItem,
          selectedItemText,
          position,
          isPositioned,
          searchRef,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            FocusScope,
            {
              asChild: true,
              trapped: context.open,
              onMountAutoFocus: /* @__PURE__ */ __name((event) => {
                event.preventDefault();
              }, "onMountAutoFocus"),
              onUnmountAutoFocus: composeEventHandlers(onCloseAutoFocus, (event) => {
                var _a3;
                (_a3 = context.trigger) == null ? void 0 : _a3.focus({ preventScroll: true });
                event.preventDefault();
              }),
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                DismissableLayer,
                {
                  asChild: true,
                  disableOutsidePointerEvents: true,
                  onEscapeKeyDown,
                  onPointerDownOutside,
                  onFocusOutside: /* @__PURE__ */ __name((event) => event.preventDefault(), "onFocusOutside"),
                  onDismiss: /* @__PURE__ */ __name(() => context.onOpenChange(false), "onDismiss"),
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                    SelectPosition,
                    __spreadProps(__spreadValues(__spreadValues({
                      role: "listbox",
                      id: context.contentId,
                      "data-state": context.open ? "open" : "closed",
                      dir: context.dir,
                      onContextMenu: /* @__PURE__ */ __name((event) => event.preventDefault(), "onContextMenu")
                    }, contentProps), popperContentProps), {
                      onPlaced: /* @__PURE__ */ __name(() => setIsPositioned(true), "onPlaced"),
                      ref: composedRefs,
                      style: __spreadValues({
                        // flex layout so we can place the scroll buttons properly
                        display: "flex",
                        flexDirection: "column",
                        // reset the outline by default as the content MAY get focused
                        outline: "none"
                      }, contentProps.style),
                      onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {
                        const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
                        if (event.key === "Tab") event.preventDefault();
                        if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
                        if (["ArrowUp", "ArrowDown", "Home", "End"].includes(event.key)) {
                          const items = getItems().filter((item) => !item.disabled);
                          let candidateNodes = items.map((item) => item.ref.current);
                          if (["ArrowUp", "End"].includes(event.key)) {
                            candidateNodes = candidateNodes.slice().reverse();
                          }
                          if (["ArrowUp", "ArrowDown"].includes(event.key)) {
                            const currentElement = event.target;
                            const currentIndex = candidateNodes.indexOf(currentElement);
                            candidateNodes = candidateNodes.slice(currentIndex + 1);
                          }
                          setTimeout(() => focusFirst2(candidateNodes));
                          event.preventDefault();
                        }
                      })
                    })
                  )
                }
              )
            }
          ) })
        }
      );
    }
  );
  SelectContentImpl.displayName = CONTENT_IMPL_NAME;
  var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition";
  var SelectItemAlignedPosition = reactExports.forwardRef((props, forwardedRef) => {
    const _a2 = props, { __scopeSelect, onPlaced } = _a2, popperProps = __objRest(_a2, ["__scopeSelect", "onPlaced"]);
    const context = useSelectContext(CONTENT_NAME$1, __scopeSelect);
    const contentContext = useSelectContentContext(CONTENT_NAME$1, __scopeSelect);
    const [contentWrapper, setContentWrapper] = reactExports.useState(null);
    const [content, setContent] = reactExports.useState(null);
    const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
    const getItems = useCollection(__scopeSelect);
    const shouldExpandOnScrollRef = reactExports.useRef(false);
    const shouldRepositionRef = reactExports.useRef(true);
    const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;
    const position = reactExports.useCallback(() => {
      if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
        const triggerRect = context.trigger.getBoundingClientRect();
        const contentRect = content.getBoundingClientRect();
        const valueNodeRect = context.valueNode.getBoundingClientRect();
        const itemTextRect = selectedItemText.getBoundingClientRect();
        if (context.dir !== "rtl") {
          const itemTextOffset = itemTextRect.left - contentRect.left;
          const left = valueNodeRect.left - itemTextOffset;
          const leftDelta = triggerRect.left - left;
          const minContentWidth = triggerRect.width + leftDelta;
          const contentWidth = Math.max(minContentWidth, contentRect.width);
          const rightEdge = window.innerWidth - CONTENT_MARGIN;
          const clampedLeft = clamp(left, [
            CONTENT_MARGIN,
            // Prevents the content from going off the starting edge of the
            // viewport. It may still go off the ending edge, but this can be
            // controlled by the user since they may want to manage overflow in a
            // specific way.
            // https://github.com/radix-ui/primitives/issues/2049
            Math.max(CONTENT_MARGIN, rightEdge - contentWidth)
          ]);
          contentWrapper.style.minWidth = minContentWidth + "px";
          contentWrapper.style.left = clampedLeft + "px";
        } else {
          const itemTextOffset = contentRect.right - itemTextRect.right;
          const right = window.innerWidth - valueNodeRect.right - itemTextOffset;
          const rightDelta = window.innerWidth - triggerRect.right - right;
          const minContentWidth = triggerRect.width + rightDelta;
          const contentWidth = Math.max(minContentWidth, contentRect.width);
          const leftEdge = window.innerWidth - CONTENT_MARGIN;
          const clampedRight = clamp(right, [
            CONTENT_MARGIN,
            Math.max(CONTENT_MARGIN, leftEdge - contentWidth)
          ]);
          contentWrapper.style.minWidth = minContentWidth + "px";
          contentWrapper.style.right = clampedRight + "px";
        }
        const items = getItems();
        const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;
        const itemsHeight = viewport.scrollHeight;
        const contentStyles = window.getComputedStyle(content);
        const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);
        const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);
        const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);
        const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);
        const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth;
        const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);
        const viewportStyles = window.getComputedStyle(viewport);
        const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);
        const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);
        const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - CONTENT_MARGIN;
        const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;
        const selectedItemHalfHeight = selectedItem.offsetHeight / 2;
        const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;
        const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;
        const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;
        const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;
        if (willAlignWithoutTopOverflow) {
          const isLastItem = items.length > 0 && selectedItem === items[items.length - 1].ref.current;
          contentWrapper.style.bottom = "0px";
          const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight;
          const clampedTriggerMiddleToBottomEdge = Math.max(
            triggerMiddleToBottomEdge,
            selectedItemHalfHeight + // viewport might have padding bottom, include it to avoid a scrollable viewport
            (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth
          );
          const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;
          contentWrapper.style.height = height + "px";
        } else {
          const isFirstItem = items.length > 0 && selectedItem === items[0].ref.current;
          contentWrapper.style.top = "0px";
          const clampedTopEdgeToTriggerMiddle = Math.max(
            topEdgeToTriggerMiddle,
            contentBorderTopWidth + viewport.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
            (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight
          );
          const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;
          contentWrapper.style.height = height + "px";
          viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;
        }
        contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`;
        contentWrapper.style.minHeight = minContentHeight + "px";
        contentWrapper.style.maxHeight = availableHeight + "px";
        onPlaced == null ? void 0 : onPlaced();
        requestAnimationFrame(() => shouldExpandOnScrollRef.current = true);
      }
    }, [
      getItems,
      context.trigger,
      context.valueNode,
      contentWrapper,
      content,
      viewport,
      selectedItem,
      selectedItemText,
      context.dir,
      onPlaced
    ]);
    useLayoutEffect2(() => position(), [position]);
    const [contentZIndex, setContentZIndex] = reactExports.useState();
    useLayoutEffect2(() => {
      if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
    }, [content]);
    const handleScrollButtonChange = reactExports.useCallback(
      (node) => {
        if (node && shouldRepositionRef.current === true) {
          position();
          focusSelectedItem == null ? void 0 : focusSelectedItem();
          shouldRepositionRef.current = false;
        }
      },
      [position, focusSelectedItem]
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      SelectViewportProvider,
      {
        scope: __scopeSelect,
        contentWrapper,
        shouldExpandOnScrollRef,
        onScrollButtonChange: handleScrollButtonChange,
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            ref: setContentWrapper,
            style: {
              display: "flex",
              flexDirection: "column",
              position: "fixed",
              zIndex: contentZIndex
            },
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              Primitive$1.div,
              __spreadProps(__spreadValues({}, popperProps), {
                ref: composedRefs,
                style: __spreadValues({
                  // When we get the height of the content, it includes borders. If we were to set
                  // the height without having `boxSizing: 'border-box'` it would be too big.
                  boxSizing: "border-box",
                  // We need to ensure the content doesn't get taller than the wrapper
                  maxHeight: "100%"
                }, popperProps.style)
              })
            )
          }
        )
      }
    );
  });
  SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;
  var POPPER_POSITION_NAME = "SelectPopperPosition";
  var SelectPopperPosition = reactExports.forwardRef((props, forwardedRef) => {
    const _a2 = props, {
      __scopeSelect,
      align = "start",
      collisionPadding = CONTENT_MARGIN
    } = _a2, popperProps = __objRest(_a2, [
      "__scopeSelect",
      "align",
      "collisionPadding"
    ]);
    const popperScope = usePopperScope(__scopeSelect);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Content$3,
      __spreadProps(__spreadValues(__spreadValues({}, popperScope), popperProps), {
        ref: forwardedRef,
        align,
        collisionPadding,
        style: __spreadValues(__spreadValues({
          // Ensure border-box for floating-ui calculations
          boxSizing: "border-box"
        }, popperProps.style), {
          "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
          "--radix-select-content-available-width": "var(--radix-popper-available-width)",
          "--radix-select-content-available-height": "var(--radix-popper-available-height)",
          "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
          "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
        })
      })
    );
  });
  SelectPopperPosition.displayName = POPPER_POSITION_NAME;
  var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME$1, {});
  var VIEWPORT_NAME = "SelectViewport";
  var SelectViewport = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeSelect, nonce } = _a2, viewportProps = __objRest(_a2, ["__scopeSelect", "nonce"]);
      const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);
      const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
      const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);
      const prevScrollTopRef = reactExports.useRef(0);
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "style",
          {
            dangerouslySetInnerHTML: {
              __html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`
            },
            nonce
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Collection.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Primitive$1.div,
          __spreadProps(__spreadValues({
            "data-radix-select-viewport": "",
            role: "presentation"
          }, viewportProps), {
            ref: composedRefs,
            style: __spreadValues({
              // we use position: 'relative' here on the `viewport` so that when we call
              // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
              // (independent of the scrollUpButton).
              position: "relative",
              flex: 1,
              // Viewport should only be scrollable in the vertical direction.
              // This won't work in vertical writing modes, so we'll need to
              // revisit this if/when that is supported
              // https://developer.chrome.com/blog/vertical-form-controls
              overflow: "hidden auto"
            }, viewportProps.style),
            onScroll: composeEventHandlers(viewportProps.onScroll, (event) => {
              const viewport = event.currentTarget;
              const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;
              if ((shouldExpandOnScrollRef == null ? void 0 : shouldExpandOnScrollRef.current) && contentWrapper) {
                const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);
                if (scrolledBy > 0) {
                  const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;
                  const cssMinHeight = parseFloat(contentWrapper.style.minHeight);
                  const cssHeight = parseFloat(contentWrapper.style.height);
                  const prevHeight = Math.max(cssMinHeight, cssHeight);
                  if (prevHeight < availableHeight) {
                    const nextHeight = prevHeight + scrolledBy;
                    const clampedNextHeight = Math.min(availableHeight, nextHeight);
                    const heightDiff = nextHeight - clampedNextHeight;
                    contentWrapper.style.height = clampedNextHeight + "px";
                    if (contentWrapper.style.bottom === "0px") {
                      viewport.scrollTop = heightDiff > 0 ? heightDiff : 0;
                      contentWrapper.style.justifyContent = "flex-end";
                    }
                  }
                }
              }
              prevScrollTopRef.current = viewport.scrollTop;
            })
          })
        ) })
      ] });
    }
  );
  SelectViewport.displayName = VIEWPORT_NAME;
  var GROUP_NAME = "SelectGroup";
  var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME);
  var SelectGroup = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeSelect } = _a2, groupProps = __objRest(_a2, ["__scopeSelect"]);
      const groupId = useId();
      return /* @__PURE__ */ jsxRuntimeExports.jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, __spreadProps(__spreadValues({ role: "group", "aria-labelledby": groupId }, groupProps), { ref: forwardedRef })) });
    }
  );
  SelectGroup.displayName = GROUP_NAME;
  var LABEL_NAME = "SelectLabel";
  var SelectLabel$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeSelect } = _a2, labelProps = __objRest(_a2, ["__scopeSelect"]);
      const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, __spreadProps(__spreadValues({ id: groupContext.id }, labelProps), { ref: forwardedRef }));
    }
  );
  SelectLabel$1.displayName = LABEL_NAME;
  var ITEM_NAME$1 = "SelectItem";
  var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME$1);
  var SelectItem$2 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, {
        __scopeSelect,
        value,
        disabled = false,
        textValue: textValueProp
      } = _a2, itemProps = __objRest(_a2, [
        "__scopeSelect",
        "value",
        "disabled",
        "textValue"
      ]);
      const context = useSelectContext(ITEM_NAME$1, __scopeSelect);
      const contentContext = useSelectContentContext(ITEM_NAME$1, __scopeSelect);
      const isSelected = context.value === value;
      const [textValue, setTextValue] = reactExports.useState(textValueProp != null ? textValueProp : "");
      const [isFocused, setIsFocused] = reactExports.useState(false);
      const composedRefs = useComposedRefs(
        forwardedRef,
        (node) => {
          var _a3;
          return (_a3 = contentContext.itemRefCallback) == null ? void 0 : _a3.call(contentContext, node, value, disabled);
        }
      );
      const textId = useId();
      const pointerTypeRef = reactExports.useRef("touch");
      const handleSelect = /* @__PURE__ */ __name(() => {
        if (!disabled) {
          context.onValueChange(value);
          context.onOpenChange(false);
        }
      }, "handleSelect");
      if (value === "") {
        throw new Error(
          "A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
        );
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        SelectItemContextProvider,
        {
          scope: __scopeSelect,
          value,
          disabled,
          textId,
          isSelected,
          onItemTextChange: reactExports.useCallback((node) => {
            setTextValue((prevTextValue) => {
              var _a3;
              return prevTextValue || ((_a3 = node == null ? void 0 : node.textContent) != null ? _a3 : "").trim();
            });
          }, []),
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Collection.ItemSlot,
            {
              scope: __scopeSelect,
              value,
              disabled,
              textValue,
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                Primitive$1.div,
                __spreadProps(__spreadValues({
                  role: "option",
                  "aria-labelledby": textId,
                  "data-highlighted": isFocused ? "" : void 0,
                  "aria-selected": isSelected && isFocused,
                  "data-state": isSelected ? "checked" : "unchecked",
                  "aria-disabled": disabled || void 0,
                  "data-disabled": disabled ? "" : void 0,
                  tabIndex: disabled ? void 0 : -1
                }, itemProps), {
                  ref: composedRefs,
                  onFocus: composeEventHandlers(itemProps.onFocus, () => setIsFocused(true)),
                  onBlur: composeEventHandlers(itemProps.onBlur, () => setIsFocused(false)),
                  onClick: composeEventHandlers(itemProps.onClick, () => {
                    if (pointerTypeRef.current !== "mouse") handleSelect();
                  }),
                  onPointerUp: composeEventHandlers(itemProps.onPointerUp, () => {
                    if (pointerTypeRef.current === "mouse") handleSelect();
                  }),
                  onPointerDown: composeEventHandlers(itemProps.onPointerDown, (event) => {
                    pointerTypeRef.current = event.pointerType;
                  }),
                  onPointerMove: composeEventHandlers(itemProps.onPointerMove, (event) => {
                    var _a3;
                    pointerTypeRef.current = event.pointerType;
                    if (disabled) {
                      (_a3 = contentContext.onItemLeave) == null ? void 0 : _a3.call(contentContext);
                    } else if (pointerTypeRef.current === "mouse") {
                      event.currentTarget.focus({ preventScroll: true });
                    }
                  }),
                  onPointerLeave: composeEventHandlers(itemProps.onPointerLeave, (event) => {
                    var _a3;
                    if (event.currentTarget === document.activeElement) {
                      (_a3 = contentContext.onItemLeave) == null ? void 0 : _a3.call(contentContext);
                    }
                  }),
                  onKeyDown: composeEventHandlers(itemProps.onKeyDown, (event) => {
                    var _a3;
                    const isTypingAhead = ((_a3 = contentContext.searchRef) == null ? void 0 : _a3.current) !== "";
                    if (isTypingAhead && event.key === " ") return;
                    if (SELECTION_KEYS.includes(event.key)) handleSelect();
                    if (event.key === " ") event.preventDefault();
                  })
                })
              )
            }
          )
        }
      );
    }
  );
  SelectItem$2.displayName = ITEM_NAME$1;
  var ITEM_TEXT_NAME = "SelectItemText";
  var SelectItemText = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeSelect, className, style } = _a2, itemTextProps = __objRest(_a2, ["__scopeSelect", "className", "style"]);
      const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);
      const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);
      const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
      const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
      const [itemTextNode, setItemTextNode] = reactExports.useState(null);
      const composedRefs = useComposedRefs(
        forwardedRef,
        (node) => setItemTextNode(node),
        itemContext.onItemTextChange,
        (node) => {
          var _a3;
          return (_a3 = contentContext.itemTextRefCallback) == null ? void 0 : _a3.call(contentContext, node, itemContext.value, itemContext.disabled);
        }
      );
      const textContent = itemTextNode == null ? void 0 : itemTextNode.textContent;
      const nativeOption = reactExports.useMemo(
        () => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),
        [itemContext.disabled, itemContext.value, textContent]
      );
      const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;
      useLayoutEffect2(() => {
        onNativeOptionAdd(nativeOption);
        return () => onNativeOptionRemove(nativeOption);
      }, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.span, __spreadProps(__spreadValues({ id: itemContext.textId }, itemTextProps), { ref: composedRefs })),
        itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? reactDomExports.createPortal(itemTextProps.children, context.valueNode) : null
      ] });
    }
  );
  SelectItemText.displayName = ITEM_TEXT_NAME;
  var ITEM_INDICATOR_NAME = "SelectItemIndicator";
  var SelectItemIndicator = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeSelect } = _a2, itemIndicatorProps = __objRest(_a2, ["__scopeSelect"]);
      const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
      return itemContext.isSelected ? /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.span, __spreadProps(__spreadValues({ "aria-hidden": true }, itemIndicatorProps), { ref: forwardedRef })) : null;
    }
  );
  SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
  var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
  var SelectScrollUpButton$1 = reactExports.forwardRef((props, forwardedRef) => {
    const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
    const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
    const [canScrollUp, setCanScrollUp] = reactExports.useState(false);
    const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
    useLayoutEffect2(() => {
      if (contentContext.viewport && contentContext.isPositioned) {
        let handleScroll2 = /* @__PURE__ */ __name(function() {
          const canScrollUp2 = viewport.scrollTop > 0;
          setCanScrollUp(canScrollUp2);
        }, "handleScroll2");
        const viewport = contentContext.viewport;
        handleScroll2();
        viewport.addEventListener("scroll", handleScroll2);
        return () => viewport.removeEventListener("scroll", handleScroll2);
      }
    }, [contentContext.viewport, contentContext.isPositioned]);
    return canScrollUp ? /* @__PURE__ */ jsxRuntimeExports.jsx(
      SelectScrollButtonImpl,
      __spreadProps(__spreadValues({}, props), {
        ref: composedRefs,
        onAutoScroll: /* @__PURE__ */ __name(() => {
          const { viewport, selectedItem } = contentContext;
          if (viewport && selectedItem) {
            viewport.scrollTop = viewport.scrollTop - selectedItem.offsetHeight;
          }
        }, "onAutoScroll")
      })
    ) : null;
  });
  SelectScrollUpButton$1.displayName = SCROLL_UP_BUTTON_NAME;
  var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
  var SelectScrollDownButton$1 = reactExports.forwardRef((props, forwardedRef) => {
    const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
    const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
    const [canScrollDown, setCanScrollDown] = reactExports.useState(false);
    const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
    useLayoutEffect2(() => {
      if (contentContext.viewport && contentContext.isPositioned) {
        let handleScroll2 = /* @__PURE__ */ __name(function() {
          const maxScroll = viewport.scrollHeight - viewport.clientHeight;
          const canScrollDown2 = Math.ceil(viewport.scrollTop) < maxScroll;
          setCanScrollDown(canScrollDown2);
        }, "handleScroll2");
        const viewport = contentContext.viewport;
        handleScroll2();
        viewport.addEventListener("scroll", handleScroll2);
        return () => viewport.removeEventListener("scroll", handleScroll2);
      }
    }, [contentContext.viewport, contentContext.isPositioned]);
    return canScrollDown ? /* @__PURE__ */ jsxRuntimeExports.jsx(
      SelectScrollButtonImpl,
      __spreadProps(__spreadValues({}, props), {
        ref: composedRefs,
        onAutoScroll: /* @__PURE__ */ __name(() => {
          const { viewport, selectedItem } = contentContext;
          if (viewport && selectedItem) {
            viewport.scrollTop = viewport.scrollTop + selectedItem.offsetHeight;
          }
        }, "onAutoScroll")
      })
    ) : null;
  });
  SelectScrollDownButton$1.displayName = SCROLL_DOWN_BUTTON_NAME;
  var SelectScrollButtonImpl = reactExports.forwardRef((props, forwardedRef) => {
    const _a2 = props, { __scopeSelect, onAutoScroll } = _a2, scrollIndicatorProps = __objRest(_a2, ["__scopeSelect", "onAutoScroll"]);
    const contentContext = useSelectContentContext("SelectScrollButton", __scopeSelect);
    const autoScrollTimerRef = reactExports.useRef(null);
    const getItems = useCollection(__scopeSelect);
    const clearAutoScrollTimer = reactExports.useCallback(() => {
      if (autoScrollTimerRef.current !== null) {
        window.clearInterval(autoScrollTimerRef.current);
        autoScrollTimerRef.current = null;
      }
    }, []);
    reactExports.useEffect(() => {
      return () => clearAutoScrollTimer();
    }, [clearAutoScrollTimer]);
    useLayoutEffect2(() => {
      var _a3;
      const activeItem = getItems().find((item) => item.ref.current === document.activeElement);
      (_a3 = activeItem == null ? void 0 : activeItem.ref.current) == null ? void 0 : _a3.scrollIntoView({ block: "nearest" });
    }, [getItems]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Primitive$1.div,
      __spreadProps(__spreadValues({
        "aria-hidden": true
      }, scrollIndicatorProps), {
        ref: forwardedRef,
        style: __spreadValues({ flexShrink: 0 }, scrollIndicatorProps.style),
        onPointerDown: composeEventHandlers(scrollIndicatorProps.onPointerDown, () => {
          if (autoScrollTimerRef.current === null) {
            autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
          }
        }),
        onPointerMove: composeEventHandlers(scrollIndicatorProps.onPointerMove, () => {
          var _a3;
          (_a3 = contentContext.onItemLeave) == null ? void 0 : _a3.call(contentContext);
          if (autoScrollTimerRef.current === null) {
            autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
          }
        }),
        onPointerLeave: composeEventHandlers(scrollIndicatorProps.onPointerLeave, () => {
          clearAutoScrollTimer();
        })
      })
    );
  });
  var SEPARATOR_NAME = "SelectSeparator";
  var SelectSeparator$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeSelect } = _a2, separatorProps = __objRest(_a2, ["__scopeSelect"]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive$1.div, __spreadProps(__spreadValues({ "aria-hidden": true }, separatorProps), { ref: forwardedRef }));
    }
  );
  SelectSeparator$1.displayName = SEPARATOR_NAME;
  var ARROW_NAME = "SelectArrow";
  var SelectArrow = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeSelect } = _a2, arrowProps = __objRest(_a2, ["__scopeSelect"]);
      const popperScope = usePopperScope(__scopeSelect);
      const context = useSelectContext(ARROW_NAME, __scopeSelect);
      const contentContext = useSelectContentContext(ARROW_NAME, __scopeSelect);
      return context.open && contentContext.position === "popper" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Arrow, __spreadProps(__spreadValues(__spreadValues({}, popperScope), arrowProps), { ref: forwardedRef })) : null;
    }
  );
  SelectArrow.displayName = ARROW_NAME;
  var BUBBLE_INPUT_NAME$3 = "SelectBubbleInput";
  var SelectBubbleInput = reactExports.forwardRef(
    (_rb, forwardedRef) => {
      var _sb = _rb, { __scopeSelect, value } = _sb, props = __objRest(_sb, ["__scopeSelect", "value"]);
      const ref = reactExports.useRef(null);
      const composedRefs = useComposedRefs(forwardedRef, ref);
      const prevValue = usePrevious(value);
      reactExports.useEffect(() => {
        const select = ref.current;
        if (!select) return;
        const selectProto = window.HTMLSelectElement.prototype;
        const descriptor = Object.getOwnPropertyDescriptor(
          selectProto,
          "value"
        );
        const setValue = descriptor.set;
        if (prevValue !== value && setValue) {
          const event = new Event("change", { bubbles: true });
          setValue.call(select, value);
          select.dispatchEvent(event);
        }
      }, [prevValue, value]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.select,
        __spreadProps(__spreadValues({}, props), {
          style: __spreadValues(__spreadValues({}, VISUALLY_HIDDEN_STYLES), props.style),
          ref: composedRefs,
          defaultValue: value
        })
      );
    }
  );
  SelectBubbleInput.displayName = BUBBLE_INPUT_NAME$3;
  function shouldShowPlaceholder(value) {
    return value === "" || value === void 0;
  }
  __name(shouldShowPlaceholder, "shouldShowPlaceholder");
  function useTypeaheadSearch(onSearchChange) {
    const handleSearchChange = useCallbackRef$1(onSearchChange);
    const searchRef = reactExports.useRef("");
    const timerRef = reactExports.useRef(0);
    const handleTypeaheadSearch = reactExports.useCallback(
      (key) => {
        const search = searchRef.current + key;
        handleSearchChange(search);
        (/* @__PURE__ */ __name((function updateSearch(value) {
          searchRef.current = value;
          window.clearTimeout(timerRef.current);
          if (value !== "") timerRef.current = window.setTimeout(() => updateSearch(""), 1e3);
        }), "updateSearch"))(search);
      },
      [handleSearchChange]
    );
    const resetTypeahead = reactExports.useCallback(() => {
      searchRef.current = "";
      window.clearTimeout(timerRef.current);
    }, []);
    reactExports.useEffect(() => {
      return () => window.clearTimeout(timerRef.current);
    }, []);
    return [searchRef, handleTypeaheadSearch, resetTypeahead];
  }
  __name(useTypeaheadSearch, "useTypeaheadSearch");
  function findNextItem(items, search, currentItem) {
    const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);
    const normalizedSearch = isRepeated ? search[0] : search;
    const currentItemIndex = currentItem ? items.indexOf(currentItem) : -1;
    let wrappedItems = wrapArray(items, Math.max(currentItemIndex, 0));
    const excludeCurrentItem = normalizedSearch.length === 1;
    if (excludeCurrentItem) wrappedItems = wrappedItems.filter((v) => v !== currentItem);
    const nextItem = wrappedItems.find(
      (item) => item.textValue.toLowerCase().startsWith(normalizedSearch.toLowerCase())
    );
    return nextItem !== currentItem ? nextItem : void 0;
  }
  __name(findNextItem, "findNextItem");
  function wrapArray(array2, startIndex) {
    return array2.map((_, index2) => array2[(startIndex + index2) % array2.length]);
  }
  __name(wrapArray, "wrapArray");
  var Root2$2 = Select$1;
  var Trigger$1 = SelectTrigger$2;
  var Value = SelectValue$1;
  var Icon = SelectIcon;
  var Portal = SelectPortal;
  var Content2 = SelectContent$2;
  var Viewport = SelectViewport;
  var Label$4 = SelectLabel$1;
  var Item = SelectItem$2;
  var ItemText = SelectItemText;
  var ItemIndicator = SelectItemIndicator;
  var ScrollUpButton = SelectScrollUpButton$1;
  var ScrollDownButton = SelectScrollDownButton$1;
  var Separator = SelectSeparator$1;
  const Select = Root2$2;
  const SelectValue = Value;
  const SelectTrigger$1 = reactExports.forwardRef((_tb, ref) => {
    var _ub = _tb, { className, children } = _ub, props = __objRest(_ub, ["className", "children"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      Trigger$1,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(
          "cky:flex cky:h-10 cky:w-full cky:items-center cky:justify-between cky:rounded-md cky:border cky:border-input cky:bg-background cky:px-3 cky:py-2 cky:text-sm cky:ring-offset-background cky:data-[placeholder]:text-muted-foreground cky:focus:outline-none cky:focus:ring-2 cky:focus:ring-ring cky:focus:ring-offset-2 cky:disabled:cursor-not-allowed cky:disabled:opacity-50 cky:[&>span]:line-clamp-1",
          className
        )
      }, props), {
        children: [
          children,
          /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "cky:h-4 cky:w-4 cky:opacity-50" }) })
        ]
      })
    );
  });
  SelectTrigger$1.displayName = Trigger$1.displayName;
  const SelectScrollUpButton = reactExports.forwardRef((_vb, ref) => {
    var _wb = _vb, { className } = _wb, props = __objRest(_wb, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      ScrollUpButton,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(
          "cky:flex cky:cursor-default cky:items-center cky:justify-center cky:py-1",
          className
        )
      }, props), {
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronUp, { className: "cky:h-4 cky:w-4" })
      })
    );
  });
  SelectScrollUpButton.displayName = ScrollUpButton.displayName;
  const SelectScrollDownButton = reactExports.forwardRef((_xb, ref) => {
    var _yb = _xb, { className } = _yb, props = __objRest(_yb, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      ScrollDownButton,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(
          "cky:flex cky:cursor-default cky:items-center cky:justify-center cky:py-1",
          className
        )
      }, props), {
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "cky:h-4 cky:w-4" })
      })
    );
  });
  SelectScrollDownButton.displayName = ScrollDownButton.displayName;
  const SelectContent$1 = reactExports.forwardRef((_zb, ref) => {
    var _Ab = _zb, { className, children, position = "popper" } = _Ab, props = __objRest(_Ab, ["className", "children", "position"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      Content2,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(
          "cky:relative cky:z-50 cky:max-h-[--radix-select-content-available-height] cky:min-w-[8rem] cky:overflow-y-auto cky:overflow-x-hidden cky:rounded-md cky:border cky:bg-popover cky:text-popover-foreground cky:shadow-md cky:data-[state=open]:animate-in cky:data-[state=closed]:animate-out cky:data-[state=closed]:fade-out-0 cky:data-[state=open]:fade-in-0 cky:data-[state=closed]:zoom-out-95 cky:data-[state=open]:zoom-in-95 cky:data-[side=bottom]:slide-in-from-top-2 cky:data-[side=left]:slide-in-from-right-2 cky:data-[side=right]:slide-in-from-left-2 cky:data-[side=top]:slide-in-from-bottom-2 cky:origin-[--radix-select-content-transform-origin]",
          position === "popper" && "cky:data-[side=bottom]:translate-y-1 cky:data-[side=left]:-translate-x-1 cky:data-[side=right]:translate-x-1 cky:data-[side=top]:-translate-y-1",
          className
        ),
        position
      }, props), {
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(SelectScrollUpButton, {}),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            Viewport,
            {
              className: cn$1(
                "cky:p-1",
                position === "popper" && "cky:h-[var(--radix-select-trigger-height)] cky:w-full cky:min-w-[var(--radix-select-trigger-width)]"
              ),
              children
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(SelectScrollDownButton, {})
        ]
      })
    ) });
  });
  SelectContent$1.displayName = Content2.displayName;
  const SelectLabel = reactExports.forwardRef((_Bb, ref) => {
    var _Cb = _Bb, { className } = _Cb, props = __objRest(_Cb, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Label$4,
      __spreadValues({
        ref,
        className: cn$1("cky:py-1.5 cky:pl-8 cky:pr-2 cky:text-sm cky:font-semibold", className)
      }, props)
    );
  });
  SelectLabel.displayName = Label$4.displayName;
  const SelectItem$1 = reactExports.forwardRef((_Db, ref) => {
    var _Eb = _Db, { className, children } = _Eb, props = __objRest(_Eb, ["className", "children"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      Item,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(
          "cky:relative cky:flex cky:w-full cky:cursor-default cky:select-none cky:items-center cky:rounded-sm cky:py-1.5 cky:pl-8 cky:pr-2 cky:text-sm cky:outline-none cky:focus:bg-accent cky:focus:text-accent-foreground cky:data-[disabled]:pointer-events-none cky:data-[disabled]:opacity-50",
          className
        )
      }, props), {
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:absolute cky:left-2 cky:flex cky:h-3.5 cky:w-3.5 cky:items-center cky:justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ItemIndicator, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "cky:h-4 cky:w-4" }) }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(ItemText, { children })
        ]
      })
    );
  });
  SelectItem$1.displayName = Item.displayName;
  const SelectSeparator = reactExports.forwardRef((_Fb, ref) => {
    var _Gb = _Fb, { className } = _Gb, props = __objRest(_Gb, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Separator,
      __spreadValues({
        ref,
        className: cn$1("cky:-mx-1 cky:my-1 cky:h-px cky:bg-muted", className)
      }, props)
    );
  });
  SelectSeparator.displayName = Separator.displayName;
  const CKY_SELECT_CONTENT_CLASS = "cky:z-[100000001] cky:border cky:border-solid cky:border-gray-300 cky:rounded-[8px] cky:bg-gray-700 cky:text-white";
  const CKY_SELECT_ITEM_CLASS = "cky-select-item cky:px-[14px] cky:py-[8px] cky:text-sm cky:text-white cky:cursor-pointer cky:focus:bg-blue-500 cky:focus:text-white cky:data-[highlighted]:bg-blue-500 cky:data-[highlighted]:text-white";
  const CKY_SELECT_ITEM_MODAL_CLASS = "cky-select-item cky:px-[14px] cky:py-[8px] cky:text-sm cky:text-white cky:cursor-pointer cky:focus:bg-gray-50 cky:focus:text-gray-900 cky:data-[highlighted]:bg-gray-50 cky:data-[highlighted]:text-gray-900";
  const SELECT_TRIGGER_ARROW_STYLE = {
    backgroundImage: 'url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Ctitle%3Edown-arrow%3C%2Ftitle%3E%3Cg%20fill%3D%22%23000000%22%3E%3Cpath%20d%3D%22M10.293%2C3.293%2C6%2C7.586%2C1.707%2C3.293A1%2C1%2C0%2C0%2C0%2C.293%2C4.707l5%2C5a1%2C1%2C0%2C0%2C0%2C1.414%2C0l5-5a1%2C1%2C0%2C1%2C0-1.414-1.414Z%22%20fill%3D%22%23000000%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3C%2Fsvg%3E")',
    backgroundSize: "10px",
    backgroundPosition: "calc(100% - 10px) center",
    backgroundRepeat: "no-repeat"
  };
  const SELECT_TRIGGER_BASE = "cky-select cky:flex cky:w-full cky:items-center cky:justify-between cky:bg-background cky:px-[14px] cky:py-[8px] cky:pr-[25px] cky:text-sm cky:ring-offset-background cky:data-[placeholder]:text-muted-foreground cky:focus:outline-none cky:focus:ring-2 cky:focus:ring-ring cky:focus:ring-offset-2 cky:disabled:cursor-not-allowed cky:disabled:text-[#a7aaad] cky:disabled:border-[#dcdcde] cky:disabled:bg-[#f6f7f7] cky:[&>span]:line-clamp-1";
  const SELECT_TRIGGER_VARIANT = {
    currency: "cky:h-[34px] cky:rounded-[8px] cky:border cky:border-solid cky:border-[#bebfc5]",
    default: "cky:h-10 cky:rounded-[3px] cky:border cky:border-solid cky:border-[#d1d5db]",
    modal: "cky:h-10 cky:rounded-[3px] cky:border cky:border-solid cky:border-[#d1d5db] cky:py-[8px] cky:pl-[14px] cky:pr-[25px]"
  };
  function SelectTrigger(_Hb) {
    var _Ib = _Hb, {
      className,
      variant = "default",
      children,
      ref
    } = _Ib, props = __objRest(_Ib, [
      "className",
      "variant",
      "children",
      "ref"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Trigger$1,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(SELECT_TRIGGER_BASE, SELECT_TRIGGER_VARIANT[variant], className),
        style: SELECT_TRIGGER_ARROW_STYLE
      }, props), {
        children
      })
    );
  }
  __name(SelectTrigger, "SelectTrigger");
  SelectTrigger.displayName = "SelectTrigger";
  function SelectContent(_Jb) {
    var _Kb = _Jb, { className, ref } = _Kb, props = __objRest(_Kb, ["className", "ref"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      SelectContent$1,
      __spreadValues({
        ref,
        className: cn$1(CKY_SELECT_CONTENT_CLASS, className)
      }, props)
    );
  }
  __name(SelectContent, "SelectContent");
  SelectContent.displayName = "SelectContent";
  function SelectItem(_Lb) {
    var _Mb = _Lb, { className, variant = "default", ref } = _Mb, props = __objRest(_Mb, ["className", "variant", "ref"]);
    const itemClass = variant === "modal" ? CKY_SELECT_ITEM_MODAL_CLASS : CKY_SELECT_ITEM_CLASS;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      SelectItem$1,
      __spreadValues({
        ref,
        className: cn$1(itemClass, className)
      }, props)
    );
  }
  __name(SelectItem, "SelectItem");
  SelectItem.displayName = "SelectItem";
  const Input = reactExports.forwardRef(
    (_Nb, ref) => {
      var _Ob = _Nb, { className, type } = _Ob, props = __objRest(_Ob, ["className", "type"]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "input",
        __spreadValues({
          type,
          className: cn$1(
            "cky:flex cky:h-10 cky:w-full cky:rounded-md cky:border cky:border-input cky:bg-background cky:px-3 cky:py-2 cky:text-base cky:ring-offset-background cky:file:border-0 cky:file:bg-transparent cky:file:text-sm cky:file:font-medium cky:file:text-foreground cky:placeholder:text-muted-foreground cky:focus-visible:outline-none cky:focus-visible:ring-2 cky:focus-visible:ring-ring cky:focus-visible:ring-offset-2 cky:disabled:cursor-not-allowed cky:disabled:opacity-50 cky:md:text-sm",
            className
          ),
          ref
        }, props)
      );
    }
  );
  Input.displayName = "Input";
  const CKY_INPUT_FORM_CLASS = "cky:box-border cky:border cky:border-solid cky:!border-[#d1d5db] cky:rounded-[3px] cky:bg-white cky:text-[#23282d] hover:cky:!border-[#b4b9be] focus-visible:cky:!border-[var(--cky-primary)] focus-visible:cky:shadow-[0_0_0_1px_var(--cky-primary)] focus-visible:cky:outline-none focus-visible:cky:ring-0 focus-visible:cky:ring-offset-0";
  const CKY_INPUT_FORM_PADDING = "cky:py-[9px] cky:px-[14px]";
  function CkyInput(_Pb) {
    var _Qb = _Pb, { className, ref } = _Qb, props = __objRest(_Qb, ["className", "ref"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Input,
      __spreadValues({
        ref,
        className: cn$1(CKY_INPUT_FORM_CLASS, CKY_INPUT_FORM_PADDING, className)
      }, props)
    );
  }
  __name(CkyInput, "CkyInput");
  var SWITCH_NAME = "Switch";
  var [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);
  var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
  var Switch$2 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, {
        __scopeSwitch,
        name,
        checked: checkedProp,
        defaultChecked,
        required,
        disabled,
        value = "on",
        onCheckedChange,
        form
      } = _a2, switchProps = __objRest(_a2, [
        "__scopeSwitch",
        "name",
        "checked",
        "defaultChecked",
        "required",
        "disabled",
        "value",
        "onCheckedChange",
        "form"
      ]);
      const [button, setButton] = reactExports.useState(null);
      const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
      const hasConsumerStoppedPropagationRef = reactExports.useRef(false);
      const isFormControl = button ? form || !!button.closest("form") : true;
      const [checked, setChecked] = useControllableState({
        prop: checkedProp,
        defaultProp: defaultChecked != null ? defaultChecked : false,
        onChange: onCheckedChange,
        caller: SWITCH_NAME
      });
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Primitive$1.button,
          __spreadProps(__spreadValues({
            type: "button",
            role: "switch",
            "aria-checked": checked,
            "aria-required": required,
            "data-state": getState$2(checked),
            "data-disabled": disabled ? "" : void 0,
            disabled,
            value
          }, switchProps), {
            ref: composedRefs,
            onClick: composeEventHandlers(props.onClick, (event) => {
              setChecked((prevChecked) => !prevChecked);
              if (isFormControl) {
                hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
                if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
              }
            })
          })
        ),
        isFormControl && /* @__PURE__ */ jsxRuntimeExports.jsx(
          SwitchBubbleInput,
          {
            control: button,
            bubbles: !hasConsumerStoppedPropagationRef.current,
            name,
            value,
            checked,
            required,
            disabled,
            form,
            style: { transform: "translateX(-100%)" }
          }
        )
      ] });
    }
  );
  Switch$2.displayName = SWITCH_NAME;
  var THUMB_NAME = "SwitchThumb";
  var SwitchThumb = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeSwitch } = _a2, thumbProps = __objRest(_a2, ["__scopeSwitch"]);
      const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.span,
        __spreadProps(__spreadValues({
          "data-state": getState$2(context.checked),
          "data-disabled": context.disabled ? "" : void 0
        }, thumbProps), {
          ref: forwardedRef
        })
      );
    }
  );
  SwitchThumb.displayName = THUMB_NAME;
  var BUBBLE_INPUT_NAME$2 = "SwitchBubbleInput";
  var SwitchBubbleInput = reactExports.forwardRef(
    (_Rb, forwardedRef) => {
      var _Sb = _Rb, {
        __scopeSwitch,
        control,
        checked,
        bubbles = true
      } = _Sb, props = __objRest(_Sb, [
        "__scopeSwitch",
        "control",
        "checked",
        "bubbles"
      ]);
      const ref = reactExports.useRef(null);
      const composedRefs = useComposedRefs(ref, forwardedRef);
      const prevChecked = usePrevious(checked);
      const controlSize = useSize(control);
      reactExports.useEffect(() => {
        const input = ref.current;
        if (!input) return;
        const inputProto = window.HTMLInputElement.prototype;
        const descriptor = Object.getOwnPropertyDescriptor(
          inputProto,
          "checked"
        );
        const setChecked = descriptor.set;
        if (prevChecked !== checked && setChecked) {
          const event = new Event("click", { bubbles });
          setChecked.call(input, checked);
          input.dispatchEvent(event);
        }
      }, [prevChecked, checked, bubbles]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "input",
        __spreadProps(__spreadValues({
          type: "checkbox",
          "aria-hidden": true,
          defaultChecked: checked
        }, props), {
          tabIndex: -1,
          ref: composedRefs,
          style: __spreadProps(__spreadValues(__spreadValues({}, props.style), controlSize), {
            position: "absolute",
            pointerEvents: "none",
            opacity: 0,
            margin: 0
          })
        })
      );
    }
  );
  SwitchBubbleInput.displayName = BUBBLE_INPUT_NAME$2;
  function getState$2(checked) {
    return checked ? "checked" : "unchecked";
  }
  __name(getState$2, "getState$2");
  var Root$1 = Switch$2;
  var Thumb = SwitchThumb;
  const Switch$1 = reactExports.forwardRef((_Tb, ref) => {
    var _Ub = _Tb, { className } = _Ub, props = __objRest(_Ub, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Root$1,
      __spreadProps(__spreadValues({
        className: cn$1(
          "cky:peer cky:inline-flex cky:h-6 cky:w-11 cky:shrink-0 cky:cursor-pointer cky:items-center cky:rounded-full cky:border-2 cky:border-transparent cky:transition-colors cky:focus-visible:outline-none cky:focus-visible:ring-2 cky:focus-visible:ring-ring cky:focus-visible:ring-offset-2 cky:focus-visible:ring-offset-background cky:disabled:cursor-not-allowed cky:disabled:opacity-50 cky:data-[state=checked]:bg-primary cky:data-[state=unchecked]:bg-input",
          className
        )
      }, props), {
        ref,
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Thumb,
          {
            className: cn$1(
              "cky:pointer-events-none cky:block cky:h-5 cky:w-5 cky:rounded-full cky:bg-background cky:shadow-lg cky:ring-0 cky:transition-transform cky:data-[state=checked]:translate-x-5 cky:data-[state=unchecked]:translate-x-0"
            )
          }
        )
      })
    );
  });
  Switch$1.displayName = Root$1.displayName;
  const CKY_SWITCH_CLASSES = [
    "cky:h-[18px] cky:w-9 cky:shrink-0 cky:cursor-pointer cky:items-center cky:rounded-full cky:border-0",
    "cky:bg-[#adadad] cky:transition-colors cky:duration-200",
    "cky:data-[state=checked]:bg-[#15a753] cky:data-[state=unchecked]:bg-[#adadad]",
    "cky:disabled:data-[state=checked]:bg-[#adadad]",
    "cky:focus-visible:outline-none cky:focus-visible:ring-0",
    "cky:disabled:cursor-not-allowed cky:disabled:opacity-50",
    "cky:[&>span]:cky:block cky:[&>span]:cky:!h-3 cky:[&>span]:cky:!w-3",
    "cky:[&>span]:cky:rounded-full cky:[&>span]:cky:bg-white cky:[&>span]:cky:shadow-none cky:[&>span]:cky:ring-0"
  ].join(" ");
  function Switch(_Vb) {
    var _Wb = _Vb, { className, ref } = _Wb, props = __objRest(_Wb, ["className", "ref"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Switch$1,
      __spreadValues({
        ref,
        className: cn$1("cky-app-switch", CKY_SWITCH_CLASSES, className)
      }, props)
    );
  }
  __name(Switch, "Switch");
  Switch.displayName = "Switch";
  var CHECKBOX_NAME = "Checkbox";
  var [createCheckboxContext, createCheckboxScope] = createContextScope(CHECKBOX_NAME);
  var [CheckboxProviderImpl, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);
  function CheckboxProvider(props) {
    const {
      __scopeCheckbox,
      checked: checkedProp,
      children,
      defaultChecked,
      disabled,
      form,
      name,
      onCheckedChange,
      required,
      value = "on",
      // @ts-expect-error
      internal_do_not_use_render
    } = props;
    const [checked, setChecked] = useControllableState({
      prop: checkedProp,
      defaultProp: defaultChecked != null ? defaultChecked : false,
      onChange: onCheckedChange,
      caller: CHECKBOX_NAME
    });
    const [control, setControl] = reactExports.useState(null);
    const [bubbleInput, setBubbleInput] = reactExports.useState(null);
    const hasConsumerStoppedPropagationRef = reactExports.useRef(false);
    const isFormControl = control ? !!form || !!control.closest("form") : (
      // We set this to true by default so that events bubble to forms without JS (SSR)
      true
    );
    const context = {
      checked,
      disabled,
      setChecked,
      control,
      setControl,
      name,
      form,
      value,
      hasConsumerStoppedPropagationRef,
      required,
      defaultChecked: isIndeterminate(defaultChecked) ? false : defaultChecked,
      isFormControl,
      bubbleInput,
      setBubbleInput
    };
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      CheckboxProviderImpl,
      __spreadProps(__spreadValues({
        scope: __scopeCheckbox
      }, context), {
        children: isFunction$3(internal_do_not_use_render) ? internal_do_not_use_render(context) : children
      })
    );
  }
  __name(CheckboxProvider, "CheckboxProvider");
  var TRIGGER_NAME$1 = "CheckboxTrigger";
  var CheckboxTrigger = reactExports.forwardRef(
    (_Xb, forwardedRef) => {
      var _Yb = _Xb, { __scopeCheckbox, onKeyDown, onClick } = _Yb, checkboxProps = __objRest(_Yb, ["__scopeCheckbox", "onKeyDown", "onClick"]);
      const {
        control,
        value,
        disabled,
        checked,
        required,
        setControl,
        setChecked,
        hasConsumerStoppedPropagationRef,
        isFormControl,
        bubbleInput
      } = useCheckboxContext(TRIGGER_NAME$1, __scopeCheckbox);
      const composedRefs = useComposedRefs(forwardedRef, setControl);
      const initialCheckedStateRef = reactExports.useRef(checked);
      reactExports.useEffect(() => {
        const form = control == null ? void 0 : control.form;
        if (form) {
          const reset = /* @__PURE__ */ __name(() => setChecked(initialCheckedStateRef.current), "reset");
          form.addEventListener("reset", reset);
          return () => form.removeEventListener("reset", reset);
        }
      }, [control, setChecked]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.button,
        __spreadProps(__spreadValues({
          type: "button",
          role: "checkbox",
          "aria-checked": isIndeterminate(checked) ? "mixed" : checked,
          "aria-required": required,
          "data-state": getState$1(checked),
          "data-disabled": disabled ? "" : void 0,
          disabled,
          value
        }, checkboxProps), {
          ref: composedRefs,
          onKeyDown: composeEventHandlers(onKeyDown, (event) => {
            if (event.key === "Enter") event.preventDefault();
          }),
          onClick: composeEventHandlers(onClick, (event) => {
            setChecked((prevChecked) => isIndeterminate(prevChecked) ? true : !prevChecked);
            if (bubbleInput && isFormControl) {
              hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
              if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
            }
          })
        })
      );
    }
  );
  CheckboxTrigger.displayName = TRIGGER_NAME$1;
  var Checkbox$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, {
        __scopeCheckbox,
        name,
        checked,
        defaultChecked,
        required,
        disabled,
        value,
        onCheckedChange,
        form
      } = _a2, checkboxProps = __objRest(_a2, [
        "__scopeCheckbox",
        "name",
        "checked",
        "defaultChecked",
        "required",
        "disabled",
        "value",
        "onCheckedChange",
        "form"
      ]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        CheckboxProvider,
        {
          __scopeCheckbox,
          checked,
          defaultChecked,
          disabled,
          required,
          onCheckedChange,
          name,
          form,
          value,
          internal_do_not_use_render: /* @__PURE__ */ __name(({ isFormControl }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              CheckboxTrigger,
              __spreadProps(__spreadValues({}, checkboxProps), {
                ref: forwardedRef,
                __scopeCheckbox
              })
            ),
            isFormControl && /* @__PURE__ */ jsxRuntimeExports.jsx(
              CheckboxBubbleInput,
              {
                __scopeCheckbox
              }
            )
          ] }), "internal_do_not_use_render")
        }
      );
    }
  );
  Checkbox$1.displayName = CHECKBOX_NAME;
  var INDICATOR_NAME$1 = "CheckboxIndicator";
  var CheckboxIndicator = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeCheckbox, forceMount } = _a2, indicatorProps = __objRest(_a2, ["__scopeCheckbox", "forceMount"]);
      const context = useCheckboxContext(INDICATOR_NAME$1, __scopeCheckbox);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Presence,
        {
          present: forceMount || isIndeterminate(context.checked) || context.checked === true,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Primitive$1.span,
            __spreadProps(__spreadValues({
              "data-state": getState$1(context.checked),
              "data-disabled": context.disabled ? "" : void 0
            }, indicatorProps), {
              ref: forwardedRef,
              style: __spreadValues({ pointerEvents: "none" }, props.style)
            })
          )
        }
      );
    }
  );
  CheckboxIndicator.displayName = INDICATOR_NAME$1;
  var BUBBLE_INPUT_NAME$1 = "CheckboxBubbleInput";
  var CheckboxBubbleInput = reactExports.forwardRef(
    (_Zb, forwardedRef) => {
      var __b = _Zb, { __scopeCheckbox } = __b, props = __objRest(__b, ["__scopeCheckbox"]);
      const {
        control,
        hasConsumerStoppedPropagationRef,
        checked,
        defaultChecked,
        required,
        disabled,
        name,
        value,
        form,
        bubbleInput,
        setBubbleInput
      } = useCheckboxContext(BUBBLE_INPUT_NAME$1, __scopeCheckbox);
      const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);
      const prevChecked = usePrevious(checked);
      const controlSize = useSize(control);
      reactExports.useEffect(() => {
        const input = bubbleInput;
        if (!input) return;
        const inputProto = window.HTMLInputElement.prototype;
        const descriptor = Object.getOwnPropertyDescriptor(
          inputProto,
          "checked"
        );
        const setChecked = descriptor.set;
        const bubbles = !hasConsumerStoppedPropagationRef.current;
        if (prevChecked !== checked && setChecked) {
          const event = new Event("click", { bubbles });
          input.indeterminate = isIndeterminate(checked);
          setChecked.call(input, isIndeterminate(checked) ? false : checked);
          input.dispatchEvent(event);
        }
      }, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);
      const defaultCheckedRef = reactExports.useRef(isIndeterminate(checked) ? false : checked);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.input,
        __spreadProps(__spreadValues({
          type: "checkbox",
          "aria-hidden": true,
          defaultChecked: defaultChecked != null ? defaultChecked : defaultCheckedRef.current,
          required,
          disabled,
          name,
          value,
          form
        }, props), {
          tabIndex: -1,
          ref: composedRefs,
          style: __spreadProps(__spreadValues(__spreadValues({}, props.style), controlSize), {
            position: "absolute",
            pointerEvents: "none",
            opacity: 0,
            margin: 0,
            // We transform because the input is absolutely positioned but we have
            // rendered it **after** the button. This pulls it back to sit on top
            // of the button.
            transform: "translateX(-100%)"
          })
        })
      );
    }
  );
  CheckboxBubbleInput.displayName = BUBBLE_INPUT_NAME$1;
  function isFunction$3(value) {
    return typeof value === "function";
  }
  __name(isFunction$3, "isFunction$3");
  function isIndeterminate(checked) {
    return checked === "indeterminate";
  }
  __name(isIndeterminate, "isIndeterminate");
  function getState$1(checked) {
    return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
  }
  __name(getState$1, "getState$1");
  const Checkbox = reactExports.forwardRef((_$b, ref) => {
    var _ac = _$b, { className } = _ac, props = __objRest(_ac, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Checkbox$1,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(
          "cky:grid cky:place-content-center cky:peer cky:h-4 cky:w-4 cky:shrink-0 cky:rounded-sm cky:border cky:border-primary cky:ring-offset-background cky:focus-visible:outline-none cky:focus-visible:ring-2 cky:focus-visible:ring-ring cky:focus-visible:ring-offset-2 cky:disabled:cursor-not-allowed cky:disabled:opacity-50 cky:data-[state=checked]:bg-primary cky:data-[state=checked]:text-primary-foreground",
          className
        )
      }, props), {
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          CheckboxIndicator,
          {
            className: cn$1("cky:grid cky:place-content-center cky:text-current"),
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "cky:h-4 cky:w-4" })
          }
        )
      })
    );
  });
  Checkbox.displayName = Checkbox$1.displayName;
  function CkyCheckbox(_bc) {
    var _cc = _bc, { className, ref } = _cc, props = __objRest(_cc, ["className", "ref"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Checkbox,
      __spreadValues({
        ref,
        className: cn$1(
          "cky:rounded-[4px] cky:border-black/25 cky:bg-white",
          "cky:data-[state=unchecked]:bg-white",
          "cky:data-[state=checked]:border-[var(--cky-primary)] cky:data-[state=checked]:bg-[var(--cky-primary)] cky:data-[state=checked]:text-white",
          className
        )
      }, props)
    );
  }
  __name(CkyCheckbox, "CkyCheckbox");
  var NODES = [
    "a",
    "button",
    "div",
    "form",
    "h2",
    "h3",
    "img",
    "input",
    "label",
    "li",
    "nav",
    "ol",
    "p",
    "select",
    "span",
    "svg",
    "ul"
  ];
  var Primitive = NODES.reduce((primitive, node) => {
    const Slot2 = /* @__PURE__ */ createSlot$2(`Primitive.${node}`);
    const Node2 = reactExports.forwardRef((props, forwardedRef) => {
      const _a2 = props, { asChild } = _a2, primitiveProps = __objRest(_a2, ["asChild"]);
      const Comp = asChild ? Slot2 : node;
      if (typeof window !== "undefined") {
        window[Symbol.for("radix-ui")] = true;
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, __spreadProps(__spreadValues({}, primitiveProps), { ref: forwardedRef }));
    });
    Node2.displayName = `Primitive.${node}`;
    return __spreadProps(__spreadValues({}, primitive), { [node]: Node2 });
  }, {});
  var NAME = "Label";
  var Label$3 = reactExports.forwardRef((props, forwardedRef) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Primitive.label,
      __spreadProps(__spreadValues({}, props), {
        ref: forwardedRef,
        onMouseDown: /* @__PURE__ */ __name((event) => {
          var _a2;
          const target = event.target;
          if (target.closest("button, input, select, textarea")) return;
          (_a2 = props.onMouseDown) == null ? void 0 : _a2.call(props, event);
          if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
        }, "onMouseDown")
      })
    );
  });
  Label$3.displayName = NAME;
  var Root = Label$3;
  const labelVariants = cva(
    "cky:text-sm cky:font-medium cky:leading-none cky:peer-disabled:cursor-not-allowed cky:peer-disabled:opacity-70"
  );
  const Label$2 = reactExports.forwardRef((_dc, ref) => {
    var _ec = _dc, { className } = _ec, props = __objRest(_ec, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Root,
      __spreadValues({
        ref,
        className: cn$1(labelVariants(), className)
      }, props)
    );
  });
  Label$2.displayName = Root.displayName;
  const CKY_LABEL_CLASS = "cky:text-[var(--cky-text-primary,#23282d)]";
  const Label$1 = reactExports.forwardRef((_fc, ref) => {
    var _gc = _fc, { className } = _gc, props = __objRest(_gc, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Label$2,
      __spreadValues({
        ref,
        className: cn$1(CKY_LABEL_CLASS, className)
      }, props)
    );
  });
  Label$1.displayName = Label$2.displayName;
  function __insertCSS(code) {
    if (typeof document == "undefined") return;
    let head = document.head || document.getElementsByTagName("head")[0];
    let style = document.createElement("style");
    style.type = "text/css";
    head.appendChild(style);
    style.styleSheet ? style.styleSheet.cssText = code : style.appendChild(document.createTextNode(code));
  }
  __name(__insertCSS, "__insertCSS");
  const getAsset = /* @__PURE__ */ __name((type) => {
    switch (type) {
      case "success":
        return SuccessIcon;
      case "info":
        return InfoIcon;
      case "warning":
        return WarningIcon;
      case "error":
        return ErrorIcon;
      default:
        return null;
    }
  }, "getAsset");
  const bars = Array(12).fill(0);
  const Loader = /* @__PURE__ */ __name(({ visible, className }) => {
    return /* @__PURE__ */ React.createElement("div", {
      className: [
        "sonner-loading-wrapper",
        className
      ].filter(Boolean).join(" "),
      "data-visible": visible
    }, /* @__PURE__ */ React.createElement("div", {
      className: "sonner-spinner"
    }, bars.map((_, i2) => /* @__PURE__ */ React.createElement("div", {
      className: "sonner-loading-bar",
      key: `spinner-bar-${i2}`
    }))));
  }, "Loader");
  const SuccessIcon = /* @__PURE__ */ React.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 20 20",
    fill: "currentColor",
    height: "20",
    width: "20"
  }, /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
    clipRule: "evenodd"
  }));
  const WarningIcon = /* @__PURE__ */ React.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24",
    fill: "currentColor",
    height: "20",
    width: "20"
  }, /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
    clipRule: "evenodd"
  }));
  const InfoIcon = /* @__PURE__ */ React.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 20 20",
    fill: "currentColor",
    height: "20",
    width: "20"
  }, /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
    clipRule: "evenodd"
  }));
  const ErrorIcon = /* @__PURE__ */ React.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 20 20",
    fill: "currentColor",
    height: "20",
    width: "20"
  }, /* @__PURE__ */ React.createElement("path", {
    fillRule: "evenodd",
    d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
    clipRule: "evenodd"
  }));
  const CloseIcon = /* @__PURE__ */ React.createElement("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    width: "12",
    height: "12",
    viewBox: "0 0 24 24",
    fill: "none",
    stroke: "currentColor",
    strokeWidth: "1.5",
    strokeLinecap: "round",
    strokeLinejoin: "round"
  }, /* @__PURE__ */ React.createElement("line", {
    x1: "18",
    y1: "6",
    x2: "6",
    y2: "18"
  }), /* @__PURE__ */ React.createElement("line", {
    x1: "6",
    y1: "6",
    x2: "18",
    y2: "18"
  }));
  const useIsDocumentHidden = /* @__PURE__ */ __name(() => {
    const [isDocumentHidden, setIsDocumentHidden] = React.useState(document.hidden);
    React.useEffect(() => {
      const callback = /* @__PURE__ */ __name(() => {
        setIsDocumentHidden(document.hidden);
      }, "callback");
      document.addEventListener("visibilitychange", callback);
      return () => window.removeEventListener("visibilitychange", callback);
    }, []);
    return isDocumentHidden;
  }, "useIsDocumentHidden");
  let toastsCounter = 1;
  const _Observer = class _Observer {
    constructor() {
      this.subscribe = (subscriber) => {
        this.subscribers.push(subscriber);
        return () => {
          const index2 = this.subscribers.indexOf(subscriber);
          this.subscribers.splice(index2, 1);
        };
      };
      this.publish = (data) => {
        this.subscribers.forEach((subscriber) => subscriber(data));
      };
      this.addToast = (data) => {
        this.publish(data);
        this.toasts = [
          ...this.toasts,
          data
        ];
      };
      this.create = (data) => {
        var _data_id;
        const _a2 = data, { message } = _a2, rest = __objRest(_a2, ["message"]);
        const id = typeof (data == null ? void 0 : data.id) === "number" || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
        const alreadyExists = this.toasts.find((toast2) => {
          return toast2.id === id;
        });
        const dismissible = data.dismissible === void 0 ? true : data.dismissible;
        if (this.dismissedToasts.has(id)) {
          this.dismissedToasts.delete(id);
        }
        if (alreadyExists) {
          this.toasts = this.toasts.map((toast2) => {
            if (toast2.id === id) {
              this.publish(__spreadProps(__spreadValues(__spreadValues({}, toast2), data), {
                id,
                title: message
              }));
              return __spreadProps(__spreadValues(__spreadValues({}, toast2), data), {
                id,
                dismissible,
                title: message
              });
            }
            return toast2;
          });
        } else {
          this.addToast(__spreadProps(__spreadValues({
            title: message
          }, rest), {
            dismissible,
            id
          }));
        }
        return id;
      };
      this.dismiss = (id) => {
        if (id) {
          this.dismissedToasts.add(id);
          requestAnimationFrame(() => this.subscribers.forEach((subscriber) => subscriber({
            id,
            dismiss: true
          })));
        } else {
          this.toasts.forEach((toast2) => {
            this.subscribers.forEach((subscriber) => subscriber({
              id: toast2.id,
              dismiss: true
            }));
          });
        }
        return id;
      };
      this.message = (message, data) => {
        return this.create(__spreadProps(__spreadValues({}, data), {
          message
        }));
      };
      this.error = (message, data) => {
        return this.create(__spreadProps(__spreadValues({}, data), {
          message,
          type: "error"
        }));
      };
      this.success = (message, data) => {
        return this.create(__spreadProps(__spreadValues({}, data), {
          type: "success",
          message
        }));
      };
      this.info = (message, data) => {
        return this.create(__spreadProps(__spreadValues({}, data), {
          type: "info",
          message
        }));
      };
      this.warning = (message, data) => {
        return this.create(__spreadProps(__spreadValues({}, data), {
          type: "warning",
          message
        }));
      };
      this.loading = (message, data) => {
        return this.create(__spreadProps(__spreadValues({}, data), {
          type: "loading",
          message
        }));
      };
      this.promise = (promise, data) => {
        if (!data) {
          return;
        }
        let id = void 0;
        if (data.loading !== void 0) {
          id = this.create(__spreadProps(__spreadValues({}, data), {
            promise,
            type: "loading",
            message: data.loading,
            description: typeof data.description !== "function" ? data.description : void 0
          }));
        }
        const p2 = Promise.resolve(promise instanceof Function ? promise() : promise);
        let shouldDismiss = id !== void 0;
        let result;
        const originalPromise = p2.then((response) => __async(this, null, function* () {
          result = [
            "resolve",
            response
          ];
          const isReactElementResponse = React.isValidElement(response);
          if (isReactElementResponse) {
            shouldDismiss = false;
            this.create({
              id,
              type: "default",
              message: response
            });
          } else if (isHttpResponse(response) && !response.ok) {
            shouldDismiss = false;
            const promiseData = typeof data.error === "function" ? yield data.error(`HTTP error! status: ${response.status}`) : data.error;
            const description = typeof data.description === "function" ? yield data.description(`HTTP error! status: ${response.status}`) : data.description;
            const isExtendedResult = typeof promiseData === "object" && !React.isValidElement(promiseData);
            const toastSettings = isExtendedResult ? promiseData : {
              message: promiseData
            };
            this.create(__spreadValues({
              id,
              type: "error",
              description
            }, toastSettings));
          } else if (response instanceof Error) {
            shouldDismiss = false;
            const promiseData = typeof data.error === "function" ? yield data.error(response) : data.error;
            const description = typeof data.description === "function" ? yield data.description(response) : data.description;
            const isExtendedResult = typeof promiseData === "object" && !React.isValidElement(promiseData);
            const toastSettings = isExtendedResult ? promiseData : {
              message: promiseData
            };
            this.create(__spreadValues({
              id,
              type: "error",
              description
            }, toastSettings));
          } else if (data.success !== void 0) {
            shouldDismiss = false;
            const promiseData = typeof data.success === "function" ? yield data.success(response) : data.success;
            const description = typeof data.description === "function" ? yield data.description(response) : data.description;
            const isExtendedResult = typeof promiseData === "object" && !React.isValidElement(promiseData);
            const toastSettings = isExtendedResult ? promiseData : {
              message: promiseData
            };
            this.create(__spreadValues({
              id,
              type: "success",
              description
            }, toastSettings));
          }
        })).catch((error) => __async(this, null, function* () {
          result = [
            "reject",
            error
          ];
          if (data.error !== void 0) {
            shouldDismiss = false;
            const promiseData = typeof data.error === "function" ? yield data.error(error) : data.error;
            const description = typeof data.description === "function" ? yield data.description(error) : data.description;
            const isExtendedResult = typeof promiseData === "object" && !React.isValidElement(promiseData);
            const toastSettings = isExtendedResult ? promiseData : {
              message: promiseData
            };
            this.create(__spreadValues({
              id,
              type: "error",
              description
            }, toastSettings));
          }
        })).finally(() => {
          if (shouldDismiss) {
            this.dismiss(id);
            id = void 0;
          }
          data.finally == null ? void 0 : data.finally.call(data);
        });
        const unwrap = /* @__PURE__ */ __name(() => new Promise((resolve, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve(result[1])).catch(reject)), "unwrap");
        if (typeof id !== "string" && typeof id !== "number") {
          return {
            unwrap
          };
        } else {
          return Object.assign(id, {
            unwrap
          });
        }
      };
      this.custom = (jsx, data) => {
        const id = (data == null ? void 0 : data.id) || toastsCounter++;
        this.create(__spreadValues({
          jsx: jsx(id),
          id
        }, data));
        return id;
      };
      this.getActiveToasts = () => {
        return this.toasts.filter((toast2) => !this.dismissedToasts.has(toast2.id));
      };
      this.subscribers = [];
      this.toasts = [];
      this.dismissedToasts = /* @__PURE__ */ new Set();
    }
  };
  __name(_Observer, "Observer");
  let Observer = _Observer;
  const ToastState = new Observer();
  const toastFunction = /* @__PURE__ */ __name((message, data) => {
    const id = (data == null ? void 0 : data.id) || toastsCounter++;
    ToastState.addToast(__spreadProps(__spreadValues({
      title: message
    }, data), {
      id
    }));
    return id;
  }, "toastFunction");
  const isHttpResponse = /* @__PURE__ */ __name((data) => {
    return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
  }, "isHttpResponse");
  const basicToast = toastFunction;
  const getHistory = /* @__PURE__ */ __name(() => ToastState.toasts, "getHistory");
  const getToasts = /* @__PURE__ */ __name(() => ToastState.getActiveToasts(), "getToasts");
  const toast = Object.assign(basicToast, {
    success: ToastState.success,
    info: ToastState.info,
    warning: ToastState.warning,
    error: ToastState.error,
    custom: ToastState.custom,
    message: ToastState.message,
    promise: ToastState.promise,
    dismiss: ToastState.dismiss,
    loading: ToastState.loading
  }, {
    getHistory,
    getToasts
  });
  __insertCSS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
  function isAction(action) {
    return action.label !== void 0;
  }
  __name(isAction, "isAction");
  const VISIBLE_TOASTS_AMOUNT = 3;
  const VIEWPORT_OFFSET = "24px";
  const MOBILE_VIEWPORT_OFFSET = "16px";
  const TOAST_LIFETIME = 4e3;
  const TOAST_WIDTH = 356;
  const GAP = 14;
  const SWIPE_THRESHOLD = 45;
  const TIME_BEFORE_UNMOUNT = 200;
  function cn(...classes) {
    return classes.filter(Boolean).join(" ");
  }
  __name(cn, "cn");
  function getDefaultSwipeDirections(position) {
    const [y2, x2] = position.split("-");
    const directions = [];
    if (y2) {
      directions.push(y2);
    }
    if (x2) {
      directions.push(x2);
    }
    return directions;
  }
  __name(getDefaultSwipeDirections, "getDefaultSwipeDirections");
  const Toast = /* @__PURE__ */ __name((props) => {
    var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
    const { invert: ToasterInvert, toast: toast2, unstyled, interacting, setHeights, visibleToasts, heights, index: index2, toasts, expanded, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style, cancelButtonStyle, actionButtonStyle, className = "", descriptionClassName = "", duration: durationFromToaster, position, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = "Close toast" } = props;
    const [swipeDirection, setSwipeDirection] = React.useState(null);
    const [swipeOutDirection, setSwipeOutDirection] = React.useState(null);
    const [mounted, setMounted] = React.useState(false);
    const [removed, setRemoved] = React.useState(false);
    const [swiping, setSwiping] = React.useState(false);
    const [swipeOut, setSwipeOut] = React.useState(false);
    const [isSwiped, setIsSwiped] = React.useState(false);
    const [offsetBeforeRemove, setOffsetBeforeRemove] = React.useState(0);
    const [initialHeight, setInitialHeight] = React.useState(0);
    const remainingTime = React.useRef(toast2.duration || durationFromToaster || TOAST_LIFETIME);
    const dragStartTime = React.useRef(null);
    const toastRef = React.useRef(null);
    const isFront = index2 === 0;
    const isVisible2 = index2 + 1 <= visibleToasts;
    const toastType = toast2.type;
    const dismissible = toast2.dismissible !== false;
    const toastClassname = toast2.className || "";
    const toastDescriptionClassname = toast2.descriptionClassName || "";
    const heightIndex = React.useMemo(() => heights.findIndex((height) => height.toastId === toast2.id) || 0, [
      heights,
      toast2.id
    ]);
    const closeButton = React.useMemo(() => {
      var _toast_closeButton;
      return (_toast_closeButton = toast2.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
    }, [
      toast2.closeButton,
      closeButtonFromToaster
    ]);
    const duration = React.useMemo(() => toast2.duration || durationFromToaster || TOAST_LIFETIME, [
      toast2.duration,
      durationFromToaster
    ]);
    const closeTimerStartTimeRef = React.useRef(0);
    const offset2 = React.useRef(0);
    const lastCloseTimerStartTimeRef = React.useRef(0);
    const pointerStartRef = React.useRef(null);
    const [y2, x2] = position.split("-");
    const toastsHeightBefore = React.useMemo(() => {
      return heights.reduce((prev, curr, reducerIndex) => {
        if (reducerIndex >= heightIndex) {
          return prev;
        }
        return prev + curr.height;
      }, 0);
    }, [
      heights,
      heightIndex
    ]);
    const isDocumentHidden = useIsDocumentHidden();
    const invert = toast2.invert || ToasterInvert;
    const disabled = toastType === "loading";
    offset2.current = React.useMemo(() => heightIndex * gap + toastsHeightBefore, [
      heightIndex,
      toastsHeightBefore
    ]);
    React.useEffect(() => {
      remainingTime.current = duration;
    }, [
      duration
    ]);
    React.useEffect(() => {
      setMounted(true);
    }, []);
    React.useEffect(() => {
      const toastNode = toastRef.current;
      if (toastNode) {
        const height = toastNode.getBoundingClientRect().height;
        setInitialHeight(height);
        setHeights((h) => [
          {
            toastId: toast2.id,
            height,
            position: toast2.position
          },
          ...h
        ]);
        return () => setHeights((h) => h.filter((height2) => height2.toastId !== toast2.id));
      }
    }, [
      setHeights,
      toast2.id
    ]);
    React.useLayoutEffect(() => {
      if (!mounted) return;
      const toastNode = toastRef.current;
      const originalHeight = toastNode.style.height;
      toastNode.style.height = "auto";
      const newHeight = toastNode.getBoundingClientRect().height;
      toastNode.style.height = originalHeight;
      setInitialHeight(newHeight);
      setHeights((heights2) => {
        const alreadyExists = heights2.find((height) => height.toastId === toast2.id);
        if (!alreadyExists) {
          return [
            {
              toastId: toast2.id,
              height: newHeight,
              position: toast2.position
            },
            ...heights2
          ];
        } else {
          return heights2.map((height) => height.toastId === toast2.id ? __spreadProps(__spreadValues({}, height), {
            height: newHeight
          }) : height);
        }
      });
    }, [
      mounted,
      toast2.title,
      toast2.description,
      setHeights,
      toast2.id,
      toast2.jsx,
      toast2.action,
      toast2.cancel
    ]);
    const deleteToast = React.useCallback(() => {
      setRemoved(true);
      setOffsetBeforeRemove(offset2.current);
      setHeights((h) => h.filter((height) => height.toastId !== toast2.id));
      setTimeout(() => {
        removeToast(toast2);
      }, TIME_BEFORE_UNMOUNT);
    }, [
      toast2,
      removeToast,
      setHeights,
      offset2
    ]);
    React.useEffect(() => {
      if (toast2.promise && toastType === "loading" || toast2.duration === Infinity || toast2.type === "loading") return;
      let timeoutId;
      const pauseTimer = /* @__PURE__ */ __name(() => {
        if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
          const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;
          remainingTime.current = remainingTime.current - elapsedTime;
        }
        lastCloseTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
      }, "pauseTimer");
      const startTimer = /* @__PURE__ */ __name(() => {
        if (remainingTime.current === Infinity) return;
        closeTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
        timeoutId = setTimeout(() => {
          toast2.onAutoClose == null ? void 0 : toast2.onAutoClose.call(toast2, toast2);
          deleteToast();
        }, remainingTime.current);
      }, "startTimer");
      if (expanded || interacting || isDocumentHidden) {
        pauseTimer();
      } else {
        startTimer();
      }
      return () => clearTimeout(timeoutId);
    }, [
      expanded,
      interacting,
      toast2,
      toastType,
      isDocumentHidden,
      deleteToast
    ]);
    React.useEffect(() => {
      if (toast2.delete) {
        deleteToast();
        toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
      }
    }, [
      deleteToast,
      toast2.delete
    ]);
    function getLoadingIcon() {
      var _toast_classNames9;
      if (icons == null ? void 0 : icons.loading) {
        var _toast_classNames12;
        return /* @__PURE__ */ React.createElement("div", {
          className: cn(classNames == null ? void 0 : classNames.loader, toast2 == null ? void 0 : (_toast_classNames12 = toast2.classNames) == null ? void 0 : _toast_classNames12.loader, "sonner-loader"),
          "data-visible": toastType === "loading"
        }, icons.loading);
      }
      return /* @__PURE__ */ React.createElement(Loader, {
        className: cn(classNames == null ? void 0 : classNames.loader, toast2 == null ? void 0 : (_toast_classNames9 = toast2.classNames) == null ? void 0 : _toast_classNames9.loader),
        visible: toastType === "loading"
      });
    }
    __name(getLoadingIcon, "getLoadingIcon");
    const icon = toast2.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType);
    var _toast_richColors, _icons_close;
    return /* @__PURE__ */ React.createElement("li", {
      tabIndex: 0,
      ref: toastRef,
      className: cn(className, toastClassname, classNames == null ? void 0 : classNames.toast, toast2 == null ? void 0 : (_toast_classNames = toast2.classNames) == null ? void 0 : _toast_classNames.toast, classNames == null ? void 0 : classNames.default, classNames == null ? void 0 : classNames[toastType], toast2 == null ? void 0 : (_toast_classNames1 = toast2.classNames) == null ? void 0 : _toast_classNames1[toastType]),
      "data-sonner-toast": "",
      "data-rich-colors": (_toast_richColors = toast2.richColors) != null ? _toast_richColors : defaultRichColors,
      "data-styled": !Boolean(toast2.jsx || toast2.unstyled || unstyled),
      "data-mounted": mounted,
      "data-promise": Boolean(toast2.promise),
      "data-swiped": isSwiped,
      "data-removed": removed,
      "data-visible": isVisible2,
      "data-y-position": y2,
      "data-x-position": x2,
      "data-index": index2,
      "data-front": isFront,
      "data-swiping": swiping,
      "data-dismissible": dismissible,
      "data-type": toastType,
      "data-invert": invert,
      "data-swipe-out": swipeOut,
      "data-swipe-direction": swipeOutDirection,
      "data-expanded": Boolean(expanded || expandByDefault && mounted),
      "data-testid": toast2.testId,
      style: __spreadValues(__spreadValues({
        "--index": index2,
        "--toasts-before": index2,
        "--z-index": toasts.length - index2,
        "--offset": `${removed ? offsetBeforeRemove : offset2.current}px`,
        "--initial-height": expandByDefault ? "auto" : `${initialHeight}px`
      }, style), toast2.style),
      onDragEnd: /* @__PURE__ */ __name(() => {
        setSwiping(false);
        setSwipeDirection(null);
        pointerStartRef.current = null;
      }, "onDragEnd"),
      onPointerDown: /* @__PURE__ */ __name((event) => {
        if (event.button === 2) return;
        if (disabled || !dismissible) return;
        dragStartTime.current = /* @__PURE__ */ new Date();
        setOffsetBeforeRemove(offset2.current);
        event.target.setPointerCapture(event.pointerId);
        if (event.target.tagName === "BUTTON") return;
        setSwiping(true);
        pointerStartRef.current = {
          x: event.clientX,
          y: event.clientY
        };
      }, "onPointerDown"),
      onPointerUp: /* @__PURE__ */ __name(() => {
        var _toastRef_current, _toastRef_current1, _dragStartTime_current;
        if (swipeOut || !dismissible) return;
        pointerStartRef.current = null;
        const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0);
        const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0);
        const timeTaken = (/* @__PURE__ */ new Date()).getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());
        const swipeAmount = swipeDirection === "x" ? swipeAmountX : swipeAmountY;
        const velocity = Math.abs(swipeAmount) / timeTaken;
        if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
          setOffsetBeforeRemove(offset2.current);
          toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
          if (swipeDirection === "x") {
            setSwipeOutDirection(swipeAmountX > 0 ? "right" : "left");
          } else {
            setSwipeOutDirection(swipeAmountY > 0 ? "down" : "up");
          }
          deleteToast();
          setSwipeOut(true);
          return;
        } else {
          var _toastRef_current2, _toastRef_current3;
          (_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty("--swipe-amount-x", `0px`);
          (_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty("--swipe-amount-y", `0px`);
        }
        setIsSwiped(false);
        setSwiping(false);
        setSwipeDirection(null);
      }, "onPointerUp"),
      onPointerMove: /* @__PURE__ */ __name((event) => {
        var _window_getSelection, _toastRef_current, _toastRef_current1;
        if (!pointerStartRef.current || !dismissible) return;
        const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0;
        if (isHighlighted) return;
        const yDelta = event.clientY - pointerStartRef.current.y;
        const xDelta = event.clientX - pointerStartRef.current.x;
        var _props_swipeDirections;
        const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position);
        if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
          setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y");
        }
        let swipeAmount = {
          x: 0,
          y: 0
        };
        const getDampening = /* @__PURE__ */ __name((delta) => {
          const factor = Math.abs(delta) / 20;
          return 1 / (1.5 + factor);
        }, "getDampening");
        if (swipeDirection === "y") {
          if (swipeDirections.includes("top") || swipeDirections.includes("bottom")) {
            if (swipeDirections.includes("top") && yDelta < 0 || swipeDirections.includes("bottom") && yDelta > 0) {
              swipeAmount.y = yDelta;
            } else {
              const dampenedDelta = yDelta * getDampening(yDelta);
              swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
            }
          }
        } else if (swipeDirection === "x") {
          if (swipeDirections.includes("left") || swipeDirections.includes("right")) {
            if (swipeDirections.includes("left") && xDelta < 0 || swipeDirections.includes("right") && xDelta > 0) {
              swipeAmount.x = xDelta;
            } else {
              const dampenedDelta = xDelta * getDampening(xDelta);
              swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
            }
          }
        }
        if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {
          setIsSwiped(true);
        }
        (_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
        (_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
      }, "onPointerMove")
    }, closeButton && !toast2.jsx && toastType !== "loading" ? /* @__PURE__ */ React.createElement("button", {
      "aria-label": closeButtonAriaLabel,
      "data-disabled": disabled,
      "data-close-button": true,
      onClick: disabled || !dismissible ? () => {
      } : () => {
        deleteToast();
        toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
      },
      className: cn(classNames == null ? void 0 : classNames.closeButton, toast2 == null ? void 0 : (_toast_classNames2 = toast2.classNames) == null ? void 0 : _toast_classNames2.closeButton)
    }, (_icons_close = icons == null ? void 0 : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast2.icon || toast2.promise) && toast2.icon !== null && ((icons == null ? void 0 : icons[toastType]) !== null || toast2.icon) ? /* @__PURE__ */ React.createElement("div", {
      "data-icon": "",
      className: cn(classNames == null ? void 0 : classNames.icon, toast2 == null ? void 0 : (_toast_classNames3 = toast2.classNames) == null ? void 0 : _toast_classNames3.icon)
    }, toast2.promise || toast2.type === "loading" && !toast2.icon ? toast2.icon || getLoadingIcon() : null, toast2.type !== "loading" ? icon : null) : null, /* @__PURE__ */ React.createElement("div", {
      "data-content": "",
      className: cn(classNames == null ? void 0 : classNames.content, toast2 == null ? void 0 : (_toast_classNames4 = toast2.classNames) == null ? void 0 : _toast_classNames4.content)
    }, /* @__PURE__ */ React.createElement("div", {
      "data-title": "",
      className: cn(classNames == null ? void 0 : classNames.title, toast2 == null ? void 0 : (_toast_classNames5 = toast2.classNames) == null ? void 0 : _toast_classNames5.title)
    }, toast2.jsx ? toast2.jsx : typeof toast2.title === "function" ? toast2.title() : toast2.title), toast2.description ? /* @__PURE__ */ React.createElement("div", {
      "data-description": "",
      className: cn(descriptionClassName, toastDescriptionClassname, classNames == null ? void 0 : classNames.description, toast2 == null ? void 0 : (_toast_classNames6 = toast2.classNames) == null ? void 0 : _toast_classNames6.description)
    }, typeof toast2.description === "function" ? toast2.description() : toast2.description) : null), /* @__PURE__ */ React.isValidElement(toast2.cancel) ? toast2.cancel : toast2.cancel && isAction(toast2.cancel) ? /* @__PURE__ */ React.createElement("button", {
      "data-button": true,
      "data-cancel": true,
      style: toast2.cancelButtonStyle || cancelButtonStyle,
      onClick: /* @__PURE__ */ __name((event) => {
        if (!isAction(toast2.cancel)) return;
        if (!dismissible) return;
        toast2.cancel.onClick == null ? void 0 : toast2.cancel.onClick.call(toast2.cancel, event);
        deleteToast();
      }, "onClick"),
      className: cn(classNames == null ? void 0 : classNames.cancelButton, toast2 == null ? void 0 : (_toast_classNames7 = toast2.classNames) == null ? void 0 : _toast_classNames7.cancelButton)
    }, toast2.cancel.label) : null, /* @__PURE__ */ React.isValidElement(toast2.action) ? toast2.action : toast2.action && isAction(toast2.action) ? /* @__PURE__ */ React.createElement("button", {
      "data-button": true,
      "data-action": true,
      style: toast2.actionButtonStyle || actionButtonStyle,
      onClick: /* @__PURE__ */ __name((event) => {
        if (!isAction(toast2.action)) return;
        toast2.action.onClick == null ? void 0 : toast2.action.onClick.call(toast2.action, event);
        if (event.defaultPrevented) return;
        deleteToast();
      }, "onClick"),
      className: cn(classNames == null ? void 0 : classNames.actionButton, toast2 == null ? void 0 : (_toast_classNames8 = toast2.classNames) == null ? void 0 : _toast_classNames8.actionButton)
    }, toast2.action.label) : null);
  }, "Toast");
  function getDocumentDirection() {
    if (typeof window === "undefined") return "ltr";
    if (typeof document === "undefined") return "ltr";
    const dirAttribute = document.documentElement.getAttribute("dir");
    if (dirAttribute === "auto" || !dirAttribute) {
      return window.getComputedStyle(document.documentElement).direction;
    }
    return dirAttribute;
  }
  __name(getDocumentDirection, "getDocumentDirection");
  function assignOffset(defaultOffset, mobileOffset) {
    const styles = {};
    [
      defaultOffset,
      mobileOffset
    ].forEach((offset2, index2) => {
      const isMobile = index2 === 1;
      const prefix2 = isMobile ? "--mobile-offset" : "--offset";
      const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
      function assignAll(offset3) {
        [
          "top",
          "right",
          "bottom",
          "left"
        ].forEach((key) => {
          styles[`${prefix2}-${key}`] = typeof offset3 === "number" ? `${offset3}px` : offset3;
        });
      }
      __name(assignAll, "assignAll");
      if (typeof offset2 === "number" || typeof offset2 === "string") {
        assignAll(offset2);
      } else if (typeof offset2 === "object") {
        [
          "top",
          "right",
          "bottom",
          "left"
        ].forEach((key) => {
          if (offset2[key] === void 0) {
            styles[`${prefix2}-${key}`] = defaultValue;
          } else {
            styles[`${prefix2}-${key}`] = typeof offset2[key] === "number" ? `${offset2[key]}px` : offset2[key];
          }
        });
      } else {
        assignAll(defaultValue);
      }
    });
    return styles;
  }
  __name(assignOffset, "assignOffset");
  const Toaster = /* @__PURE__ */ React.forwardRef(/* @__PURE__ */ __name(function Toaster2(props, ref) {
    const { id, invert, position = "bottom-right", hotkey = [
      "altKey",
      "KeyT"
    ], expand, closeButton, className, offset: offset2, mobileOffset, theme = "light", richColors, duration, style, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, containerAriaLabel = "Notifications" } = props;
    const [toasts, setToasts] = React.useState([]);
    const filteredToasts = React.useMemo(() => {
      if (id) {
        return toasts.filter((toast2) => toast2.toasterId === id);
      }
      return toasts.filter((toast2) => !toast2.toasterId);
    }, [
      toasts,
      id
    ]);
    const possiblePositions = React.useMemo(() => {
      return Array.from(new Set([
        position
      ].concat(filteredToasts.filter((toast2) => toast2.position).map((toast2) => toast2.position))));
    }, [
      filteredToasts,
      position
    ]);
    const [heights, setHeights] = React.useState([]);
    const [expanded, setExpanded] = React.useState(false);
    const [interacting, setInteracting] = React.useState(false);
    const [actualTheme, setActualTheme] = React.useState(theme !== "system" ? theme : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
    const listRef = React.useRef(null);
    const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
    const lastFocusedElementRef = React.useRef(null);
    const isFocusWithinRef = React.useRef(false);
    const removeToast = React.useCallback((toastToRemove) => {
      setToasts((toasts2) => {
        var _toasts_find;
        if (!((_toasts_find = toasts2.find((toast2) => toast2.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) {
          ToastState.dismiss(toastToRemove.id);
        }
        return toasts2.filter(({ id: id2 }) => id2 !== toastToRemove.id);
      });
    }, []);
    React.useEffect(() => {
      return ToastState.subscribe((toast2) => {
        if (toast2.dismiss) {
          requestAnimationFrame(() => {
            setToasts((toasts2) => toasts2.map((t2) => t2.id === toast2.id ? __spreadProps(__spreadValues({}, t2), {
              delete: true
            }) : t2));
          });
          return;
        }
        setTimeout(() => {
          ReactDOM.flushSync(() => {
            setToasts((toasts2) => {
              const indexOfExistingToast = toasts2.findIndex((t2) => t2.id === toast2.id);
              if (indexOfExistingToast !== -1) {
                return [
                  ...toasts2.slice(0, indexOfExistingToast),
                  __spreadValues(__spreadValues({}, toasts2[indexOfExistingToast]), toast2),
                  ...toasts2.slice(indexOfExistingToast + 1)
                ];
              }
              return [
                toast2,
                ...toasts2
              ];
            });
          });
        });
      });
    }, [
      toasts
    ]);
    React.useEffect(() => {
      if (theme !== "system") {
        setActualTheme(theme);
        return;
      }
      if (theme === "system") {
        if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
          setActualTheme("dark");
        } else {
          setActualTheme("light");
        }
      }
      if (typeof window === "undefined") return;
      const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
      try {
        darkMediaQuery.addEventListener("change", ({ matches }) => {
          if (matches) {
            setActualTheme("dark");
          } else {
            setActualTheme("light");
          }
        });
      } catch (error) {
        darkMediaQuery.addListener(({ matches }) => {
          try {
            if (matches) {
              setActualTheme("dark");
            } else {
              setActualTheme("light");
            }
          } catch (e) {
            console.error(e);
          }
        });
      }
    }, [
      theme
    ]);
    React.useEffect(() => {
      if (toasts.length <= 1) {
        setExpanded(false);
      }
    }, [
      toasts
    ]);
    React.useEffect(() => {
      const handleKeyDown = /* @__PURE__ */ __name((event) => {
        var _listRef_current;
        const isHotkeyPressed = hotkey.every((key) => event[key] || event.code === key);
        if (isHotkeyPressed) {
          var _listRef_current1;
          setExpanded(true);
          (_listRef_current1 = listRef.current) == null ? void 0 : _listRef_current1.focus();
        }
        if (event.code === "Escape" && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) {
          setExpanded(false);
        }
      }, "handleKeyDown");
      document.addEventListener("keydown", handleKeyDown);
      return () => document.removeEventListener("keydown", handleKeyDown);
    }, [
      hotkey
    ]);
    React.useEffect(() => {
      if (listRef.current) {
        return () => {
          if (lastFocusedElementRef.current) {
            lastFocusedElementRef.current.focus({
              preventScroll: true
            });
            lastFocusedElementRef.current = null;
            isFocusWithinRef.current = false;
          }
        };
      }
    }, [
      listRef.current
    ]);
    return (
      // Remove item from normal navigation flow, only available via hotkey
      /* @__PURE__ */ React.createElement("section", {
        ref,
        "aria-label": `${containerAriaLabel} ${hotkeyLabel}`,
        tabIndex: -1,
        "aria-live": "polite",
        "aria-relevant": "additions text",
        "aria-atomic": "false",
        suppressHydrationWarning: true
      }, possiblePositions.map((position2, index2) => {
        var _heights_;
        const [y2, x2] = position2.split("-");
        if (!filteredToasts.length) return null;
        return /* @__PURE__ */ React.createElement("ol", {
          key: position2,
          dir: dir === "auto" ? getDocumentDirection() : dir,
          tabIndex: -1,
          ref: listRef,
          className,
          "data-sonner-toaster": true,
          "data-sonner-theme": actualTheme,
          "data-y-position": y2,
          "data-x-position": x2,
          style: __spreadValues(__spreadValues({
            "--front-toast-height": `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,
            "--width": `${TOAST_WIDTH}px`,
            "--gap": `${gap}px`
          }, style), assignOffset(offset2, mobileOffset)),
          onBlur: /* @__PURE__ */ __name((event) => {
            if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
              isFocusWithinRef.current = false;
              if (lastFocusedElementRef.current) {
                lastFocusedElementRef.current.focus({
                  preventScroll: true
                });
                lastFocusedElementRef.current = null;
              }
            }
          }, "onBlur"),
          onFocus: /* @__PURE__ */ __name((event) => {
            const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
            if (isNotDismissible) return;
            if (!isFocusWithinRef.current) {
              isFocusWithinRef.current = true;
              lastFocusedElementRef.current = event.relatedTarget;
            }
          }, "onFocus"),
          onMouseEnter: /* @__PURE__ */ __name(() => setExpanded(true), "onMouseEnter"),
          onMouseMove: /* @__PURE__ */ __name(() => setExpanded(true), "onMouseMove"),
          onMouseLeave: /* @__PURE__ */ __name(() => {
            if (!interacting) {
              setExpanded(false);
            }
          }, "onMouseLeave"),
          onDragEnd: /* @__PURE__ */ __name(() => setExpanded(false), "onDragEnd"),
          onPointerDown: /* @__PURE__ */ __name((event) => {
            const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
            if (isNotDismissible) return;
            setInteracting(true);
          }, "onPointerDown"),
          onPointerUp: /* @__PURE__ */ __name(() => setInteracting(false), "onPointerUp")
        }, filteredToasts.filter((toast2) => !toast2.position && index2 === 0 || toast2.position === position2).map((toast2, index3) => {
          var _toastOptions_duration, _toastOptions_closeButton;
          return /* @__PURE__ */ React.createElement(Toast, {
            key: toast2.id,
            icons,
            index: index3,
            toast: toast2,
            defaultRichColors: richColors,
            duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration,
            className: toastOptions == null ? void 0 : toastOptions.className,
            descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,
            invert,
            visibleToasts,
            closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
            interacting,
            position: position2,
            style: toastOptions == null ? void 0 : toastOptions.style,
            unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,
            classNames: toastOptions == null ? void 0 : toastOptions.classNames,
            cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,
            actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,
            closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,
            removeToast,
            toasts: filteredToasts.filter((t2) => t2.position == toast2.position),
            heights: heights.filter((h) => h.position == toast2.position),
            setHeights,
            expandByDefault: expand,
            gap,
            expanded,
            swipeDirections: props.swipeDirections
          });
        }));
      }))
    );
  }, "Toaster"));
  const toastIconClass = "cky:h-5 cky:w-5 cky:shrink-0";
  function ToastIcon({ src, alt }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src, alt, className: toastIconClass });
  }
  __name(ToastIcon, "ToastIcon");
  function CkyToaster(props) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Toaster,
      __spreadValues({
        theme: "light",
        className: "cky:toaster cky:group",
        icons: {
          success: /* @__PURE__ */ jsxRuntimeExports.jsx(ToastIcon, { src: assets.success, alt: "" }),
          info: /* @__PURE__ */ jsxRuntimeExports.jsx(ToastIcon, { src: assets.info, alt: "" }),
          warning: /* @__PURE__ */ jsxRuntimeExports.jsx(ToastIcon, { src: assets.warning, alt: "" }),
          error: /* @__PURE__ */ jsxRuntimeExports.jsx(ToastIcon, { src: assets.error, alt: "" }),
          loading: /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: `${toastIconClass} cky:animate-spin` })
        },
        toastOptions: {
          classNames: {
            toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
            description: "group-[.toast]:text-muted-foreground",
            actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
            cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"
          }
        }
      }, props)
    );
  }
  __name(CkyToaster, "CkyToaster");
  var TABS_NAME = "Tabs";
  var [createTabsContext, createTabsScope] = createContextScope(TABS_NAME, [
    createRovingFocusGroupScope
  ]);
  var useRovingFocusGroupScope$1 = createRovingFocusGroupScope();
  var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);
  var Tabs$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, {
        __scopeTabs,
        value: valueProp,
        onValueChange,
        defaultValue,
        orientation = "horizontal",
        dir,
        activationMode = "automatic"
      } = _a2, tabsProps = __objRest(_a2, [
        "__scopeTabs",
        "value",
        "onValueChange",
        "defaultValue",
        "orientation",
        "dir",
        "activationMode"
      ]);
      const direction = useDirection(dir);
      const [value, setValue] = useControllableState({
        prop: valueProp,
        onChange: onValueChange,
        defaultProp: defaultValue != null ? defaultValue : "",
        caller: TABS_NAME
      });
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        TabsProvider,
        {
          scope: __scopeTabs,
          baseId: useId(),
          value,
          onValueChange: setValue,
          orientation,
          dir: direction,
          activationMode,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Primitive$1.div,
            __spreadProps(__spreadValues({
              dir: direction,
              "data-orientation": orientation
            }, tabsProps), {
              ref: forwardedRef
            })
          )
        }
      );
    }
  );
  Tabs$1.displayName = TABS_NAME;
  var TAB_LIST_NAME = "TabsList";
  var TabsList$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeTabs, loop = true } = _a2, listProps = __objRest(_a2, ["__scopeTabs", "loop"]);
      const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
      const rovingFocusGroupScope = useRovingFocusGroupScope$1(__scopeTabs);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Root$5,
        __spreadProps(__spreadValues({
          asChild: true
        }, rovingFocusGroupScope), {
          orientation: context.orientation,
          dir: context.dir,
          loop,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Primitive$1.div,
            __spreadProps(__spreadValues({
              role: "tablist",
              "aria-orientation": context.orientation
            }, listProps), {
              ref: forwardedRef
            })
          )
        })
      );
    }
  );
  TabsList$1.displayName = TAB_LIST_NAME;
  var TRIGGER_NAME = "TabsTrigger";
  var TabsTrigger$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeTabs, value, disabled = false } = _a2, triggerProps = __objRest(_a2, ["__scopeTabs", "value", "disabled"]);
      const context = useTabsContext(TRIGGER_NAME, __scopeTabs);
      const rovingFocusGroupScope = useRovingFocusGroupScope$1(__scopeTabs);
      const triggerId = makeTriggerId(context.baseId, value);
      const contentId = makeContentId(context.baseId, value);
      const isSelected = value === context.value;
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Item$2,
        __spreadProps(__spreadValues({
          asChild: true
        }, rovingFocusGroupScope), {
          focusable: !disabled,
          active: isSelected,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Primitive$1.button,
            __spreadProps(__spreadValues({
              type: "button",
              role: "tab",
              "aria-selected": isSelected,
              "aria-controls": contentId,
              "data-state": isSelected ? "active" : "inactive",
              "data-disabled": disabled ? "" : void 0,
              disabled,
              id: triggerId
            }, triggerProps), {
              ref: forwardedRef,
              onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
                if (!disabled && event.button === 0 && event.ctrlKey === false) {
                  context.onValueChange(value);
                } else {
                  event.preventDefault();
                }
              }),
              onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
                if ([" ", "Enter"].includes(event.key)) context.onValueChange(value);
              }),
              onFocus: composeEventHandlers(props.onFocus, () => {
                const isAutomaticActivation = context.activationMode !== "manual";
                if (!isSelected && !disabled && isAutomaticActivation) {
                  context.onValueChange(value);
                }
              })
            })
          )
        })
      );
    }
  );
  TabsTrigger$1.displayName = TRIGGER_NAME;
  var CONTENT_NAME = "TabsContent";
  var TabsContent$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeTabs, value, forceMount, children } = _a2, contentProps = __objRest(_a2, ["__scopeTabs", "value", "forceMount", "children"]);
      const context = useTabsContext(CONTENT_NAME, __scopeTabs);
      const triggerId = makeTriggerId(context.baseId, value);
      const contentId = makeContentId(context.baseId, value);
      const isSelected = value === context.value;
      const isMountAnimationPreventedRef = reactExports.useRef(isSelected);
      reactExports.useEffect(() => {
        const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
        return () => cancelAnimationFrame(rAF);
      }, []);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || isSelected, children: /* @__PURE__ */ __name(({ present }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.div,
        __spreadProps(__spreadValues({
          "data-state": isSelected ? "active" : "inactive",
          "data-orientation": context.orientation,
          role: "tabpanel",
          "aria-labelledby": triggerId,
          hidden: !present,
          id: contentId,
          tabIndex: 0
        }, contentProps), {
          ref: forwardedRef,
          style: __spreadProps(__spreadValues({}, props.style), {
            animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0
          }),
          children: present && children
        })
      ), "children") });
    }
  );
  TabsContent$1.displayName = CONTENT_NAME;
  function makeTriggerId(baseId, value) {
    return `${baseId}-trigger-${value}`;
  }
  __name(makeTriggerId, "makeTriggerId");
  function makeContentId(baseId, value) {
    return `${baseId}-content-${value}`;
  }
  __name(makeContentId, "makeContentId");
  var Root2$1 = Tabs$1;
  var List = TabsList$1;
  var Trigger = TabsTrigger$1;
  var Content = TabsContent$1;
  const Tabs = Root2$1;
  const TabsList = reactExports.forwardRef((_hc, ref) => {
    var _ic = _hc, { className } = _ic, props = __objRest(_ic, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      List,
      __spreadValues({
        ref,
        className: cn$1(
          "cky:inline-flex cky:h-10 cky:items-center cky:justify-center cky:rounded-md cky:bg-muted cky:p-1 cky:text-muted-foreground",
          className
        )
      }, props)
    );
  });
  TabsList.displayName = List.displayName;
  const TabsTrigger = reactExports.forwardRef((_jc, ref) => {
    var _kc = _jc, { className } = _kc, props = __objRest(_kc, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Trigger,
      __spreadValues({
        ref,
        className: cn$1(
          "cky:inline-flex cky:items-center cky:justify-center cky:whitespace-nowrap cky:rounded-sm cky:px-3 cky:py-1.5 cky:text-sm cky:font-medium cky:ring-offset-background cky:transition-all cky:focus-visible:outline-none cky:focus-visible:ring-2 cky:focus-visible:ring-ring cky:focus-visible:ring-offset-2 cky:disabled:pointer-events-none cky:disabled:opacity-50 cky:data-[state=active]:bg-background cky:data-[state=active]:text-foreground cky:data-[state=active]:shadow-sm",
          className
        )
      }, props)
    );
  });
  TabsTrigger.displayName = Trigger.displayName;
  const TabsContent = reactExports.forwardRef((_lc, ref) => {
    var _mc = _lc, { className } = _mc, props = __objRest(_mc, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Content,
      __spreadValues({
        ref,
        className: cn$1(
          "cky:mt-2 cky:ring-offset-background cky:focus-visible:outline-none cky:focus-visible:ring-2 cky:focus-visible:ring-ring cky:focus-visible:ring-offset-2",
          className
        )
      }, props)
    );
  });
  TabsContent.displayName = Content.displayName;
  var isArray_1;
  var hasRequiredIsArray;
  function requireIsArray() {
    if (hasRequiredIsArray) return isArray_1;
    hasRequiredIsArray = 1;
    var isArray2 = Array.isArray;
    isArray_1 = isArray2;
    return isArray_1;
  }
  __name(requireIsArray, "requireIsArray");
  var _freeGlobal;
  var hasRequired_freeGlobal;
  function require_freeGlobal() {
    if (hasRequired_freeGlobal) return _freeGlobal;
    hasRequired_freeGlobal = 1;
    var freeGlobal2 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
    _freeGlobal = freeGlobal2;
    return _freeGlobal;
  }
  __name(require_freeGlobal, "require_freeGlobal");
  var _root;
  var hasRequired_root;
  function require_root() {
    if (hasRequired_root) return _root;
    hasRequired_root = 1;
    var freeGlobal2 = require_freeGlobal();
    var freeSelf2 = typeof self == "object" && self && self.Object === Object && self;
    var root2 = freeGlobal2 || freeSelf2 || Function("return this")();
    _root = root2;
    return _root;
  }
  __name(require_root, "require_root");
  var _Symbol;
  var hasRequired_Symbol;
  function require_Symbol() {
    if (hasRequired_Symbol) return _Symbol;
    hasRequired_Symbol = 1;
    var root2 = require_root();
    var Symbol2 = root2.Symbol;
    _Symbol = Symbol2;
    return _Symbol;
  }
  __name(require_Symbol, "require_Symbol");
  var _getRawTag;
  var hasRequired_getRawTag;
  function require_getRawTag() {
    if (hasRequired_getRawTag) return _getRawTag;
    hasRequired_getRawTag = 1;
    var Symbol2 = require_Symbol();
    var objectProto2 = Object.prototype;
    var hasOwnProperty2 = objectProto2.hasOwnProperty;
    var nativeObjectToString2 = objectProto2.toString;
    var symToStringTag2 = Symbol2 ? Symbol2.toStringTag : void 0;
    function getRawTag2(value) {
      var isOwn = hasOwnProperty2.call(value, symToStringTag2), tag = value[symToStringTag2];
      try {
        value[symToStringTag2] = void 0;
        var unmasked = true;
      } catch (e) {
      }
      var result = nativeObjectToString2.call(value);
      if (unmasked) {
        if (isOwn) {
          value[symToStringTag2] = tag;
        } else {
          delete value[symToStringTag2];
        }
      }
      return result;
    }
    __name(getRawTag2, "getRawTag");
    _getRawTag = getRawTag2;
    return _getRawTag;
  }
  __name(require_getRawTag, "require_getRawTag");
  var _objectToString;
  var hasRequired_objectToString;
  function require_objectToString() {
    if (hasRequired_objectToString) return _objectToString;
    hasRequired_objectToString = 1;
    var objectProto2 = Object.prototype;
    var nativeObjectToString2 = objectProto2.toString;
    function objectToString2(value) {
      return nativeObjectToString2.call(value);
    }
    __name(objectToString2, "objectToString");
    _objectToString = objectToString2;
    return _objectToString;
  }
  __name(require_objectToString, "require_objectToString");
  var _baseGetTag;
  var hasRequired_baseGetTag;
  function require_baseGetTag() {
    if (hasRequired_baseGetTag) return _baseGetTag;
    hasRequired_baseGetTag = 1;
    var Symbol2 = require_Symbol(), getRawTag2 = require_getRawTag(), objectToString2 = require_objectToString();
    var nullTag2 = "[object Null]", undefinedTag2 = "[object Undefined]";
    var symToStringTag2 = Symbol2 ? Symbol2.toStringTag : void 0;
    function baseGetTag2(value) {
      if (value == null) {
        return value === void 0 ? undefinedTag2 : nullTag2;
      }
      return symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag2(value) : objectToString2(value);
    }
    __name(baseGetTag2, "baseGetTag");
    _baseGetTag = baseGetTag2;
    return _baseGetTag;
  }
  __name(require_baseGetTag, "require_baseGetTag");
  var isObjectLike_1;
  var hasRequiredIsObjectLike;
  function requireIsObjectLike() {
    if (hasRequiredIsObjectLike) return isObjectLike_1;
    hasRequiredIsObjectLike = 1;
    function isObjectLike2(value) {
      return value != null && typeof value == "object";
    }
    __name(isObjectLike2, "isObjectLike");
    isObjectLike_1 = isObjectLike2;
    return isObjectLike_1;
  }
  __name(requireIsObjectLike, "requireIsObjectLike");
  var isSymbol_1;
  var hasRequiredIsSymbol;
  function requireIsSymbol() {
    if (hasRequiredIsSymbol) return isSymbol_1;
    hasRequiredIsSymbol = 1;
    var baseGetTag2 = require_baseGetTag(), isObjectLike2 = requireIsObjectLike();
    var symbolTag2 = "[object Symbol]";
    function isSymbol(value) {
      return typeof value == "symbol" || isObjectLike2(value) && baseGetTag2(value) == symbolTag2;
    }
    __name(isSymbol, "isSymbol");
    isSymbol_1 = isSymbol;
    return isSymbol_1;
  }
  __name(requireIsSymbol, "requireIsSymbol");
  var _isKey;
  var hasRequired_isKey;
  function require_isKey() {
    if (hasRequired_isKey) return _isKey;
    hasRequired_isKey = 1;
    var isArray2 = requireIsArray(), isSymbol = requireIsSymbol();
    var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
    function isKey2(value, object2) {
      if (isArray2(value)) {
        return false;
      }
      var type = typeof value;
      if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
        return true;
      }
      return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object2 != null && value in Object(object2);
    }
    __name(isKey2, "isKey");
    _isKey = isKey2;
    return _isKey;
  }
  __name(require_isKey, "require_isKey");
  var isObject_1;
  var hasRequiredIsObject;
  function requireIsObject() {
    if (hasRequiredIsObject) return isObject_1;
    hasRequiredIsObject = 1;
    function isObject2(value) {
      var type = typeof value;
      return value != null && (type == "object" || type == "function");
    }
    __name(isObject2, "isObject");
    isObject_1 = isObject2;
    return isObject_1;
  }
  __name(requireIsObject, "requireIsObject");
  var isFunction_1;
  var hasRequiredIsFunction;
  function requireIsFunction() {
    if (hasRequiredIsFunction) return isFunction_1;
    hasRequiredIsFunction = 1;
    var baseGetTag2 = require_baseGetTag(), isObject2 = requireIsObject();
    var asyncTag2 = "[object AsyncFunction]", funcTag2 = "[object Function]", genTag2 = "[object GeneratorFunction]", proxyTag2 = "[object Proxy]";
    function isFunction2(value) {
      if (!isObject2(value)) {
        return false;
      }
      var tag = baseGetTag2(value);
      return tag == funcTag2 || tag == genTag2 || tag == asyncTag2 || tag == proxyTag2;
    }
    __name(isFunction2, "isFunction");
    isFunction_1 = isFunction2;
    return isFunction_1;
  }
  __name(requireIsFunction, "requireIsFunction");
  var _coreJsData;
  var hasRequired_coreJsData;
  function require_coreJsData() {
    if (hasRequired_coreJsData) return _coreJsData;
    hasRequired_coreJsData = 1;
    var root2 = require_root();
    var coreJsData2 = root2["__core-js_shared__"];
    _coreJsData = coreJsData2;
    return _coreJsData;
  }
  __name(require_coreJsData, "require_coreJsData");
  var _isMasked;
  var hasRequired_isMasked;
  function require_isMasked() {
    if (hasRequired_isMasked) return _isMasked;
    hasRequired_isMasked = 1;
    var coreJsData2 = require_coreJsData();
    var maskSrcKey2 = (function() {
      var uid = /[^.]+$/.exec(coreJsData2 && coreJsData2.keys && coreJsData2.keys.IE_PROTO || "");
      return uid ? "Symbol(src)_1." + uid : "";
    })();
    function isMasked2(func) {
      return !!maskSrcKey2 && maskSrcKey2 in func;
    }
    __name(isMasked2, "isMasked");
    _isMasked = isMasked2;
    return _isMasked;
  }
  __name(require_isMasked, "require_isMasked");
  var _toSource;
  var hasRequired_toSource;
  function require_toSource() {
    if (hasRequired_toSource) return _toSource;
    hasRequired_toSource = 1;
    var funcProto2 = Function.prototype;
    var funcToString2 = funcProto2.toString;
    function toSource2(func) {
      if (func != null) {
        try {
          return funcToString2.call(func);
        } catch (e) {
        }
        try {
          return func + "";
        } catch (e) {
        }
      }
      return "";
    }
    __name(toSource2, "toSource");
    _toSource = toSource2;
    return _toSource;
  }
  __name(require_toSource, "require_toSource");
  var _baseIsNative;
  var hasRequired_baseIsNative;
  function require_baseIsNative() {
    if (hasRequired_baseIsNative) return _baseIsNative;
    hasRequired_baseIsNative = 1;
    var isFunction2 = requireIsFunction(), isMasked2 = require_isMasked(), isObject2 = requireIsObject(), toSource2 = require_toSource();
    var reRegExpChar2 = /[\\^$.*+?()[\]{}|]/g;
    var reIsHostCtor2 = /^\[object .+?Constructor\]$/;
    var funcProto2 = Function.prototype, objectProto2 = Object.prototype;
    var funcToString2 = funcProto2.toString;
    var hasOwnProperty2 = objectProto2.hasOwnProperty;
    var reIsNative2 = RegExp(
      "^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar2, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
    );
    function baseIsNative2(value) {
      if (!isObject2(value) || isMasked2(value)) {
        return false;
      }
      var pattern = isFunction2(value) ? reIsNative2 : reIsHostCtor2;
      return pattern.test(toSource2(value));
    }
    __name(baseIsNative2, "baseIsNative");
    _baseIsNative = baseIsNative2;
    return _baseIsNative;
  }
  __name(require_baseIsNative, "require_baseIsNative");
  var _getValue;
  var hasRequired_getValue;
  function require_getValue() {
    if (hasRequired_getValue) return _getValue;
    hasRequired_getValue = 1;
    function getValue2(object2, key) {
      return object2 == null ? void 0 : object2[key];
    }
    __name(getValue2, "getValue");
    _getValue = getValue2;
    return _getValue;
  }
  __name(require_getValue, "require_getValue");
  var _getNative;
  var hasRequired_getNative;
  function require_getNative() {
    if (hasRequired_getNative) return _getNative;
    hasRequired_getNative = 1;
    var baseIsNative2 = require_baseIsNative(), getValue2 = require_getValue();
    function getNative2(object2, key) {
      var value = getValue2(object2, key);
      return baseIsNative2(value) ? value : void 0;
    }
    __name(getNative2, "getNative");
    _getNative = getNative2;
    return _getNative;
  }
  __name(require_getNative, "require_getNative");
  var _nativeCreate;
  var hasRequired_nativeCreate;
  function require_nativeCreate() {
    if (hasRequired_nativeCreate) return _nativeCreate;
    hasRequired_nativeCreate = 1;
    var getNative2 = require_getNative();
    var nativeCreate2 = getNative2(Object, "create");
    _nativeCreate = nativeCreate2;
    return _nativeCreate;
  }
  __name(require_nativeCreate, "require_nativeCreate");
  var _hashClear;
  var hasRequired_hashClear;
  function require_hashClear() {
    if (hasRequired_hashClear) return _hashClear;
    hasRequired_hashClear = 1;
    var nativeCreate2 = require_nativeCreate();
    function hashClear2() {
      this.__data__ = nativeCreate2 ? nativeCreate2(null) : {};
      this.size = 0;
    }
    __name(hashClear2, "hashClear");
    _hashClear = hashClear2;
    return _hashClear;
  }
  __name(require_hashClear, "require_hashClear");
  var _hashDelete;
  var hasRequired_hashDelete;
  function require_hashDelete() {
    if (hasRequired_hashDelete) return _hashDelete;
    hasRequired_hashDelete = 1;
    function hashDelete2(key) {
      var result = this.has(key) && delete this.__data__[key];
      this.size -= result ? 1 : 0;
      return result;
    }
    __name(hashDelete2, "hashDelete");
    _hashDelete = hashDelete2;
    return _hashDelete;
  }
  __name(require_hashDelete, "require_hashDelete");
  var _hashGet;
  var hasRequired_hashGet;
  function require_hashGet() {
    if (hasRequired_hashGet) return _hashGet;
    hasRequired_hashGet = 1;
    var nativeCreate2 = require_nativeCreate();
    var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
    var objectProto2 = Object.prototype;
    var hasOwnProperty2 = objectProto2.hasOwnProperty;
    function hashGet2(key) {
      var data = this.__data__;
      if (nativeCreate2) {
        var result = data[key];
        return result === HASH_UNDEFINED2 ? void 0 : result;
      }
      return hasOwnProperty2.call(data, key) ? data[key] : void 0;
    }
    __name(hashGet2, "hashGet");
    _hashGet = hashGet2;
    return _hashGet;
  }
  __name(require_hashGet, "require_hashGet");
  var _hashHas;
  var hasRequired_hashHas;
  function require_hashHas() {
    if (hasRequired_hashHas) return _hashHas;
    hasRequired_hashHas = 1;
    var nativeCreate2 = require_nativeCreate();
    var objectProto2 = Object.prototype;
    var hasOwnProperty2 = objectProto2.hasOwnProperty;
    function hashHas2(key) {
      var data = this.__data__;
      return nativeCreate2 ? data[key] !== void 0 : hasOwnProperty2.call(data, key);
    }
    __name(hashHas2, "hashHas");
    _hashHas = hashHas2;
    return _hashHas;
  }
  __name(require_hashHas, "require_hashHas");
  var _hashSet;
  var hasRequired_hashSet;
  function require_hashSet() {
    if (hasRequired_hashSet) return _hashSet;
    hasRequired_hashSet = 1;
    var nativeCreate2 = require_nativeCreate();
    var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
    function hashSet2(key, value) {
      var data = this.__data__;
      this.size += this.has(key) ? 0 : 1;
      data[key] = nativeCreate2 && value === void 0 ? HASH_UNDEFINED2 : value;
      return this;
    }
    __name(hashSet2, "hashSet");
    _hashSet = hashSet2;
    return _hashSet;
  }
  __name(require_hashSet, "require_hashSet");
  var _Hash;
  var hasRequired_Hash;
  function require_Hash() {
    if (hasRequired_Hash) return _Hash;
    hasRequired_Hash = 1;
    var hashClear2 = require_hashClear(), hashDelete2 = require_hashDelete(), hashGet2 = require_hashGet(), hashHas2 = require_hashHas(), hashSet2 = require_hashSet();
    function Hash2(entries) {
      var index2 = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index2 < length) {
        var entry = entries[index2];
        this.set(entry[0], entry[1]);
      }
    }
    __name(Hash2, "Hash");
    Hash2.prototype.clear = hashClear2;
    Hash2.prototype["delete"] = hashDelete2;
    Hash2.prototype.get = hashGet2;
    Hash2.prototype.has = hashHas2;
    Hash2.prototype.set = hashSet2;
    _Hash = Hash2;
    return _Hash;
  }
  __name(require_Hash, "require_Hash");
  var _listCacheClear;
  var hasRequired_listCacheClear;
  function require_listCacheClear() {
    if (hasRequired_listCacheClear) return _listCacheClear;
    hasRequired_listCacheClear = 1;
    function listCacheClear2() {
      this.__data__ = [];
      this.size = 0;
    }
    __name(listCacheClear2, "listCacheClear");
    _listCacheClear = listCacheClear2;
    return _listCacheClear;
  }
  __name(require_listCacheClear, "require_listCacheClear");
  var eq_1;
  var hasRequiredEq;
  function requireEq() {
    if (hasRequiredEq) return eq_1;
    hasRequiredEq = 1;
    function eq2(value, other) {
      return value === other || value !== value && other !== other;
    }
    __name(eq2, "eq");
    eq_1 = eq2;
    return eq_1;
  }
  __name(requireEq, "requireEq");
  var _assocIndexOf;
  var hasRequired_assocIndexOf;
  function require_assocIndexOf() {
    if (hasRequired_assocIndexOf) return _assocIndexOf;
    hasRequired_assocIndexOf = 1;
    var eq2 = requireEq();
    function assocIndexOf2(array2, key) {
      var length = array2.length;
      while (length--) {
        if (eq2(array2[length][0], key)) {
          return length;
        }
      }
      return -1;
    }
    __name(assocIndexOf2, "assocIndexOf");
    _assocIndexOf = assocIndexOf2;
    return _assocIndexOf;
  }
  __name(require_assocIndexOf, "require_assocIndexOf");
  var _listCacheDelete;
  var hasRequired_listCacheDelete;
  function require_listCacheDelete() {
    if (hasRequired_listCacheDelete) return _listCacheDelete;
    hasRequired_listCacheDelete = 1;
    var assocIndexOf2 = require_assocIndexOf();
    var arrayProto2 = Array.prototype;
    var splice2 = arrayProto2.splice;
    function listCacheDelete2(key) {
      var data = this.__data__, index2 = assocIndexOf2(data, key);
      if (index2 < 0) {
        return false;
      }
      var lastIndex = data.length - 1;
      if (index2 == lastIndex) {
        data.pop();
      } else {
        splice2.call(data, index2, 1);
      }
      --this.size;
      return true;
    }
    __name(listCacheDelete2, "listCacheDelete");
    _listCacheDelete = listCacheDelete2;
    return _listCacheDelete;
  }
  __name(require_listCacheDelete, "require_listCacheDelete");
  var _listCacheGet;
  var hasRequired_listCacheGet;
  function require_listCacheGet() {
    if (hasRequired_listCacheGet) return _listCacheGet;
    hasRequired_listCacheGet = 1;
    var assocIndexOf2 = require_assocIndexOf();
    function listCacheGet2(key) {
      var data = this.__data__, index2 = assocIndexOf2(data, key);
      return index2 < 0 ? void 0 : data[index2][1];
    }
    __name(listCacheGet2, "listCacheGet");
    _listCacheGet = listCacheGet2;
    return _listCacheGet;
  }
  __name(require_listCacheGet, "require_listCacheGet");
  var _listCacheHas;
  var hasRequired_listCacheHas;
  function require_listCacheHas() {
    if (hasRequired_listCacheHas) return _listCacheHas;
    hasRequired_listCacheHas = 1;
    var assocIndexOf2 = require_assocIndexOf();
    function listCacheHas2(key) {
      return assocIndexOf2(this.__data__, key) > -1;
    }
    __name(listCacheHas2, "listCacheHas");
    _listCacheHas = listCacheHas2;
    return _listCacheHas;
  }
  __name(require_listCacheHas, "require_listCacheHas");
  var _listCacheSet;
  var hasRequired_listCacheSet;
  function require_listCacheSet() {
    if (hasRequired_listCacheSet) return _listCacheSet;
    hasRequired_listCacheSet = 1;
    var assocIndexOf2 = require_assocIndexOf();
    function listCacheSet2(key, value) {
      var data = this.__data__, index2 = assocIndexOf2(data, key);
      if (index2 < 0) {
        ++this.size;
        data.push([key, value]);
      } else {
        data[index2][1] = value;
      }
      return this;
    }
    __name(listCacheSet2, "listCacheSet");
    _listCacheSet = listCacheSet2;
    return _listCacheSet;
  }
  __name(require_listCacheSet, "require_listCacheSet");
  var _ListCache;
  var hasRequired_ListCache;
  function require_ListCache() {
    if (hasRequired_ListCache) return _ListCache;
    hasRequired_ListCache = 1;
    var listCacheClear2 = require_listCacheClear(), listCacheDelete2 = require_listCacheDelete(), listCacheGet2 = require_listCacheGet(), listCacheHas2 = require_listCacheHas(), listCacheSet2 = require_listCacheSet();
    function ListCache2(entries) {
      var index2 = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index2 < length) {
        var entry = entries[index2];
        this.set(entry[0], entry[1]);
      }
    }
    __name(ListCache2, "ListCache");
    ListCache2.prototype.clear = listCacheClear2;
    ListCache2.prototype["delete"] = listCacheDelete2;
    ListCache2.prototype.get = listCacheGet2;
    ListCache2.prototype.has = listCacheHas2;
    ListCache2.prototype.set = listCacheSet2;
    _ListCache = ListCache2;
    return _ListCache;
  }
  __name(require_ListCache, "require_ListCache");
  var _Map;
  var hasRequired_Map;
  function require_Map() {
    if (hasRequired_Map) return _Map;
    hasRequired_Map = 1;
    var getNative2 = require_getNative(), root2 = require_root();
    var Map2 = getNative2(root2, "Map");
    _Map = Map2;
    return _Map;
  }
  __name(require_Map, "require_Map");
  var _mapCacheClear;
  var hasRequired_mapCacheClear;
  function require_mapCacheClear() {
    if (hasRequired_mapCacheClear) return _mapCacheClear;
    hasRequired_mapCacheClear = 1;
    var Hash2 = require_Hash(), ListCache2 = require_ListCache(), Map2 = require_Map();
    function mapCacheClear2() {
      this.size = 0;
      this.__data__ = {
        "hash": new Hash2(),
        "map": new (Map2 || ListCache2)(),
        "string": new Hash2()
      };
    }
    __name(mapCacheClear2, "mapCacheClear");
    _mapCacheClear = mapCacheClear2;
    return _mapCacheClear;
  }
  __name(require_mapCacheClear, "require_mapCacheClear");
  var _isKeyable;
  var hasRequired_isKeyable;
  function require_isKeyable() {
    if (hasRequired_isKeyable) return _isKeyable;
    hasRequired_isKeyable = 1;
    function isKeyable2(value) {
      var type = typeof value;
      return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
    }
    __name(isKeyable2, "isKeyable");
    _isKeyable = isKeyable2;
    return _isKeyable;
  }
  __name(require_isKeyable, "require_isKeyable");
  var _getMapData;
  var hasRequired_getMapData;
  function require_getMapData() {
    if (hasRequired_getMapData) return _getMapData;
    hasRequired_getMapData = 1;
    var isKeyable2 = require_isKeyable();
    function getMapData2(map2, key) {
      var data = map2.__data__;
      return isKeyable2(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
    }
    __name(getMapData2, "getMapData");
    _getMapData = getMapData2;
    return _getMapData;
  }
  __name(require_getMapData, "require_getMapData");
  var _mapCacheDelete;
  var hasRequired_mapCacheDelete;
  function require_mapCacheDelete() {
    if (hasRequired_mapCacheDelete) return _mapCacheDelete;
    hasRequired_mapCacheDelete = 1;
    var getMapData2 = require_getMapData();
    function mapCacheDelete2(key) {
      var result = getMapData2(this, key)["delete"](key);
      this.size -= result ? 1 : 0;
      return result;
    }
    __name(mapCacheDelete2, "mapCacheDelete");
    _mapCacheDelete = mapCacheDelete2;
    return _mapCacheDelete;
  }
  __name(require_mapCacheDelete, "require_mapCacheDelete");
  var _mapCacheGet;
  var hasRequired_mapCacheGet;
  function require_mapCacheGet() {
    if (hasRequired_mapCacheGet) return _mapCacheGet;
    hasRequired_mapCacheGet = 1;
    var getMapData2 = require_getMapData();
    function mapCacheGet2(key) {
      return getMapData2(this, key).get(key);
    }
    __name(mapCacheGet2, "mapCacheGet");
    _mapCacheGet = mapCacheGet2;
    return _mapCacheGet;
  }
  __name(require_mapCacheGet, "require_mapCacheGet");
  var _mapCacheHas;
  var hasRequired_mapCacheHas;
  function require_mapCacheHas() {
    if (hasRequired_mapCacheHas) return _mapCacheHas;
    hasRequired_mapCacheHas = 1;
    var getMapData2 = require_getMapData();
    function mapCacheHas2(key) {
      return getMapData2(this, key).has(key);
    }
    __name(mapCacheHas2, "mapCacheHas");
    _mapCacheHas = mapCacheHas2;
    return _mapCacheHas;
  }
  __name(require_mapCacheHas, "require_mapCacheHas");
  var _mapCacheSet;
  var hasRequired_mapCacheSet;
  function require_mapCacheSet() {
    if (hasRequired_mapCacheSet) return _mapCacheSet;
    hasRequired_mapCacheSet = 1;
    var getMapData2 = require_getMapData();
    function mapCacheSet2(key, value) {
      var data = getMapData2(this, key), size2 = data.size;
      data.set(key, value);
      this.size += data.size == size2 ? 0 : 1;
      return this;
    }
    __name(mapCacheSet2, "mapCacheSet");
    _mapCacheSet = mapCacheSet2;
    return _mapCacheSet;
  }
  __name(require_mapCacheSet, "require_mapCacheSet");
  var _MapCache;
  var hasRequired_MapCache;
  function require_MapCache() {
    if (hasRequired_MapCache) return _MapCache;
    hasRequired_MapCache = 1;
    var mapCacheClear2 = require_mapCacheClear(), mapCacheDelete2 = require_mapCacheDelete(), mapCacheGet2 = require_mapCacheGet(), mapCacheHas2 = require_mapCacheHas(), mapCacheSet2 = require_mapCacheSet();
    function MapCache2(entries) {
      var index2 = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index2 < length) {
        var entry = entries[index2];
        this.set(entry[0], entry[1]);
      }
    }
    __name(MapCache2, "MapCache");
    MapCache2.prototype.clear = mapCacheClear2;
    MapCache2.prototype["delete"] = mapCacheDelete2;
    MapCache2.prototype.get = mapCacheGet2;
    MapCache2.prototype.has = mapCacheHas2;
    MapCache2.prototype.set = mapCacheSet2;
    _MapCache = MapCache2;
    return _MapCache;
  }
  __name(require_MapCache, "require_MapCache");
  var memoize_1;
  var hasRequiredMemoize;
  function requireMemoize() {
    if (hasRequiredMemoize) return memoize_1;
    hasRequiredMemoize = 1;
    var MapCache2 = require_MapCache();
    var FUNC_ERROR_TEXT = "Expected a function";
    function memoize2(func, resolver) {
      if (typeof func != "function" || resolver != null && typeof resolver != "function") {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      var memoized = /* @__PURE__ */ __name(function() {
        var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
        if (cache.has(key)) {
          return cache.get(key);
        }
        var result = func.apply(this, args);
        memoized.cache = cache.set(key, result) || cache;
        return result;
      }, "memoized");
      memoized.cache = new (memoize2.Cache || MapCache2)();
      return memoized;
    }
    __name(memoize2, "memoize");
    memoize2.Cache = MapCache2;
    memoize_1 = memoize2;
    return memoize_1;
  }
  __name(requireMemoize, "requireMemoize");
  var _memoizeCapped;
  var hasRequired_memoizeCapped;
  function require_memoizeCapped() {
    if (hasRequired_memoizeCapped) return _memoizeCapped;
    hasRequired_memoizeCapped = 1;
    var memoize2 = requireMemoize();
    var MAX_MEMOIZE_SIZE = 500;
    function memoizeCapped(func) {
      var result = memoize2(func, function(key) {
        if (cache.size === MAX_MEMOIZE_SIZE) {
          cache.clear();
        }
        return key;
      });
      var cache = result.cache;
      return result;
    }
    __name(memoizeCapped, "memoizeCapped");
    _memoizeCapped = memoizeCapped;
    return _memoizeCapped;
  }
  __name(require_memoizeCapped, "require_memoizeCapped");
  var _stringToPath;
  var hasRequired_stringToPath;
  function require_stringToPath() {
    if (hasRequired_stringToPath) return _stringToPath;
    hasRequired_stringToPath = 1;
    var memoizeCapped = require_memoizeCapped();
    var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
    var reEscapeChar = /\\(\\)?/g;
    var stringToPath2 = memoizeCapped(function(string2) {
      var result = [];
      if (string2.charCodeAt(0) === 46) {
        result.push("");
      }
      string2.replace(rePropName, function(match, number2, quote, subString) {
        result.push(quote ? subString.replace(reEscapeChar, "$1") : number2 || match);
      });
      return result;
    });
    _stringToPath = stringToPath2;
    return _stringToPath;
  }
  __name(require_stringToPath, "require_stringToPath");
  var _arrayMap;
  var hasRequired_arrayMap;
  function require_arrayMap() {
    if (hasRequired_arrayMap) return _arrayMap;
    hasRequired_arrayMap = 1;
    function arrayMap(array2, iteratee) {
      var index2 = -1, length = array2 == null ? 0 : array2.length, result = Array(length);
      while (++index2 < length) {
        result[index2] = iteratee(array2[index2], index2, array2);
      }
      return result;
    }
    __name(arrayMap, "arrayMap");
    _arrayMap = arrayMap;
    return _arrayMap;
  }
  __name(require_arrayMap, "require_arrayMap");
  var _baseToString;
  var hasRequired_baseToString;
  function require_baseToString() {
    if (hasRequired_baseToString) return _baseToString;
    hasRequired_baseToString = 1;
    var Symbol2 = require_Symbol(), arrayMap = require_arrayMap(), isArray2 = requireIsArray(), isSymbol = requireIsSymbol();
    var symbolProto2 = Symbol2 ? Symbol2.prototype : void 0, symbolToString = symbolProto2 ? symbolProto2.toString : void 0;
    function baseToString(value) {
      if (typeof value == "string") {
        return value;
      }
      if (isArray2(value)) {
        return arrayMap(value, baseToString) + "";
      }
      if (isSymbol(value)) {
        return symbolToString ? symbolToString.call(value) : "";
      }
      var result = value + "";
      return result == "0" && 1 / value == -Infinity ? "-0" : result;
    }
    __name(baseToString, "baseToString");
    _baseToString = baseToString;
    return _baseToString;
  }
  __name(require_baseToString, "require_baseToString");
  var toString_1;
  var hasRequiredToString;
  function requireToString() {
    if (hasRequiredToString) return toString_1;
    hasRequiredToString = 1;
    var baseToString = require_baseToString();
    function toString2(value) {
      return value == null ? "" : baseToString(value);
    }
    __name(toString2, "toString");
    toString_1 = toString2;
    return toString_1;
  }
  __name(requireToString, "requireToString");
  var _castPath;
  var hasRequired_castPath;
  function require_castPath() {
    if (hasRequired_castPath) return _castPath;
    hasRequired_castPath = 1;
    var isArray2 = requireIsArray(), isKey2 = require_isKey(), stringToPath2 = require_stringToPath(), toString2 = requireToString();
    function castPath(value, object2) {
      if (isArray2(value)) {
        return value;
      }
      return isKey2(value, object2) ? [value] : stringToPath2(toString2(value));
    }
    __name(castPath, "castPath");
    _castPath = castPath;
    return _castPath;
  }
  __name(require_castPath, "require_castPath");
  var _toKey;
  var hasRequired_toKey;
  function require_toKey() {
    if (hasRequired_toKey) return _toKey;
    hasRequired_toKey = 1;
    var isSymbol = requireIsSymbol();
    function toKey(value) {
      if (typeof value == "string" || isSymbol(value)) {
        return value;
      }
      var result = value + "";
      return result == "0" && 1 / value == -Infinity ? "-0" : result;
    }
    __name(toKey, "toKey");
    _toKey = toKey;
    return _toKey;
  }
  __name(require_toKey, "require_toKey");
  var _baseGet;
  var hasRequired_baseGet;
  function require_baseGet() {
    if (hasRequired_baseGet) return _baseGet;
    hasRequired_baseGet = 1;
    var castPath = require_castPath(), toKey = require_toKey();
    function baseGet2(object2, path) {
      path = castPath(path, object2);
      var index2 = 0, length = path.length;
      while (object2 != null && index2 < length) {
        object2 = object2[toKey(path[index2++])];
      }
      return index2 && index2 == length ? object2 : void 0;
    }
    __name(baseGet2, "baseGet");
    _baseGet = baseGet2;
    return _baseGet;
  }
  __name(require_baseGet, "require_baseGet");
  var get_1;
  var hasRequiredGet;
  function requireGet() {
    if (hasRequiredGet) return get_1;
    hasRequiredGet = 1;
    var baseGet2 = require_baseGet();
    function get2(object2, path, defaultValue) {
      var result = object2 == null ? void 0 : baseGet2(object2, path);
      return result === void 0 ? defaultValue : result;
    }
    __name(get2, "get");
    get_1 = get2;
    return get_1;
  }
  __name(requireGet, "requireGet");
  var getExports = requireGet();
  const get$1 = /* @__PURE__ */ getDefaultExportFromCjs(getExports);
  var isNil_1;
  var hasRequiredIsNil;
  function requireIsNil() {
    if (hasRequiredIsNil) return isNil_1;
    hasRequiredIsNil = 1;
    function isNil2(value) {
      return value == null;
    }
    __name(isNil2, "isNil");
    isNil_1 = isNil2;
    return isNil_1;
  }
  __name(requireIsNil, "requireIsNil");
  var isNilExports = requireIsNil();
  const isNil = /* @__PURE__ */ getDefaultExportFromCjs(isNilExports);
  var isString_1;
  var hasRequiredIsString;
  function requireIsString() {
    if (hasRequiredIsString) return isString_1;
    hasRequiredIsString = 1;
    var baseGetTag2 = require_baseGetTag(), isArray2 = requireIsArray(), isObjectLike2 = requireIsObjectLike();
    var stringTag2 = "[object String]";
    function isString2(value) {
      return typeof value == "string" || !isArray2(value) && isObjectLike2(value) && baseGetTag2(value) == stringTag2;
    }
    __name(isString2, "isString");
    isString_1 = isString2;
    return isString_1;
  }
  __name(requireIsString, "requireIsString");
  var isStringExports = requireIsString();
  const isString$1 = /* @__PURE__ */ getDefaultExportFromCjs(isStringExports);
  var isFunctionExports = requireIsFunction();
  const isFunction$2 = /* @__PURE__ */ getDefaultExportFromCjs(isFunctionExports);
  var isObjectExports = requireIsObject();
  const isObject$2 = /* @__PURE__ */ getDefaultExportFromCjs(isObjectExports);
  var reactIs = { exports: {} };
  var reactIs_production_min = {};
  /**
   * @license React
   * react-is.production.min.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  var hasRequiredReactIs_production_min;
  function requireReactIs_production_min() {
    if (hasRequiredReactIs_production_min) return reactIs_production_min;
    hasRequiredReactIs_production_min = 1;
    var b = Symbol.for("react.element"), c2 = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), e = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), h = Symbol.for("react.context"), k2 = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), m2 = Symbol.for("react.suspense"), n2 = Symbol.for("react.suspense_list"), p2 = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t2 = Symbol.for("react.offscreen"), u2;
    u2 = Symbol.for("react.module.reference");
    function v(a2) {
      if ("object" === typeof a2 && null !== a2) {
        var r2 = a2.$$typeof;
        switch (r2) {
          case b:
            switch (a2 = a2.type, a2) {
              case d:
              case f:
              case e:
              case m2:
              case n2:
                return a2;
              default:
                switch (a2 = a2 && a2.$$typeof, a2) {
                  case k2:
                  case h:
                  case l:
                  case q:
                  case p2:
                  case g:
                    return a2;
                  default:
                    return r2;
                }
            }
          case c2:
            return r2;
        }
      }
    }
    __name(v, "v");
    reactIs_production_min.ContextConsumer = h;
    reactIs_production_min.ContextProvider = g;
    reactIs_production_min.Element = b;
    reactIs_production_min.ForwardRef = l;
    reactIs_production_min.Fragment = d;
    reactIs_production_min.Lazy = q;
    reactIs_production_min.Memo = p2;
    reactIs_production_min.Portal = c2;
    reactIs_production_min.Profiler = f;
    reactIs_production_min.StrictMode = e;
    reactIs_production_min.Suspense = m2;
    reactIs_production_min.SuspenseList = n2;
    reactIs_production_min.isAsyncMode = function() {
      return false;
    };
    reactIs_production_min.isConcurrentMode = function() {
      return false;
    };
    reactIs_production_min.isContextConsumer = function(a2) {
      return v(a2) === h;
    };
    reactIs_production_min.isContextProvider = function(a2) {
      return v(a2) === g;
    };
    reactIs_production_min.isElement = function(a2) {
      return "object" === typeof a2 && null !== a2 && a2.$$typeof === b;
    };
    reactIs_production_min.isForwardRef = function(a2) {
      return v(a2) === l;
    };
    reactIs_production_min.isFragment = function(a2) {
      return v(a2) === d;
    };
    reactIs_production_min.isLazy = function(a2) {
      return v(a2) === q;
    };
    reactIs_production_min.isMemo = function(a2) {
      return v(a2) === p2;
    };
    reactIs_production_min.isPortal = function(a2) {
      return v(a2) === c2;
    };
    reactIs_production_min.isProfiler = function(a2) {
      return v(a2) === f;
    };
    reactIs_production_min.isStrictMode = function(a2) {
      return v(a2) === e;
    };
    reactIs_production_min.isSuspense = function(a2) {
      return v(a2) === m2;
    };
    reactIs_production_min.isSuspenseList = function(a2) {
      return v(a2) === n2;
    };
    reactIs_production_min.isValidElementType = function(a2) {
      return "string" === typeof a2 || "function" === typeof a2 || a2 === d || a2 === f || a2 === e || a2 === m2 || a2 === n2 || a2 === t2 || "object" === typeof a2 && null !== a2 && (a2.$$typeof === q || a2.$$typeof === p2 || a2.$$typeof === g || a2.$$typeof === h || a2.$$typeof === l || a2.$$typeof === u2 || void 0 !== a2.getModuleId) ? true : false;
    };
    reactIs_production_min.typeOf = v;
    return reactIs_production_min;
  }
  __name(requireReactIs_production_min, "requireReactIs_production_min");
  var hasRequiredReactIs;
  function requireReactIs() {
    if (hasRequiredReactIs) return reactIs.exports;
    hasRequiredReactIs = 1;
    {
      reactIs.exports = requireReactIs_production_min();
    }
    return reactIs.exports;
  }
  __name(requireReactIs, "requireReactIs");
  var reactIsExports = requireReactIs();
  var isNumber_1;
  var hasRequiredIsNumber;
  function requireIsNumber() {
    if (hasRequiredIsNumber) return isNumber_1;
    hasRequiredIsNumber = 1;
    var baseGetTag2 = require_baseGetTag(), isObjectLike2 = requireIsObjectLike();
    var numberTag2 = "[object Number]";
    function isNumber2(value) {
      return typeof value == "number" || isObjectLike2(value) && baseGetTag2(value) == numberTag2;
    }
    __name(isNumber2, "isNumber");
    isNumber_1 = isNumber2;
    return isNumber_1;
  }
  __name(requireIsNumber, "requireIsNumber");
  var _isNaN;
  var hasRequired_isNaN;
  function require_isNaN() {
    if (hasRequired_isNaN) return _isNaN;
    hasRequired_isNaN = 1;
    var isNumber2 = requireIsNumber();
    function isNaN2(value) {
      return isNumber2(value) && value != +value;
    }
    __name(isNaN2, "isNaN");
    _isNaN = isNaN2;
    return _isNaN;
  }
  __name(require_isNaN, "require_isNaN");
  var _isNaNExports = require_isNaN();
  const isNan = /* @__PURE__ */ getDefaultExportFromCjs(_isNaNExports);
  var isNumberExports = requireIsNumber();
  const isNumber$1 = /* @__PURE__ */ getDefaultExportFromCjs(isNumberExports);
  var mathSign = /* @__PURE__ */ __name(function mathSign2(value) {
    if (value === 0) {
      return 0;
    }
    if (value > 0) {
      return 1;
    }
    return -1;
  }, "mathSign");
  var isPercent = /* @__PURE__ */ __name(function isPercent2(value) {
    return isString$1(value) && value.indexOf("%") === value.length - 1;
  }, "isPercent");
  var isNumber = /* @__PURE__ */ __name(function isNumber2(value) {
    return isNumber$1(value) && !isNan(value);
  }, "isNumber");
  var isNullish = /* @__PURE__ */ __name(function isNullish2(value) {
    return isNil(value);
  }, "isNullish");
  var isNumOrStr = /* @__PURE__ */ __name(function isNumOrStr2(value) {
    return isNumber(value) || isString$1(value);
  }, "isNumOrStr");
  var idCounter = 0;
  var uniqueId = /* @__PURE__ */ __name(function uniqueId2(prefix2) {
    var id = ++idCounter;
    return "".concat(prefix2 || "").concat(id);
  }, "uniqueId");
  var getPercentValue = /* @__PURE__ */ __name(function getPercentValue2(percent, totalValue) {
    var defaultValue = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
    var validate = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
    if (!isNumber(percent) && !isString$1(percent)) {
      return defaultValue;
    }
    var value;
    if (isPercent(percent)) {
      var index2 = percent.indexOf("%");
      value = totalValue * parseFloat(percent.slice(0, index2)) / 100;
    } else {
      value = +percent;
    }
    if (isNan(value)) {
      value = defaultValue;
    }
    if (validate && value > totalValue) {
      value = totalValue;
    }
    return value;
  }, "getPercentValue");
  var getAnyElementOfObject = /* @__PURE__ */ __name(function getAnyElementOfObject2(obj) {
    if (!obj) {
      return null;
    }
    var keys2 = Object.keys(obj);
    if (keys2 && keys2.length) {
      return obj[keys2[0]];
    }
    return null;
  }, "getAnyElementOfObject");
  var hasDuplicate = /* @__PURE__ */ __name(function hasDuplicate2(ary) {
    if (!Array.isArray(ary)) {
      return false;
    }
    var len = ary.length;
    var cache = {};
    for (var i2 = 0; i2 < len; i2++) {
      if (!cache[ary[i2]]) {
        cache[ary[i2]] = true;
      } else {
        return true;
      }
    }
    return false;
  }, "hasDuplicate");
  var interpolateNumber$2 = /* @__PURE__ */ __name(function interpolateNumber2(numberA, numberB) {
    if (isNumber(numberA) && isNumber(numberB)) {
      return function(t2) {
        return numberA + t2 * (numberB - numberA);
      };
    }
    return function() {
      return numberB;
    };
  }, "interpolateNumber");
  function findEntryInArray(ary, specifiedKey, specifiedValue) {
    if (!ary || !ary.length) {
      return null;
    }
    return ary.find(function(entry) {
      return entry && (typeof specifiedKey === "function" ? specifiedKey(entry) : get$1(entry, specifiedKey)) === specifiedValue;
    });
  }
  __name(findEntryInArray, "findEntryInArray");
  var compareValues = /* @__PURE__ */ __name(function compareValues2(a2, b) {
    if (isNumber(a2) && isNumber(b)) {
      return a2 - b;
    }
    if (isString$1(a2) && isString$1(b)) {
      return a2.localeCompare(b);
    }
    if (a2 instanceof Date && b instanceof Date) {
      return a2.getTime() - b.getTime();
    }
    return String(a2).localeCompare(String(b));
  }, "compareValues");
  function shallowEqual(a2, b) {
    for (var key in a2) {
      if ({}.hasOwnProperty.call(a2, key) && (!{}.hasOwnProperty.call(b, key) || a2[key] !== b[key])) {
        return false;
      }
    }
    for (var _key in b) {
      if ({}.hasOwnProperty.call(b, _key) && !{}.hasOwnProperty.call(a2, _key)) {
        return false;
      }
    }
    return true;
  }
  __name(shallowEqual, "shallowEqual");
  function _typeof$L(o2) {
    "@babel/helpers - typeof";
    return _typeof$L = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$L(o2);
  }
  __name(_typeof$L, "_typeof$L");
  var SVGContainerPropKeys = ["viewBox", "children"];
  var SVGElementPropKeys = [
    "aria-activedescendant",
    "aria-atomic",
    "aria-autocomplete",
    "aria-busy",
    "aria-checked",
    "aria-colcount",
    "aria-colindex",
    "aria-colspan",
    "aria-controls",
    "aria-current",
    "aria-describedby",
    "aria-details",
    "aria-disabled",
    "aria-errormessage",
    "aria-expanded",
    "aria-flowto",
    "aria-haspopup",
    "aria-hidden",
    "aria-invalid",
    "aria-keyshortcuts",
    "aria-label",
    "aria-labelledby",
    "aria-level",
    "aria-live",
    "aria-modal",
    "aria-multiline",
    "aria-multiselectable",
    "aria-orientation",
    "aria-owns",
    "aria-placeholder",
    "aria-posinset",
    "aria-pressed",
    "aria-readonly",
    "aria-relevant",
    "aria-required",
    "aria-roledescription",
    "aria-rowcount",
    "aria-rowindex",
    "aria-rowspan",
    "aria-selected",
    "aria-setsize",
    "aria-sort",
    "aria-valuemax",
    "aria-valuemin",
    "aria-valuenow",
    "aria-valuetext",
    "className",
    "color",
    "height",
    "id",
    "lang",
    "max",
    "media",
    "method",
    "min",
    "name",
    "style",
    /*
     * removed 'type' SVGElementPropKey because we do not currently use any SVG elements
     * that can use it and it conflicts with the recharts prop 'type'
     * https://github.com/recharts/recharts/pull/3327
     * https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/type
     */
    // 'type',
    "target",
    "width",
    "role",
    "tabIndex",
    "accentHeight",
    "accumulate",
    "additive",
    "alignmentBaseline",
    "allowReorder",
    "alphabetic",
    "amplitude",
    "arabicForm",
    "ascent",
    "attributeName",
    "attributeType",
    "autoReverse",
    "azimuth",
    "baseFrequency",
    "baselineShift",
    "baseProfile",
    "bbox",
    "begin",
    "bias",
    "by",
    "calcMode",
    "capHeight",
    "clip",
    "clipPath",
    "clipPathUnits",
    "clipRule",
    "colorInterpolation",
    "colorInterpolationFilters",
    "colorProfile",
    "colorRendering",
    "contentScriptType",
    "contentStyleType",
    "cursor",
    "cx",
    "cy",
    "d",
    "decelerate",
    "descent",
    "diffuseConstant",
    "direction",
    "display",
    "divisor",
    "dominantBaseline",
    "dur",
    "dx",
    "dy",
    "edgeMode",
    "elevation",
    "enableBackground",
    "end",
    "exponent",
    "externalResourcesRequired",
    "fill",
    "fillOpacity",
    "fillRule",
    "filter",
    "filterRes",
    "filterUnits",
    "floodColor",
    "floodOpacity",
    "focusable",
    "fontFamily",
    "fontSize",
    "fontSizeAdjust",
    "fontStretch",
    "fontStyle",
    "fontVariant",
    "fontWeight",
    "format",
    "from",
    "fx",
    "fy",
    "g1",
    "g2",
    "glyphName",
    "glyphOrientationHorizontal",
    "glyphOrientationVertical",
    "glyphRef",
    "gradientTransform",
    "gradientUnits",
    "hanging",
    "horizAdvX",
    "horizOriginX",
    "href",
    "ideographic",
    "imageRendering",
    "in2",
    "in",
    "intercept",
    "k1",
    "k2",
    "k3",
    "k4",
    "k",
    "kernelMatrix",
    "kernelUnitLength",
    "kerning",
    "keyPoints",
    "keySplines",
    "keyTimes",
    "lengthAdjust",
    "letterSpacing",
    "lightingColor",
    "limitingConeAngle",
    "local",
    "markerEnd",
    "markerHeight",
    "markerMid",
    "markerStart",
    "markerUnits",
    "markerWidth",
    "mask",
    "maskContentUnits",
    "maskUnits",
    "mathematical",
    "mode",
    "numOctaves",
    "offset",
    "opacity",
    "operator",
    "order",
    "orient",
    "orientation",
    "origin",
    "overflow",
    "overlinePosition",
    "overlineThickness",
    "paintOrder",
    "panose1",
    "pathLength",
    "patternContentUnits",
    "patternTransform",
    "patternUnits",
    "pointerEvents",
    "pointsAtX",
    "pointsAtY",
    "pointsAtZ",
    "preserveAlpha",
    "preserveAspectRatio",
    "primitiveUnits",
    "r",
    "radius",
    "refX",
    "refY",
    "renderingIntent",
    "repeatCount",
    "repeatDur",
    "requiredExtensions",
    "requiredFeatures",
    "restart",
    "result",
    "rotate",
    "rx",
    "ry",
    "seed",
    "shapeRendering",
    "slope",
    "spacing",
    "specularConstant",
    "specularExponent",
    "speed",
    "spreadMethod",
    "startOffset",
    "stdDeviation",
    "stemh",
    "stemv",
    "stitchTiles",
    "stopColor",
    "stopOpacity",
    "strikethroughPosition",
    "strikethroughThickness",
    "string",
    "stroke",
    "strokeDasharray",
    "strokeDashoffset",
    "strokeLinecap",
    "strokeLinejoin",
    "strokeMiterlimit",
    "strokeOpacity",
    "strokeWidth",
    "surfaceScale",
    "systemLanguage",
    "tableValues",
    "targetX",
    "targetY",
    "textAnchor",
    "textDecoration",
    "textLength",
    "textRendering",
    "to",
    "transform",
    "u1",
    "u2",
    "underlinePosition",
    "underlineThickness",
    "unicode",
    "unicodeBidi",
    "unicodeRange",
    "unitsPerEm",
    "vAlphabetic",
    "values",
    "vectorEffect",
    "version",
    "vertAdvY",
    "vertOriginX",
    "vertOriginY",
    "vHanging",
    "vIdeographic",
    "viewTarget",
    "visibility",
    "vMathematical",
    "widths",
    "wordSpacing",
    "writingMode",
    "x1",
    "x2",
    "x",
    "xChannelSelector",
    "xHeight",
    "xlinkActuate",
    "xlinkArcrole",
    "xlinkHref",
    "xlinkRole",
    "xlinkShow",
    "xlinkTitle",
    "xlinkType",
    "xmlBase",
    "xmlLang",
    "xmlns",
    "xmlnsXlink",
    "xmlSpace",
    "y1",
    "y2",
    "y",
    "yChannelSelector",
    "z",
    "zoomAndPan",
    "ref",
    "key",
    "angle"
  ];
  var PolyElementKeys = ["points", "pathLength"];
  var FilteredElementKeyMap = {
    svg: SVGContainerPropKeys,
    polygon: PolyElementKeys,
    polyline: PolyElementKeys
  };
  var EventKeys = ["dangerouslySetInnerHTML", "onCopy", "onCopyCapture", "onCut", "onCutCapture", "onPaste", "onPasteCapture", "onCompositionEnd", "onCompositionEndCapture", "onCompositionStart", "onCompositionStartCapture", "onCompositionUpdate", "onCompositionUpdateCapture", "onFocus", "onFocusCapture", "onBlur", "onBlurCapture", "onChange", "onChangeCapture", "onBeforeInput", "onBeforeInputCapture", "onInput", "onInputCapture", "onReset", "onResetCapture", "onSubmit", "onSubmitCapture", "onInvalid", "onInvalidCapture", "onLoad", "onLoadCapture", "onError", "onErrorCapture", "onKeyDown", "onKeyDownCapture", "onKeyPress", "onKeyPressCapture", "onKeyUp", "onKeyUpCapture", "onAbort", "onAbortCapture", "onCanPlay", "onCanPlayCapture", "onCanPlayThrough", "onCanPlayThroughCapture", "onDurationChange", "onDurationChangeCapture", "onEmptied", "onEmptiedCapture", "onEncrypted", "onEncryptedCapture", "onEnded", "onEndedCapture", "onLoadedData", "onLoadedDataCapture", "onLoadedMetadata", "onLoadedMetadataCapture", "onLoadStart", "onLoadStartCapture", "onPause", "onPauseCapture", "onPlay", "onPlayCapture", "onPlaying", "onPlayingCapture", "onProgress", "onProgressCapture", "onRateChange", "onRateChangeCapture", "onSeeked", "onSeekedCapture", "onSeeking", "onSeekingCapture", "onStalled", "onStalledCapture", "onSuspend", "onSuspendCapture", "onTimeUpdate", "onTimeUpdateCapture", "onVolumeChange", "onVolumeChangeCapture", "onWaiting", "onWaitingCapture", "onAuxClick", "onAuxClickCapture", "onClick", "onClickCapture", "onContextMenu", "onContextMenuCapture", "onDoubleClick", "onDoubleClickCapture", "onDrag", "onDragCapture", "onDragEnd", "onDragEndCapture", "onDragEnter", "onDragEnterCapture", "onDragExit", "onDragExitCapture", "onDragLeave", "onDragLeaveCapture", "onDragOver", "onDragOverCapture", "onDragStart", "onDragStartCapture", "onDrop", "onDropCapture", "onMouseDown", "onMouseDownCapture", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseMoveCapture", "onMouseOut", "onMouseOutCapture", "onMouseOver", "onMouseOverCapture", "onMouseUp", "onMouseUpCapture", "onSelect", "onSelectCapture", "onTouchCancel", "onTouchCancelCapture", "onTouchEnd", "onTouchEndCapture", "onTouchMove", "onTouchMoveCapture", "onTouchStart", "onTouchStartCapture", "onPointerDown", "onPointerDownCapture", "onPointerMove", "onPointerMoveCapture", "onPointerUp", "onPointerUpCapture", "onPointerCancel", "onPointerCancelCapture", "onPointerEnter", "onPointerEnterCapture", "onPointerLeave", "onPointerLeaveCapture", "onPointerOver", "onPointerOverCapture", "onPointerOut", "onPointerOutCapture", "onGotPointerCapture", "onGotPointerCaptureCapture", "onLostPointerCapture", "onLostPointerCaptureCapture", "onScroll", "onScrollCapture", "onWheel", "onWheelCapture", "onAnimationStart", "onAnimationStartCapture", "onAnimationEnd", "onAnimationEndCapture", "onAnimationIteration", "onAnimationIterationCapture", "onTransitionEnd", "onTransitionEndCapture"];
  var adaptEventHandlers = /* @__PURE__ */ __name(function adaptEventHandlers2(props, newHandler) {
    if (!props || typeof props === "function" || typeof props === "boolean") {
      return null;
    }
    var inputProps = props;
    if (/* @__PURE__ */ reactExports.isValidElement(props)) {
      inputProps = props.props;
    }
    if (!isObject$2(inputProps)) {
      return null;
    }
    var out = {};
    Object.keys(inputProps).forEach(function(key) {
      if (EventKeys.includes(key)) {
        out[key] = newHandler || function(e) {
          return inputProps[key](inputProps, e);
        };
      }
    });
    return out;
  }, "adaptEventHandlers");
  var getEventHandlerOfChild = /* @__PURE__ */ __name(function getEventHandlerOfChild2(originalHandler, data, index2) {
    return function(e) {
      originalHandler(data, index2, e);
      return null;
    };
  }, "getEventHandlerOfChild");
  var adaptEventsOfChild = /* @__PURE__ */ __name(function adaptEventsOfChild2(props, data, index2) {
    if (!isObject$2(props) || _typeof$L(props) !== "object") {
      return null;
    }
    var out = null;
    Object.keys(props).forEach(function(key) {
      var item = props[key];
      if (EventKeys.includes(key) && typeof item === "function") {
        if (!out) out = {};
        out[key] = getEventHandlerOfChild(item, data, index2);
      }
    });
    return out;
  }, "adaptEventsOfChild");
  var _excluded$j = ["children"], _excluded2$7 = ["children"];
  function _objectWithoutProperties$j(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$j(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$j, "_objectWithoutProperties$j");
  function _objectWithoutPropertiesLoose$j(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$j, "_objectWithoutPropertiesLoose$j");
  function _typeof$K(o2) {
    "@babel/helpers - typeof";
    return _typeof$K = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$K(o2);
  }
  __name(_typeof$K, "_typeof$K");
  var REACT_BROWSER_EVENT_MAP = {
    click: "onClick",
    mousedown: "onMouseDown",
    mouseup: "onMouseUp",
    mouseover: "onMouseOver",
    mousemove: "onMouseMove",
    mouseout: "onMouseOut",
    mouseenter: "onMouseEnter",
    mouseleave: "onMouseLeave",
    touchcancel: "onTouchCancel",
    touchend: "onTouchEnd",
    touchmove: "onTouchMove",
    touchstart: "onTouchStart",
    contextmenu: "onContextMenu",
    dblclick: "onDoubleClick"
  };
  var getDisplayName = /* @__PURE__ */ __name(function getDisplayName2(Comp) {
    if (typeof Comp === "string") {
      return Comp;
    }
    if (!Comp) {
      return "";
    }
    return Comp.displayName || Comp.name || "Component";
  }, "getDisplayName");
  var lastChildren = null;
  var lastResult = null;
  var toArray = /* @__PURE__ */ __name(function toArray2(children) {
    if (children === lastChildren && Array.isArray(lastResult)) {
      return lastResult;
    }
    var result = [];
    reactExports.Children.forEach(children, function(child) {
      if (isNil(child)) return;
      if (reactIsExports.isFragment(child)) {
        result = result.concat(toArray2(child.props.children));
      } else {
        result.push(child);
      }
    });
    lastResult = result;
    lastChildren = children;
    return result;
  }, "toArray");
  function findAllByType(children, type) {
    var result = [];
    var types = [];
    if (Array.isArray(type)) {
      types = type.map(function(t2) {
        return getDisplayName(t2);
      });
    } else {
      types = [getDisplayName(type)];
    }
    toArray(children).forEach(function(child) {
      var childType = get$1(child, "type.displayName") || get$1(child, "type.name");
      if (types.indexOf(childType) !== -1) {
        result.push(child);
      }
    });
    return result;
  }
  __name(findAllByType, "findAllByType");
  function findChildByType(children, type) {
    var result = findAllByType(children, type);
    return result && result[0];
  }
  __name(findChildByType, "findChildByType");
  var validateWidthHeight = /* @__PURE__ */ __name(function validateWidthHeight2(el) {
    if (!el || !el.props) {
      return false;
    }
    var _el$props = el.props, width = _el$props.width, height = _el$props.height;
    if (!isNumber(width) || width <= 0 || !isNumber(height) || height <= 0) {
      return false;
    }
    return true;
  }, "validateWidthHeight");
  var SVG_TAGS = ["a", "altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColormatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "font", "font-face", "font-face-format", "font-face-name", "font-face-url", "foreignObject", "g", "glyph", "glyphRef", "hkern", "image", "line", "lineGradient", "marker", "mask", "metadata", "missing-glyph", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "script", "set", "stop", "style", "svg", "switch", "symbol", "text", "textPath", "title", "tref", "tspan", "use", "view", "vkern"];
  var isSvgElement = /* @__PURE__ */ __name(function isSvgElement2(child) {
    return child && child.type && isString$1(child.type) && SVG_TAGS.indexOf(child.type) >= 0;
  }, "isSvgElement");
  var hasClipDot = /* @__PURE__ */ __name(function hasClipDot2(dot) {
    return dot && _typeof$K(dot) === "object" && "clipDot" in dot;
  }, "hasClipDot");
  var isValidSpreadableProp = /* @__PURE__ */ __name(function isValidSpreadableProp2(property, key, includeEvents, svgElementType) {
    var _FilteredElementKeyMa;
    var matchingElementTypeKeys = (_FilteredElementKeyMa = FilteredElementKeyMap === null || FilteredElementKeyMap === void 0 ? void 0 : FilteredElementKeyMap[svgElementType]) !== null && _FilteredElementKeyMa !== void 0 ? _FilteredElementKeyMa : [];
    return key.startsWith("data-") || !isFunction$2(property) && (svgElementType && matchingElementTypeKeys.includes(key) || SVGElementPropKeys.includes(key)) || includeEvents && EventKeys.includes(key);
  }, "isValidSpreadableProp");
  var filterProps = /* @__PURE__ */ __name(function filterProps2(props, includeEvents, svgElementType) {
    if (!props || typeof props === "function" || typeof props === "boolean") {
      return null;
    }
    var inputProps = props;
    if (/* @__PURE__ */ reactExports.isValidElement(props)) {
      inputProps = props.props;
    }
    if (!isObject$2(inputProps)) {
      return null;
    }
    var out = {};
    Object.keys(inputProps).forEach(function(key) {
      var _inputProps;
      if (isValidSpreadableProp((_inputProps = inputProps) === null || _inputProps === void 0 ? void 0 : _inputProps[key], key, includeEvents, svgElementType)) {
        out[key] = inputProps[key];
      }
    });
    return out;
  }, "filterProps");
  var isChildrenEqual = /* @__PURE__ */ __name(function isChildrenEqual2(nextChildren, prevChildren) {
    if (nextChildren === prevChildren) {
      return true;
    }
    var count2 = reactExports.Children.count(nextChildren);
    if (count2 !== reactExports.Children.count(prevChildren)) {
      return false;
    }
    if (count2 === 0) {
      return true;
    }
    if (count2 === 1) {
      return isSingleChildEqual(Array.isArray(nextChildren) ? nextChildren[0] : nextChildren, Array.isArray(prevChildren) ? prevChildren[0] : prevChildren);
    }
    for (var i2 = 0; i2 < count2; i2++) {
      var nextChild = nextChildren[i2];
      var prevChild = prevChildren[i2];
      if (Array.isArray(nextChild) || Array.isArray(prevChild)) {
        if (!isChildrenEqual2(nextChild, prevChild)) {
          return false;
        }
      } else if (!isSingleChildEqual(nextChild, prevChild)) {
        return false;
      }
    }
    return true;
  }, "isChildrenEqual");
  var isSingleChildEqual = /* @__PURE__ */ __name(function isSingleChildEqual2(nextChild, prevChild) {
    if (isNil(nextChild) && isNil(prevChild)) {
      return true;
    }
    if (!isNil(nextChild) && !isNil(prevChild)) {
      var _ref = nextChild.props || {}, nextChildren = _ref.children, nextProps = _objectWithoutProperties$j(_ref, _excluded$j);
      var _ref2 = prevChild.props || {}, prevChildren = _ref2.children, prevProps = _objectWithoutProperties$j(_ref2, _excluded2$7);
      if (nextChildren && prevChildren) {
        return shallowEqual(nextProps, prevProps) && isChildrenEqual(nextChildren, prevChildren);
      }
      if (!nextChildren && !prevChildren) {
        return shallowEqual(nextProps, prevProps);
      }
      return false;
    }
    return false;
  }, "isSingleChildEqual");
  var renderByOrder = /* @__PURE__ */ __name(function renderByOrder2(children, renderMap) {
    var elements = [];
    var record = {};
    toArray(children).forEach(function(child, index2) {
      if (isSvgElement(child)) {
        elements.push(child);
      } else if (child) {
        var displayName2 = getDisplayName(child.type);
        var _ref3 = renderMap[displayName2] || {}, handler = _ref3.handler, once = _ref3.once;
        if (handler && (!once || !record[displayName2])) {
          var results = handler(child, displayName2, index2);
          elements.push(results);
          record[displayName2] = true;
        }
      }
    });
    return elements;
  }, "renderByOrder");
  var getReactEventByType = /* @__PURE__ */ __name(function getReactEventByType2(e) {
    var type = e && e.type;
    if (type && REACT_BROWSER_EVENT_MAP[type]) {
      return REACT_BROWSER_EVENT_MAP[type];
    }
    return null;
  }, "getReactEventByType");
  var parseChildIndex = /* @__PURE__ */ __name(function parseChildIndex2(child, children) {
    return toArray(children).indexOf(child);
  }, "parseChildIndex");
  var _excluded$i = ["children", "width", "height", "viewBox", "className", "style", "title", "desc"];
  function _extends$u() {
    _extends$u = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$u.apply(this, arguments);
  }
  __name(_extends$u, "_extends$u");
  function _objectWithoutProperties$i(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$i(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$i, "_objectWithoutProperties$i");
  function _objectWithoutPropertiesLoose$i(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$i, "_objectWithoutPropertiesLoose$i");
  function Surface(props) {
    var children = props.children, width = props.width, height = props.height, viewBox = props.viewBox, className = props.className, style = props.style, title = props.title, desc = props.desc, others = _objectWithoutProperties$i(props, _excluded$i);
    var svgView = viewBox || {
      width,
      height,
      x: 0,
      y: 0
    };
    var layerClass = clsx("recharts-surface", className);
    return /* @__PURE__ */ React.createElement("svg", _extends$u({}, filterProps(others, true, "svg"), {
      className: layerClass,
      width,
      height,
      style,
      viewBox: "".concat(svgView.x, " ").concat(svgView.y, " ").concat(svgView.width, " ").concat(svgView.height)
    }), /* @__PURE__ */ React.createElement("title", null, title), /* @__PURE__ */ React.createElement("desc", null, desc), children);
  }
  __name(Surface, "Surface");
  var _excluded$h = ["children", "className"];
  function _extends$t() {
    _extends$t = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$t.apply(this, arguments);
  }
  __name(_extends$t, "_extends$t");
  function _objectWithoutProperties$h(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$h(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$h, "_objectWithoutProperties$h");
  function _objectWithoutPropertiesLoose$h(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$h, "_objectWithoutPropertiesLoose$h");
  var Layer = /* @__PURE__ */ React.forwardRef(function(props, ref) {
    var children = props.children, className = props.className, others = _objectWithoutProperties$h(props, _excluded$h);
    var layerClass = clsx("recharts-layer", className);
    return /* @__PURE__ */ React.createElement("g", _extends$t({
      className: layerClass
    }, filterProps(others, true), {
      ref
    }), children);
  });
  var warn = /* @__PURE__ */ __name(function warn2(condition, format2) {
    for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
      args[_key - 2] = arguments[_key];
    }
  }, "warn2");
  var _baseSlice;
  var hasRequired_baseSlice;
  function require_baseSlice() {
    if (hasRequired_baseSlice) return _baseSlice;
    hasRequired_baseSlice = 1;
    function baseSlice(array2, start, end) {
      var index2 = -1, length = array2.length;
      if (start < 0) {
        start = -start > length ? 0 : length + start;
      }
      end = end > length ? length : end;
      if (end < 0) {
        end += length;
      }
      length = start > end ? 0 : end - start >>> 0;
      start >>>= 0;
      var result = Array(length);
      while (++index2 < length) {
        result[index2] = array2[index2 + start];
      }
      return result;
    }
    __name(baseSlice, "baseSlice");
    _baseSlice = baseSlice;
    return _baseSlice;
  }
  __name(require_baseSlice, "require_baseSlice");
  var _castSlice;
  var hasRequired_castSlice;
  function require_castSlice() {
    if (hasRequired_castSlice) return _castSlice;
    hasRequired_castSlice = 1;
    var baseSlice = require_baseSlice();
    function castSlice(array2, start, end) {
      var length = array2.length;
      end = end === void 0 ? length : end;
      return !start && end >= length ? array2 : baseSlice(array2, start, end);
    }
    __name(castSlice, "castSlice");
    _castSlice = castSlice;
    return _castSlice;
  }
  __name(require_castSlice, "require_castSlice");
  var _hasUnicode;
  var hasRequired_hasUnicode;
  function require_hasUnicode() {
    if (hasRequired_hasUnicode) return _hasUnicode;
    hasRequired_hasUnicode = 1;
    var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = "\\ufe0e\\ufe0f";
    var rsZWJ = "\\u200d";
    var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
    function hasUnicode(string2) {
      return reHasUnicode.test(string2);
    }
    __name(hasUnicode, "hasUnicode");
    _hasUnicode = hasUnicode;
    return _hasUnicode;
  }
  __name(require_hasUnicode, "require_hasUnicode");
  var _asciiToArray;
  var hasRequired_asciiToArray;
  function require_asciiToArray() {
    if (hasRequired_asciiToArray) return _asciiToArray;
    hasRequired_asciiToArray = 1;
    function asciiToArray(string2) {
      return string2.split("");
    }
    __name(asciiToArray, "asciiToArray");
    _asciiToArray = asciiToArray;
    return _asciiToArray;
  }
  __name(require_asciiToArray, "require_asciiToArray");
  var _unicodeToArray;
  var hasRequired_unicodeToArray;
  function require_unicodeToArray() {
    if (hasRequired_unicodeToArray) return _unicodeToArray;
    hasRequired_unicodeToArray = 1;
    var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = "\\ufe0e\\ufe0f";
    var rsAstral = "[" + rsAstralRange + "]", rsCombo = "[" + rsComboRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsZWJ = "\\u200d";
    var reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
    var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
    function unicodeToArray(string2) {
      return string2.match(reUnicode) || [];
    }
    __name(unicodeToArray, "unicodeToArray");
    _unicodeToArray = unicodeToArray;
    return _unicodeToArray;
  }
  __name(require_unicodeToArray, "require_unicodeToArray");
  var _stringToArray;
  var hasRequired_stringToArray;
  function require_stringToArray() {
    if (hasRequired_stringToArray) return _stringToArray;
    hasRequired_stringToArray = 1;
    var asciiToArray = require_asciiToArray(), hasUnicode = require_hasUnicode(), unicodeToArray = require_unicodeToArray();
    function stringToArray(string2) {
      return hasUnicode(string2) ? unicodeToArray(string2) : asciiToArray(string2);
    }
    __name(stringToArray, "stringToArray");
    _stringToArray = stringToArray;
    return _stringToArray;
  }
  __name(require_stringToArray, "require_stringToArray");
  var _createCaseFirst;
  var hasRequired_createCaseFirst;
  function require_createCaseFirst() {
    if (hasRequired_createCaseFirst) return _createCaseFirst;
    hasRequired_createCaseFirst = 1;
    var castSlice = require_castSlice(), hasUnicode = require_hasUnicode(), stringToArray = require_stringToArray(), toString2 = requireToString();
    function createCaseFirst(methodName) {
      return function(string2) {
        string2 = toString2(string2);
        var strSymbols = hasUnicode(string2) ? stringToArray(string2) : void 0;
        var chr = strSymbols ? strSymbols[0] : string2.charAt(0);
        var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string2.slice(1);
        return chr[methodName]() + trailing;
      };
    }
    __name(createCaseFirst, "createCaseFirst");
    _createCaseFirst = createCaseFirst;
    return _createCaseFirst;
  }
  __name(require_createCaseFirst, "require_createCaseFirst");
  var upperFirst_1;
  var hasRequiredUpperFirst;
  function requireUpperFirst() {
    if (hasRequiredUpperFirst) return upperFirst_1;
    hasRequiredUpperFirst = 1;
    var createCaseFirst = require_createCaseFirst();
    var upperFirst2 = createCaseFirst("toUpperCase");
    upperFirst_1 = upperFirst2;
    return upperFirst_1;
  }
  __name(requireUpperFirst, "requireUpperFirst");
  var upperFirstExports = requireUpperFirst();
  const upperFirst = /* @__PURE__ */ getDefaultExportFromCjs(upperFirstExports);
  function constant$1(x2) {
    return /* @__PURE__ */ __name(function constant2() {
      return x2;
    }, "constant");
  }
  __name(constant$1, "constant$1");
  const cos = Math.cos;
  const sin = Math.sin;
  const sqrt$1 = Math.sqrt;
  const pi$1 = Math.PI;
  const tau$1 = 2 * pi$1;
  const pi = Math.PI, tau = 2 * pi, epsilon = 1e-6, tauEpsilon = tau - epsilon;
  function append(strings) {
    this._ += strings[0];
    for (let i2 = 1, n2 = strings.length; i2 < n2; ++i2) {
      this._ += arguments[i2] + strings[i2];
    }
  }
  __name(append, "append");
  function appendRound(digits) {
    let d = Math.floor(digits);
    if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);
    if (d > 15) return append;
    const k2 = __pow(10, d);
    return function(strings) {
      this._ += strings[0];
      for (let i2 = 1, n2 = strings.length; i2 < n2; ++i2) {
        this._ += Math.round(arguments[i2] * k2) / k2 + strings[i2];
      }
    };
  }
  __name(appendRound, "appendRound");
  const _Path = class _Path {
    constructor(digits) {
      this._x0 = this._y0 = // start of current subpath
      this._x1 = this._y1 = null;
      this._ = "";
      this._append = digits == null ? append : appendRound(digits);
    }
    moveTo(x2, y2) {
      this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}`;
    }
    closePath() {
      if (this._x1 !== null) {
        this._x1 = this._x0, this._y1 = this._y0;
        this._append`Z`;
      }
    }
    lineTo(x2, y2) {
      this._append`L${this._x1 = +x2},${this._y1 = +y2}`;
    }
    quadraticCurveTo(x1, y1, x2, y2) {
      this._append`Q${+x1},${+y1},${this._x1 = +x2},${this._y1 = +y2}`;
    }
    bezierCurveTo(x1, y1, x2, y2, x3, y3) {
      this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x3},${this._y1 = +y3}`;
    }
    arcTo(x1, y1, x2, y2, r2) {
      x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r2 = +r2;
      if (r2 < 0) throw new Error(`negative radius: ${r2}`);
      let x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01;
      if (this._x1 === null) {
        this._append`M${this._x1 = x1},${this._y1 = y1}`;
      } else if (!(l01_2 > epsilon)) ;
      else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r2) {
        this._append`L${this._x1 = x1},${this._y1 = y1}`;
      } else {
        let x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r2 * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21;
        if (Math.abs(t01 - 1) > epsilon) {
          this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;
        }
        this._append`A${r2},${r2},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;
      }
    }
    arc(x2, y2, r2, a0, a1, ccw) {
      x2 = +x2, y2 = +y2, r2 = +r2, ccw = !!ccw;
      if (r2 < 0) throw new Error(`negative radius: ${r2}`);
      let dx = r2 * Math.cos(a0), dy = r2 * Math.sin(a0), x0 = x2 + dx, y0 = y2 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0;
      if (this._x1 === null) {
        this._append`M${x0},${y0}`;
      } else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {
        this._append`L${x0},${y0}`;
      }
      if (!r2) return;
      if (da < 0) da = da % tau + tau;
      if (da > tauEpsilon) {
        this._append`A${r2},${r2},0,1,${cw},${x2 - dx},${y2 - dy}A${r2},${r2},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;
      } else if (da > epsilon) {
        this._append`A${r2},${r2},0,${+(da >= pi)},${cw},${this._x1 = x2 + r2 * Math.cos(a1)},${this._y1 = y2 + r2 * Math.sin(a1)}`;
      }
    }
    rect(x2, y2, w, h) {
      this._append`M${this._x0 = this._x1 = +x2},${this._y0 = this._y1 = +y2}h${w = +w}v${+h}h${-w}Z`;
    }
    toString() {
      return this._;
    }
  };
  __name(_Path, "Path");
  let Path = _Path;
  function withPath(shape) {
    let digits = 3;
    shape.digits = function(_) {
      if (!arguments.length) return digits;
      if (_ == null) {
        digits = null;
      } else {
        const d = Math.floor(_);
        if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);
        digits = d;
      }
      return shape;
    };
    return () => new Path(digits);
  }
  __name(withPath, "withPath");
  function array(x2) {
    return typeof x2 === "object" && "length" in x2 ? x2 : Array.from(x2);
  }
  __name(array, "array");
  function Linear(context) {
    this._context = context;
  }
  __name(Linear, "Linear");
  Linear.prototype = {
    areaStart: /* @__PURE__ */ __name(function() {
      this._line = 0;
    }, "areaStart"),
    areaEnd: /* @__PURE__ */ __name(function() {
      this._line = NaN;
    }, "areaEnd"),
    lineStart: /* @__PURE__ */ __name(function() {
      this._point = 0;
    }, "lineStart"),
    lineEnd: /* @__PURE__ */ __name(function() {
      if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
      this._line = 1 - this._line;
    }, "lineEnd"),
    point: /* @__PURE__ */ __name(function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
        // falls through
        default:
          this._context.lineTo(x2, y2);
          break;
      }
    }, "point")
  };
  function curveLinear(context) {
    return new Linear(context);
  }
  __name(curveLinear, "curveLinear");
  function x(p2) {
    return p2[0];
  }
  __name(x, "x");
  function y(p2) {
    return p2[1];
  }
  __name(y, "y");
  function shapeLine(x$1, y$1) {
    var defined2 = constant$1(true), context = null, curve = curveLinear, output = null, path = withPath(line);
    x$1 = typeof x$1 === "function" ? x$1 : x$1 === void 0 ? x : constant$1(x$1);
    y$1 = typeof y$1 === "function" ? y$1 : y$1 === void 0 ? y : constant$1(y$1);
    function line(data) {
      var i2, n2 = (data = array(data)).length, d, defined0 = false, buffer;
      if (context == null) output = curve(buffer = path());
      for (i2 = 0; i2 <= n2; ++i2) {
        if (!(i2 < n2 && defined2(d = data[i2], i2, data)) === defined0) {
          if (defined0 = !defined0) output.lineStart();
          else output.lineEnd();
        }
        if (defined0) output.point(+x$1(d, i2, data), +y$1(d, i2, data));
      }
      if (buffer) return output = null, buffer + "" || null;
    }
    __name(line, "line");
    line.x = function(_) {
      return arguments.length ? (x$1 = typeof _ === "function" ? _ : constant$1(+_), line) : x$1;
    };
    line.y = function(_) {
      return arguments.length ? (y$1 = typeof _ === "function" ? _ : constant$1(+_), line) : y$1;
    };
    line.defined = function(_) {
      return arguments.length ? (defined2 = typeof _ === "function" ? _ : constant$1(!!_), line) : defined2;
    };
    line.curve = function(_) {
      return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;
    };
    line.context = function(_) {
      return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;
    };
    return line;
  }
  __name(shapeLine, "shapeLine");
  function shapeArea(x0, y0, y1) {
    var x1 = null, defined2 = constant$1(true), context = null, curve = curveLinear, output = null, path = withPath(area);
    x0 = typeof x0 === "function" ? x0 : x0 === void 0 ? x : constant$1(+x0);
    y0 = typeof y0 === "function" ? y0 : y0 === void 0 ? constant$1(0) : constant$1(+y0);
    y1 = typeof y1 === "function" ? y1 : y1 === void 0 ? y : constant$1(+y1);
    function area(data) {
      var i2, j, k2, n2 = (data = array(data)).length, d, defined0 = false, buffer, x0z = new Array(n2), y0z = new Array(n2);
      if (context == null) output = curve(buffer = path());
      for (i2 = 0; i2 <= n2; ++i2) {
        if (!(i2 < n2 && defined2(d = data[i2], i2, data)) === defined0) {
          if (defined0 = !defined0) {
            j = i2;
            output.areaStart();
            output.lineStart();
          } else {
            output.lineEnd();
            output.lineStart();
            for (k2 = i2 - 1; k2 >= j; --k2) {
              output.point(x0z[k2], y0z[k2]);
            }
            output.lineEnd();
            output.areaEnd();
          }
        }
        if (defined0) {
          x0z[i2] = +x0(d, i2, data), y0z[i2] = +y0(d, i2, data);
          output.point(x1 ? +x1(d, i2, data) : x0z[i2], y1 ? +y1(d, i2, data) : y0z[i2]);
        }
      }
      if (buffer) return output = null, buffer + "" || null;
    }
    __name(area, "area");
    function arealine() {
      return shapeLine().defined(defined2).curve(curve).context(context);
    }
    __name(arealine, "arealine");
    area.x = function(_) {
      return arguments.length ? (x0 = typeof _ === "function" ? _ : constant$1(+_), x1 = null, area) : x0;
    };
    area.x0 = function(_) {
      return arguments.length ? (x0 = typeof _ === "function" ? _ : constant$1(+_), area) : x0;
    };
    area.x1 = function(_) {
      return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant$1(+_), area) : x1;
    };
    area.y = function(_) {
      return arguments.length ? (y0 = typeof _ === "function" ? _ : constant$1(+_), y1 = null, area) : y0;
    };
    area.y0 = function(_) {
      return arguments.length ? (y0 = typeof _ === "function" ? _ : constant$1(+_), area) : y0;
    };
    area.y1 = function(_) {
      return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant$1(+_), area) : y1;
    };
    area.lineX0 = area.lineY0 = function() {
      return arealine().x(x0).y(y0);
    };
    area.lineY1 = function() {
      return arealine().x(x0).y(y1);
    };
    area.lineX1 = function() {
      return arealine().x(x1).y(y0);
    };
    area.defined = function(_) {
      return arguments.length ? (defined2 = typeof _ === "function" ? _ : constant$1(!!_), area) : defined2;
    };
    area.curve = function(_) {
      return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;
    };
    area.context = function(_) {
      return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;
    };
    return area;
  }
  __name(shapeArea, "shapeArea");
  const _Bump = class _Bump {
    constructor(context, x2) {
      this._context = context;
      this._x = x2;
    }
    areaStart() {
      this._line = 0;
    }
    areaEnd() {
      this._line = NaN;
    }
    lineStart() {
      this._point = 0;
    }
    lineEnd() {
      if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
      this._line = 1 - this._line;
    }
    point(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0: {
          this._point = 1;
          if (this._line) this._context.lineTo(x2, y2);
          else this._context.moveTo(x2, y2);
          break;
        }
        case 1:
          this._point = 2;
        // falls through
        default: {
          if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x2) / 2, this._y0, this._x0, y2, x2, y2);
          else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y2) / 2, x2, this._y0, x2, y2);
          break;
        }
      }
      this._x0 = x2, this._y0 = y2;
    }
  };
  __name(_Bump, "Bump");
  let Bump = _Bump;
  function bumpX(context) {
    return new Bump(context, true);
  }
  __name(bumpX, "bumpX");
  function bumpY(context) {
    return new Bump(context, false);
  }
  __name(bumpY, "bumpY");
  const symbolCircle = {
    draw(context, size2) {
      const r2 = sqrt$1(size2 / pi$1);
      context.moveTo(r2, 0);
      context.arc(0, 0, r2, 0, tau$1);
    }
  };
  const symbolCross = {
    draw(context, size2) {
      const r2 = sqrt$1(size2 / 5) / 2;
      context.moveTo(-3 * r2, -r2);
      context.lineTo(-r2, -r2);
      context.lineTo(-r2, -3 * r2);
      context.lineTo(r2, -3 * r2);
      context.lineTo(r2, -r2);
      context.lineTo(3 * r2, -r2);
      context.lineTo(3 * r2, r2);
      context.lineTo(r2, r2);
      context.lineTo(r2, 3 * r2);
      context.lineTo(-r2, 3 * r2);
      context.lineTo(-r2, r2);
      context.lineTo(-3 * r2, r2);
      context.closePath();
    }
  };
  const tan30 = sqrt$1(1 / 3);
  const tan30_2 = tan30 * 2;
  const symbolDiamond = {
    draw(context, size2) {
      const y2 = sqrt$1(size2 / tan30_2);
      const x2 = y2 * tan30;
      context.moveTo(0, -y2);
      context.lineTo(x2, 0);
      context.lineTo(0, y2);
      context.lineTo(-x2, 0);
      context.closePath();
    }
  };
  const symbolSquare = {
    draw(context, size2) {
      const w = sqrt$1(size2);
      const x2 = -w / 2;
      context.rect(x2, x2, w, w);
    }
  };
  const ka = 0.8908130915292852;
  const kr = sin(pi$1 / 10) / sin(7 * pi$1 / 10);
  const kx = sin(tau$1 / 10) * kr;
  const ky = -cos(tau$1 / 10) * kr;
  const symbolStar = {
    draw(context, size2) {
      const r2 = sqrt$1(size2 * ka);
      const x2 = kx * r2;
      const y2 = ky * r2;
      context.moveTo(0, -r2);
      context.lineTo(x2, y2);
      for (let i2 = 1; i2 < 5; ++i2) {
        const a2 = tau$1 * i2 / 5;
        const c2 = cos(a2);
        const s2 = sin(a2);
        context.lineTo(s2 * r2, -c2 * r2);
        context.lineTo(c2 * x2 - s2 * y2, s2 * x2 + c2 * y2);
      }
      context.closePath();
    }
  };
  const sqrt3 = sqrt$1(3);
  const symbolTriangle = {
    draw(context, size2) {
      const y2 = -sqrt$1(size2 / (sqrt3 * 3));
      context.moveTo(0, y2 * 2);
      context.lineTo(-sqrt3 * y2, -y2);
      context.lineTo(sqrt3 * y2, -y2);
      context.closePath();
    }
  };
  const c = -0.5;
  const s$1 = sqrt$1(3) / 2;
  const k$2 = 1 / sqrt$1(12);
  const a = (k$2 / 2 + 1) * 3;
  const symbolWye = {
    draw(context, size2) {
      const r2 = sqrt$1(size2 / a);
      const x0 = r2 / 2, y0 = r2 * k$2;
      const x1 = x0, y1 = r2 * k$2 + r2;
      const x2 = -x1, y2 = y1;
      context.moveTo(x0, y0);
      context.lineTo(x1, y1);
      context.lineTo(x2, y2);
      context.lineTo(c * x0 - s$1 * y0, s$1 * x0 + c * y0);
      context.lineTo(c * x1 - s$1 * y1, s$1 * x1 + c * y1);
      context.lineTo(c * x2 - s$1 * y2, s$1 * x2 + c * y2);
      context.lineTo(c * x0 + s$1 * y0, c * y0 - s$1 * x0);
      context.lineTo(c * x1 + s$1 * y1, c * y1 - s$1 * x1);
      context.lineTo(c * x2 + s$1 * y2, c * y2 - s$1 * x2);
      context.closePath();
    }
  };
  function Symbol$2(type, size2) {
    let context = null, path = withPath(symbol);
    type = typeof type === "function" ? type : constant$1(type || symbolCircle);
    size2 = typeof size2 === "function" ? size2 : constant$1(size2 === void 0 ? 64 : +size2);
    function symbol() {
      let buffer;
      if (!context) context = buffer = path();
      type.apply(this, arguments).draw(context, +size2.apply(this, arguments));
      if (buffer) return context = null, buffer + "" || null;
    }
    __name(symbol, "symbol");
    symbol.type = function(_) {
      return arguments.length ? (type = typeof _ === "function" ? _ : constant$1(_), symbol) : type;
    };
    symbol.size = function(_) {
      return arguments.length ? (size2 = typeof _ === "function" ? _ : constant$1(+_), symbol) : size2;
    };
    symbol.context = function(_) {
      return arguments.length ? (context = _ == null ? null : _, symbol) : context;
    };
    return symbol;
  }
  __name(Symbol$2, "Symbol$2");
  function noop() {
  }
  __name(noop, "noop");
  function point$2(that, x2, y2) {
    that._context.bezierCurveTo(
      (2 * that._x0 + that._x1) / 3,
      (2 * that._y0 + that._y1) / 3,
      (that._x0 + 2 * that._x1) / 3,
      (that._y0 + 2 * that._y1) / 3,
      (that._x0 + 4 * that._x1 + x2) / 6,
      (that._y0 + 4 * that._y1 + y2) / 6
    );
  }
  __name(point$2, "point$2");
  function Basis(context) {
    this._context = context;
  }
  __name(Basis, "Basis");
  Basis.prototype = {
    areaStart: /* @__PURE__ */ __name(function() {
      this._line = 0;
    }, "areaStart"),
    areaEnd: /* @__PURE__ */ __name(function() {
      this._line = NaN;
    }, "areaEnd"),
    lineStart: /* @__PURE__ */ __name(function() {
      this._x0 = this._x1 = this._y0 = this._y1 = NaN;
      this._point = 0;
    }, "lineStart"),
    lineEnd: /* @__PURE__ */ __name(function() {
      switch (this._point) {
        case 3:
          point$2(this, this._x1, this._y1);
        // falls through
        case 2:
          this._context.lineTo(this._x1, this._y1);
          break;
      }
      if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
      this._line = 1 - this._line;
    }, "lineEnd"),
    point: /* @__PURE__ */ __name(function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
          this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
        // falls through
        default:
          point$2(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = x2;
      this._y0 = this._y1, this._y1 = y2;
    }, "point")
  };
  function curveBasis(context) {
    return new Basis(context);
  }
  __name(curveBasis, "curveBasis");
  function BasisClosed(context) {
    this._context = context;
  }
  __name(BasisClosed, "BasisClosed");
  BasisClosed.prototype = {
    areaStart: noop,
    areaEnd: noop,
    lineStart: /* @__PURE__ */ __name(function() {
      this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;
      this._point = 0;
    }, "lineStart"),
    lineEnd: /* @__PURE__ */ __name(function() {
      switch (this._point) {
        case 1: {
          this._context.moveTo(this._x2, this._y2);
          this._context.closePath();
          break;
        }
        case 2: {
          this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);
          this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);
          this._context.closePath();
          break;
        }
        case 3: {
          this.point(this._x2, this._y2);
          this.point(this._x3, this._y3);
          this.point(this._x4, this._y4);
          break;
        }
      }
    }, "lineEnd"),
    point: /* @__PURE__ */ __name(function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._x2 = x2, this._y2 = y2;
          break;
        case 1:
          this._point = 2;
          this._x3 = x2, this._y3 = y2;
          break;
        case 2:
          this._point = 3;
          this._x4 = x2, this._y4 = y2;
          this._context.moveTo((this._x0 + 4 * this._x1 + x2) / 6, (this._y0 + 4 * this._y1 + y2) / 6);
          break;
        default:
          point$2(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = x2;
      this._y0 = this._y1, this._y1 = y2;
    }, "point")
  };
  function curveBasisClosed(context) {
    return new BasisClosed(context);
  }
  __name(curveBasisClosed, "curveBasisClosed");
  function BasisOpen(context) {
    this._context = context;
  }
  __name(BasisOpen, "BasisOpen");
  BasisOpen.prototype = {
    areaStart: /* @__PURE__ */ __name(function() {
      this._line = 0;
    }, "areaStart"),
    areaEnd: /* @__PURE__ */ __name(function() {
      this._line = NaN;
    }, "areaEnd"),
    lineStart: /* @__PURE__ */ __name(function() {
      this._x0 = this._x1 = this._y0 = this._y1 = NaN;
      this._point = 0;
    }, "lineStart"),
    lineEnd: /* @__PURE__ */ __name(function() {
      if (this._line || this._line !== 0 && this._point === 3) this._context.closePath();
      this._line = 1 - this._line;
    }, "lineEnd"),
    point: /* @__PURE__ */ __name(function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
          var x0 = (this._x0 + 4 * this._x1 + x2) / 6, y0 = (this._y0 + 4 * this._y1 + y2) / 6;
          this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0);
          break;
        case 3:
          this._point = 4;
        // falls through
        default:
          point$2(this, x2, y2);
          break;
      }
      this._x0 = this._x1, this._x1 = x2;
      this._y0 = this._y1, this._y1 = y2;
    }, "point")
  };
  function curveBasisOpen(context) {
    return new BasisOpen(context);
  }
  __name(curveBasisOpen, "curveBasisOpen");
  function LinearClosed(context) {
    this._context = context;
  }
  __name(LinearClosed, "LinearClosed");
  LinearClosed.prototype = {
    areaStart: noop,
    areaEnd: noop,
    lineStart: /* @__PURE__ */ __name(function() {
      this._point = 0;
    }, "lineStart"),
    lineEnd: /* @__PURE__ */ __name(function() {
      if (this._point) this._context.closePath();
    }, "lineEnd"),
    point: /* @__PURE__ */ __name(function(x2, y2) {
      x2 = +x2, y2 = +y2;
      if (this._point) this._context.lineTo(x2, y2);
      else this._point = 1, this._context.moveTo(x2, y2);
    }, "point")
  };
  function curveLinearClosed(context) {
    return new LinearClosed(context);
  }
  __name(curveLinearClosed, "curveLinearClosed");
  function sign(x2) {
    return x2 < 0 ? -1 : 1;
  }
  __name(sign, "sign");
  function slope3(that, x2, y2) {
    var h0 = that._x1 - that._x0, h1 = x2 - that._x1, s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0), s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0), p2 = (s0 * h1 + s1 * h0) / (h0 + h1);
    return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p2)) || 0;
  }
  __name(slope3, "slope3");
  function slope2(that, t2) {
    var h = that._x1 - that._x0;
    return h ? (3 * (that._y1 - that._y0) / h - t2) / 2 : t2;
  }
  __name(slope2, "slope2");
  function point$1(that, t02, t12) {
    var x0 = that._x0, y0 = that._y0, x1 = that._x1, y1 = that._y1, dx = (x1 - x0) / 3;
    that._context.bezierCurveTo(x0 + dx, y0 + dx * t02, x1 - dx, y1 - dx * t12, x1, y1);
  }
  __name(point$1, "point$1");
  function MonotoneX(context) {
    this._context = context;
  }
  __name(MonotoneX, "MonotoneX");
  MonotoneX.prototype = {
    areaStart: /* @__PURE__ */ __name(function() {
      this._line = 0;
    }, "areaStart"),
    areaEnd: /* @__PURE__ */ __name(function() {
      this._line = NaN;
    }, "areaEnd"),
    lineStart: /* @__PURE__ */ __name(function() {
      this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN;
      this._point = 0;
    }, "lineStart"),
    lineEnd: /* @__PURE__ */ __name(function() {
      switch (this._point) {
        case 2:
          this._context.lineTo(this._x1, this._y1);
          break;
        case 3:
          point$1(this, this._t0, slope2(this, this._t0));
          break;
      }
      if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
      this._line = 1 - this._line;
    }, "lineEnd"),
    point: /* @__PURE__ */ __name(function(x2, y2) {
      var t12 = NaN;
      x2 = +x2, y2 = +y2;
      if (x2 === this._x1 && y2 === this._y1) return;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3;
          point$1(this, slope2(this, t12 = slope3(this, x2, y2)), t12);
          break;
        default:
          point$1(this, this._t0, t12 = slope3(this, x2, y2));
          break;
      }
      this._x0 = this._x1, this._x1 = x2;
      this._y0 = this._y1, this._y1 = y2;
      this._t0 = t12;
    }, "point")
  };
  function MonotoneY(context) {
    this._context = new ReflectContext(context);
  }
  __name(MonotoneY, "MonotoneY");
  (MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x2, y2) {
    MonotoneX.prototype.point.call(this, y2, x2);
  };
  function ReflectContext(context) {
    this._context = context;
  }
  __name(ReflectContext, "ReflectContext");
  ReflectContext.prototype = {
    moveTo: /* @__PURE__ */ __name(function(x2, y2) {
      this._context.moveTo(y2, x2);
    }, "moveTo"),
    closePath: /* @__PURE__ */ __name(function() {
      this._context.closePath();
    }, "closePath"),
    lineTo: /* @__PURE__ */ __name(function(x2, y2) {
      this._context.lineTo(y2, x2);
    }, "lineTo"),
    bezierCurveTo: /* @__PURE__ */ __name(function(x1, y1, x2, y2, x3, y3) {
      this._context.bezierCurveTo(y1, x1, y2, x2, y3, x3);
    }, "bezierCurveTo")
  };
  function monotoneX(context) {
    return new MonotoneX(context);
  }
  __name(monotoneX, "monotoneX");
  function monotoneY(context) {
    return new MonotoneY(context);
  }
  __name(monotoneY, "monotoneY");
  function Natural(context) {
    this._context = context;
  }
  __name(Natural, "Natural");
  Natural.prototype = {
    areaStart: /* @__PURE__ */ __name(function() {
      this._line = 0;
    }, "areaStart"),
    areaEnd: /* @__PURE__ */ __name(function() {
      this._line = NaN;
    }, "areaEnd"),
    lineStart: /* @__PURE__ */ __name(function() {
      this._x = [];
      this._y = [];
    }, "lineStart"),
    lineEnd: /* @__PURE__ */ __name(function() {
      var x2 = this._x, y2 = this._y, n2 = x2.length;
      if (n2) {
        this._line ? this._context.lineTo(x2[0], y2[0]) : this._context.moveTo(x2[0], y2[0]);
        if (n2 === 2) {
          this._context.lineTo(x2[1], y2[1]);
        } else {
          var px = controlPoints(x2), py = controlPoints(y2);
          for (var i0 = 0, i1 = 1; i1 < n2; ++i0, ++i1) {
            this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x2[i1], y2[i1]);
          }
        }
      }
      if (this._line || this._line !== 0 && n2 === 1) this._context.closePath();
      this._line = 1 - this._line;
      this._x = this._y = null;
    }, "lineEnd"),
    point: /* @__PURE__ */ __name(function(x2, y2) {
      this._x.push(+x2);
      this._y.push(+y2);
    }, "point")
  };
  function controlPoints(x2) {
    var i2, n2 = x2.length - 1, m2, a2 = new Array(n2), b = new Array(n2), r2 = new Array(n2);
    a2[0] = 0, b[0] = 2, r2[0] = x2[0] + 2 * x2[1];
    for (i2 = 1; i2 < n2 - 1; ++i2) a2[i2] = 1, b[i2] = 4, r2[i2] = 4 * x2[i2] + 2 * x2[i2 + 1];
    a2[n2 - 1] = 2, b[n2 - 1] = 7, r2[n2 - 1] = 8 * x2[n2 - 1] + x2[n2];
    for (i2 = 1; i2 < n2; ++i2) m2 = a2[i2] / b[i2 - 1], b[i2] -= m2, r2[i2] -= m2 * r2[i2 - 1];
    a2[n2 - 1] = r2[n2 - 1] / b[n2 - 1];
    for (i2 = n2 - 2; i2 >= 0; --i2) a2[i2] = (r2[i2] - a2[i2 + 1]) / b[i2];
    b[n2 - 1] = (x2[n2] + a2[n2 - 1]) / 2;
    for (i2 = 0; i2 < n2 - 1; ++i2) b[i2] = 2 * x2[i2 + 1] - a2[i2 + 1];
    return [a2, b];
  }
  __name(controlPoints, "controlPoints");
  function curveNatural(context) {
    return new Natural(context);
  }
  __name(curveNatural, "curveNatural");
  function Step(context, t2) {
    this._context = context;
    this._t = t2;
  }
  __name(Step, "Step");
  Step.prototype = {
    areaStart: /* @__PURE__ */ __name(function() {
      this._line = 0;
    }, "areaStart"),
    areaEnd: /* @__PURE__ */ __name(function() {
      this._line = NaN;
    }, "areaEnd"),
    lineStart: /* @__PURE__ */ __name(function() {
      this._x = this._y = NaN;
      this._point = 0;
    }, "lineStart"),
    lineEnd: /* @__PURE__ */ __name(function() {
      if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);
      if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
      if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;
    }, "lineEnd"),
    point: /* @__PURE__ */ __name(function(x2, y2) {
      x2 = +x2, y2 = +y2;
      switch (this._point) {
        case 0:
          this._point = 1;
          this._line ? this._context.lineTo(x2, y2) : this._context.moveTo(x2, y2);
          break;
        case 1:
          this._point = 2;
        // falls through
        default: {
          if (this._t <= 0) {
            this._context.lineTo(this._x, y2);
            this._context.lineTo(x2, y2);
          } else {
            var x1 = this._x * (1 - this._t) + x2 * this._t;
            this._context.lineTo(x1, this._y);
            this._context.lineTo(x1, y2);
          }
          break;
        }
      }
      this._x = x2, this._y = y2;
    }, "point")
  };
  function curveStep(context) {
    return new Step(context, 0.5);
  }
  __name(curveStep, "curveStep");
  function stepBefore(context) {
    return new Step(context, 0);
  }
  __name(stepBefore, "stepBefore");
  function stepAfter(context) {
    return new Step(context, 1);
  }
  __name(stepAfter, "stepAfter");
  function stackOffsetNone(series, order) {
    if (!((n2 = series.length) > 1)) return;
    for (var i2 = 1, j, s0, s1 = series[order[0]], n2, m2 = s1.length; i2 < n2; ++i2) {
      s0 = s1, s1 = series[order[i2]];
      for (j = 0; j < m2; ++j) {
        s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];
      }
    }
  }
  __name(stackOffsetNone, "stackOffsetNone");
  function stackOrderNone(series) {
    var n2 = series.length, o2 = new Array(n2);
    while (--n2 >= 0) o2[n2] = n2;
    return o2;
  }
  __name(stackOrderNone, "stackOrderNone");
  function stackValue(d, key) {
    return d[key];
  }
  __name(stackValue, "stackValue");
  function stackSeries(key) {
    const series = [];
    series.key = key;
    return series;
  }
  __name(stackSeries, "stackSeries");
  function shapeStack() {
    var keys2 = constant$1([]), order = stackOrderNone, offset2 = stackOffsetNone, value = stackValue;
    function stack(data) {
      var sz = Array.from(keys2.apply(this, arguments), stackSeries), i2, n2 = sz.length, j = -1, oz;
      for (const d of data) {
        for (i2 = 0, ++j; i2 < n2; ++i2) {
          (sz[i2][j] = [0, +value(d, sz[i2].key, j, data)]).data = d;
        }
      }
      for (i2 = 0, oz = array(order(sz)); i2 < n2; ++i2) {
        sz[oz[i2]].index = i2;
      }
      offset2(sz, oz);
      return sz;
    }
    __name(stack, "stack");
    stack.keys = function(_) {
      return arguments.length ? (keys2 = typeof _ === "function" ? _ : constant$1(Array.from(_)), stack) : keys2;
    };
    stack.value = function(_) {
      return arguments.length ? (value = typeof _ === "function" ? _ : constant$1(+_), stack) : value;
    };
    stack.order = function(_) {
      return arguments.length ? (order = _ == null ? stackOrderNone : typeof _ === "function" ? _ : constant$1(Array.from(_)), stack) : order;
    };
    stack.offset = function(_) {
      return arguments.length ? (offset2 = _ == null ? stackOffsetNone : _, stack) : offset2;
    };
    return stack;
  }
  __name(shapeStack, "shapeStack");
  function stackOffsetExpand(series, order) {
    if (!((n2 = series.length) > 0)) return;
    for (var i2, n2, j = 0, m2 = series[0].length, y2; j < m2; ++j) {
      for (y2 = i2 = 0; i2 < n2; ++i2) y2 += series[i2][j][1] || 0;
      if (y2) for (i2 = 0; i2 < n2; ++i2) series[i2][j][1] /= y2;
    }
    stackOffsetNone(series, order);
  }
  __name(stackOffsetExpand, "stackOffsetExpand");
  function stackOffsetSilhouette(series, order) {
    if (!((n2 = series.length) > 0)) return;
    for (var j = 0, s0 = series[order[0]], n2, m2 = s0.length; j < m2; ++j) {
      for (var i2 = 0, y2 = 0; i2 < n2; ++i2) y2 += series[i2][j][1] || 0;
      s0[j][1] += s0[j][0] = -y2 / 2;
    }
    stackOffsetNone(series, order);
  }
  __name(stackOffsetSilhouette, "stackOffsetSilhouette");
  function stackOffsetWiggle(series, order) {
    if (!((n2 = series.length) > 0) || !((m2 = (s0 = series[order[0]]).length) > 0)) return;
    for (var y2 = 0, j = 1, s0, m2, n2; j < m2; ++j) {
      for (var i2 = 0, s1 = 0, s2 = 0; i2 < n2; ++i2) {
        var si = series[order[i2]], sij0 = si[j][1] || 0, sij1 = si[j - 1][1] || 0, s3 = (sij0 - sij1) / 2;
        for (var k2 = 0; k2 < i2; ++k2) {
          var sk = series[order[k2]], skj0 = sk[j][1] || 0, skj1 = sk[j - 1][1] || 0;
          s3 += skj0 - skj1;
        }
        s1 += sij0, s2 += s3 * sij0;
      }
      s0[j - 1][1] += s0[j - 1][0] = y2;
      if (s1) y2 -= s2 / s1;
    }
    s0[j - 1][1] += s0[j - 1][0] = y2;
    stackOffsetNone(series, order);
  }
  __name(stackOffsetWiggle, "stackOffsetWiggle");
  function _typeof$J(o2) {
    "@babel/helpers - typeof";
    return _typeof$J = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$J(o2);
  }
  __name(_typeof$J, "_typeof$J");
  var _excluded$g = ["type", "size", "sizeType"];
  function _extends$s() {
    _extends$s = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$s.apply(this, arguments);
  }
  __name(_extends$s, "_extends$s");
  function ownKeys$C(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$C, "ownKeys$C");
  function _objectSpread$C(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$C(Object(t2), true).forEach(function(r3) {
        _defineProperty$I(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$C(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$C, "_objectSpread$C");
  function _defineProperty$I(obj, key, value) {
    key = _toPropertyKey$I(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$I, "_defineProperty$I");
  function _toPropertyKey$I(t2) {
    var i2 = _toPrimitive$I(t2, "string");
    return "symbol" == _typeof$J(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$I, "_toPropertyKey$I");
  function _toPrimitive$I(t2, r2) {
    if ("object" != _typeof$J(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$J(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$I, "_toPrimitive$I");
  function _objectWithoutProperties$g(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$g(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$g, "_objectWithoutProperties$g");
  function _objectWithoutPropertiesLoose$g(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$g, "_objectWithoutPropertiesLoose$g");
  var symbolFactories = {
    symbolCircle,
    symbolCross,
    symbolDiamond,
    symbolSquare,
    symbolStar,
    symbolTriangle,
    symbolWye
  };
  var RADIAN$2 = Math.PI / 180;
  var getSymbolFactory = /* @__PURE__ */ __name(function getSymbolFactory2(type) {
    var name = "symbol".concat(upperFirst(type));
    return symbolFactories[name] || symbolCircle;
  }, "getSymbolFactory");
  var calculateAreaSize = /* @__PURE__ */ __name(function calculateAreaSize2(size2, sizeType, type) {
    if (sizeType === "area") {
      return size2;
    }
    switch (type) {
      case "cross":
        return 5 * size2 * size2 / 9;
      case "diamond":
        return 0.5 * size2 * size2 / Math.sqrt(3);
      case "square":
        return size2 * size2;
      case "star": {
        var angle = 18 * RADIAN$2;
        return 1.25 * size2 * size2 * (Math.tan(angle) - Math.tan(angle * 2) * Math.pow(Math.tan(angle), 2));
      }
      case "triangle":
        return Math.sqrt(3) * size2 * size2 / 4;
      case "wye":
        return (21 - 10 * Math.sqrt(3)) * size2 * size2 / 8;
      default:
        return Math.PI * size2 * size2 / 4;
    }
  }, "calculateAreaSize");
  var registerSymbol = /* @__PURE__ */ __name(function registerSymbol2(key, factory) {
    symbolFactories["symbol".concat(upperFirst(key))] = factory;
  }, "registerSymbol");
  var Symbols = /* @__PURE__ */ __name(function Symbols2(_ref) {
    var _ref$type = _ref.type, type = _ref$type === void 0 ? "circle" : _ref$type, _ref$size = _ref.size, size2 = _ref$size === void 0 ? 64 : _ref$size, _ref$sizeType = _ref.sizeType, sizeType = _ref$sizeType === void 0 ? "area" : _ref$sizeType, rest = _objectWithoutProperties$g(_ref, _excluded$g);
    var props = _objectSpread$C(_objectSpread$C({}, rest), {}, {
      type,
      size: size2,
      sizeType
    });
    var getPath2 = /* @__PURE__ */ __name(function getPath3() {
      var symbolFactory = getSymbolFactory(type);
      var symbol = Symbol$2().type(symbolFactory).size(calculateAreaSize(size2, sizeType, type));
      return symbol();
    }, "getPath");
    var className = props.className, cx2 = props.cx, cy = props.cy;
    var filteredProps = filterProps(props, true);
    if (cx2 === +cx2 && cy === +cy && size2 === +size2) {
      return /* @__PURE__ */ React.createElement("path", _extends$s({}, filteredProps, {
        className: clsx("recharts-symbols", className),
        transform: "translate(".concat(cx2, ", ").concat(cy, ")"),
        d: getPath2()
      }));
    }
    return null;
  }, "Symbols");
  Symbols.registerSymbol = registerSymbol;
  function _typeof$I(o2) {
    "@babel/helpers - typeof";
    return _typeof$I = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$I(o2);
  }
  __name(_typeof$I, "_typeof$I");
  function _extends$r() {
    _extends$r = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$r.apply(this, arguments);
  }
  __name(_extends$r, "_extends$r");
  function ownKeys$B(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$B, "ownKeys$B");
  function _objectSpread$B(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$B(Object(t2), true).forEach(function(r3) {
        _defineProperty$H(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$B(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$B, "_objectSpread$B");
  function _classCallCheck$l(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$l, "_classCallCheck$l");
  function _defineProperties$l(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$H(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$l, "_defineProperties$l");
  function _createClass$l(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$l(Constructor.prototype, protoProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$l, "_createClass$l");
  function _callSuper$h(t2, o2, e) {
    return o2 = _getPrototypeOf$i(o2), _possibleConstructorReturn$i(t2, _isNativeReflectConstruct$i() ? Reflect.construct(o2, e || [], _getPrototypeOf$i(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$h, "_callSuper$h");
  function _possibleConstructorReturn$i(self2, call) {
    if (call && (_typeof$I(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$i(self2);
  }
  __name(_possibleConstructorReturn$i, "_possibleConstructorReturn$i");
  function _assertThisInitialized$i(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$i, "_assertThisInitialized$i");
  function _isNativeReflectConstruct$i() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$i = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$i, "_isNativeReflectConstruct$i");
  function _getPrototypeOf$i(o2) {
    _getPrototypeOf$i = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$i(o2);
  }
  __name(_getPrototypeOf$i, "_getPrototypeOf$i");
  function _inherits$i(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$i(subClass, superClass);
  }
  __name(_inherits$i, "_inherits$i");
  function _setPrototypeOf$i(o2, p2) {
    _setPrototypeOf$i = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$i(o2, p2);
  }
  __name(_setPrototypeOf$i, "_setPrototypeOf$i");
  function _defineProperty$H(obj, key, value) {
    key = _toPropertyKey$H(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$H, "_defineProperty$H");
  function _toPropertyKey$H(t2) {
    var i2 = _toPrimitive$H(t2, "string");
    return "symbol" == _typeof$I(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$H, "_toPropertyKey$H");
  function _toPrimitive$H(t2, r2) {
    if ("object" != _typeof$I(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$I(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$H, "_toPrimitive$H");
  var SIZE = 32;
  var DefaultLegendContent = /* @__PURE__ */ (function(_PureComponent) {
    function DefaultLegendContent2() {
      _classCallCheck$l(this, DefaultLegendContent2);
      return _callSuper$h(this, DefaultLegendContent2, arguments);
    }
    __name(DefaultLegendContent2, "DefaultLegendContent");
    _inherits$i(DefaultLegendContent2, _PureComponent);
    return _createClass$l(DefaultLegendContent2, [{
      key: "renderIcon",
      value: (
        /**
         * Render the path of icon
         * @param {Object} data Data of each legend item
         * @return {String} Path element
         */
        /* @__PURE__ */ __name(function renderIcon(data) {
          var inactiveColor = this.props.inactiveColor;
          var halfSize = SIZE / 2;
          var sixthSize = SIZE / 6;
          var thirdSize = SIZE / 3;
          var color2 = data.inactive ? inactiveColor : data.color;
          if (data.type === "plainline") {
            return /* @__PURE__ */ React.createElement("line", {
              strokeWidth: 4,
              fill: "none",
              stroke: color2,
              strokeDasharray: data.payload.strokeDasharray,
              x1: 0,
              y1: halfSize,
              x2: SIZE,
              y2: halfSize,
              className: "recharts-legend-icon"
            });
          }
          if (data.type === "line") {
            return /* @__PURE__ */ React.createElement("path", {
              strokeWidth: 4,
              fill: "none",
              stroke: color2,
              d: "M0,".concat(halfSize, "h").concat(thirdSize, "\n            A").concat(sixthSize, ",").concat(sixthSize, ",0,1,1,").concat(2 * thirdSize, ",").concat(halfSize, "\n            H").concat(SIZE, "M").concat(2 * thirdSize, ",").concat(halfSize, "\n            A").concat(sixthSize, ",").concat(sixthSize, ",0,1,1,").concat(thirdSize, ",").concat(halfSize),
              className: "recharts-legend-icon"
            });
          }
          if (data.type === "rect") {
            return /* @__PURE__ */ React.createElement("path", {
              stroke: "none",
              fill: color2,
              d: "M0,".concat(SIZE / 8, "h").concat(SIZE, "v").concat(SIZE * 3 / 4, "h").concat(-SIZE, "z"),
              className: "recharts-legend-icon"
            });
          }
          if (/* @__PURE__ */ React.isValidElement(data.legendIcon)) {
            var iconProps = _objectSpread$B({}, data);
            delete iconProps.legendIcon;
            return /* @__PURE__ */ React.cloneElement(data.legendIcon, iconProps);
          }
          return /* @__PURE__ */ React.createElement(Symbols, {
            fill: color2,
            cx: halfSize,
            cy: halfSize,
            size: SIZE,
            sizeType: "diameter",
            type: data.type
          });
        }, "renderIcon")
      )
      /**
       * Draw items of legend
       * @return {ReactElement} Items
       */
    }, {
      key: "renderItems",
      value: /* @__PURE__ */ __name(function renderItems() {
        var _this = this;
        var _this$props = this.props, payload = _this$props.payload, iconSize = _this$props.iconSize, layout = _this$props.layout, formatter = _this$props.formatter, inactiveColor = _this$props.inactiveColor;
        var viewBox = {
          x: 0,
          y: 0,
          width: SIZE,
          height: SIZE
        };
        var itemStyle = {
          display: layout === "horizontal" ? "inline-block" : "block",
          marginRight: 10
        };
        var svgStyle = {
          display: "inline-block",
          verticalAlign: "middle",
          marginRight: 4
        };
        return payload.map(function(entry, i2) {
          var finalFormatter = entry.formatter || formatter;
          var className = clsx(_defineProperty$H(_defineProperty$H({
            "recharts-legend-item": true
          }, "legend-item-".concat(i2), true), "inactive", entry.inactive));
          if (entry.type === "none") {
            return null;
          }
          var entryValue = !isFunction$2(entry.value) ? entry.value : null;
          warn(
            !isFunction$2(entry.value),
            `The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`
            // eslint-disable-line max-len
          );
          var color2 = entry.inactive ? inactiveColor : entry.color;
          return /* @__PURE__ */ React.createElement("li", _extends$r({
            className,
            style: itemStyle,
            key: "legend-item-".concat(i2)
          }, adaptEventsOfChild(_this.props, entry, i2)), /* @__PURE__ */ React.createElement(Surface, {
            width: iconSize,
            height: iconSize,
            viewBox,
            style: svgStyle
          }, _this.renderIcon(entry)), /* @__PURE__ */ React.createElement("span", {
            className: "recharts-legend-item-text",
            style: {
              color: color2
            }
          }, finalFormatter ? finalFormatter(entryValue, entry, i2) : entryValue));
        });
      }, "renderItems")
    }, {
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _this$props2 = this.props, payload = _this$props2.payload, layout = _this$props2.layout, align = _this$props2.align;
        if (!payload || !payload.length) {
          return null;
        }
        var finalStyle = {
          padding: 0,
          margin: 0,
          textAlign: layout === "horizontal" ? align : "left"
        };
        return /* @__PURE__ */ React.createElement("ul", {
          className: "recharts-default-legend",
          style: finalStyle
        }, this.renderItems());
      }, "render")
    }]);
  })(reactExports.PureComponent);
  _defineProperty$H(DefaultLegendContent, "displayName", "Legend");
  _defineProperty$H(DefaultLegendContent, "defaultProps", {
    iconSize: 14,
    layout: "horizontal",
    align: "center",
    verticalAlign: "middle",
    inactiveColor: "#ccc"
  });
  var _stackClear;
  var hasRequired_stackClear;
  function require_stackClear() {
    if (hasRequired_stackClear) return _stackClear;
    hasRequired_stackClear = 1;
    var ListCache2 = require_ListCache();
    function stackClear2() {
      this.__data__ = new ListCache2();
      this.size = 0;
    }
    __name(stackClear2, "stackClear");
    _stackClear = stackClear2;
    return _stackClear;
  }
  __name(require_stackClear, "require_stackClear");
  var _stackDelete;
  var hasRequired_stackDelete;
  function require_stackDelete() {
    if (hasRequired_stackDelete) return _stackDelete;
    hasRequired_stackDelete = 1;
    function stackDelete2(key) {
      var data = this.__data__, result = data["delete"](key);
      this.size = data.size;
      return result;
    }
    __name(stackDelete2, "stackDelete");
    _stackDelete = stackDelete2;
    return _stackDelete;
  }
  __name(require_stackDelete, "require_stackDelete");
  var _stackGet;
  var hasRequired_stackGet;
  function require_stackGet() {
    if (hasRequired_stackGet) return _stackGet;
    hasRequired_stackGet = 1;
    function stackGet2(key) {
      return this.__data__.get(key);
    }
    __name(stackGet2, "stackGet");
    _stackGet = stackGet2;
    return _stackGet;
  }
  __name(require_stackGet, "require_stackGet");
  var _stackHas;
  var hasRequired_stackHas;
  function require_stackHas() {
    if (hasRequired_stackHas) return _stackHas;
    hasRequired_stackHas = 1;
    function stackHas2(key) {
      return this.__data__.has(key);
    }
    __name(stackHas2, "stackHas");
    _stackHas = stackHas2;
    return _stackHas;
  }
  __name(require_stackHas, "require_stackHas");
  var _stackSet;
  var hasRequired_stackSet;
  function require_stackSet() {
    if (hasRequired_stackSet) return _stackSet;
    hasRequired_stackSet = 1;
    var ListCache2 = require_ListCache(), Map2 = require_Map(), MapCache2 = require_MapCache();
    var LARGE_ARRAY_SIZE2 = 200;
    function stackSet2(key, value) {
      var data = this.__data__;
      if (data instanceof ListCache2) {
        var pairs = data.__data__;
        if (!Map2 || pairs.length < LARGE_ARRAY_SIZE2 - 1) {
          pairs.push([key, value]);
          this.size = ++data.size;
          return this;
        }
        data = this.__data__ = new MapCache2(pairs);
      }
      data.set(key, value);
      this.size = data.size;
      return this;
    }
    __name(stackSet2, "stackSet");
    _stackSet = stackSet2;
    return _stackSet;
  }
  __name(require_stackSet, "require_stackSet");
  var _Stack;
  var hasRequired_Stack;
  function require_Stack() {
    if (hasRequired_Stack) return _Stack;
    hasRequired_Stack = 1;
    var ListCache2 = require_ListCache(), stackClear2 = require_stackClear(), stackDelete2 = require_stackDelete(), stackGet2 = require_stackGet(), stackHas2 = require_stackHas(), stackSet2 = require_stackSet();
    function Stack2(entries) {
      var data = this.__data__ = new ListCache2(entries);
      this.size = data.size;
    }
    __name(Stack2, "Stack");
    Stack2.prototype.clear = stackClear2;
    Stack2.prototype["delete"] = stackDelete2;
    Stack2.prototype.get = stackGet2;
    Stack2.prototype.has = stackHas2;
    Stack2.prototype.set = stackSet2;
    _Stack = Stack2;
    return _Stack;
  }
  __name(require_Stack, "require_Stack");
  var _setCacheAdd;
  var hasRequired_setCacheAdd;
  function require_setCacheAdd() {
    if (hasRequired_setCacheAdd) return _setCacheAdd;
    hasRequired_setCacheAdd = 1;
    var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
    function setCacheAdd2(value) {
      this.__data__.set(value, HASH_UNDEFINED2);
      return this;
    }
    __name(setCacheAdd2, "setCacheAdd");
    _setCacheAdd = setCacheAdd2;
    return _setCacheAdd;
  }
  __name(require_setCacheAdd, "require_setCacheAdd");
  var _setCacheHas;
  var hasRequired_setCacheHas;
  function require_setCacheHas() {
    if (hasRequired_setCacheHas) return _setCacheHas;
    hasRequired_setCacheHas = 1;
    function setCacheHas2(value) {
      return this.__data__.has(value);
    }
    __name(setCacheHas2, "setCacheHas");
    _setCacheHas = setCacheHas2;
    return _setCacheHas;
  }
  __name(require_setCacheHas, "require_setCacheHas");
  var _SetCache;
  var hasRequired_SetCache;
  function require_SetCache() {
    if (hasRequired_SetCache) return _SetCache;
    hasRequired_SetCache = 1;
    var MapCache2 = require_MapCache(), setCacheAdd2 = require_setCacheAdd(), setCacheHas2 = require_setCacheHas();
    function SetCache2(values) {
      var index2 = -1, length = values == null ? 0 : values.length;
      this.__data__ = new MapCache2();
      while (++index2 < length) {
        this.add(values[index2]);
      }
    }
    __name(SetCache2, "SetCache");
    SetCache2.prototype.add = SetCache2.prototype.push = setCacheAdd2;
    SetCache2.prototype.has = setCacheHas2;
    _SetCache = SetCache2;
    return _SetCache;
  }
  __name(require_SetCache, "require_SetCache");
  var _arraySome;
  var hasRequired_arraySome;
  function require_arraySome() {
    if (hasRequired_arraySome) return _arraySome;
    hasRequired_arraySome = 1;
    function arraySome2(array2, predicate) {
      var index2 = -1, length = array2 == null ? 0 : array2.length;
      while (++index2 < length) {
        if (predicate(array2[index2], index2, array2)) {
          return true;
        }
      }
      return false;
    }
    __name(arraySome2, "arraySome");
    _arraySome = arraySome2;
    return _arraySome;
  }
  __name(require_arraySome, "require_arraySome");
  var _cacheHas;
  var hasRequired_cacheHas;
  function require_cacheHas() {
    if (hasRequired_cacheHas) return _cacheHas;
    hasRequired_cacheHas = 1;
    function cacheHas2(cache, key) {
      return cache.has(key);
    }
    __name(cacheHas2, "cacheHas");
    _cacheHas = cacheHas2;
    return _cacheHas;
  }
  __name(require_cacheHas, "require_cacheHas");
  var _equalArrays;
  var hasRequired_equalArrays;
  function require_equalArrays() {
    if (hasRequired_equalArrays) return _equalArrays;
    hasRequired_equalArrays = 1;
    var SetCache2 = require_SetCache(), arraySome2 = require_arraySome(), cacheHas2 = require_cacheHas();
    var COMPARE_PARTIAL_FLAG2 = 1, COMPARE_UNORDERED_FLAG2 = 2;
    function equalArrays2(array2, other, bitmask, customizer, equalFunc, stack) {
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG2, arrLength = array2.length, othLength = other.length;
      if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
        return false;
      }
      var arrStacked = stack.get(array2);
      var othStacked = stack.get(other);
      if (arrStacked && othStacked) {
        return arrStacked == other && othStacked == array2;
      }
      var index2 = -1, result = true, seen2 = bitmask & COMPARE_UNORDERED_FLAG2 ? new SetCache2() : void 0;
      stack.set(array2, other);
      stack.set(other, array2);
      while (++index2 < arrLength) {
        var arrValue = array2[index2], othValue = other[index2];
        if (customizer) {
          var compared = isPartial ? customizer(othValue, arrValue, index2, other, array2, stack) : customizer(arrValue, othValue, index2, array2, other, stack);
        }
        if (compared !== void 0) {
          if (compared) {
            continue;
          }
          result = false;
          break;
        }
        if (seen2) {
          if (!arraySome2(other, function(othValue2, othIndex) {
            if (!cacheHas2(seen2, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
              return seen2.push(othIndex);
            }
          })) {
            result = false;
            break;
          }
        } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
          result = false;
          break;
        }
      }
      stack["delete"](array2);
      stack["delete"](other);
      return result;
    }
    __name(equalArrays2, "equalArrays");
    _equalArrays = equalArrays2;
    return _equalArrays;
  }
  __name(require_equalArrays, "require_equalArrays");
  var _Uint8Array;
  var hasRequired_Uint8Array;
  function require_Uint8Array() {
    if (hasRequired_Uint8Array) return _Uint8Array;
    hasRequired_Uint8Array = 1;
    var root2 = require_root();
    var Uint8Array2 = root2.Uint8Array;
    _Uint8Array = Uint8Array2;
    return _Uint8Array;
  }
  __name(require_Uint8Array, "require_Uint8Array");
  var _mapToArray;
  var hasRequired_mapToArray;
  function require_mapToArray() {
    if (hasRequired_mapToArray) return _mapToArray;
    hasRequired_mapToArray = 1;
    function mapToArray2(map2) {
      var index2 = -1, result = Array(map2.size);
      map2.forEach(function(value, key) {
        result[++index2] = [key, value];
      });
      return result;
    }
    __name(mapToArray2, "mapToArray");
    _mapToArray = mapToArray2;
    return _mapToArray;
  }
  __name(require_mapToArray, "require_mapToArray");
  var _setToArray;
  var hasRequired_setToArray;
  function require_setToArray() {
    if (hasRequired_setToArray) return _setToArray;
    hasRequired_setToArray = 1;
    function setToArray2(set2) {
      var index2 = -1, result = Array(set2.size);
      set2.forEach(function(value) {
        result[++index2] = value;
      });
      return result;
    }
    __name(setToArray2, "setToArray");
    _setToArray = setToArray2;
    return _setToArray;
  }
  __name(require_setToArray, "require_setToArray");
  var _equalByTag;
  var hasRequired_equalByTag;
  function require_equalByTag() {
    if (hasRequired_equalByTag) return _equalByTag;
    hasRequired_equalByTag = 1;
    var Symbol2 = require_Symbol(), Uint8Array2 = require_Uint8Array(), eq2 = requireEq(), equalArrays2 = require_equalArrays(), mapToArray2 = require_mapToArray(), setToArray2 = require_setToArray();
    var COMPARE_PARTIAL_FLAG2 = 1, COMPARE_UNORDERED_FLAG2 = 2;
    var boolTag2 = "[object Boolean]", dateTag2 = "[object Date]", errorTag2 = "[object Error]", mapTag2 = "[object Map]", numberTag2 = "[object Number]", regexpTag2 = "[object RegExp]", setTag2 = "[object Set]", stringTag2 = "[object String]", symbolTag2 = "[object Symbol]";
    var arrayBufferTag2 = "[object ArrayBuffer]", dataViewTag2 = "[object DataView]";
    var symbolProto2 = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf2 = symbolProto2 ? symbolProto2.valueOf : void 0;
    function equalByTag2(object2, other, tag, bitmask, customizer, equalFunc, stack) {
      switch (tag) {
        case dataViewTag2:
          if (object2.byteLength != other.byteLength || object2.byteOffset != other.byteOffset) {
            return false;
          }
          object2 = object2.buffer;
          other = other.buffer;
        case arrayBufferTag2:
          if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object2), new Uint8Array2(other))) {
            return false;
          }
          return true;
        case boolTag2:
        case dateTag2:
        case numberTag2:
          return eq2(+object2, +other);
        case errorTag2:
          return object2.name == other.name && object2.message == other.message;
        case regexpTag2:
        case stringTag2:
          return object2 == other + "";
        case mapTag2:
          var convert = mapToArray2;
        case setTag2:
          var isPartial = bitmask & COMPARE_PARTIAL_FLAG2;
          convert || (convert = setToArray2);
          if (object2.size != other.size && !isPartial) {
            return false;
          }
          var stacked = stack.get(object2);
          if (stacked) {
            return stacked == other;
          }
          bitmask |= COMPARE_UNORDERED_FLAG2;
          stack.set(object2, other);
          var result = equalArrays2(convert(object2), convert(other), bitmask, customizer, equalFunc, stack);
          stack["delete"](object2);
          return result;
        case symbolTag2:
          if (symbolValueOf2) {
            return symbolValueOf2.call(object2) == symbolValueOf2.call(other);
          }
      }
      return false;
    }
    __name(equalByTag2, "equalByTag");
    _equalByTag = equalByTag2;
    return _equalByTag;
  }
  __name(require_equalByTag, "require_equalByTag");
  var _arrayPush;
  var hasRequired_arrayPush;
  function require_arrayPush() {
    if (hasRequired_arrayPush) return _arrayPush;
    hasRequired_arrayPush = 1;
    function arrayPush2(array2, values) {
      var index2 = -1, length = values.length, offset2 = array2.length;
      while (++index2 < length) {
        array2[offset2 + index2] = values[index2];
      }
      return array2;
    }
    __name(arrayPush2, "arrayPush");
    _arrayPush = arrayPush2;
    return _arrayPush;
  }
  __name(require_arrayPush, "require_arrayPush");
  var _baseGetAllKeys;
  var hasRequired_baseGetAllKeys;
  function require_baseGetAllKeys() {
    if (hasRequired_baseGetAllKeys) return _baseGetAllKeys;
    hasRequired_baseGetAllKeys = 1;
    var arrayPush2 = require_arrayPush(), isArray2 = requireIsArray();
    function baseGetAllKeys2(object2, keysFunc, symbolsFunc) {
      var result = keysFunc(object2);
      return isArray2(object2) ? result : arrayPush2(result, symbolsFunc(object2));
    }
    __name(baseGetAllKeys2, "baseGetAllKeys");
    _baseGetAllKeys = baseGetAllKeys2;
    return _baseGetAllKeys;
  }
  __name(require_baseGetAllKeys, "require_baseGetAllKeys");
  var _arrayFilter;
  var hasRequired_arrayFilter;
  function require_arrayFilter() {
    if (hasRequired_arrayFilter) return _arrayFilter;
    hasRequired_arrayFilter = 1;
    function arrayFilter2(array2, predicate) {
      var index2 = -1, length = array2 == null ? 0 : array2.length, resIndex = 0, result = [];
      while (++index2 < length) {
        var value = array2[index2];
        if (predicate(value, index2, array2)) {
          result[resIndex++] = value;
        }
      }
      return result;
    }
    __name(arrayFilter2, "arrayFilter");
    _arrayFilter = arrayFilter2;
    return _arrayFilter;
  }
  __name(require_arrayFilter, "require_arrayFilter");
  var stubArray_1;
  var hasRequiredStubArray;
  function requireStubArray() {
    if (hasRequiredStubArray) return stubArray_1;
    hasRequiredStubArray = 1;
    function stubArray2() {
      return [];
    }
    __name(stubArray2, "stubArray");
    stubArray_1 = stubArray2;
    return stubArray_1;
  }
  __name(requireStubArray, "requireStubArray");
  var _getSymbols;
  var hasRequired_getSymbols;
  function require_getSymbols() {
    if (hasRequired_getSymbols) return _getSymbols;
    hasRequired_getSymbols = 1;
    var arrayFilter2 = require_arrayFilter(), stubArray2 = requireStubArray();
    var objectProto2 = Object.prototype;
    var propertyIsEnumerable2 = objectProto2.propertyIsEnumerable;
    var nativeGetSymbols2 = Object.getOwnPropertySymbols;
    var getSymbols2 = !nativeGetSymbols2 ? stubArray2 : function(object2) {
      if (object2 == null) {
        return [];
      }
      object2 = Object(object2);
      return arrayFilter2(nativeGetSymbols2(object2), function(symbol) {
        return propertyIsEnumerable2.call(object2, symbol);
      });
    };
    _getSymbols = getSymbols2;
    return _getSymbols;
  }
  __name(require_getSymbols, "require_getSymbols");
  var _baseTimes;
  var hasRequired_baseTimes;
  function require_baseTimes() {
    if (hasRequired_baseTimes) return _baseTimes;
    hasRequired_baseTimes = 1;
    function baseTimes2(n2, iteratee) {
      var index2 = -1, result = Array(n2);
      while (++index2 < n2) {
        result[index2] = iteratee(index2);
      }
      return result;
    }
    __name(baseTimes2, "baseTimes");
    _baseTimes = baseTimes2;
    return _baseTimes;
  }
  __name(require_baseTimes, "require_baseTimes");
  var _baseIsArguments;
  var hasRequired_baseIsArguments;
  function require_baseIsArguments() {
    if (hasRequired_baseIsArguments) return _baseIsArguments;
    hasRequired_baseIsArguments = 1;
    var baseGetTag2 = require_baseGetTag(), isObjectLike2 = requireIsObjectLike();
    var argsTag2 = "[object Arguments]";
    function baseIsArguments2(value) {
      return isObjectLike2(value) && baseGetTag2(value) == argsTag2;
    }
    __name(baseIsArguments2, "baseIsArguments");
    _baseIsArguments = baseIsArguments2;
    return _baseIsArguments;
  }
  __name(require_baseIsArguments, "require_baseIsArguments");
  var isArguments_1;
  var hasRequiredIsArguments;
  function requireIsArguments() {
    if (hasRequiredIsArguments) return isArguments_1;
    hasRequiredIsArguments = 1;
    var baseIsArguments2 = require_baseIsArguments(), isObjectLike2 = requireIsObjectLike();
    var objectProto2 = Object.prototype;
    var hasOwnProperty2 = objectProto2.hasOwnProperty;
    var propertyIsEnumerable2 = objectProto2.propertyIsEnumerable;
    var isArguments2 = baseIsArguments2(/* @__PURE__ */ (function() {
      return arguments;
    })()) ? baseIsArguments2 : function(value) {
      return isObjectLike2(value) && hasOwnProperty2.call(value, "callee") && !propertyIsEnumerable2.call(value, "callee");
    };
    isArguments_1 = isArguments2;
    return isArguments_1;
  }
  __name(requireIsArguments, "requireIsArguments");
  var isBuffer$1 = { exports: {} };
  var stubFalse_1;
  var hasRequiredStubFalse;
  function requireStubFalse() {
    if (hasRequiredStubFalse) return stubFalse_1;
    hasRequiredStubFalse = 1;
    function stubFalse2() {
      return false;
    }
    __name(stubFalse2, "stubFalse");
    stubFalse_1 = stubFalse2;
    return stubFalse_1;
  }
  __name(requireStubFalse, "requireStubFalse");
  isBuffer$1.exports;
  var hasRequiredIsBuffer;
  function requireIsBuffer() {
    if (hasRequiredIsBuffer) return isBuffer$1.exports;
    hasRequiredIsBuffer = 1;
    (function(module2, exports2) {
      var root2 = require_root(), stubFalse2 = requireStubFalse();
      var freeExports2 = exports2 && !exports2.nodeType && exports2;
      var freeModule2 = freeExports2 && true && module2 && !module2.nodeType && module2;
      var moduleExports2 = freeModule2 && freeModule2.exports === freeExports2;
      var Buffer3 = moduleExports2 ? root2.Buffer : void 0;
      var nativeIsBuffer2 = Buffer3 ? Buffer3.isBuffer : void 0;
      var isBuffer2 = nativeIsBuffer2 || stubFalse2;
      module2.exports = isBuffer2;
    })(isBuffer$1, isBuffer$1.exports);
    return isBuffer$1.exports;
  }
  __name(requireIsBuffer, "requireIsBuffer");
  var _isIndex;
  var hasRequired_isIndex;
  function require_isIndex() {
    if (hasRequired_isIndex) return _isIndex;
    hasRequired_isIndex = 1;
    var MAX_SAFE_INTEGER2 = 9007199254740991;
    var reIsUint2 = /^(?:0|[1-9]\d*)$/;
    function isIndex2(value, length) {
      var type = typeof value;
      length = length == null ? MAX_SAFE_INTEGER2 : length;
      return !!length && (type == "number" || type != "symbol" && reIsUint2.test(value)) && (value > -1 && value % 1 == 0 && value < length);
    }
    __name(isIndex2, "isIndex");
    _isIndex = isIndex2;
    return _isIndex;
  }
  __name(require_isIndex, "require_isIndex");
  var isLength_1;
  var hasRequiredIsLength;
  function requireIsLength() {
    if (hasRequiredIsLength) return isLength_1;
    hasRequiredIsLength = 1;
    var MAX_SAFE_INTEGER2 = 9007199254740991;
    function isLength2(value) {
      return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER2;
    }
    __name(isLength2, "isLength");
    isLength_1 = isLength2;
    return isLength_1;
  }
  __name(requireIsLength, "requireIsLength");
  var _baseIsTypedArray;
  var hasRequired_baseIsTypedArray;
  function require_baseIsTypedArray() {
    if (hasRequired_baseIsTypedArray) return _baseIsTypedArray;
    hasRequired_baseIsTypedArray = 1;
    var baseGetTag2 = require_baseGetTag(), isLength2 = requireIsLength(), isObjectLike2 = requireIsObjectLike();
    var argsTag2 = "[object Arguments]", arrayTag2 = "[object Array]", boolTag2 = "[object Boolean]", dateTag2 = "[object Date]", errorTag2 = "[object Error]", funcTag2 = "[object Function]", mapTag2 = "[object Map]", numberTag2 = "[object Number]", objectTag2 = "[object Object]", regexpTag2 = "[object RegExp]", setTag2 = "[object Set]", stringTag2 = "[object String]", weakMapTag2 = "[object WeakMap]";
    var arrayBufferTag2 = "[object ArrayBuffer]", dataViewTag2 = "[object DataView]", float32Tag2 = "[object Float32Array]", float64Tag2 = "[object Float64Array]", int8Tag2 = "[object Int8Array]", int16Tag2 = "[object Int16Array]", int32Tag2 = "[object Int32Array]", uint8Tag2 = "[object Uint8Array]", uint8ClampedTag2 = "[object Uint8ClampedArray]", uint16Tag2 = "[object Uint16Array]", uint32Tag2 = "[object Uint32Array]";
    var typedArrayTags2 = {};
    typedArrayTags2[float32Tag2] = typedArrayTags2[float64Tag2] = typedArrayTags2[int8Tag2] = typedArrayTags2[int16Tag2] = typedArrayTags2[int32Tag2] = typedArrayTags2[uint8Tag2] = typedArrayTags2[uint8ClampedTag2] = typedArrayTags2[uint16Tag2] = typedArrayTags2[uint32Tag2] = true;
    typedArrayTags2[argsTag2] = typedArrayTags2[arrayTag2] = typedArrayTags2[arrayBufferTag2] = typedArrayTags2[boolTag2] = typedArrayTags2[dataViewTag2] = typedArrayTags2[dateTag2] = typedArrayTags2[errorTag2] = typedArrayTags2[funcTag2] = typedArrayTags2[mapTag2] = typedArrayTags2[numberTag2] = typedArrayTags2[objectTag2] = typedArrayTags2[regexpTag2] = typedArrayTags2[setTag2] = typedArrayTags2[stringTag2] = typedArrayTags2[weakMapTag2] = false;
    function baseIsTypedArray2(value) {
      return isObjectLike2(value) && isLength2(value.length) && !!typedArrayTags2[baseGetTag2(value)];
    }
    __name(baseIsTypedArray2, "baseIsTypedArray");
    _baseIsTypedArray = baseIsTypedArray2;
    return _baseIsTypedArray;
  }
  __name(require_baseIsTypedArray, "require_baseIsTypedArray");
  var _baseUnary;
  var hasRequired_baseUnary;
  function require_baseUnary() {
    if (hasRequired_baseUnary) return _baseUnary;
    hasRequired_baseUnary = 1;
    function baseUnary2(func) {
      return function(value) {
        return func(value);
      };
    }
    __name(baseUnary2, "baseUnary");
    _baseUnary = baseUnary2;
    return _baseUnary;
  }
  __name(require_baseUnary, "require_baseUnary");
  var _nodeUtil = { exports: {} };
  _nodeUtil.exports;
  var hasRequired_nodeUtil;
  function require_nodeUtil() {
    if (hasRequired_nodeUtil) return _nodeUtil.exports;
    hasRequired_nodeUtil = 1;
    (function(module2, exports2) {
      var freeGlobal2 = require_freeGlobal();
      var freeExports2 = exports2 && !exports2.nodeType && exports2;
      var freeModule2 = freeExports2 && true && module2 && !module2.nodeType && module2;
      var moduleExports2 = freeModule2 && freeModule2.exports === freeExports2;
      var freeProcess2 = moduleExports2 && freeGlobal2.process;
      var nodeUtil2 = (function() {
        try {
          var types = freeModule2 && freeModule2.require && freeModule2.require("util").types;
          if (types) {
            return types;
          }
          return freeProcess2 && freeProcess2.binding && freeProcess2.binding("util");
        } catch (e) {
        }
      })();
      module2.exports = nodeUtil2;
    })(_nodeUtil, _nodeUtil.exports);
    return _nodeUtil.exports;
  }
  __name(require_nodeUtil, "require_nodeUtil");
  var isTypedArray_1;
  var hasRequiredIsTypedArray;
  function requireIsTypedArray() {
    if (hasRequiredIsTypedArray) return isTypedArray_1;
    hasRequiredIsTypedArray = 1;
    var baseIsTypedArray2 = require_baseIsTypedArray(), baseUnary2 = require_baseUnary(), nodeUtil2 = require_nodeUtil();
    var nodeIsTypedArray2 = nodeUtil2 && nodeUtil2.isTypedArray;
    var isTypedArray2 = nodeIsTypedArray2 ? baseUnary2(nodeIsTypedArray2) : baseIsTypedArray2;
    isTypedArray_1 = isTypedArray2;
    return isTypedArray_1;
  }
  __name(requireIsTypedArray, "requireIsTypedArray");
  var _arrayLikeKeys;
  var hasRequired_arrayLikeKeys;
  function require_arrayLikeKeys() {
    if (hasRequired_arrayLikeKeys) return _arrayLikeKeys;
    hasRequired_arrayLikeKeys = 1;
    var baseTimes2 = require_baseTimes(), isArguments2 = requireIsArguments(), isArray2 = requireIsArray(), isBuffer2 = requireIsBuffer(), isIndex2 = require_isIndex(), isTypedArray2 = requireIsTypedArray();
    var objectProto2 = Object.prototype;
    var hasOwnProperty2 = objectProto2.hasOwnProperty;
    function arrayLikeKeys2(value, inherited) {
      var isArr = isArray2(value), isArg = !isArr && isArguments2(value), isBuff = !isArr && !isArg && isBuffer2(value), isType = !isArr && !isArg && !isBuff && isTypedArray2(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes2(value.length, String) : [], length = result.length;
      for (var key in value) {
        if ((inherited || hasOwnProperty2.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
        (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
        isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
        isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
        isIndex2(key, length)))) {
          result.push(key);
        }
      }
      return result;
    }
    __name(arrayLikeKeys2, "arrayLikeKeys");
    _arrayLikeKeys = arrayLikeKeys2;
    return _arrayLikeKeys;
  }
  __name(require_arrayLikeKeys, "require_arrayLikeKeys");
  var _isPrototype;
  var hasRequired_isPrototype;
  function require_isPrototype() {
    if (hasRequired_isPrototype) return _isPrototype;
    hasRequired_isPrototype = 1;
    var objectProto2 = Object.prototype;
    function isPrototype2(value) {
      var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto2;
      return value === proto;
    }
    __name(isPrototype2, "isPrototype");
    _isPrototype = isPrototype2;
    return _isPrototype;
  }
  __name(require_isPrototype, "require_isPrototype");
  var _overArg;
  var hasRequired_overArg;
  function require_overArg() {
    if (hasRequired_overArg) return _overArg;
    hasRequired_overArg = 1;
    function overArg2(func, transform) {
      return function(arg) {
        return func(transform(arg));
      };
    }
    __name(overArg2, "overArg");
    _overArg = overArg2;
    return _overArg;
  }
  __name(require_overArg, "require_overArg");
  var _nativeKeys;
  var hasRequired_nativeKeys;
  function require_nativeKeys() {
    if (hasRequired_nativeKeys) return _nativeKeys;
    hasRequired_nativeKeys = 1;
    var overArg2 = require_overArg();
    var nativeKeys2 = overArg2(Object.keys, Object);
    _nativeKeys = nativeKeys2;
    return _nativeKeys;
  }
  __name(require_nativeKeys, "require_nativeKeys");
  var _baseKeys;
  var hasRequired_baseKeys;
  function require_baseKeys() {
    if (hasRequired_baseKeys) return _baseKeys;
    hasRequired_baseKeys = 1;
    var isPrototype2 = require_isPrototype(), nativeKeys2 = require_nativeKeys();
    var objectProto2 = Object.prototype;
    var hasOwnProperty2 = objectProto2.hasOwnProperty;
    function baseKeys2(object2) {
      if (!isPrototype2(object2)) {
        return nativeKeys2(object2);
      }
      var result = [];
      for (var key in Object(object2)) {
        if (hasOwnProperty2.call(object2, key) && key != "constructor") {
          result.push(key);
        }
      }
      return result;
    }
    __name(baseKeys2, "baseKeys");
    _baseKeys = baseKeys2;
    return _baseKeys;
  }
  __name(require_baseKeys, "require_baseKeys");
  var isArrayLike_1;
  var hasRequiredIsArrayLike;
  function requireIsArrayLike() {
    if (hasRequiredIsArrayLike) return isArrayLike_1;
    hasRequiredIsArrayLike = 1;
    var isFunction2 = requireIsFunction(), isLength2 = requireIsLength();
    function isArrayLike2(value) {
      return value != null && isLength2(value.length) && !isFunction2(value);
    }
    __name(isArrayLike2, "isArrayLike");
    isArrayLike_1 = isArrayLike2;
    return isArrayLike_1;
  }
  __name(requireIsArrayLike, "requireIsArrayLike");
  var keys_1;
  var hasRequiredKeys;
  function requireKeys() {
    if (hasRequiredKeys) return keys_1;
    hasRequiredKeys = 1;
    var arrayLikeKeys2 = require_arrayLikeKeys(), baseKeys2 = require_baseKeys(), isArrayLike2 = requireIsArrayLike();
    function keys2(object2) {
      return isArrayLike2(object2) ? arrayLikeKeys2(object2) : baseKeys2(object2);
    }
    __name(keys2, "keys");
    keys_1 = keys2;
    return keys_1;
  }
  __name(requireKeys, "requireKeys");
  var _getAllKeys;
  var hasRequired_getAllKeys;
  function require_getAllKeys() {
    if (hasRequired_getAllKeys) return _getAllKeys;
    hasRequired_getAllKeys = 1;
    var baseGetAllKeys2 = require_baseGetAllKeys(), getSymbols2 = require_getSymbols(), keys2 = requireKeys();
    function getAllKeys2(object2) {
      return baseGetAllKeys2(object2, keys2, getSymbols2);
    }
    __name(getAllKeys2, "getAllKeys");
    _getAllKeys = getAllKeys2;
    return _getAllKeys;
  }
  __name(require_getAllKeys, "require_getAllKeys");
  var _equalObjects;
  var hasRequired_equalObjects;
  function require_equalObjects() {
    if (hasRequired_equalObjects) return _equalObjects;
    hasRequired_equalObjects = 1;
    var getAllKeys2 = require_getAllKeys();
    var COMPARE_PARTIAL_FLAG2 = 1;
    var objectProto2 = Object.prototype;
    var hasOwnProperty2 = objectProto2.hasOwnProperty;
    function equalObjects2(object2, other, bitmask, customizer, equalFunc, stack) {
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG2, objProps = getAllKeys2(object2), objLength = objProps.length, othProps = getAllKeys2(other), othLength = othProps.length;
      if (objLength != othLength && !isPartial) {
        return false;
      }
      var index2 = objLength;
      while (index2--) {
        var key = objProps[index2];
        if (!(isPartial ? key in other : hasOwnProperty2.call(other, key))) {
          return false;
        }
      }
      var objStacked = stack.get(object2);
      var othStacked = stack.get(other);
      if (objStacked && othStacked) {
        return objStacked == other && othStacked == object2;
      }
      var result = true;
      stack.set(object2, other);
      stack.set(other, object2);
      var skipCtor = isPartial;
      while (++index2 < objLength) {
        key = objProps[index2];
        var objValue = object2[key], othValue = other[key];
        if (customizer) {
          var compared = isPartial ? customizer(othValue, objValue, key, other, object2, stack) : customizer(objValue, othValue, key, object2, other, stack);
        }
        if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
          result = false;
          break;
        }
        skipCtor || (skipCtor = key == "constructor");
      }
      if (result && !skipCtor) {
        var objCtor = object2.constructor, othCtor = other.constructor;
        if (objCtor != othCtor && ("constructor" in object2 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
          result = false;
        }
      }
      stack["delete"](object2);
      stack["delete"](other);
      return result;
    }
    __name(equalObjects2, "equalObjects");
    _equalObjects = equalObjects2;
    return _equalObjects;
  }
  __name(require_equalObjects, "require_equalObjects");
  var _DataView;
  var hasRequired_DataView;
  function require_DataView() {
    if (hasRequired_DataView) return _DataView;
    hasRequired_DataView = 1;
    var getNative2 = require_getNative(), root2 = require_root();
    var DataView2 = getNative2(root2, "DataView");
    _DataView = DataView2;
    return _DataView;
  }
  __name(require_DataView, "require_DataView");
  var _Promise;
  var hasRequired_Promise;
  function require_Promise() {
    if (hasRequired_Promise) return _Promise;
    hasRequired_Promise = 1;
    var getNative2 = require_getNative(), root2 = require_root();
    var Promise2 = getNative2(root2, "Promise");
    _Promise = Promise2;
    return _Promise;
  }
  __name(require_Promise, "require_Promise");
  var _Set;
  var hasRequired_Set;
  function require_Set() {
    if (hasRequired_Set) return _Set;
    hasRequired_Set = 1;
    var getNative2 = require_getNative(), root2 = require_root();
    var Set2 = getNative2(root2, "Set");
    _Set = Set2;
    return _Set;
  }
  __name(require_Set, "require_Set");
  var _WeakMap;
  var hasRequired_WeakMap;
  function require_WeakMap() {
    if (hasRequired_WeakMap) return _WeakMap;
    hasRequired_WeakMap = 1;
    var getNative2 = require_getNative(), root2 = require_root();
    var WeakMap2 = getNative2(root2, "WeakMap");
    _WeakMap = WeakMap2;
    return _WeakMap;
  }
  __name(require_WeakMap, "require_WeakMap");
  var _getTag;
  var hasRequired_getTag;
  function require_getTag() {
    if (hasRequired_getTag) return _getTag;
    hasRequired_getTag = 1;
    var DataView2 = require_DataView(), Map2 = require_Map(), Promise2 = require_Promise(), Set2 = require_Set(), WeakMap2 = require_WeakMap(), baseGetTag2 = require_baseGetTag(), toSource2 = require_toSource();
    var mapTag2 = "[object Map]", objectTag2 = "[object Object]", promiseTag2 = "[object Promise]", setTag2 = "[object Set]", weakMapTag2 = "[object WeakMap]";
    var dataViewTag2 = "[object DataView]";
    var dataViewCtorString2 = toSource2(DataView2), mapCtorString2 = toSource2(Map2), promiseCtorString2 = toSource2(Promise2), setCtorString2 = toSource2(Set2), weakMapCtorString2 = toSource2(WeakMap2);
    var getTag2 = baseGetTag2;
    if (DataView2 && getTag2(new DataView2(new ArrayBuffer(1))) != dataViewTag2 || Map2 && getTag2(new Map2()) != mapTag2 || Promise2 && getTag2(Promise2.resolve()) != promiseTag2 || Set2 && getTag2(new Set2()) != setTag2 || WeakMap2 && getTag2(new WeakMap2()) != weakMapTag2) {
      getTag2 = /* @__PURE__ */ __name(function(value) {
        var result = baseGetTag2(value), Ctor = result == objectTag2 ? value.constructor : void 0, ctorString = Ctor ? toSource2(Ctor) : "";
        if (ctorString) {
          switch (ctorString) {
            case dataViewCtorString2:
              return dataViewTag2;
            case mapCtorString2:
              return mapTag2;
            case promiseCtorString2:
              return promiseTag2;
            case setCtorString2:
              return setTag2;
            case weakMapCtorString2:
              return weakMapTag2;
          }
        }
        return result;
      }, "getTag");
    }
    _getTag = getTag2;
    return _getTag;
  }
  __name(require_getTag, "require_getTag");
  var _baseIsEqualDeep;
  var hasRequired_baseIsEqualDeep;
  function require_baseIsEqualDeep() {
    if (hasRequired_baseIsEqualDeep) return _baseIsEqualDeep;
    hasRequired_baseIsEqualDeep = 1;
    var Stack2 = require_Stack(), equalArrays2 = require_equalArrays(), equalByTag2 = require_equalByTag(), equalObjects2 = require_equalObjects(), getTag2 = require_getTag(), isArray2 = requireIsArray(), isBuffer2 = requireIsBuffer(), isTypedArray2 = requireIsTypedArray();
    var COMPARE_PARTIAL_FLAG2 = 1;
    var argsTag2 = "[object Arguments]", arrayTag2 = "[object Array]", objectTag2 = "[object Object]";
    var objectProto2 = Object.prototype;
    var hasOwnProperty2 = objectProto2.hasOwnProperty;
    function baseIsEqualDeep2(object2, other, bitmask, customizer, equalFunc, stack) {
      var objIsArr = isArray2(object2), othIsArr = isArray2(other), objTag = objIsArr ? arrayTag2 : getTag2(object2), othTag = othIsArr ? arrayTag2 : getTag2(other);
      objTag = objTag == argsTag2 ? objectTag2 : objTag;
      othTag = othTag == argsTag2 ? objectTag2 : othTag;
      var objIsObj = objTag == objectTag2, othIsObj = othTag == objectTag2, isSameTag = objTag == othTag;
      if (isSameTag && isBuffer2(object2)) {
        if (!isBuffer2(other)) {
          return false;
        }
        objIsArr = true;
        objIsObj = false;
      }
      if (isSameTag && !objIsObj) {
        stack || (stack = new Stack2());
        return objIsArr || isTypedArray2(object2) ? equalArrays2(object2, other, bitmask, customizer, equalFunc, stack) : equalByTag2(object2, other, objTag, bitmask, customizer, equalFunc, stack);
      }
      if (!(bitmask & COMPARE_PARTIAL_FLAG2)) {
        var objIsWrapped = objIsObj && hasOwnProperty2.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty2.call(other, "__wrapped__");
        if (objIsWrapped || othIsWrapped) {
          var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other;
          stack || (stack = new Stack2());
          return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
        }
      }
      if (!isSameTag) {
        return false;
      }
      stack || (stack = new Stack2());
      return equalObjects2(object2, other, bitmask, customizer, equalFunc, stack);
    }
    __name(baseIsEqualDeep2, "baseIsEqualDeep");
    _baseIsEqualDeep = baseIsEqualDeep2;
    return _baseIsEqualDeep;
  }
  __name(require_baseIsEqualDeep, "require_baseIsEqualDeep");
  var _baseIsEqual;
  var hasRequired_baseIsEqual;
  function require_baseIsEqual() {
    if (hasRequired_baseIsEqual) return _baseIsEqual;
    hasRequired_baseIsEqual = 1;
    var baseIsEqualDeep2 = require_baseIsEqualDeep(), isObjectLike2 = requireIsObjectLike();
    function baseIsEqual2(value, other, bitmask, customizer, stack) {
      if (value === other) {
        return true;
      }
      if (value == null || other == null || !isObjectLike2(value) && !isObjectLike2(other)) {
        return value !== value && other !== other;
      }
      return baseIsEqualDeep2(value, other, bitmask, customizer, baseIsEqual2, stack);
    }
    __name(baseIsEqual2, "baseIsEqual");
    _baseIsEqual = baseIsEqual2;
    return _baseIsEqual;
  }
  __name(require_baseIsEqual, "require_baseIsEqual");
  var _baseIsMatch;
  var hasRequired_baseIsMatch;
  function require_baseIsMatch() {
    if (hasRequired_baseIsMatch) return _baseIsMatch;
    hasRequired_baseIsMatch = 1;
    var Stack2 = require_Stack(), baseIsEqual2 = require_baseIsEqual();
    var COMPARE_PARTIAL_FLAG2 = 1, COMPARE_UNORDERED_FLAG2 = 2;
    function baseIsMatch(object2, source, matchData, customizer) {
      var index2 = matchData.length, length = index2, noCustomizer = !customizer;
      if (object2 == null) {
        return !length;
      }
      object2 = Object(object2);
      while (index2--) {
        var data = matchData[index2];
        if (noCustomizer && data[2] ? data[1] !== object2[data[0]] : !(data[0] in object2)) {
          return false;
        }
      }
      while (++index2 < length) {
        data = matchData[index2];
        var key = data[0], objValue = object2[key], srcValue = data[1];
        if (noCustomizer && data[2]) {
          if (objValue === void 0 && !(key in object2)) {
            return false;
          }
        } else {
          var stack = new Stack2();
          if (customizer) {
            var result = customizer(objValue, srcValue, key, object2, source, stack);
          }
          if (!(result === void 0 ? baseIsEqual2(srcValue, objValue, COMPARE_PARTIAL_FLAG2 | COMPARE_UNORDERED_FLAG2, customizer, stack) : result)) {
            return false;
          }
        }
      }
      return true;
    }
    __name(baseIsMatch, "baseIsMatch");
    _baseIsMatch = baseIsMatch;
    return _baseIsMatch;
  }
  __name(require_baseIsMatch, "require_baseIsMatch");
  var _isStrictComparable;
  var hasRequired_isStrictComparable;
  function require_isStrictComparable() {
    if (hasRequired_isStrictComparable) return _isStrictComparable;
    hasRequired_isStrictComparable = 1;
    var isObject2 = requireIsObject();
    function isStrictComparable(value) {
      return value === value && !isObject2(value);
    }
    __name(isStrictComparable, "isStrictComparable");
    _isStrictComparable = isStrictComparable;
    return _isStrictComparable;
  }
  __name(require_isStrictComparable, "require_isStrictComparable");
  var _getMatchData;
  var hasRequired_getMatchData;
  function require_getMatchData() {
    if (hasRequired_getMatchData) return _getMatchData;
    hasRequired_getMatchData = 1;
    var isStrictComparable = require_isStrictComparable(), keys2 = requireKeys();
    function getMatchData(object2) {
      var result = keys2(object2), length = result.length;
      while (length--) {
        var key = result[length], value = object2[key];
        result[length] = [key, value, isStrictComparable(value)];
      }
      return result;
    }
    __name(getMatchData, "getMatchData");
    _getMatchData = getMatchData;
    return _getMatchData;
  }
  __name(require_getMatchData, "require_getMatchData");
  var _matchesStrictComparable;
  var hasRequired_matchesStrictComparable;
  function require_matchesStrictComparable() {
    if (hasRequired_matchesStrictComparable) return _matchesStrictComparable;
    hasRequired_matchesStrictComparable = 1;
    function matchesStrictComparable(key, srcValue) {
      return function(object2) {
        if (object2 == null) {
          return false;
        }
        return object2[key] === srcValue && (srcValue !== void 0 || key in Object(object2));
      };
    }
    __name(matchesStrictComparable, "matchesStrictComparable");
    _matchesStrictComparable = matchesStrictComparable;
    return _matchesStrictComparable;
  }
  __name(require_matchesStrictComparable, "require_matchesStrictComparable");
  var _baseMatches;
  var hasRequired_baseMatches;
  function require_baseMatches() {
    if (hasRequired_baseMatches) return _baseMatches;
    hasRequired_baseMatches = 1;
    var baseIsMatch = require_baseIsMatch(), getMatchData = require_getMatchData(), matchesStrictComparable = require_matchesStrictComparable();
    function baseMatches(source) {
      var matchData = getMatchData(source);
      if (matchData.length == 1 && matchData[0][2]) {
        return matchesStrictComparable(matchData[0][0], matchData[0][1]);
      }
      return function(object2) {
        return object2 === source || baseIsMatch(object2, source, matchData);
      };
    }
    __name(baseMatches, "baseMatches");
    _baseMatches = baseMatches;
    return _baseMatches;
  }
  __name(require_baseMatches, "require_baseMatches");
  var _baseHasIn;
  var hasRequired_baseHasIn;
  function require_baseHasIn() {
    if (hasRequired_baseHasIn) return _baseHasIn;
    hasRequired_baseHasIn = 1;
    function baseHasIn(object2, key) {
      return object2 != null && key in Object(object2);
    }
    __name(baseHasIn, "baseHasIn");
    _baseHasIn = baseHasIn;
    return _baseHasIn;
  }
  __name(require_baseHasIn, "require_baseHasIn");
  var _hasPath;
  var hasRequired_hasPath;
  function require_hasPath() {
    if (hasRequired_hasPath) return _hasPath;
    hasRequired_hasPath = 1;
    var castPath = require_castPath(), isArguments2 = requireIsArguments(), isArray2 = requireIsArray(), isIndex2 = require_isIndex(), isLength2 = requireIsLength(), toKey = require_toKey();
    function hasPath(object2, path, hasFunc) {
      path = castPath(path, object2);
      var index2 = -1, length = path.length, result = false;
      while (++index2 < length) {
        var key = toKey(path[index2]);
        if (!(result = object2 != null && hasFunc(object2, key))) {
          break;
        }
        object2 = object2[key];
      }
      if (result || ++index2 != length) {
        return result;
      }
      length = object2 == null ? 0 : object2.length;
      return !!length && isLength2(length) && isIndex2(key, length) && (isArray2(object2) || isArguments2(object2));
    }
    __name(hasPath, "hasPath");
    _hasPath = hasPath;
    return _hasPath;
  }
  __name(require_hasPath, "require_hasPath");
  var hasIn_1;
  var hasRequiredHasIn;
  function requireHasIn() {
    if (hasRequiredHasIn) return hasIn_1;
    hasRequiredHasIn = 1;
    var baseHasIn = require_baseHasIn(), hasPath = require_hasPath();
    function hasIn(object2, path) {
      return object2 != null && hasPath(object2, path, baseHasIn);
    }
    __name(hasIn, "hasIn");
    hasIn_1 = hasIn;
    return hasIn_1;
  }
  __name(requireHasIn, "requireHasIn");
  var _baseMatchesProperty;
  var hasRequired_baseMatchesProperty;
  function require_baseMatchesProperty() {
    if (hasRequired_baseMatchesProperty) return _baseMatchesProperty;
    hasRequired_baseMatchesProperty = 1;
    var baseIsEqual2 = require_baseIsEqual(), get2 = requireGet(), hasIn = requireHasIn(), isKey2 = require_isKey(), isStrictComparable = require_isStrictComparable(), matchesStrictComparable = require_matchesStrictComparable(), toKey = require_toKey();
    var COMPARE_PARTIAL_FLAG2 = 1, COMPARE_UNORDERED_FLAG2 = 2;
    function baseMatchesProperty(path, srcValue) {
      if (isKey2(path) && isStrictComparable(srcValue)) {
        return matchesStrictComparable(toKey(path), srcValue);
      }
      return function(object2) {
        var objValue = get2(object2, path);
        return objValue === void 0 && objValue === srcValue ? hasIn(object2, path) : baseIsEqual2(srcValue, objValue, COMPARE_PARTIAL_FLAG2 | COMPARE_UNORDERED_FLAG2);
      };
    }
    __name(baseMatchesProperty, "baseMatchesProperty");
    _baseMatchesProperty = baseMatchesProperty;
    return _baseMatchesProperty;
  }
  __name(require_baseMatchesProperty, "require_baseMatchesProperty");
  var identity_1;
  var hasRequiredIdentity;
  function requireIdentity() {
    if (hasRequiredIdentity) return identity_1;
    hasRequiredIdentity = 1;
    function identity2(value) {
      return value;
    }
    __name(identity2, "identity");
    identity_1 = identity2;
    return identity_1;
  }
  __name(requireIdentity, "requireIdentity");
  var _baseProperty;
  var hasRequired_baseProperty;
  function require_baseProperty() {
    if (hasRequired_baseProperty) return _baseProperty;
    hasRequired_baseProperty = 1;
    function baseProperty(key) {
      return function(object2) {
        return object2 == null ? void 0 : object2[key];
      };
    }
    __name(baseProperty, "baseProperty");
    _baseProperty = baseProperty;
    return _baseProperty;
  }
  __name(require_baseProperty, "require_baseProperty");
  var _basePropertyDeep;
  var hasRequired_basePropertyDeep;
  function require_basePropertyDeep() {
    if (hasRequired_basePropertyDeep) return _basePropertyDeep;
    hasRequired_basePropertyDeep = 1;
    var baseGet2 = require_baseGet();
    function basePropertyDeep(path) {
      return function(object2) {
        return baseGet2(object2, path);
      };
    }
    __name(basePropertyDeep, "basePropertyDeep");
    _basePropertyDeep = basePropertyDeep;
    return _basePropertyDeep;
  }
  __name(require_basePropertyDeep, "require_basePropertyDeep");
  var property_1;
  var hasRequiredProperty;
  function requireProperty() {
    if (hasRequiredProperty) return property_1;
    hasRequiredProperty = 1;
    var baseProperty = require_baseProperty(), basePropertyDeep = require_basePropertyDeep(), isKey2 = require_isKey(), toKey = require_toKey();
    function property(path) {
      return isKey2(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
    }
    __name(property, "property");
    property_1 = property;
    return property_1;
  }
  __name(requireProperty, "requireProperty");
  var _baseIteratee;
  var hasRequired_baseIteratee;
  function require_baseIteratee() {
    if (hasRequired_baseIteratee) return _baseIteratee;
    hasRequired_baseIteratee = 1;
    var baseMatches = require_baseMatches(), baseMatchesProperty = require_baseMatchesProperty(), identity2 = requireIdentity(), isArray2 = requireIsArray(), property = requireProperty();
    function baseIteratee(value) {
      if (typeof value == "function") {
        return value;
      }
      if (value == null) {
        return identity2;
      }
      if (typeof value == "object") {
        return isArray2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
      }
      return property(value);
    }
    __name(baseIteratee, "baseIteratee");
    _baseIteratee = baseIteratee;
    return _baseIteratee;
  }
  __name(require_baseIteratee, "require_baseIteratee");
  var _baseFindIndex;
  var hasRequired_baseFindIndex;
  function require_baseFindIndex() {
    if (hasRequired_baseFindIndex) return _baseFindIndex;
    hasRequired_baseFindIndex = 1;
    function baseFindIndex(array2, predicate, fromIndex, fromRight) {
      var length = array2.length, index2 = fromIndex + (fromRight ? 1 : -1);
      while (fromRight ? index2-- : ++index2 < length) {
        if (predicate(array2[index2], index2, array2)) {
          return index2;
        }
      }
      return -1;
    }
    __name(baseFindIndex, "baseFindIndex");
    _baseFindIndex = baseFindIndex;
    return _baseFindIndex;
  }
  __name(require_baseFindIndex, "require_baseFindIndex");
  var _baseIsNaN;
  var hasRequired_baseIsNaN;
  function require_baseIsNaN() {
    if (hasRequired_baseIsNaN) return _baseIsNaN;
    hasRequired_baseIsNaN = 1;
    function baseIsNaN(value) {
      return value !== value;
    }
    __name(baseIsNaN, "baseIsNaN");
    _baseIsNaN = baseIsNaN;
    return _baseIsNaN;
  }
  __name(require_baseIsNaN, "require_baseIsNaN");
  var _strictIndexOf;
  var hasRequired_strictIndexOf;
  function require_strictIndexOf() {
    if (hasRequired_strictIndexOf) return _strictIndexOf;
    hasRequired_strictIndexOf = 1;
    function strictIndexOf(array2, value, fromIndex) {
      var index2 = fromIndex - 1, length = array2.length;
      while (++index2 < length) {
        if (array2[index2] === value) {
          return index2;
        }
      }
      return -1;
    }
    __name(strictIndexOf, "strictIndexOf");
    _strictIndexOf = strictIndexOf;
    return _strictIndexOf;
  }
  __name(require_strictIndexOf, "require_strictIndexOf");
  var _baseIndexOf;
  var hasRequired_baseIndexOf;
  function require_baseIndexOf() {
    if (hasRequired_baseIndexOf) return _baseIndexOf;
    hasRequired_baseIndexOf = 1;
    var baseFindIndex = require_baseFindIndex(), baseIsNaN = require_baseIsNaN(), strictIndexOf = require_strictIndexOf();
    function baseIndexOf(array2, value, fromIndex) {
      return value === value ? strictIndexOf(array2, value, fromIndex) : baseFindIndex(array2, baseIsNaN, fromIndex);
    }
    __name(baseIndexOf, "baseIndexOf");
    _baseIndexOf = baseIndexOf;
    return _baseIndexOf;
  }
  __name(require_baseIndexOf, "require_baseIndexOf");
  var _arrayIncludes;
  var hasRequired_arrayIncludes;
  function require_arrayIncludes() {
    if (hasRequired_arrayIncludes) return _arrayIncludes;
    hasRequired_arrayIncludes = 1;
    var baseIndexOf = require_baseIndexOf();
    function arrayIncludes(array2, value) {
      var length = array2 == null ? 0 : array2.length;
      return !!length && baseIndexOf(array2, value, 0) > -1;
    }
    __name(arrayIncludes, "arrayIncludes");
    _arrayIncludes = arrayIncludes;
    return _arrayIncludes;
  }
  __name(require_arrayIncludes, "require_arrayIncludes");
  var _arrayIncludesWith;
  var hasRequired_arrayIncludesWith;
  function require_arrayIncludesWith() {
    if (hasRequired_arrayIncludesWith) return _arrayIncludesWith;
    hasRequired_arrayIncludesWith = 1;
    function arrayIncludesWith(array2, value, comparator) {
      var index2 = -1, length = array2 == null ? 0 : array2.length;
      while (++index2 < length) {
        if (comparator(value, array2[index2])) {
          return true;
        }
      }
      return false;
    }
    __name(arrayIncludesWith, "arrayIncludesWith");
    _arrayIncludesWith = arrayIncludesWith;
    return _arrayIncludesWith;
  }
  __name(require_arrayIncludesWith, "require_arrayIncludesWith");
  var noop_1;
  var hasRequiredNoop;
  function requireNoop() {
    if (hasRequiredNoop) return noop_1;
    hasRequiredNoop = 1;
    function noop2() {
    }
    __name(noop2, "noop");
    noop_1 = noop2;
    return noop_1;
  }
  __name(requireNoop, "requireNoop");
  var _createSet;
  var hasRequired_createSet;
  function require_createSet() {
    if (hasRequired_createSet) return _createSet;
    hasRequired_createSet = 1;
    var Set2 = require_Set(), noop2 = requireNoop(), setToArray2 = require_setToArray();
    var INFINITY = 1 / 0;
    var createSet = !(Set2 && 1 / setToArray2(new Set2([, -0]))[1] == INFINITY) ? noop2 : function(values) {
      return new Set2(values);
    };
    _createSet = createSet;
    return _createSet;
  }
  __name(require_createSet, "require_createSet");
  var _baseUniq;
  var hasRequired_baseUniq;
  function require_baseUniq() {
    if (hasRequired_baseUniq) return _baseUniq;
    hasRequired_baseUniq = 1;
    var SetCache2 = require_SetCache(), arrayIncludes = require_arrayIncludes(), arrayIncludesWith = require_arrayIncludesWith(), cacheHas2 = require_cacheHas(), createSet = require_createSet(), setToArray2 = require_setToArray();
    var LARGE_ARRAY_SIZE2 = 200;
    function baseUniq(array2, iteratee, comparator) {
      var index2 = -1, includes = arrayIncludes, length = array2.length, isCommon = true, result = [], seen2 = result;
      if (comparator) {
        isCommon = false;
        includes = arrayIncludesWith;
      } else if (length >= LARGE_ARRAY_SIZE2) {
        var set2 = iteratee ? null : createSet(array2);
        if (set2) {
          return setToArray2(set2);
        }
        isCommon = false;
        includes = cacheHas2;
        seen2 = new SetCache2();
      } else {
        seen2 = iteratee ? [] : result;
      }
      outer:
        while (++index2 < length) {
          var value = array2[index2], computed = iteratee ? iteratee(value) : value;
          value = comparator || value !== 0 ? value : 0;
          if (isCommon && computed === computed) {
            var seenIndex = seen2.length;
            while (seenIndex--) {
              if (seen2[seenIndex] === computed) {
                continue outer;
              }
            }
            if (iteratee) {
              seen2.push(computed);
            }
            result.push(value);
          } else if (!includes(seen2, computed, comparator)) {
            if (seen2 !== result) {
              seen2.push(computed);
            }
            result.push(value);
          }
        }
      return result;
    }
    __name(baseUniq, "baseUniq");
    _baseUniq = baseUniq;
    return _baseUniq;
  }
  __name(require_baseUniq, "require_baseUniq");
  var uniqBy_1;
  var hasRequiredUniqBy;
  function requireUniqBy() {
    if (hasRequiredUniqBy) return uniqBy_1;
    hasRequiredUniqBy = 1;
    var baseIteratee = require_baseIteratee(), baseUniq = require_baseUniq();
    function uniqBy2(array2, iteratee) {
      return array2 && array2.length ? baseUniq(array2, baseIteratee(iteratee, 2)) : [];
    }
    __name(uniqBy2, "uniqBy");
    uniqBy_1 = uniqBy2;
    return uniqBy_1;
  }
  __name(requireUniqBy, "requireUniqBy");
  var uniqByExports = requireUniqBy();
  const uniqBy = /* @__PURE__ */ getDefaultExportFromCjs(uniqByExports);
  function getUniqPayload(payload, option, defaultUniqBy2) {
    if (option === true) {
      return uniqBy(payload, defaultUniqBy2);
    }
    if (isFunction$2(option)) {
      return uniqBy(payload, option);
    }
    return payload;
  }
  __name(getUniqPayload, "getUniqPayload");
  function _typeof$H(o2) {
    "@babel/helpers - typeof";
    return _typeof$H = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$H(o2);
  }
  __name(_typeof$H, "_typeof$H");
  var _excluded$f = ["ref"];
  function ownKeys$A(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$A, "ownKeys$A");
  function _objectSpread$A(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$A(Object(t2), true).forEach(function(r3) {
        _defineProperty$G(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$A(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$A, "_objectSpread$A");
  function _classCallCheck$k(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$k, "_classCallCheck$k");
  function _defineProperties$k(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$G(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$k, "_defineProperties$k");
  function _createClass$k(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$k(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties$k(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$k, "_createClass$k");
  function _callSuper$g(t2, o2, e) {
    return o2 = _getPrototypeOf$h(o2), _possibleConstructorReturn$h(t2, _isNativeReflectConstruct$h() ? Reflect.construct(o2, e || [], _getPrototypeOf$h(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$g, "_callSuper$g");
  function _possibleConstructorReturn$h(self2, call) {
    if (call && (_typeof$H(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$h(self2);
  }
  __name(_possibleConstructorReturn$h, "_possibleConstructorReturn$h");
  function _assertThisInitialized$h(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$h, "_assertThisInitialized$h");
  function _isNativeReflectConstruct$h() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$h = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$h, "_isNativeReflectConstruct$h");
  function _getPrototypeOf$h(o2) {
    _getPrototypeOf$h = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$h(o2);
  }
  __name(_getPrototypeOf$h, "_getPrototypeOf$h");
  function _inherits$h(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$h(subClass, superClass);
  }
  __name(_inherits$h, "_inherits$h");
  function _setPrototypeOf$h(o2, p2) {
    _setPrototypeOf$h = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$h(o2, p2);
  }
  __name(_setPrototypeOf$h, "_setPrototypeOf$h");
  function _defineProperty$G(obj, key, value) {
    key = _toPropertyKey$G(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$G, "_defineProperty$G");
  function _toPropertyKey$G(t2) {
    var i2 = _toPrimitive$G(t2, "string");
    return "symbol" == _typeof$H(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$G, "_toPropertyKey$G");
  function _toPrimitive$G(t2, r2) {
    if ("object" != _typeof$H(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$H(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$G, "_toPrimitive$G");
  function _objectWithoutProperties$f(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$f(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$f, "_objectWithoutProperties$f");
  function _objectWithoutPropertiesLoose$f(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$f, "_objectWithoutPropertiesLoose$f");
  function defaultUniqBy$1(entry) {
    return entry.value;
  }
  __name(defaultUniqBy$1, "defaultUniqBy$1");
  function renderContent$1(content, props) {
    if (/* @__PURE__ */ React.isValidElement(content)) {
      return /* @__PURE__ */ React.cloneElement(content, props);
    }
    if (typeof content === "function") {
      return /* @__PURE__ */ React.createElement(content, props);
    }
    props.ref;
    var otherProps = _objectWithoutProperties$f(props, _excluded$f);
    return /* @__PURE__ */ React.createElement(DefaultLegendContent, otherProps);
  }
  __name(renderContent$1, "renderContent$1");
  var EPS$1 = 1;
  var Legend = /* @__PURE__ */ (function(_PureComponent) {
    function Legend2() {
      var _this;
      _classCallCheck$k(this, Legend2);
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      _this = _callSuper$g(this, Legend2, [].concat(args));
      _defineProperty$G(_this, "lastBoundingBox", {
        width: -1,
        height: -1
      });
      return _this;
    }
    __name(Legend2, "Legend");
    _inherits$h(Legend2, _PureComponent);
    return _createClass$k(Legend2, [{
      key: "componentDidMount",
      value: /* @__PURE__ */ __name(function componentDidMount() {
        this.updateBBox();
      }, "componentDidMount")
    }, {
      key: "componentDidUpdate",
      value: /* @__PURE__ */ __name(function componentDidUpdate() {
        this.updateBBox();
      }, "componentDidUpdate")
    }, {
      key: "getBBox",
      value: /* @__PURE__ */ __name(function getBBox() {
        if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {
          var box = this.wrapperNode.getBoundingClientRect();
          box.height = this.wrapperNode.offsetHeight;
          box.width = this.wrapperNode.offsetWidth;
          return box;
        }
        return null;
      }, "getBBox")
    }, {
      key: "updateBBox",
      value: /* @__PURE__ */ __name(function updateBBox() {
        var onBBoxUpdate = this.props.onBBoxUpdate;
        var box = this.getBBox();
        if (box) {
          if (Math.abs(box.width - this.lastBoundingBox.width) > EPS$1 || Math.abs(box.height - this.lastBoundingBox.height) > EPS$1) {
            this.lastBoundingBox.width = box.width;
            this.lastBoundingBox.height = box.height;
            if (onBBoxUpdate) {
              onBBoxUpdate(box);
            }
          }
        } else if (this.lastBoundingBox.width !== -1 || this.lastBoundingBox.height !== -1) {
          this.lastBoundingBox.width = -1;
          this.lastBoundingBox.height = -1;
          if (onBBoxUpdate) {
            onBBoxUpdate(null);
          }
        }
      }, "updateBBox")
    }, {
      key: "getBBoxSnapshot",
      value: /* @__PURE__ */ __name(function getBBoxSnapshot() {
        if (this.lastBoundingBox.width >= 0 && this.lastBoundingBox.height >= 0) {
          return _objectSpread$A({}, this.lastBoundingBox);
        }
        return {
          width: 0,
          height: 0
        };
      }, "getBBoxSnapshot")
    }, {
      key: "getDefaultPosition",
      value: /* @__PURE__ */ __name(function getDefaultPosition(style) {
        var _this$props = this.props, layout = _this$props.layout, align = _this$props.align, verticalAlign = _this$props.verticalAlign, margin = _this$props.margin, chartWidth = _this$props.chartWidth, chartHeight = _this$props.chartHeight;
        var hPos, vPos;
        if (!style || (style.left === void 0 || style.left === null) && (style.right === void 0 || style.right === null)) {
          if (align === "center" && layout === "vertical") {
            var box = this.getBBoxSnapshot();
            hPos = {
              left: ((chartWidth || 0) - box.width) / 2
            };
          } else {
            hPos = align === "right" ? {
              right: margin && margin.right || 0
            } : {
              left: margin && margin.left || 0
            };
          }
        }
        if (!style || (style.top === void 0 || style.top === null) && (style.bottom === void 0 || style.bottom === null)) {
          if (verticalAlign === "middle") {
            var _box = this.getBBoxSnapshot();
            vPos = {
              top: ((chartHeight || 0) - _box.height) / 2
            };
          } else {
            vPos = verticalAlign === "bottom" ? {
              bottom: margin && margin.bottom || 0
            } : {
              top: margin && margin.top || 0
            };
          }
        }
        return _objectSpread$A(_objectSpread$A({}, hPos), vPos);
      }, "getDefaultPosition")
    }, {
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _this2 = this;
        var _this$props2 = this.props, content = _this$props2.content, width = _this$props2.width, height = _this$props2.height, wrapperStyle = _this$props2.wrapperStyle, payloadUniqBy = _this$props2.payloadUniqBy, payload = _this$props2.payload;
        var outerStyle = _objectSpread$A(_objectSpread$A({
          position: "absolute",
          width: width || "auto",
          height: height || "auto"
        }, this.getDefaultPosition(wrapperStyle)), wrapperStyle);
        return /* @__PURE__ */ React.createElement("div", {
          className: "recharts-legend-wrapper",
          style: outerStyle,
          ref: /* @__PURE__ */ __name(function ref(node) {
            _this2.wrapperNode = node;
          }, "ref")
        }, renderContent$1(content, _objectSpread$A(_objectSpread$A({}, this.props), {}, {
          payload: getUniqPayload(payload, payloadUniqBy, defaultUniqBy$1)
        })));
      }, "render")
    }], [{
      key: "getWithHeight",
      value: /* @__PURE__ */ __name(function getWithHeight(item, chartWidth) {
        var _this$defaultProps$it = _objectSpread$A(_objectSpread$A({}, this.defaultProps), item.props), layout = _this$defaultProps$it.layout;
        if (layout === "vertical" && isNumber(item.props.height)) {
          return {
            height: item.props.height
          };
        }
        if (layout === "horizontal") {
          return {
            width: item.props.width || chartWidth
          };
        }
        return null;
      }, "getWithHeight")
    }]);
  })(reactExports.PureComponent);
  _defineProperty$G(Legend, "displayName", "Legend");
  _defineProperty$G(Legend, "defaultProps", {
    iconSize: 14,
    layout: "horizontal",
    align: "center",
    verticalAlign: "bottom"
  });
  var _isFlattenable;
  var hasRequired_isFlattenable;
  function require_isFlattenable() {
    if (hasRequired_isFlattenable) return _isFlattenable;
    hasRequired_isFlattenable = 1;
    var Symbol2 = require_Symbol(), isArguments2 = requireIsArguments(), isArray2 = requireIsArray();
    var spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : void 0;
    function isFlattenable(value) {
      return isArray2(value) || isArguments2(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
    }
    __name(isFlattenable, "isFlattenable");
    _isFlattenable = isFlattenable;
    return _isFlattenable;
  }
  __name(require_isFlattenable, "require_isFlattenable");
  var _baseFlatten;
  var hasRequired_baseFlatten;
  function require_baseFlatten() {
    if (hasRequired_baseFlatten) return _baseFlatten;
    hasRequired_baseFlatten = 1;
    var arrayPush2 = require_arrayPush(), isFlattenable = require_isFlattenable();
    function baseFlatten(array2, depth, predicate, isStrict, result) {
      var index2 = -1, length = array2.length;
      predicate || (predicate = isFlattenable);
      result || (result = []);
      while (++index2 < length) {
        var value = array2[index2];
        if (depth > 0 && predicate(value)) {
          if (depth > 1) {
            baseFlatten(value, depth - 1, predicate, isStrict, result);
          } else {
            arrayPush2(result, value);
          }
        } else if (!isStrict) {
          result[result.length] = value;
        }
      }
      return result;
    }
    __name(baseFlatten, "baseFlatten");
    _baseFlatten = baseFlatten;
    return _baseFlatten;
  }
  __name(require_baseFlatten, "require_baseFlatten");
  var _createBaseFor;
  var hasRequired_createBaseFor;
  function require_createBaseFor() {
    if (hasRequired_createBaseFor) return _createBaseFor;
    hasRequired_createBaseFor = 1;
    function createBaseFor(fromRight) {
      return function(object2, iteratee, keysFunc) {
        var index2 = -1, iterable = Object(object2), props = keysFunc(object2), length = props.length;
        while (length--) {
          var key = props[fromRight ? length : ++index2];
          if (iteratee(iterable[key], key, iterable) === false) {
            break;
          }
        }
        return object2;
      };
    }
    __name(createBaseFor, "createBaseFor");
    _createBaseFor = createBaseFor;
    return _createBaseFor;
  }
  __name(require_createBaseFor, "require_createBaseFor");
  var _baseFor;
  var hasRequired_baseFor;
  function require_baseFor() {
    if (hasRequired_baseFor) return _baseFor;
    hasRequired_baseFor = 1;
    var createBaseFor = require_createBaseFor();
    var baseFor = createBaseFor();
    _baseFor = baseFor;
    return _baseFor;
  }
  __name(require_baseFor, "require_baseFor");
  var _baseForOwn;
  var hasRequired_baseForOwn;
  function require_baseForOwn() {
    if (hasRequired_baseForOwn) return _baseForOwn;
    hasRequired_baseForOwn = 1;
    var baseFor = require_baseFor(), keys2 = requireKeys();
    function baseForOwn(object2, iteratee) {
      return object2 && baseFor(object2, iteratee, keys2);
    }
    __name(baseForOwn, "baseForOwn");
    _baseForOwn = baseForOwn;
    return _baseForOwn;
  }
  __name(require_baseForOwn, "require_baseForOwn");
  var _createBaseEach;
  var hasRequired_createBaseEach;
  function require_createBaseEach() {
    if (hasRequired_createBaseEach) return _createBaseEach;
    hasRequired_createBaseEach = 1;
    var isArrayLike2 = requireIsArrayLike();
    function createBaseEach(eachFunc, fromRight) {
      return function(collection, iteratee) {
        if (collection == null) {
          return collection;
        }
        if (!isArrayLike2(collection)) {
          return eachFunc(collection, iteratee);
        }
        var length = collection.length, index2 = fromRight ? length : -1, iterable = Object(collection);
        while (fromRight ? index2-- : ++index2 < length) {
          if (iteratee(iterable[index2], index2, iterable) === false) {
            break;
          }
        }
        return collection;
      };
    }
    __name(createBaseEach, "createBaseEach");
    _createBaseEach = createBaseEach;
    return _createBaseEach;
  }
  __name(require_createBaseEach, "require_createBaseEach");
  var _baseEach;
  var hasRequired_baseEach;
  function require_baseEach() {
    if (hasRequired_baseEach) return _baseEach;
    hasRequired_baseEach = 1;
    var baseForOwn = require_baseForOwn(), createBaseEach = require_createBaseEach();
    var baseEach = createBaseEach(baseForOwn);
    _baseEach = baseEach;
    return _baseEach;
  }
  __name(require_baseEach, "require_baseEach");
  var _baseMap;
  var hasRequired_baseMap;
  function require_baseMap() {
    if (hasRequired_baseMap) return _baseMap;
    hasRequired_baseMap = 1;
    var baseEach = require_baseEach(), isArrayLike2 = requireIsArrayLike();
    function baseMap(collection, iteratee) {
      var index2 = -1, result = isArrayLike2(collection) ? Array(collection.length) : [];
      baseEach(collection, function(value, key, collection2) {
        result[++index2] = iteratee(value, key, collection2);
      });
      return result;
    }
    __name(baseMap, "baseMap");
    _baseMap = baseMap;
    return _baseMap;
  }
  __name(require_baseMap, "require_baseMap");
  var _baseSortBy;
  var hasRequired_baseSortBy;
  function require_baseSortBy() {
    if (hasRequired_baseSortBy) return _baseSortBy;
    hasRequired_baseSortBy = 1;
    function baseSortBy(array2, comparer) {
      var length = array2.length;
      array2.sort(comparer);
      while (length--) {
        array2[length] = array2[length].value;
      }
      return array2;
    }
    __name(baseSortBy, "baseSortBy");
    _baseSortBy = baseSortBy;
    return _baseSortBy;
  }
  __name(require_baseSortBy, "require_baseSortBy");
  var _compareAscending;
  var hasRequired_compareAscending;
  function require_compareAscending() {
    if (hasRequired_compareAscending) return _compareAscending;
    hasRequired_compareAscending = 1;
    var isSymbol = requireIsSymbol();
    function compareAscending(value, other) {
      if (value !== other) {
        var valIsDefined = value !== void 0, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
        var othIsDefined = other !== void 0, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
        if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
          return 1;
        }
        if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
          return -1;
        }
      }
      return 0;
    }
    __name(compareAscending, "compareAscending");
    _compareAscending = compareAscending;
    return _compareAscending;
  }
  __name(require_compareAscending, "require_compareAscending");
  var _compareMultiple;
  var hasRequired_compareMultiple;
  function require_compareMultiple() {
    if (hasRequired_compareMultiple) return _compareMultiple;
    hasRequired_compareMultiple = 1;
    var compareAscending = require_compareAscending();
    function compareMultiple(object2, other, orders) {
      var index2 = -1, objCriteria = object2.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
      while (++index2 < length) {
        var result = compareAscending(objCriteria[index2], othCriteria[index2]);
        if (result) {
          if (index2 >= ordersLength) {
            return result;
          }
          var order = orders[index2];
          return result * (order == "desc" ? -1 : 1);
        }
      }
      return object2.index - other.index;
    }
    __name(compareMultiple, "compareMultiple");
    _compareMultiple = compareMultiple;
    return _compareMultiple;
  }
  __name(require_compareMultiple, "require_compareMultiple");
  var _baseOrderBy;
  var hasRequired_baseOrderBy;
  function require_baseOrderBy() {
    if (hasRequired_baseOrderBy) return _baseOrderBy;
    hasRequired_baseOrderBy = 1;
    var arrayMap = require_arrayMap(), baseGet2 = require_baseGet(), baseIteratee = require_baseIteratee(), baseMap = require_baseMap(), baseSortBy = require_baseSortBy(), baseUnary2 = require_baseUnary(), compareMultiple = require_compareMultiple(), identity2 = requireIdentity(), isArray2 = requireIsArray();
    function baseOrderBy(collection, iteratees, orders) {
      if (iteratees.length) {
        iteratees = arrayMap(iteratees, function(iteratee) {
          if (isArray2(iteratee)) {
            return function(value) {
              return baseGet2(value, iteratee.length === 1 ? iteratee[0] : iteratee);
            };
          }
          return iteratee;
        });
      } else {
        iteratees = [identity2];
      }
      var index2 = -1;
      iteratees = arrayMap(iteratees, baseUnary2(baseIteratee));
      var result = baseMap(collection, function(value, key, collection2) {
        var criteria = arrayMap(iteratees, function(iteratee) {
          return iteratee(value);
        });
        return { "criteria": criteria, "index": ++index2, "value": value };
      });
      return baseSortBy(result, function(object2, other) {
        return compareMultiple(object2, other, orders);
      });
    }
    __name(baseOrderBy, "baseOrderBy");
    _baseOrderBy = baseOrderBy;
    return _baseOrderBy;
  }
  __name(require_baseOrderBy, "require_baseOrderBy");
  var _apply;
  var hasRequired_apply;
  function require_apply() {
    if (hasRequired_apply) return _apply;
    hasRequired_apply = 1;
    function apply(func, thisArg, args) {
      switch (args.length) {
        case 0:
          return func.call(thisArg);
        case 1:
          return func.call(thisArg, args[0]);
        case 2:
          return func.call(thisArg, args[0], args[1]);
        case 3:
          return func.call(thisArg, args[0], args[1], args[2]);
      }
      return func.apply(thisArg, args);
    }
    __name(apply, "apply");
    _apply = apply;
    return _apply;
  }
  __name(require_apply, "require_apply");
  var _overRest;
  var hasRequired_overRest;
  function require_overRest() {
    if (hasRequired_overRest) return _overRest;
    hasRequired_overRest = 1;
    var apply = require_apply();
    var nativeMax = Math.max;
    function overRest(func, start, transform) {
      start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
      return function() {
        var args = arguments, index2 = -1, length = nativeMax(args.length - start, 0), array2 = Array(length);
        while (++index2 < length) {
          array2[index2] = args[start + index2];
        }
        index2 = -1;
        var otherArgs = Array(start + 1);
        while (++index2 < start) {
          otherArgs[index2] = args[index2];
        }
        otherArgs[start] = transform(array2);
        return apply(func, this, otherArgs);
      };
    }
    __name(overRest, "overRest");
    _overRest = overRest;
    return _overRest;
  }
  __name(require_overRest, "require_overRest");
  var constant_1;
  var hasRequiredConstant;
  function requireConstant() {
    if (hasRequiredConstant) return constant_1;
    hasRequiredConstant = 1;
    function constant2(value) {
      return function() {
        return value;
      };
    }
    __name(constant2, "constant");
    constant_1 = constant2;
    return constant_1;
  }
  __name(requireConstant, "requireConstant");
  var _defineProperty$F;
  var hasRequired_defineProperty;
  function require_defineProperty() {
    if (hasRequired_defineProperty) return _defineProperty$F;
    hasRequired_defineProperty = 1;
    var getNative2 = require_getNative();
    var defineProperty = (function() {
      try {
        var func = getNative2(Object, "defineProperty");
        func({}, "", {});
        return func;
      } catch (e) {
      }
    })();
    _defineProperty$F = defineProperty;
    return _defineProperty$F;
  }
  __name(require_defineProperty, "require_defineProperty");
  var _baseSetToString;
  var hasRequired_baseSetToString;
  function require_baseSetToString() {
    if (hasRequired_baseSetToString) return _baseSetToString;
    hasRequired_baseSetToString = 1;
    var constant2 = requireConstant(), defineProperty = require_defineProperty(), identity2 = requireIdentity();
    var baseSetToString = !defineProperty ? identity2 : function(func, string2) {
      return defineProperty(func, "toString", {
        "configurable": true,
        "enumerable": false,
        "value": constant2(string2),
        "writable": true
      });
    };
    _baseSetToString = baseSetToString;
    return _baseSetToString;
  }
  __name(require_baseSetToString, "require_baseSetToString");
  var _shortOut;
  var hasRequired_shortOut;
  function require_shortOut() {
    if (hasRequired_shortOut) return _shortOut;
    hasRequired_shortOut = 1;
    var HOT_COUNT = 800, HOT_SPAN = 16;
    var nativeNow = Date.now;
    function shortOut(func) {
      var count2 = 0, lastCalled = 0;
      return function() {
        var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
        lastCalled = stamp;
        if (remaining > 0) {
          if (++count2 >= HOT_COUNT) {
            return arguments[0];
          }
        } else {
          count2 = 0;
        }
        return func.apply(void 0, arguments);
      };
    }
    __name(shortOut, "shortOut");
    _shortOut = shortOut;
    return _shortOut;
  }
  __name(require_shortOut, "require_shortOut");
  var _setToString;
  var hasRequired_setToString;
  function require_setToString() {
    if (hasRequired_setToString) return _setToString;
    hasRequired_setToString = 1;
    var baseSetToString = require_baseSetToString(), shortOut = require_shortOut();
    var setToString = shortOut(baseSetToString);
    _setToString = setToString;
    return _setToString;
  }
  __name(require_setToString, "require_setToString");
  var _baseRest;
  var hasRequired_baseRest;
  function require_baseRest() {
    if (hasRequired_baseRest) return _baseRest;
    hasRequired_baseRest = 1;
    var identity2 = requireIdentity(), overRest = require_overRest(), setToString = require_setToString();
    function baseRest(func, start) {
      return setToString(overRest(func, start, identity2), func + "");
    }
    __name(baseRest, "baseRest");
    _baseRest = baseRest;
    return _baseRest;
  }
  __name(require_baseRest, "require_baseRest");
  var _isIterateeCall;
  var hasRequired_isIterateeCall;
  function require_isIterateeCall() {
    if (hasRequired_isIterateeCall) return _isIterateeCall;
    hasRequired_isIterateeCall = 1;
    var eq2 = requireEq(), isArrayLike2 = requireIsArrayLike(), isIndex2 = require_isIndex(), isObject2 = requireIsObject();
    function isIterateeCall(value, index2, object2) {
      if (!isObject2(object2)) {
        return false;
      }
      var type = typeof index2;
      if (type == "number" ? isArrayLike2(object2) && isIndex2(index2, object2.length) : type == "string" && index2 in object2) {
        return eq2(object2[index2], value);
      }
      return false;
    }
    __name(isIterateeCall, "isIterateeCall");
    _isIterateeCall = isIterateeCall;
    return _isIterateeCall;
  }
  __name(require_isIterateeCall, "require_isIterateeCall");
  var sortBy_1;
  var hasRequiredSortBy;
  function requireSortBy() {
    if (hasRequiredSortBy) return sortBy_1;
    hasRequiredSortBy = 1;
    var baseFlatten = require_baseFlatten(), baseOrderBy = require_baseOrderBy(), baseRest = require_baseRest(), isIterateeCall = require_isIterateeCall();
    var sortBy2 = baseRest(function(collection, iteratees) {
      if (collection == null) {
        return [];
      }
      var length = iteratees.length;
      if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
        iteratees = [];
      } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
        iteratees = [iteratees[0]];
      }
      return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
    });
    sortBy_1 = sortBy2;
    return sortBy_1;
  }
  __name(requireSortBy, "requireSortBy");
  var sortByExports = requireSortBy();
  const sortBy = /* @__PURE__ */ getDefaultExportFromCjs(sortByExports);
  function _typeof$G(o2) {
    "@babel/helpers - typeof";
    return _typeof$G = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$G(o2);
  }
  __name(_typeof$G, "_typeof$G");
  function _extends$q() {
    _extends$q = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$q.apply(this, arguments);
  }
  __name(_extends$q, "_extends$q");
  function _slicedToArray$c(arr, i2) {
    return _arrayWithHoles$d(arr) || _iterableToArrayLimit$c(arr, i2) || _unsupportedIterableToArray$k(arr, i2) || _nonIterableRest$d();
  }
  __name(_slicedToArray$c, "_slicedToArray$c");
  function _nonIterableRest$d() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableRest$d, "_nonIterableRest$d");
  function _unsupportedIterableToArray$k(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$k(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$k(o2, minLen);
  }
  __name(_unsupportedIterableToArray$k, "_unsupportedIterableToArray$k");
  function _arrayLikeToArray$k(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$k, "_arrayLikeToArray$k");
  function _iterableToArrayLimit$c(r2, l) {
    var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
    if (null != t2) {
      var e, n2, i2, u2, a2 = [], f = true, o2 = false;
      try {
        if (i2 = (t2 = t2.call(r2)).next, 0 === l) ;
        else for (; !(f = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l); f = true) ;
      } catch (r3) {
        o2 = true, n2 = r3;
      } finally {
        try {
          if (!f && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
        } finally {
          if (o2) throw n2;
        }
      }
      return a2;
    }
  }
  __name(_iterableToArrayLimit$c, "_iterableToArrayLimit$c");
  function _arrayWithHoles$d(arr) {
    if (Array.isArray(arr)) return arr;
  }
  __name(_arrayWithHoles$d, "_arrayWithHoles$d");
  function ownKeys$z(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$z, "ownKeys$z");
  function _objectSpread$z(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$z(Object(t2), true).forEach(function(r3) {
        _defineProperty$E(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$z(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$z, "_objectSpread$z");
  function _defineProperty$E(obj, key, value) {
    key = _toPropertyKey$F(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$E, "_defineProperty$E");
  function _toPropertyKey$F(t2) {
    var i2 = _toPrimitive$F(t2, "string");
    return "symbol" == _typeof$G(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$F, "_toPropertyKey$F");
  function _toPrimitive$F(t2, r2) {
    if ("object" != _typeof$G(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$G(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$F, "_toPrimitive$F");
  function defaultFormatter(value) {
    return Array.isArray(value) && isNumOrStr(value[0]) && isNumOrStr(value[1]) ? value.join(" ~ ") : value;
  }
  __name(defaultFormatter, "defaultFormatter");
  var DefaultTooltipContent = /* @__PURE__ */ __name(function DefaultTooltipContent2(props) {
    var _props$separator = props.separator, separator = _props$separator === void 0 ? " : " : _props$separator, _props$contentStyle = props.contentStyle, contentStyle = _props$contentStyle === void 0 ? {} : _props$contentStyle, _props$itemStyle = props.itemStyle, itemStyle = _props$itemStyle === void 0 ? {} : _props$itemStyle, _props$labelStyle = props.labelStyle, labelStyle = _props$labelStyle === void 0 ? {} : _props$labelStyle, payload = props.payload, formatter = props.formatter, itemSorter = props.itemSorter, wrapperClassName = props.wrapperClassName, labelClassName = props.labelClassName, label = props.label, labelFormatter = props.labelFormatter, _props$accessibilityL = props.accessibilityLayer, accessibilityLayer = _props$accessibilityL === void 0 ? false : _props$accessibilityL;
    var renderContent2 = /* @__PURE__ */ __name(function renderContent3() {
      if (payload && payload.length) {
        var listStyle = {
          padding: 0,
          margin: 0
        };
        var items = (itemSorter ? sortBy(payload, itemSorter) : payload).map(function(entry, i2) {
          if (entry.type === "none") {
            return null;
          }
          var finalItemStyle = _objectSpread$z({
            display: "block",
            paddingTop: 4,
            paddingBottom: 4,
            color: entry.color || "#000"
          }, itemStyle);
          var finalFormatter = entry.formatter || formatter || defaultFormatter;
          var value = entry.value, name = entry.name;
          var finalValue = value;
          var finalName = name;
          if (finalFormatter && finalValue != null && finalName != null) {
            var formatted = finalFormatter(value, name, entry, i2, payload);
            if (Array.isArray(formatted)) {
              var _formatted = _slicedToArray$c(formatted, 2);
              finalValue = _formatted[0];
              finalName = _formatted[1];
            } else {
              finalValue = formatted;
            }
          }
          return (
            // eslint-disable-next-line react/no-array-index-key
            /* @__PURE__ */ React.createElement("li", {
              className: "recharts-tooltip-item",
              key: "tooltip-item-".concat(i2),
              style: finalItemStyle
            }, isNumOrStr(finalName) ? /* @__PURE__ */ React.createElement("span", {
              className: "recharts-tooltip-item-name"
            }, finalName) : null, isNumOrStr(finalName) ? /* @__PURE__ */ React.createElement("span", {
              className: "recharts-tooltip-item-separator"
            }, separator) : null, /* @__PURE__ */ React.createElement("span", {
              className: "recharts-tooltip-item-value"
            }, finalValue), /* @__PURE__ */ React.createElement("span", {
              className: "recharts-tooltip-item-unit"
            }, entry.unit || ""))
          );
        });
        return /* @__PURE__ */ React.createElement("ul", {
          className: "recharts-tooltip-item-list",
          style: listStyle
        }, items);
      }
      return null;
    }, "renderContent");
    var finalStyle = _objectSpread$z({
      margin: 0,
      padding: 10,
      backgroundColor: "#fff",
      border: "1px solid #ccc",
      whiteSpace: "nowrap"
    }, contentStyle);
    var finalLabelStyle = _objectSpread$z({
      margin: 0
    }, labelStyle);
    var hasLabel = !isNil(label);
    var finalLabel = hasLabel ? label : "";
    var wrapperCN = clsx("recharts-default-tooltip", wrapperClassName);
    var labelCN = clsx("recharts-tooltip-label", labelClassName);
    if (hasLabel && labelFormatter && payload !== void 0 && payload !== null) {
      finalLabel = labelFormatter(label, payload);
    }
    var accessibilityAttributes = accessibilityLayer ? {
      role: "status",
      "aria-live": "assertive"
    } : {};
    return /* @__PURE__ */ React.createElement("div", _extends$q({
      className: wrapperCN,
      style: finalStyle
    }, accessibilityAttributes), /* @__PURE__ */ React.createElement("p", {
      className: labelCN,
      style: finalLabelStyle
    }, /* @__PURE__ */ React.isValidElement(finalLabel) ? finalLabel : "".concat(finalLabel)), renderContent2());
  }, "DefaultTooltipContent");
  function _typeof$F(o2) {
    "@babel/helpers - typeof";
    return _typeof$F = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$F(o2);
  }
  __name(_typeof$F, "_typeof$F");
  function _defineProperty$D(obj, key, value) {
    key = _toPropertyKey$E(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$D, "_defineProperty$D");
  function _toPropertyKey$E(t2) {
    var i2 = _toPrimitive$E(t2, "string");
    return "symbol" == _typeof$F(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$E, "_toPropertyKey$E");
  function _toPrimitive$E(t2, r2) {
    if ("object" != _typeof$F(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$F(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$E, "_toPrimitive$E");
  var CSS_CLASS_PREFIX = "recharts-tooltip-wrapper";
  var TOOLTIP_HIDDEN = {
    visibility: "hidden"
  };
  function getTooltipCSSClassName(_ref) {
    var coordinate = _ref.coordinate, translateX = _ref.translateX, translateY = _ref.translateY;
    return clsx(CSS_CLASS_PREFIX, _defineProperty$D(_defineProperty$D(_defineProperty$D(_defineProperty$D({}, "".concat(CSS_CLASS_PREFIX, "-right"), isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX >= coordinate.x), "".concat(CSS_CLASS_PREFIX, "-left"), isNumber(translateX) && coordinate && isNumber(coordinate.x) && translateX < coordinate.x), "".concat(CSS_CLASS_PREFIX, "-bottom"), isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY >= coordinate.y), "".concat(CSS_CLASS_PREFIX, "-top"), isNumber(translateY) && coordinate && isNumber(coordinate.y) && translateY < coordinate.y));
  }
  __name(getTooltipCSSClassName, "getTooltipCSSClassName");
  function getTooltipTranslateXY(_ref2) {
    var allowEscapeViewBox = _ref2.allowEscapeViewBox, coordinate = _ref2.coordinate, key = _ref2.key, offsetTopLeft = _ref2.offsetTopLeft, position = _ref2.position, reverseDirection = _ref2.reverseDirection, tooltipDimension = _ref2.tooltipDimension, viewBox = _ref2.viewBox, viewBoxDimension = _ref2.viewBoxDimension;
    if (position && isNumber(position[key])) {
      return position[key];
    }
    var negative = coordinate[key] - tooltipDimension - offsetTopLeft;
    var positive = coordinate[key] + offsetTopLeft;
    if (allowEscapeViewBox[key]) {
      return reverseDirection[key] ? negative : positive;
    }
    if (reverseDirection[key]) {
      var _tooltipBoundary = negative;
      var _viewBoxBoundary = viewBox[key];
      if (_tooltipBoundary < _viewBoxBoundary) {
        return Math.max(positive, viewBox[key]);
      }
      return Math.max(negative, viewBox[key]);
    }
    var tooltipBoundary = positive + tooltipDimension;
    var viewBoxBoundary = viewBox[key] + viewBoxDimension;
    if (tooltipBoundary > viewBoxBoundary) {
      return Math.max(negative, viewBox[key]);
    }
    return Math.max(positive, viewBox[key]);
  }
  __name(getTooltipTranslateXY, "getTooltipTranslateXY");
  function getTransformStyle(_ref3) {
    var translateX = _ref3.translateX, translateY = _ref3.translateY, useTranslate3d = _ref3.useTranslate3d;
    return {
      transform: useTranslate3d ? "translate3d(".concat(translateX, "px, ").concat(translateY, "px, 0)") : "translate(".concat(translateX, "px, ").concat(translateY, "px)")
    };
  }
  __name(getTransformStyle, "getTransformStyle");
  function getTooltipTranslate(_ref4) {
    var allowEscapeViewBox = _ref4.allowEscapeViewBox, coordinate = _ref4.coordinate, offsetTopLeft = _ref4.offsetTopLeft, position = _ref4.position, reverseDirection = _ref4.reverseDirection, tooltipBox = _ref4.tooltipBox, useTranslate3d = _ref4.useTranslate3d, viewBox = _ref4.viewBox;
    var cssProperties, translateX, translateY;
    if (tooltipBox.height > 0 && tooltipBox.width > 0 && coordinate) {
      translateX = getTooltipTranslateXY({
        allowEscapeViewBox,
        coordinate,
        key: "x",
        offsetTopLeft,
        position,
        reverseDirection,
        tooltipDimension: tooltipBox.width,
        viewBox,
        viewBoxDimension: viewBox.width
      });
      translateY = getTooltipTranslateXY({
        allowEscapeViewBox,
        coordinate,
        key: "y",
        offsetTopLeft,
        position,
        reverseDirection,
        tooltipDimension: tooltipBox.height,
        viewBox,
        viewBoxDimension: viewBox.height
      });
      cssProperties = getTransformStyle({
        translateX,
        translateY,
        useTranslate3d
      });
    } else {
      cssProperties = TOOLTIP_HIDDEN;
    }
    return {
      cssProperties,
      cssClasses: getTooltipCSSClassName({
        translateX,
        translateY,
        coordinate
      })
    };
  }
  __name(getTooltipTranslate, "getTooltipTranslate");
  function _typeof$E(o2) {
    "@babel/helpers - typeof";
    return _typeof$E = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$E(o2);
  }
  __name(_typeof$E, "_typeof$E");
  function ownKeys$y(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$y, "ownKeys$y");
  function _objectSpread$y(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$y(Object(t2), true).forEach(function(r3) {
        _defineProperty$C(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$y(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$y, "_objectSpread$y");
  function _classCallCheck$j(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$j, "_classCallCheck$j");
  function _defineProperties$j(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$D(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$j, "_defineProperties$j");
  function _createClass$j(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$j(Constructor.prototype, protoProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$j, "_createClass$j");
  function _callSuper$f(t2, o2, e) {
    return o2 = _getPrototypeOf$g(o2), _possibleConstructorReturn$g(t2, _isNativeReflectConstruct$g() ? Reflect.construct(o2, e || [], _getPrototypeOf$g(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$f, "_callSuper$f");
  function _possibleConstructorReturn$g(self2, call) {
    if (call && (_typeof$E(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$g(self2);
  }
  __name(_possibleConstructorReturn$g, "_possibleConstructorReturn$g");
  function _assertThisInitialized$g(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$g, "_assertThisInitialized$g");
  function _isNativeReflectConstruct$g() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$g = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$g, "_isNativeReflectConstruct$g");
  function _getPrototypeOf$g(o2) {
    _getPrototypeOf$g = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$g(o2);
  }
  __name(_getPrototypeOf$g, "_getPrototypeOf$g");
  function _inherits$g(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$g(subClass, superClass);
  }
  __name(_inherits$g, "_inherits$g");
  function _setPrototypeOf$g(o2, p2) {
    _setPrototypeOf$g = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$g(o2, p2);
  }
  __name(_setPrototypeOf$g, "_setPrototypeOf$g");
  function _defineProperty$C(obj, key, value) {
    key = _toPropertyKey$D(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$C, "_defineProperty$C");
  function _toPropertyKey$D(t2) {
    var i2 = _toPrimitive$D(t2, "string");
    return "symbol" == _typeof$E(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$D, "_toPropertyKey$D");
  function _toPrimitive$D(t2, r2) {
    if ("object" != _typeof$E(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$E(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$D, "_toPrimitive$D");
  var EPSILON = 1;
  var TooltipBoundingBox = /* @__PURE__ */ (function(_PureComponent) {
    function TooltipBoundingBox2() {
      var _this;
      _classCallCheck$j(this, TooltipBoundingBox2);
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      _this = _callSuper$f(this, TooltipBoundingBox2, [].concat(args));
      _defineProperty$C(_this, "state", {
        dismissed: false,
        dismissedAtCoordinate: {
          x: 0,
          y: 0
        },
        lastBoundingBox: {
          width: -1,
          height: -1
        }
      });
      _defineProperty$C(_this, "handleKeyDown", function(event) {
        if (event.key === "Escape") {
          var _this$props$coordinat, _this$props$coordinat2, _this$props$coordinat3, _this$props$coordinat4;
          _this.setState({
            dismissed: true,
            dismissedAtCoordinate: {
              x: (_this$props$coordinat = (_this$props$coordinat2 = _this.props.coordinate) === null || _this$props$coordinat2 === void 0 ? void 0 : _this$props$coordinat2.x) !== null && _this$props$coordinat !== void 0 ? _this$props$coordinat : 0,
              y: (_this$props$coordinat3 = (_this$props$coordinat4 = _this.props.coordinate) === null || _this$props$coordinat4 === void 0 ? void 0 : _this$props$coordinat4.y) !== null && _this$props$coordinat3 !== void 0 ? _this$props$coordinat3 : 0
            }
          });
        }
      });
      return _this;
    }
    __name(TooltipBoundingBox2, "TooltipBoundingBox");
    _inherits$g(TooltipBoundingBox2, _PureComponent);
    return _createClass$j(TooltipBoundingBox2, [{
      key: "updateBBox",
      value: /* @__PURE__ */ __name(function updateBBox() {
        if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {
          var box = this.wrapperNode.getBoundingClientRect();
          if (Math.abs(box.width - this.state.lastBoundingBox.width) > EPSILON || Math.abs(box.height - this.state.lastBoundingBox.height) > EPSILON) {
            this.setState({
              lastBoundingBox: {
                width: box.width,
                height: box.height
              }
            });
          }
        } else if (this.state.lastBoundingBox.width !== -1 || this.state.lastBoundingBox.height !== -1) {
          this.setState({
            lastBoundingBox: {
              width: -1,
              height: -1
            }
          });
        }
      }, "updateBBox")
    }, {
      key: "componentDidMount",
      value: /* @__PURE__ */ __name(function componentDidMount() {
        document.addEventListener("keydown", this.handleKeyDown);
        this.updateBBox();
      }, "componentDidMount")
    }, {
      key: "componentWillUnmount",
      value: /* @__PURE__ */ __name(function componentWillUnmount() {
        document.removeEventListener("keydown", this.handleKeyDown);
      }, "componentWillUnmount")
    }, {
      key: "componentDidUpdate",
      value: /* @__PURE__ */ __name(function componentDidUpdate() {
        var _this$props$coordinat5, _this$props$coordinat6;
        if (this.props.active) {
          this.updateBBox();
        }
        if (!this.state.dismissed) {
          return;
        }
        if (((_this$props$coordinat5 = this.props.coordinate) === null || _this$props$coordinat5 === void 0 ? void 0 : _this$props$coordinat5.x) !== this.state.dismissedAtCoordinate.x || ((_this$props$coordinat6 = this.props.coordinate) === null || _this$props$coordinat6 === void 0 ? void 0 : _this$props$coordinat6.y) !== this.state.dismissedAtCoordinate.y) {
          this.state.dismissed = false;
        }
      }, "componentDidUpdate")
    }, {
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _this2 = this;
        var _this$props = this.props, active = _this$props.active, allowEscapeViewBox = _this$props.allowEscapeViewBox, animationDuration = _this$props.animationDuration, animationEasing = _this$props.animationEasing, children = _this$props.children, coordinate = _this$props.coordinate, hasPayload = _this$props.hasPayload, isAnimationActive = _this$props.isAnimationActive, offset2 = _this$props.offset, position = _this$props.position, reverseDirection = _this$props.reverseDirection, useTranslate3d = _this$props.useTranslate3d, viewBox = _this$props.viewBox, wrapperStyle = _this$props.wrapperStyle;
        var _getTooltipTranslate = getTooltipTranslate({
          allowEscapeViewBox,
          coordinate,
          offsetTopLeft: offset2,
          position,
          reverseDirection,
          tooltipBox: this.state.lastBoundingBox,
          useTranslate3d,
          viewBox
        }), cssClasses = _getTooltipTranslate.cssClasses, cssProperties = _getTooltipTranslate.cssProperties;
        var outerStyle = _objectSpread$y(_objectSpread$y({
          transition: isAnimationActive && active ? "transform ".concat(animationDuration, "ms ").concat(animationEasing) : void 0
        }, cssProperties), {}, {
          pointerEvents: "none",
          visibility: !this.state.dismissed && active && hasPayload ? "visible" : "hidden",
          position: "absolute",
          top: 0,
          left: 0
        }, wrapperStyle);
        return (
          // This element allow listening to the `Escape` key.
          // See https://github.com/recharts/recharts/pull/2925
          /* @__PURE__ */ React.createElement("div", {
            tabIndex: -1,
            className: cssClasses,
            style: outerStyle,
            ref: /* @__PURE__ */ __name(function ref(node) {
              _this2.wrapperNode = node;
            }, "ref")
          }, children)
        );
      }, "render")
    }]);
  })(reactExports.PureComponent);
  var parseIsSsrByDefault = /* @__PURE__ */ __name(function parseIsSsrByDefault2() {
    return !(typeof window !== "undefined" && window.document && window.document.createElement && window.setTimeout);
  }, "parseIsSsrByDefault");
  var Global = {
    isSsr: parseIsSsrByDefault()
  };
  function _typeof$D(o2) {
    "@babel/helpers - typeof";
    return _typeof$D = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$D(o2);
  }
  __name(_typeof$D, "_typeof$D");
  function ownKeys$x(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$x, "ownKeys$x");
  function _objectSpread$x(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$x(Object(t2), true).forEach(function(r3) {
        _defineProperty$B(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$x(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$x, "_objectSpread$x");
  function _classCallCheck$i(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$i, "_classCallCheck$i");
  function _defineProperties$i(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$C(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$i, "_defineProperties$i");
  function _createClass$i(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$i(Constructor.prototype, protoProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$i, "_createClass$i");
  function _callSuper$e(t2, o2, e) {
    return o2 = _getPrototypeOf$f(o2), _possibleConstructorReturn$f(t2, _isNativeReflectConstruct$f() ? Reflect.construct(o2, e || [], _getPrototypeOf$f(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$e, "_callSuper$e");
  function _possibleConstructorReturn$f(self2, call) {
    if (call && (_typeof$D(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$f(self2);
  }
  __name(_possibleConstructorReturn$f, "_possibleConstructorReturn$f");
  function _assertThisInitialized$f(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$f, "_assertThisInitialized$f");
  function _isNativeReflectConstruct$f() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$f = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$f, "_isNativeReflectConstruct$f");
  function _getPrototypeOf$f(o2) {
    _getPrototypeOf$f = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$f(o2);
  }
  __name(_getPrototypeOf$f, "_getPrototypeOf$f");
  function _inherits$f(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$f(subClass, superClass);
  }
  __name(_inherits$f, "_inherits$f");
  function _setPrototypeOf$f(o2, p2) {
    _setPrototypeOf$f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$f(o2, p2);
  }
  __name(_setPrototypeOf$f, "_setPrototypeOf$f");
  function _defineProperty$B(obj, key, value) {
    key = _toPropertyKey$C(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$B, "_defineProperty$B");
  function _toPropertyKey$C(t2) {
    var i2 = _toPrimitive$C(t2, "string");
    return "symbol" == _typeof$D(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$C, "_toPropertyKey$C");
  function _toPrimitive$C(t2, r2) {
    if ("object" != _typeof$D(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$D(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$C, "_toPrimitive$C");
  function defaultUniqBy(entry) {
    return entry.dataKey;
  }
  __name(defaultUniqBy, "defaultUniqBy");
  function renderContent(content, props) {
    if (/* @__PURE__ */ React.isValidElement(content)) {
      return /* @__PURE__ */ React.cloneElement(content, props);
    }
    if (typeof content === "function") {
      return /* @__PURE__ */ React.createElement(content, props);
    }
    return /* @__PURE__ */ React.createElement(DefaultTooltipContent, props);
  }
  __name(renderContent, "renderContent");
  var Tooltip = /* @__PURE__ */ (function(_PureComponent) {
    function Tooltip2() {
      _classCallCheck$i(this, Tooltip2);
      return _callSuper$e(this, Tooltip2, arguments);
    }
    __name(Tooltip2, "Tooltip");
    _inherits$f(Tooltip2, _PureComponent);
    return _createClass$i(Tooltip2, [{
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _this = this;
        var _this$props = this.props, active = _this$props.active, allowEscapeViewBox = _this$props.allowEscapeViewBox, animationDuration = _this$props.animationDuration, animationEasing = _this$props.animationEasing, content = _this$props.content, coordinate = _this$props.coordinate, filterNull = _this$props.filterNull, isAnimationActive = _this$props.isAnimationActive, offset2 = _this$props.offset, payload = _this$props.payload, payloadUniqBy = _this$props.payloadUniqBy, position = _this$props.position, reverseDirection = _this$props.reverseDirection, useTranslate3d = _this$props.useTranslate3d, viewBox = _this$props.viewBox, wrapperStyle = _this$props.wrapperStyle;
        var finalPayload = payload !== null && payload !== void 0 ? payload : [];
        if (filterNull && finalPayload.length) {
          finalPayload = getUniqPayload(payload.filter(function(entry) {
            return entry.value != null && (entry.hide !== true || _this.props.includeHidden);
          }), payloadUniqBy, defaultUniqBy);
        }
        var hasPayload = finalPayload.length > 0;
        return /* @__PURE__ */ React.createElement(TooltipBoundingBox, {
          allowEscapeViewBox,
          animationDuration,
          animationEasing,
          isAnimationActive,
          active,
          coordinate,
          hasPayload,
          offset: offset2,
          position,
          reverseDirection,
          useTranslate3d,
          viewBox,
          wrapperStyle
        }, renderContent(content, _objectSpread$x(_objectSpread$x({}, this.props), {}, {
          payload: finalPayload
        })));
      }, "render")
    }]);
  })(reactExports.PureComponent);
  _defineProperty$B(Tooltip, "displayName", "Tooltip");
  _defineProperty$B(Tooltip, "defaultProps", {
    accessibilityLayer: false,
    allowEscapeViewBox: {
      x: false,
      y: false
    },
    animationDuration: 400,
    animationEasing: "ease",
    contentStyle: {},
    coordinate: {
      x: 0,
      y: 0
    },
    cursor: true,
    cursorStyle: {},
    filterNull: true,
    isAnimationActive: !Global.isSsr,
    itemStyle: {},
    labelStyle: {},
    offset: 10,
    reverseDirection: {
      x: false,
      y: false
    },
    separator: " : ",
    trigger: "hover",
    useTranslate3d: false,
    viewBox: {
      x: 0,
      y: 0,
      height: 0,
      width: 0
    },
    wrapperStyle: {}
  });
  var now_1;
  var hasRequiredNow;
  function requireNow() {
    if (hasRequiredNow) return now_1;
    hasRequiredNow = 1;
    var root2 = require_root();
    var now = /* @__PURE__ */ __name(function() {
      return root2.Date.now();
    }, "now");
    now_1 = now;
    return now_1;
  }
  __name(requireNow, "requireNow");
  var _trimmedEndIndex;
  var hasRequired_trimmedEndIndex;
  function require_trimmedEndIndex() {
    if (hasRequired_trimmedEndIndex) return _trimmedEndIndex;
    hasRequired_trimmedEndIndex = 1;
    var reWhitespace = /\s/;
    function trimmedEndIndex(string2) {
      var index2 = string2.length;
      while (index2-- && reWhitespace.test(string2.charAt(index2))) {
      }
      return index2;
    }
    __name(trimmedEndIndex, "trimmedEndIndex");
    _trimmedEndIndex = trimmedEndIndex;
    return _trimmedEndIndex;
  }
  __name(require_trimmedEndIndex, "require_trimmedEndIndex");
  var _baseTrim;
  var hasRequired_baseTrim;
  function require_baseTrim() {
    if (hasRequired_baseTrim) return _baseTrim;
    hasRequired_baseTrim = 1;
    var trimmedEndIndex = require_trimmedEndIndex();
    var reTrimStart = /^\s+/;
    function baseTrim(string2) {
      return string2 ? string2.slice(0, trimmedEndIndex(string2) + 1).replace(reTrimStart, "") : string2;
    }
    __name(baseTrim, "baseTrim");
    _baseTrim = baseTrim;
    return _baseTrim;
  }
  __name(require_baseTrim, "require_baseTrim");
  var toNumber_1;
  var hasRequiredToNumber;
  function requireToNumber() {
    if (hasRequiredToNumber) return toNumber_1;
    hasRequiredToNumber = 1;
    var baseTrim = require_baseTrim(), isObject2 = requireIsObject(), isSymbol = requireIsSymbol();
    var NAN = 0 / 0;
    var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
    var reIsBinary = /^0b[01]+$/i;
    var reIsOctal = /^0o[0-7]+$/i;
    var freeParseInt = parseInt;
    function toNumber(value) {
      if (typeof value == "number") {
        return value;
      }
      if (isSymbol(value)) {
        return NAN;
      }
      if (isObject2(value)) {
        var other = typeof value.valueOf == "function" ? value.valueOf() : value;
        value = isObject2(other) ? other + "" : other;
      }
      if (typeof value != "string") {
        return value === 0 ? value : +value;
      }
      value = baseTrim(value);
      var isBinary = reIsBinary.test(value);
      return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
    }
    __name(toNumber, "toNumber");
    toNumber_1 = toNumber;
    return toNumber_1;
  }
  __name(requireToNumber, "requireToNumber");
  var debounce_1;
  var hasRequiredDebounce;
  function requireDebounce() {
    if (hasRequiredDebounce) return debounce_1;
    hasRequiredDebounce = 1;
    var isObject2 = requireIsObject(), now = requireNow(), toNumber = requireToNumber();
    var FUNC_ERROR_TEXT = "Expected a function";
    var nativeMax = Math.max, nativeMin = Math.min;
    function debounce(func, wait, options2) {
      var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
      if (typeof func != "function") {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      wait = toNumber(wait) || 0;
      if (isObject2(options2)) {
        leading = !!options2.leading;
        maxing = "maxWait" in options2;
        maxWait = maxing ? nativeMax(toNumber(options2.maxWait) || 0, wait) : maxWait;
        trailing = "trailing" in options2 ? !!options2.trailing : trailing;
      }
      function invokeFunc(time2) {
        var args = lastArgs, thisArg = lastThis;
        lastArgs = lastThis = void 0;
        lastInvokeTime = time2;
        result = func.apply(thisArg, args);
        return result;
      }
      __name(invokeFunc, "invokeFunc");
      function leadingEdge(time2) {
        lastInvokeTime = time2;
        timerId = setTimeout(timerExpired, wait);
        return leading ? invokeFunc(time2) : result;
      }
      __name(leadingEdge, "leadingEdge");
      function remainingWait(time2) {
        var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
        return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
      }
      __name(remainingWait, "remainingWait");
      function shouldInvoke(time2) {
        var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime;
        return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
      }
      __name(shouldInvoke, "shouldInvoke");
      function timerExpired() {
        var time2 = now();
        if (shouldInvoke(time2)) {
          return trailingEdge(time2);
        }
        timerId = setTimeout(timerExpired, remainingWait(time2));
      }
      __name(timerExpired, "timerExpired");
      function trailingEdge(time2) {
        timerId = void 0;
        if (trailing && lastArgs) {
          return invokeFunc(time2);
        }
        lastArgs = lastThis = void 0;
        return result;
      }
      __name(trailingEdge, "trailingEdge");
      function cancel() {
        if (timerId !== void 0) {
          clearTimeout(timerId);
        }
        lastInvokeTime = 0;
        lastArgs = lastCallTime = lastThis = timerId = void 0;
      }
      __name(cancel, "cancel");
      function flush() {
        return timerId === void 0 ? result : trailingEdge(now());
      }
      __name(flush, "flush");
      function debounced() {
        var time2 = now(), isInvoking = shouldInvoke(time2);
        lastArgs = arguments;
        lastThis = this;
        lastCallTime = time2;
        if (isInvoking) {
          if (timerId === void 0) {
            return leadingEdge(lastCallTime);
          }
          if (maxing) {
            clearTimeout(timerId);
            timerId = setTimeout(timerExpired, wait);
            return invokeFunc(lastCallTime);
          }
        }
        if (timerId === void 0) {
          timerId = setTimeout(timerExpired, wait);
        }
        return result;
      }
      __name(debounced, "debounced");
      debounced.cancel = cancel;
      debounced.flush = flush;
      return debounced;
    }
    __name(debounce, "debounce");
    debounce_1 = debounce;
    return debounce_1;
  }
  __name(requireDebounce, "requireDebounce");
  var throttle_1;
  var hasRequiredThrottle;
  function requireThrottle() {
    if (hasRequiredThrottle) return throttle_1;
    hasRequiredThrottle = 1;
    var debounce = requireDebounce(), isObject2 = requireIsObject();
    var FUNC_ERROR_TEXT = "Expected a function";
    function throttle2(func, wait, options2) {
      var leading = true, trailing = true;
      if (typeof func != "function") {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      if (isObject2(options2)) {
        leading = "leading" in options2 ? !!options2.leading : leading;
        trailing = "trailing" in options2 ? !!options2.trailing : trailing;
      }
      return debounce(func, wait, {
        "leading": leading,
        "maxWait": wait,
        "trailing": trailing
      });
    }
    __name(throttle2, "throttle");
    throttle_1 = throttle2;
    return throttle_1;
  }
  __name(requireThrottle, "requireThrottle");
  var throttleExports = requireThrottle();
  const throttle = /* @__PURE__ */ getDefaultExportFromCjs(throttleExports);
  function _typeof$C(o2) {
    "@babel/helpers - typeof";
    return _typeof$C = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$C(o2);
  }
  __name(_typeof$C, "_typeof$C");
  function ownKeys$w(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$w, "ownKeys$w");
  function _objectSpread$w(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$w(Object(t2), true).forEach(function(r3) {
        _defineProperty$A(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$w(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$w, "_objectSpread$w");
  function _defineProperty$A(obj, key, value) {
    key = _toPropertyKey$B(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$A, "_defineProperty$A");
  function _toPropertyKey$B(t2) {
    var i2 = _toPrimitive$B(t2, "string");
    return "symbol" == _typeof$C(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$B, "_toPropertyKey$B");
  function _toPrimitive$B(t2, r2) {
    if ("object" != _typeof$C(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$C(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$B, "_toPrimitive$B");
  function _slicedToArray$b(arr, i2) {
    return _arrayWithHoles$c(arr) || _iterableToArrayLimit$b(arr, i2) || _unsupportedIterableToArray$j(arr, i2) || _nonIterableRest$c();
  }
  __name(_slicedToArray$b, "_slicedToArray$b");
  function _nonIterableRest$c() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableRest$c, "_nonIterableRest$c");
  function _unsupportedIterableToArray$j(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$j(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$j(o2, minLen);
  }
  __name(_unsupportedIterableToArray$j, "_unsupportedIterableToArray$j");
  function _arrayLikeToArray$j(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$j, "_arrayLikeToArray$j");
  function _iterableToArrayLimit$b(r2, l) {
    var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
    if (null != t2) {
      var e, n2, i2, u2, a2 = [], f = true, o2 = false;
      try {
        if (i2 = (t2 = t2.call(r2)).next, 0 === l) ;
        else for (; !(f = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l); f = true) ;
      } catch (r3) {
        o2 = true, n2 = r3;
      } finally {
        try {
          if (!f && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
        } finally {
          if (o2) throw n2;
        }
      }
      return a2;
    }
  }
  __name(_iterableToArrayLimit$b, "_iterableToArrayLimit$b");
  function _arrayWithHoles$c(arr) {
    if (Array.isArray(arr)) return arr;
  }
  __name(_arrayWithHoles$c, "_arrayWithHoles$c");
  var ResponsiveContainer = /* @__PURE__ */ reactExports.forwardRef(function(_ref, ref) {
    var aspect = _ref.aspect, _ref$initialDimension = _ref.initialDimension, initialDimension = _ref$initialDimension === void 0 ? {
      width: -1,
      height: -1
    } : _ref$initialDimension, _ref$width = _ref.width, width = _ref$width === void 0 ? "100%" : _ref$width, _ref$height = _ref.height, height = _ref$height === void 0 ? "100%" : _ref$height, _ref$minWidth = _ref.minWidth, minWidth = _ref$minWidth === void 0 ? 0 : _ref$minWidth, minHeight = _ref.minHeight, maxHeight = _ref.maxHeight, children = _ref.children, _ref$debounce = _ref.debounce, debounce = _ref$debounce === void 0 ? 0 : _ref$debounce, id = _ref.id, className = _ref.className, onResize = _ref.onResize, _ref$style = _ref.style, style = _ref$style === void 0 ? {} : _ref$style;
    var containerRef = reactExports.useRef(null);
    var onResizeRef = reactExports.useRef();
    onResizeRef.current = onResize;
    reactExports.useImperativeHandle(ref, function() {
      return Object.defineProperty(containerRef.current, "current", {
        get: /* @__PURE__ */ __name(function get2() {
          console.warn("The usage of ref.current.current is deprecated and will no longer be supported.");
          return containerRef.current;
        }, "get"),
        configurable: true
      });
    });
    var _useState = reactExports.useState({
      containerWidth: initialDimension.width,
      containerHeight: initialDimension.height
    }), _useState2 = _slicedToArray$b(_useState, 2), sizes = _useState2[0], setSizes = _useState2[1];
    var setContainerSize = reactExports.useCallback(function(newWidth, newHeight) {
      setSizes(function(prevState) {
        var roundedWidth = Math.round(newWidth);
        var roundedHeight = Math.round(newHeight);
        if (prevState.containerWidth === roundedWidth && prevState.containerHeight === roundedHeight) {
          return prevState;
        }
        return {
          containerWidth: roundedWidth,
          containerHeight: roundedHeight
        };
      });
    }, []);
    reactExports.useEffect(function() {
      var callback = /* @__PURE__ */ __name(function callback2(entries) {
        var _onResizeRef$current;
        var _entries$0$contentRec = entries[0].contentRect, containerWidth2 = _entries$0$contentRec.width, containerHeight2 = _entries$0$contentRec.height;
        setContainerSize(containerWidth2, containerHeight2);
        (_onResizeRef$current = onResizeRef.current) === null || _onResizeRef$current === void 0 || _onResizeRef$current.call(onResizeRef, containerWidth2, containerHeight2);
      }, "callback");
      if (debounce > 0) {
        callback = throttle(callback, debounce, {
          trailing: true,
          leading: false
        });
      }
      var observer = new ResizeObserver(callback);
      var _containerRef$current = containerRef.current.getBoundingClientRect(), containerWidth = _containerRef$current.width, containerHeight = _containerRef$current.height;
      setContainerSize(containerWidth, containerHeight);
      observer.observe(containerRef.current);
      return function() {
        observer.disconnect();
      };
    }, [setContainerSize, debounce]);
    var chartContent = reactExports.useMemo(function() {
      var containerWidth = sizes.containerWidth, containerHeight = sizes.containerHeight;
      if (containerWidth < 0 || containerHeight < 0) {
        return null;
      }
      warn(isPercent(width) || isPercent(height), "The width(%s) and height(%s) are both fixed numbers,\n       maybe you don't need to use a ResponsiveContainer.", width, height);
      warn(!aspect || aspect > 0, "The aspect(%s) must be greater than zero.", aspect);
      var calculatedWidth = isPercent(width) ? containerWidth : width;
      var calculatedHeight = isPercent(height) ? containerHeight : height;
      if (aspect && aspect > 0) {
        if (calculatedWidth) {
          calculatedHeight = calculatedWidth / aspect;
        } else if (calculatedHeight) {
          calculatedWidth = calculatedHeight * aspect;
        }
        if (maxHeight && calculatedHeight > maxHeight) {
          calculatedHeight = maxHeight;
        }
      }
      warn(calculatedWidth > 0 || calculatedHeight > 0, "The width(%s) and height(%s) of chart should be greater than 0,\n       please check the style of container, or the props width(%s) and height(%s),\n       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n       height and width.", calculatedWidth, calculatedHeight, width, height, minWidth, minHeight, aspect);
      var isCharts = !Array.isArray(children) && getDisplayName(children.type).endsWith("Chart");
      return React.Children.map(children, function(child) {
        if (/* @__PURE__ */ React.isValidElement(child)) {
          return /* @__PURE__ */ reactExports.cloneElement(child, _objectSpread$w({
            width: calculatedWidth,
            height: calculatedHeight
          }, isCharts ? {
            style: _objectSpread$w({
              height: "100%",
              width: "100%",
              maxHeight: calculatedHeight,
              maxWidth: calculatedWidth
            }, child.props.style)
          } : {}));
        }
        return child;
      });
    }, [aspect, children, height, maxHeight, minHeight, minWidth, sizes, width]);
    return /* @__PURE__ */ React.createElement("div", {
      id: id ? "".concat(id) : void 0,
      className: clsx("recharts-responsive-container", className),
      style: _objectSpread$w(_objectSpread$w({}, style), {}, {
        width,
        height,
        minWidth,
        minHeight,
        maxHeight
      }),
      ref: containerRef
    }, chartContent);
  });
  var Cell = /* @__PURE__ */ __name(function Cell2(_props) {
    return null;
  }, "Cell");
  Cell.displayName = "Cell";
  function _typeof$B(o2) {
    "@babel/helpers - typeof";
    return _typeof$B = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$B(o2);
  }
  __name(_typeof$B, "_typeof$B");
  function ownKeys$v(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$v, "ownKeys$v");
  function _objectSpread$v(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$v(Object(t2), true).forEach(function(r3) {
        _defineProperty$z(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$v(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$v, "_objectSpread$v");
  function _defineProperty$z(obj, key, value) {
    key = _toPropertyKey$A(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$z, "_defineProperty$z");
  function _toPropertyKey$A(t2) {
    var i2 = _toPrimitive$A(t2, "string");
    return "symbol" == _typeof$B(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$A, "_toPropertyKey$A");
  function _toPrimitive$A(t2, r2) {
    if ("object" != _typeof$B(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$B(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$A, "_toPrimitive$A");
  var stringCache = {
    widthCache: {},
    cacheCount: 0
  };
  var MAX_CACHE_NUM = 2e3;
  var SPAN_STYLE = {
    position: "absolute",
    top: "-20000px",
    left: 0,
    padding: 0,
    margin: 0,
    border: "none",
    whiteSpace: "pre"
  };
  var MEASUREMENT_SPAN_ID = "recharts_measurement_span";
  function removeInvalidKeys(obj) {
    var copyObj = _objectSpread$v({}, obj);
    Object.keys(copyObj).forEach(function(key) {
      if (!copyObj[key]) {
        delete copyObj[key];
      }
    });
    return copyObj;
  }
  __name(removeInvalidKeys, "removeInvalidKeys");
  var getStringSize = /* @__PURE__ */ __name(function getStringSize2(text) {
    var style = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    if (text === void 0 || text === null || Global.isSsr) {
      return {
        width: 0,
        height: 0
      };
    }
    var copyStyle = removeInvalidKeys(style);
    var cacheKey = JSON.stringify({
      text,
      copyStyle
    });
    if (stringCache.widthCache[cacheKey]) {
      return stringCache.widthCache[cacheKey];
    }
    try {
      var measurementSpan = document.getElementById(MEASUREMENT_SPAN_ID);
      if (!measurementSpan) {
        measurementSpan = document.createElement("span");
        measurementSpan.setAttribute("id", MEASUREMENT_SPAN_ID);
        measurementSpan.setAttribute("aria-hidden", "true");
        document.body.appendChild(measurementSpan);
      }
      var measurementSpanStyle = _objectSpread$v(_objectSpread$v({}, SPAN_STYLE), copyStyle);
      Object.assign(measurementSpan.style, measurementSpanStyle);
      measurementSpan.textContent = "".concat(text);
      var rect = measurementSpan.getBoundingClientRect();
      var result = {
        width: rect.width,
        height: rect.height
      };
      stringCache.widthCache[cacheKey] = result;
      if (++stringCache.cacheCount > MAX_CACHE_NUM) {
        stringCache.cacheCount = 0;
        stringCache.widthCache = {};
      }
      return result;
    } catch (e) {
      return {
        width: 0,
        height: 0
      };
    }
  }, "getStringSize");
  var getOffset = /* @__PURE__ */ __name(function getOffset2(rect) {
    return {
      top: rect.top + window.scrollY - document.documentElement.clientTop,
      left: rect.left + window.scrollX - document.documentElement.clientLeft
    };
  }, "getOffset");
  function _typeof$A(o2) {
    "@babel/helpers - typeof";
    return _typeof$A = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$A(o2);
  }
  __name(_typeof$A, "_typeof$A");
  function _slicedToArray$a(arr, i2) {
    return _arrayWithHoles$b(arr) || _iterableToArrayLimit$a(arr, i2) || _unsupportedIterableToArray$i(arr, i2) || _nonIterableRest$b();
  }
  __name(_slicedToArray$a, "_slicedToArray$a");
  function _nonIterableRest$b() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableRest$b, "_nonIterableRest$b");
  function _unsupportedIterableToArray$i(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$i(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$i(o2, minLen);
  }
  __name(_unsupportedIterableToArray$i, "_unsupportedIterableToArray$i");
  function _arrayLikeToArray$i(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$i, "_arrayLikeToArray$i");
  function _iterableToArrayLimit$a(r2, l) {
    var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
    if (null != t2) {
      var e, n2, i2, u2, a2 = [], f = true, o2 = false;
      try {
        if (i2 = (t2 = t2.call(r2)).next, 0 === l) {
          if (Object(t2) !== t2) return;
          f = false;
        } else for (; !(f = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l); f = true) ;
      } catch (r3) {
        o2 = true, n2 = r3;
      } finally {
        try {
          if (!f && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
        } finally {
          if (o2) throw n2;
        }
      }
      return a2;
    }
  }
  __name(_iterableToArrayLimit$a, "_iterableToArrayLimit$a");
  function _arrayWithHoles$b(arr) {
    if (Array.isArray(arr)) return arr;
  }
  __name(_arrayWithHoles$b, "_arrayWithHoles$b");
  function _classCallCheck$h(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$h, "_classCallCheck$h");
  function _defineProperties$h(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$z(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$h, "_defineProperties$h");
  function _createClass$h(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$h(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties$h(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$h, "_createClass$h");
  function _toPropertyKey$z(t2) {
    var i2 = _toPrimitive$z(t2, "string");
    return "symbol" == _typeof$A(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$z, "_toPropertyKey$z");
  function _toPrimitive$z(t2, r2) {
    if ("object" != _typeof$A(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$A(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$z, "_toPrimitive$z");
  var MULTIPLY_OR_DIVIDE_REGEX = /(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/;
  var ADD_OR_SUBTRACT_REGEX = /(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/;
  var CSS_LENGTH_UNIT_REGEX = /^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/;
  var NUM_SPLIT_REGEX = /(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/;
  var CONVERSION_RATES = {
    cm: 96 / 2.54,
    mm: 96 / 25.4,
    pt: 96 / 72,
    pc: 96 / 6,
    "in": 96,
    Q: 96 / (2.54 * 40),
    px: 1
  };
  var FIXED_CSS_LENGTH_UNITS = Object.keys(CONVERSION_RATES);
  var STR_NAN = "NaN";
  function convertToPx(value, unit2) {
    return value * CONVERSION_RATES[unit2];
  }
  __name(convertToPx, "convertToPx");
  var DecimalCSS = /* @__PURE__ */ (function() {
    function DecimalCSS2(num, unit2) {
      _classCallCheck$h(this, DecimalCSS2);
      this.num = num;
      this.unit = unit2;
      this.num = num;
      this.unit = unit2;
      if (Number.isNaN(num)) {
        this.unit = "";
      }
      if (unit2 !== "" && !CSS_LENGTH_UNIT_REGEX.test(unit2)) {
        this.num = NaN;
        this.unit = "";
      }
      if (FIXED_CSS_LENGTH_UNITS.includes(unit2)) {
        this.num = convertToPx(num, unit2);
        this.unit = "px";
      }
    }
    __name(DecimalCSS2, "DecimalCSS");
    return _createClass$h(DecimalCSS2, [{
      key: "add",
      value: /* @__PURE__ */ __name(function add2(other) {
        if (this.unit !== other.unit) {
          return new DecimalCSS2(NaN, "");
        }
        return new DecimalCSS2(this.num + other.num, this.unit);
      }, "add")
    }, {
      key: "subtract",
      value: /* @__PURE__ */ __name(function subtract2(other) {
        if (this.unit !== other.unit) {
          return new DecimalCSS2(NaN, "");
        }
        return new DecimalCSS2(this.num - other.num, this.unit);
      }, "subtract")
    }, {
      key: "multiply",
      value: /* @__PURE__ */ __name(function multiply(other) {
        if (this.unit !== "" && other.unit !== "" && this.unit !== other.unit) {
          return new DecimalCSS2(NaN, "");
        }
        return new DecimalCSS2(this.num * other.num, this.unit || other.unit);
      }, "multiply")
    }, {
      key: "divide",
      value: /* @__PURE__ */ __name(function divide2(other) {
        if (this.unit !== "" && other.unit !== "" && this.unit !== other.unit) {
          return new DecimalCSS2(NaN, "");
        }
        return new DecimalCSS2(this.num / other.num, this.unit || other.unit);
      }, "divide")
    }, {
      key: "toString",
      value: /* @__PURE__ */ __name(function toString2() {
        return "".concat(this.num).concat(this.unit);
      }, "toString")
    }, {
      key: "isNaN",
      value: /* @__PURE__ */ __name(function isNaN2() {
        return Number.isNaN(this.num);
      }, "isNaN")
    }], [{
      key: "parse",
      value: /* @__PURE__ */ __name(function parse2(str) {
        var _NUM_SPLIT_REGEX$exec;
        var _ref = (_NUM_SPLIT_REGEX$exec = NUM_SPLIT_REGEX.exec(str)) !== null && _NUM_SPLIT_REGEX$exec !== void 0 ? _NUM_SPLIT_REGEX$exec : [], _ref2 = _slicedToArray$a(_ref, 3), numStr = _ref2[1], unit2 = _ref2[2];
        return new DecimalCSS2(parseFloat(numStr), unit2 !== null && unit2 !== void 0 ? unit2 : "");
      }, "parse")
    }]);
  })();
  function calculateArithmetic(expr) {
    if (expr.includes(STR_NAN)) {
      return STR_NAN;
    }
    var newExpr = expr;
    while (newExpr.includes("*") || newExpr.includes("/")) {
      var _MULTIPLY_OR_DIVIDE_R;
      var _ref3 = (_MULTIPLY_OR_DIVIDE_R = MULTIPLY_OR_DIVIDE_REGEX.exec(newExpr)) !== null && _MULTIPLY_OR_DIVIDE_R !== void 0 ? _MULTIPLY_OR_DIVIDE_R : [], _ref4 = _slicedToArray$a(_ref3, 4), leftOperand = _ref4[1], operator = _ref4[2], rightOperand = _ref4[3];
      var lTs = DecimalCSS.parse(leftOperand !== null && leftOperand !== void 0 ? leftOperand : "");
      var rTs = DecimalCSS.parse(rightOperand !== null && rightOperand !== void 0 ? rightOperand : "");
      var result = operator === "*" ? lTs.multiply(rTs) : lTs.divide(rTs);
      if (result.isNaN()) {
        return STR_NAN;
      }
      newExpr = newExpr.replace(MULTIPLY_OR_DIVIDE_REGEX, result.toString());
    }
    while (newExpr.includes("+") || /.-\d+(?:\.\d+)?/.test(newExpr)) {
      var _ADD_OR_SUBTRACT_REGE;
      var _ref5 = (_ADD_OR_SUBTRACT_REGE = ADD_OR_SUBTRACT_REGEX.exec(newExpr)) !== null && _ADD_OR_SUBTRACT_REGE !== void 0 ? _ADD_OR_SUBTRACT_REGE : [], _ref6 = _slicedToArray$a(_ref5, 4), _leftOperand = _ref6[1], _operator = _ref6[2], _rightOperand = _ref6[3];
      var _lTs = DecimalCSS.parse(_leftOperand !== null && _leftOperand !== void 0 ? _leftOperand : "");
      var _rTs = DecimalCSS.parse(_rightOperand !== null && _rightOperand !== void 0 ? _rightOperand : "");
      var _result = _operator === "+" ? _lTs.add(_rTs) : _lTs.subtract(_rTs);
      if (_result.isNaN()) {
        return STR_NAN;
      }
      newExpr = newExpr.replace(ADD_OR_SUBTRACT_REGEX, _result.toString());
    }
    return newExpr;
  }
  __name(calculateArithmetic, "calculateArithmetic");
  var PARENTHESES_REGEX = /\(([^()]*)\)/;
  function calculateParentheses(expr) {
    var newExpr = expr;
    while (newExpr.includes("(")) {
      var _PARENTHESES_REGEX$ex = PARENTHESES_REGEX.exec(newExpr), _PARENTHESES_REGEX$ex2 = _slicedToArray$a(_PARENTHESES_REGEX$ex, 2), parentheticalExpression = _PARENTHESES_REGEX$ex2[1];
      newExpr = newExpr.replace(PARENTHESES_REGEX, calculateArithmetic(parentheticalExpression));
    }
    return newExpr;
  }
  __name(calculateParentheses, "calculateParentheses");
  function evaluateExpression(expression) {
    var newExpr = expression.replace(/\s+/g, "");
    newExpr = calculateParentheses(newExpr);
    newExpr = calculateArithmetic(newExpr);
    return newExpr;
  }
  __name(evaluateExpression, "evaluateExpression");
  function safeEvaluateExpression(expression) {
    try {
      return evaluateExpression(expression);
    } catch (e) {
      return STR_NAN;
    }
  }
  __name(safeEvaluateExpression, "safeEvaluateExpression");
  function reduceCSSCalc(expression) {
    var result = safeEvaluateExpression(expression.slice(5, -1));
    if (result === STR_NAN) {
      return "";
    }
    return result;
  }
  __name(reduceCSSCalc, "reduceCSSCalc");
  var _excluded$e = ["x", "y", "lineHeight", "capHeight", "scaleToFit", "textAnchor", "verticalAnchor", "fill"], _excluded2$6 = ["dx", "dy", "angle", "className", "breakAll"];
  function _extends$p() {
    _extends$p = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$p.apply(this, arguments);
  }
  __name(_extends$p, "_extends$p");
  function _objectWithoutProperties$e(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$e(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$e, "_objectWithoutProperties$e");
  function _objectWithoutPropertiesLoose$e(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$e, "_objectWithoutPropertiesLoose$e");
  function _slicedToArray$9(arr, i2) {
    return _arrayWithHoles$a(arr) || _iterableToArrayLimit$9(arr, i2) || _unsupportedIterableToArray$h(arr, i2) || _nonIterableRest$a();
  }
  __name(_slicedToArray$9, "_slicedToArray$9");
  function _nonIterableRest$a() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableRest$a, "_nonIterableRest$a");
  function _unsupportedIterableToArray$h(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$h(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$h(o2, minLen);
  }
  __name(_unsupportedIterableToArray$h, "_unsupportedIterableToArray$h");
  function _arrayLikeToArray$h(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$h, "_arrayLikeToArray$h");
  function _iterableToArrayLimit$9(r2, l) {
    var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
    if (null != t2) {
      var e, n2, i2, u2, a2 = [], f = true, o2 = false;
      try {
        if (i2 = (t2 = t2.call(r2)).next, 0 === l) {
          if (Object(t2) !== t2) return;
          f = false;
        } else for (; !(f = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l); f = true) ;
      } catch (r3) {
        o2 = true, n2 = r3;
      } finally {
        try {
          if (!f && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
        } finally {
          if (o2) throw n2;
        }
      }
      return a2;
    }
  }
  __name(_iterableToArrayLimit$9, "_iterableToArrayLimit$9");
  function _arrayWithHoles$a(arr) {
    if (Array.isArray(arr)) return arr;
  }
  __name(_arrayWithHoles$a, "_arrayWithHoles$a");
  var BREAKING_SPACES = /[ \f\n\r\t\v\u2028\u2029]+/;
  var calculateWordWidths = /* @__PURE__ */ __name(function calculateWordWidths2(_ref) {
    var children = _ref.children, breakAll = _ref.breakAll, style = _ref.style;
    try {
      var words = [];
      if (!isNil(children)) {
        if (breakAll) {
          words = children.toString().split("");
        } else {
          words = children.toString().split(BREAKING_SPACES);
        }
      }
      var wordsWithComputedWidth = words.map(function(word) {
        return {
          word,
          width: getStringSize(word, style).width
        };
      });
      var spaceWidth = breakAll ? 0 : getStringSize(" ", style).width;
      return {
        wordsWithComputedWidth,
        spaceWidth
      };
    } catch (e) {
      return null;
    }
  }, "calculateWordWidths");
  var calculateWordsByLines = /* @__PURE__ */ __name(function calculateWordsByLines2(_ref2, initialWordsWithComputedWith, spaceWidth, lineWidth, scaleToFit) {
    var maxLines = _ref2.maxLines, children = _ref2.children, style = _ref2.style, breakAll = _ref2.breakAll;
    var shouldLimitLines = isNumber(maxLines);
    var text = children;
    var calculate = /* @__PURE__ */ __name(function calculate2() {
      var words = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
      return words.reduce(function(result2, _ref3) {
        var word = _ref3.word, width = _ref3.width;
        var currentLine = result2[result2.length - 1];
        if (currentLine && (lineWidth == null || scaleToFit || currentLine.width + width + spaceWidth < Number(lineWidth))) {
          currentLine.words.push(word);
          currentLine.width += width + spaceWidth;
        } else {
          var newLine = {
            words: [word],
            width
          };
          result2.push(newLine);
        }
        return result2;
      }, []);
    }, "calculate");
    var originalResult = calculate(initialWordsWithComputedWith);
    var findLongestLine = /* @__PURE__ */ __name(function findLongestLine2(words) {
      return words.reduce(function(a2, b) {
        return a2.width > b.width ? a2 : b;
      });
    }, "findLongestLine");
    if (!shouldLimitLines) {
      return originalResult;
    }
    var suffix = "…";
    var checkOverflow = /* @__PURE__ */ __name(function checkOverflow2(index2) {
      var tempText = text.slice(0, index2);
      var words = calculateWordWidths({
        breakAll,
        style,
        children: tempText + suffix
      }).wordsWithComputedWidth;
      var result2 = calculate(words);
      var doesOverflow = result2.length > maxLines || findLongestLine(result2).width > Number(lineWidth);
      return [doesOverflow, result2];
    }, "checkOverflow");
    var start = 0;
    var end = text.length - 1;
    var iterations = 0;
    var trimmedResult;
    while (start <= end && iterations <= text.length - 1) {
      var middle = Math.floor((start + end) / 2);
      var prev = middle - 1;
      var _checkOverflow = checkOverflow(prev), _checkOverflow2 = _slicedToArray$9(_checkOverflow, 2), doesPrevOverflow = _checkOverflow2[0], result = _checkOverflow2[1];
      var _checkOverflow3 = checkOverflow(middle), _checkOverflow4 = _slicedToArray$9(_checkOverflow3, 1), doesMiddleOverflow = _checkOverflow4[0];
      if (!doesPrevOverflow && !doesMiddleOverflow) {
        start = middle + 1;
      }
      if (doesPrevOverflow && doesMiddleOverflow) {
        end = middle - 1;
      }
      if (!doesPrevOverflow && doesMiddleOverflow) {
        trimmedResult = result;
        break;
      }
      iterations++;
    }
    return trimmedResult || originalResult;
  }, "calculateWordsByLines");
  var getWordsWithoutCalculate = /* @__PURE__ */ __name(function getWordsWithoutCalculate2(children) {
    var words = !isNil(children) ? children.toString().split(BREAKING_SPACES) : [];
    return [{
      words
    }];
  }, "getWordsWithoutCalculate");
  var getWordsByLines = /* @__PURE__ */ __name(function getWordsByLines2(_ref4) {
    var width = _ref4.width, scaleToFit = _ref4.scaleToFit, children = _ref4.children, style = _ref4.style, breakAll = _ref4.breakAll, maxLines = _ref4.maxLines;
    if ((width || scaleToFit) && !Global.isSsr) {
      var wordsWithComputedWidth, spaceWidth;
      var wordWidths = calculateWordWidths({
        breakAll,
        children,
        style
      });
      if (wordWidths) {
        var wcw = wordWidths.wordsWithComputedWidth, sw = wordWidths.spaceWidth;
        wordsWithComputedWidth = wcw;
        spaceWidth = sw;
      } else {
        return getWordsWithoutCalculate(children);
      }
      return calculateWordsByLines({
        breakAll,
        children,
        maxLines,
        style
      }, wordsWithComputedWidth, spaceWidth, width, scaleToFit);
    }
    return getWordsWithoutCalculate(children);
  }, "getWordsByLines");
  var DEFAULT_FILL = "#808080";
  var Text = /* @__PURE__ */ __name(function Text2(_ref5) {
    var _ref5$x = _ref5.x, propsX = _ref5$x === void 0 ? 0 : _ref5$x, _ref5$y = _ref5.y, propsY = _ref5$y === void 0 ? 0 : _ref5$y, _ref5$lineHeight = _ref5.lineHeight, lineHeight = _ref5$lineHeight === void 0 ? "1em" : _ref5$lineHeight, _ref5$capHeight = _ref5.capHeight, capHeight = _ref5$capHeight === void 0 ? "0.71em" : _ref5$capHeight, _ref5$scaleToFit = _ref5.scaleToFit, scaleToFit = _ref5$scaleToFit === void 0 ? false : _ref5$scaleToFit, _ref5$textAnchor = _ref5.textAnchor, textAnchor = _ref5$textAnchor === void 0 ? "start" : _ref5$textAnchor, _ref5$verticalAnchor = _ref5.verticalAnchor, verticalAnchor = _ref5$verticalAnchor === void 0 ? "end" : _ref5$verticalAnchor, _ref5$fill = _ref5.fill, fill = _ref5$fill === void 0 ? DEFAULT_FILL : _ref5$fill, props = _objectWithoutProperties$e(_ref5, _excluded$e);
    var wordsByLines = reactExports.useMemo(function() {
      return getWordsByLines({
        breakAll: props.breakAll,
        children: props.children,
        maxLines: props.maxLines,
        scaleToFit,
        style: props.style,
        width: props.width
      });
    }, [props.breakAll, props.children, props.maxLines, scaleToFit, props.style, props.width]);
    var dx = props.dx, dy = props.dy, angle = props.angle, className = props.className, breakAll = props.breakAll, textProps = _objectWithoutProperties$e(props, _excluded2$6);
    if (!isNumOrStr(propsX) || !isNumOrStr(propsY)) {
      return null;
    }
    var x2 = propsX + (isNumber(dx) ? dx : 0);
    var y2 = propsY + (isNumber(dy) ? dy : 0);
    var startDy;
    switch (verticalAnchor) {
      case "start":
        startDy = reduceCSSCalc("calc(".concat(capHeight, ")"));
        break;
      case "middle":
        startDy = reduceCSSCalc("calc(".concat((wordsByLines.length - 1) / 2, " * -").concat(lineHeight, " + (").concat(capHeight, " / 2))"));
        break;
      default:
        startDy = reduceCSSCalc("calc(".concat(wordsByLines.length - 1, " * -").concat(lineHeight, ")"));
        break;
    }
    var transforms = [];
    if (scaleToFit) {
      var lineWidth = wordsByLines[0].width;
      var width = props.width;
      transforms.push("scale(".concat((isNumber(width) ? width / lineWidth : 1) / lineWidth, ")"));
    }
    if (angle) {
      transforms.push("rotate(".concat(angle, ", ").concat(x2, ", ").concat(y2, ")"));
    }
    if (transforms.length) {
      textProps.transform = transforms.join(" ");
    }
    return /* @__PURE__ */ React.createElement("text", _extends$p({}, filterProps(textProps, true), {
      x: x2,
      y: y2,
      className: clsx("recharts-text", className),
      textAnchor,
      fill: fill.includes("url") ? DEFAULT_FILL : fill
    }), wordsByLines.map(function(line, index2) {
      var words = line.words.join(breakAll ? "" : " ");
      return (
        // duplicate words will cause duplicate keys
        // eslint-disable-next-line react/no-array-index-key
        /* @__PURE__ */ React.createElement("tspan", {
          x: x2,
          dy: index2 === 0 ? startDy : lineHeight,
          key: "".concat(words, "-").concat(index2)
        }, words)
      );
    }));
  }, "Text");
  function ascending(a2, b) {
    return a2 == null || b == null ? NaN : a2 < b ? -1 : a2 > b ? 1 : a2 >= b ? 0 : NaN;
  }
  __name(ascending, "ascending");
  function descending(a2, b) {
    return a2 == null || b == null ? NaN : b < a2 ? -1 : b > a2 ? 1 : b >= a2 ? 0 : NaN;
  }
  __name(descending, "descending");
  function bisector(f) {
    let compare1, compare2, delta;
    if (f.length !== 2) {
      compare1 = ascending;
      compare2 = /* @__PURE__ */ __name((d, x2) => ascending(f(d), x2), "compare2");
      delta = /* @__PURE__ */ __name((d, x2) => f(d) - x2, "delta");
    } else {
      compare1 = f === ascending || f === descending ? f : zero$1;
      compare2 = f;
      delta = f;
    }
    function left(a2, x2, lo = 0, hi = a2.length) {
      if (lo < hi) {
        if (compare1(x2, x2) !== 0) return hi;
        do {
          const mid = lo + hi >>> 1;
          if (compare2(a2[mid], x2) < 0) lo = mid + 1;
          else hi = mid;
        } while (lo < hi);
      }
      return lo;
    }
    __name(left, "left");
    function right(a2, x2, lo = 0, hi = a2.length) {
      if (lo < hi) {
        if (compare1(x2, x2) !== 0) return hi;
        do {
          const mid = lo + hi >>> 1;
          if (compare2(a2[mid], x2) <= 0) lo = mid + 1;
          else hi = mid;
        } while (lo < hi);
      }
      return lo;
    }
    __name(right, "right");
    function center(a2, x2, lo = 0, hi = a2.length) {
      const i2 = left(a2, x2, lo, hi - 1);
      return i2 > lo && delta(a2[i2 - 1], x2) > -delta(a2[i2], x2) ? i2 - 1 : i2;
    }
    __name(center, "center");
    return { left, center, right };
  }
  __name(bisector, "bisector");
  function zero$1() {
    return 0;
  }
  __name(zero$1, "zero$1");
  function number$2(x2) {
    return x2 === null ? NaN : +x2;
  }
  __name(number$2, "number$2");
  function* numbers(values, valueof) {
    {
      for (let value of values) {
        if (value != null && (value = +value) >= value) {
          yield value;
        }
      }
    }
  }
  __name(numbers, "numbers");
  const ascendingBisect = bisector(ascending);
  const bisectRight = ascendingBisect.right;
  bisector(number$2).center;
  const _InternMap = class _InternMap extends Map {
    constructor(entries, key = keyof) {
      super();
      Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: key } });
      if (entries != null) for (const [key2, value] of entries) this.set(key2, value);
    }
    get(key) {
      return super.get(intern_get(this, key));
    }
    has(key) {
      return super.has(intern_get(this, key));
    }
    set(key, value) {
      return super.set(intern_set(this, key), value);
    }
    delete(key) {
      return super.delete(intern_delete(this, key));
    }
  };
  __name(_InternMap, "InternMap");
  let InternMap = _InternMap;
  function intern_get({ _intern, _key }, value) {
    const key = _key(value);
    return _intern.has(key) ? _intern.get(key) : value;
  }
  __name(intern_get, "intern_get");
  function intern_set({ _intern, _key }, value) {
    const key = _key(value);
    if (_intern.has(key)) return _intern.get(key);
    _intern.set(key, value);
    return value;
  }
  __name(intern_set, "intern_set");
  function intern_delete({ _intern, _key }, value) {
    const key = _key(value);
    if (_intern.has(key)) {
      value = _intern.get(key);
      _intern.delete(key);
    }
    return value;
  }
  __name(intern_delete, "intern_delete");
  function keyof(value) {
    return value !== null && typeof value === "object" ? value.valueOf() : value;
  }
  __name(keyof, "keyof");
  function compareDefined(compare = ascending) {
    if (compare === ascending) return ascendingDefined;
    if (typeof compare !== "function") throw new TypeError("compare is not a function");
    return (a2, b) => {
      const x2 = compare(a2, b);
      if (x2 || x2 === 0) return x2;
      return (compare(b, b) === 0) - (compare(a2, a2) === 0);
    };
  }
  __name(compareDefined, "compareDefined");
  function ascendingDefined(a2, b) {
    return (a2 == null || !(a2 >= a2)) - (b == null || !(b >= b)) || (a2 < b ? -1 : a2 > b ? 1 : 0);
  }
  __name(ascendingDefined, "ascendingDefined");
  const e10 = Math.sqrt(50), e5 = Math.sqrt(10), e2 = Math.sqrt(2);
  function tickSpec(start, stop, count2) {
    const step = (stop - start) / Math.max(0, count2), power = Math.floor(Math.log10(step)), error = step / Math.pow(10, power), factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;
    let i1, i2, inc;
    if (power < 0) {
      inc = Math.pow(10, -power) / factor;
      i1 = Math.round(start * inc);
      i2 = Math.round(stop * inc);
      if (i1 / inc < start) ++i1;
      if (i2 / inc > stop) --i2;
      inc = -inc;
    } else {
      inc = Math.pow(10, power) * factor;
      i1 = Math.round(start / inc);
      i2 = Math.round(stop / inc);
      if (i1 * inc < start) ++i1;
      if (i2 * inc > stop) --i2;
    }
    if (i2 < i1 && 0.5 <= count2 && count2 < 2) return tickSpec(start, stop, count2 * 2);
    return [i1, i2, inc];
  }
  __name(tickSpec, "tickSpec");
  function ticks(start, stop, count2) {
    stop = +stop, start = +start, count2 = +count2;
    if (!(count2 > 0)) return [];
    if (start === stop) return [start];
    const reverse2 = stop < start, [i1, i2, inc] = reverse2 ? tickSpec(stop, start, count2) : tickSpec(start, stop, count2);
    if (!(i2 >= i1)) return [];
    const n2 = i2 - i1 + 1, ticks2 = new Array(n2);
    if (reverse2) {
      if (inc < 0) for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i2 - i3) / -inc;
      else for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i2 - i3) * inc;
    } else {
      if (inc < 0) for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i1 + i3) / -inc;
      else for (let i3 = 0; i3 < n2; ++i3) ticks2[i3] = (i1 + i3) * inc;
    }
    return ticks2;
  }
  __name(ticks, "ticks");
  function tickIncrement(start, stop, count2) {
    stop = +stop, start = +start, count2 = +count2;
    return tickSpec(start, stop, count2)[2];
  }
  __name(tickIncrement, "tickIncrement");
  function tickStep(start, stop, count2) {
    stop = +stop, start = +start, count2 = +count2;
    const reverse2 = stop < start, inc = reverse2 ? tickIncrement(stop, start, count2) : tickIncrement(start, stop, count2);
    return (reverse2 ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
  }
  __name(tickStep, "tickStep");
  function max$1(values, valueof) {
    let max2;
    {
      for (const value of values) {
        if (value != null && (max2 < value || max2 === void 0 && value >= value)) {
          max2 = value;
        }
      }
    }
    return max2;
  }
  __name(max$1, "max$1");
  function min$1(values, valueof) {
    let min2;
    {
      for (const value of values) {
        if (value != null && (min2 > value || min2 === void 0 && value >= value)) {
          min2 = value;
        }
      }
    }
    return min2;
  }
  __name(min$1, "min$1");
  function quickselect(array2, k2, left = 0, right = Infinity, compare) {
    k2 = Math.floor(k2);
    left = Math.floor(Math.max(0, left));
    right = Math.floor(Math.min(array2.length - 1, right));
    if (!(left <= k2 && k2 <= right)) return array2;
    compare = compare === void 0 ? ascendingDefined : compareDefined(compare);
    while (right > left) {
      if (right - left > 600) {
        const n2 = right - left + 1;
        const m2 = k2 - left + 1;
        const z = Math.log(n2);
        const s2 = 0.5 * Math.exp(2 * z / 3);
        const sd = 0.5 * Math.sqrt(z * s2 * (n2 - s2) / n2) * (m2 - n2 / 2 < 0 ? -1 : 1);
        const newLeft = Math.max(left, Math.floor(k2 - m2 * s2 / n2 + sd));
        const newRight = Math.min(right, Math.floor(k2 + (n2 - m2) * s2 / n2 + sd));
        quickselect(array2, k2, newLeft, newRight, compare);
      }
      const t2 = array2[k2];
      let i2 = left;
      let j = right;
      swap(array2, left, k2);
      if (compare(array2[right], t2) > 0) swap(array2, left, right);
      while (i2 < j) {
        swap(array2, i2, j), ++i2, --j;
        while (compare(array2[i2], t2) < 0) ++i2;
        while (compare(array2[j], t2) > 0) --j;
      }
      if (compare(array2[left], t2) === 0) swap(array2, left, j);
      else ++j, swap(array2, j, right);
      if (j <= k2) left = j + 1;
      if (k2 <= j) right = j - 1;
    }
    return array2;
  }
  __name(quickselect, "quickselect");
  function swap(array2, i2, j) {
    const t2 = array2[i2];
    array2[i2] = array2[j];
    array2[j] = t2;
  }
  __name(swap, "swap");
  function quantile$1(values, p2, valueof) {
    values = Float64Array.from(numbers(values));
    if (!(n2 = values.length) || isNaN(p2 = +p2)) return;
    if (p2 <= 0 || n2 < 2) return min$1(values);
    if (p2 >= 1) return max$1(values);
    var n2, i2 = (n2 - 1) * p2, i0 = Math.floor(i2), value0 = max$1(quickselect(values, i0).subarray(0, i0 + 1)), value1 = min$1(values.subarray(i0 + 1));
    return value0 + (value1 - value0) * (i2 - i0);
  }
  __name(quantile$1, "quantile$1");
  function quantileSorted(values, p2, valueof = number$2) {
    if (!(n2 = values.length) || isNaN(p2 = +p2)) return;
    if (p2 <= 0 || n2 < 2) return +valueof(values[0], 0, values);
    if (p2 >= 1) return +valueof(values[n2 - 1], n2 - 1, values);
    var n2, i2 = (n2 - 1) * p2, i0 = Math.floor(i2), value0 = +valueof(values[i0], i0, values), value1 = +valueof(values[i0 + 1], i0 + 1, values);
    return value0 + (value1 - value0) * (i2 - i0);
  }
  __name(quantileSorted, "quantileSorted");
  function range$2(start, stop, step) {
    start = +start, stop = +stop, step = (n2 = arguments.length) < 2 ? (stop = start, start = 0, 1) : n2 < 3 ? 1 : +step;
    var i2 = -1, n2 = Math.max(0, Math.ceil((stop - start) / step)) | 0, range2 = new Array(n2);
    while (++i2 < n2) {
      range2[i2] = start + i2 * step;
    }
    return range2;
  }
  __name(range$2, "range$2");
  function initRange(domain, range2) {
    switch (arguments.length) {
      case 0:
        break;
      case 1:
        this.range(domain);
        break;
      default:
        this.range(range2).domain(domain);
        break;
    }
    return this;
  }
  __name(initRange, "initRange");
  function initInterpolator(domain, interpolator) {
    switch (arguments.length) {
      case 0:
        break;
      case 1: {
        if (typeof domain === "function") this.interpolator(domain);
        else this.range(domain);
        break;
      }
      default: {
        this.domain(domain);
        if (typeof interpolator === "function") this.interpolator(interpolator);
        else this.range(interpolator);
        break;
      }
    }
    return this;
  }
  __name(initInterpolator, "initInterpolator");
  const implicit = Symbol("implicit");
  function ordinal() {
    var index2 = new InternMap(), domain = [], range2 = [], unknown = implicit;
    function scale(d) {
      let i2 = index2.get(d);
      if (i2 === void 0) {
        if (unknown !== implicit) return unknown;
        index2.set(d, i2 = domain.push(d) - 1);
      }
      return range2[i2 % range2.length];
    }
    __name(scale, "scale");
    scale.domain = function(_) {
      if (!arguments.length) return domain.slice();
      domain = [], index2 = new InternMap();
      for (const value of _) {
        if (index2.has(value)) continue;
        index2.set(value, domain.push(value) - 1);
      }
      return scale;
    };
    scale.range = function(_) {
      return arguments.length ? (range2 = Array.from(_), scale) : range2.slice();
    };
    scale.unknown = function(_) {
      return arguments.length ? (unknown = _, scale) : unknown;
    };
    scale.copy = function() {
      return ordinal(domain, range2).unknown(unknown);
    };
    initRange.apply(scale, arguments);
    return scale;
  }
  __name(ordinal, "ordinal");
  function band() {
    var scale = ordinal().unknown(void 0), domain = scale.domain, ordinalRange = scale.range, r0 = 0, r1 = 1, step, bandwidth, round2 = false, paddingInner = 0, paddingOuter = 0, align = 0.5;
    delete scale.unknown;
    function rescale() {
      var n2 = domain().length, reverse2 = r1 < r0, start = reverse2 ? r1 : r0, stop = reverse2 ? r0 : r1;
      step = (stop - start) / Math.max(1, n2 - paddingInner + paddingOuter * 2);
      if (round2) step = Math.floor(step);
      start += (stop - start - step * (n2 - paddingInner)) * align;
      bandwidth = step * (1 - paddingInner);
      if (round2) start = Math.round(start), bandwidth = Math.round(bandwidth);
      var values = range$2(n2).map(function(i2) {
        return start + step * i2;
      });
      return ordinalRange(reverse2 ? values.reverse() : values);
    }
    __name(rescale, "rescale");
    scale.domain = function(_) {
      return arguments.length ? (domain(_), rescale()) : domain();
    };
    scale.range = function(_) {
      return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
    };
    scale.rangeRound = function(_) {
      return [r0, r1] = _, r0 = +r0, r1 = +r1, round2 = true, rescale();
    };
    scale.bandwidth = function() {
      return bandwidth;
    };
    scale.step = function() {
      return step;
    };
    scale.round = function(_) {
      return arguments.length ? (round2 = !!_, rescale()) : round2;
    };
    scale.padding = function(_) {
      return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
    };
    scale.paddingInner = function(_) {
      return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
    };
    scale.paddingOuter = function(_) {
      return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
    };
    scale.align = function(_) {
      return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
    };
    scale.copy = function() {
      return band(domain(), [r0, r1]).round(round2).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
    };
    return initRange.apply(rescale(), arguments);
  }
  __name(band, "band");
  function pointish(scale) {
    var copy2 = scale.copy;
    scale.padding = scale.paddingOuter;
    delete scale.paddingInner;
    delete scale.paddingOuter;
    scale.copy = function() {
      return pointish(copy2());
    };
    return scale;
  }
  __name(pointish, "pointish");
  function point() {
    return pointish(band.apply(null, arguments).paddingInner(1));
  }
  __name(point, "point");
  function define(constructor, factory, prototype) {
    constructor.prototype = factory.prototype = prototype;
    prototype.constructor = constructor;
  }
  __name(define, "define");
  function extend(parent, definition) {
    var prototype = Object.create(parent.prototype);
    for (var key in definition) prototype[key] = definition[key];
    return prototype;
  }
  __name(extend, "extend");
  function Color() {
  }
  __name(Color, "Color");
  var darker = 0.7;
  var brighter = 1 / darker;
  var reI = "\\s*([+-]?\\d+)\\s*", reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", reHex = /^#([0-9a-f]{3,8})$/, reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`), reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`), reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`), reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`), reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`), reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
  var named = {
    aliceblue: 15792383,
    antiquewhite: 16444375,
    aqua: 65535,
    aquamarine: 8388564,
    azure: 15794175,
    beige: 16119260,
    bisque: 16770244,
    black: 0,
    blanchedalmond: 16772045,
    blue: 255,
    blueviolet: 9055202,
    brown: 10824234,
    burlywood: 14596231,
    cadetblue: 6266528,
    chartreuse: 8388352,
    chocolate: 13789470,
    coral: 16744272,
    cornflowerblue: 6591981,
    cornsilk: 16775388,
    crimson: 14423100,
    cyan: 65535,
    darkblue: 139,
    darkcyan: 35723,
    darkgoldenrod: 12092939,
    darkgray: 11119017,
    darkgreen: 25600,
    darkgrey: 11119017,
    darkkhaki: 12433259,
    darkmagenta: 9109643,
    darkolivegreen: 5597999,
    darkorange: 16747520,
    darkorchid: 10040012,
    darkred: 9109504,
    darksalmon: 15308410,
    darkseagreen: 9419919,
    darkslateblue: 4734347,
    darkslategray: 3100495,
    darkslategrey: 3100495,
    darkturquoise: 52945,
    darkviolet: 9699539,
    deeppink: 16716947,
    deepskyblue: 49151,
    dimgray: 6908265,
    dimgrey: 6908265,
    dodgerblue: 2003199,
    firebrick: 11674146,
    floralwhite: 16775920,
    forestgreen: 2263842,
    fuchsia: 16711935,
    gainsboro: 14474460,
    ghostwhite: 16316671,
    gold: 16766720,
    goldenrod: 14329120,
    gray: 8421504,
    green: 32768,
    greenyellow: 11403055,
    grey: 8421504,
    honeydew: 15794160,
    hotpink: 16738740,
    indianred: 13458524,
    indigo: 4915330,
    ivory: 16777200,
    khaki: 15787660,
    lavender: 15132410,
    lavenderblush: 16773365,
    lawngreen: 8190976,
    lemonchiffon: 16775885,
    lightblue: 11393254,
    lightcoral: 15761536,
    lightcyan: 14745599,
    lightgoldenrodyellow: 16448210,
    lightgray: 13882323,
    lightgreen: 9498256,
    lightgrey: 13882323,
    lightpink: 16758465,
    lightsalmon: 16752762,
    lightseagreen: 2142890,
    lightskyblue: 8900346,
    lightslategray: 7833753,
    lightslategrey: 7833753,
    lightsteelblue: 11584734,
    lightyellow: 16777184,
    lime: 65280,
    limegreen: 3329330,
    linen: 16445670,
    magenta: 16711935,
    maroon: 8388608,
    mediumaquamarine: 6737322,
    mediumblue: 205,
    mediumorchid: 12211667,
    mediumpurple: 9662683,
    mediumseagreen: 3978097,
    mediumslateblue: 8087790,
    mediumspringgreen: 64154,
    mediumturquoise: 4772300,
    mediumvioletred: 13047173,
    midnightblue: 1644912,
    mintcream: 16121850,
    mistyrose: 16770273,
    moccasin: 16770229,
    navajowhite: 16768685,
    navy: 128,
    oldlace: 16643558,
    olive: 8421376,
    olivedrab: 7048739,
    orange: 16753920,
    orangered: 16729344,
    orchid: 14315734,
    palegoldenrod: 15657130,
    palegreen: 10025880,
    paleturquoise: 11529966,
    palevioletred: 14381203,
    papayawhip: 16773077,
    peachpuff: 16767673,
    peru: 13468991,
    pink: 16761035,
    plum: 14524637,
    powderblue: 11591910,
    purple: 8388736,
    rebeccapurple: 6697881,
    red: 16711680,
    rosybrown: 12357519,
    royalblue: 4286945,
    saddlebrown: 9127187,
    salmon: 16416882,
    sandybrown: 16032864,
    seagreen: 3050327,
    seashell: 16774638,
    sienna: 10506797,
    silver: 12632256,
    skyblue: 8900331,
    slateblue: 6970061,
    slategray: 7372944,
    slategrey: 7372944,
    snow: 16775930,
    springgreen: 65407,
    steelblue: 4620980,
    tan: 13808780,
    teal: 32896,
    thistle: 14204888,
    tomato: 16737095,
    turquoise: 4251856,
    violet: 15631086,
    wheat: 16113331,
    white: 16777215,
    whitesmoke: 16119285,
    yellow: 16776960,
    yellowgreen: 10145074
  };
  define(Color, color, {
    copy(channels) {
      return Object.assign(new this.constructor(), this, channels);
    },
    displayable() {
      return this.rgb().displayable();
    },
    hex: color_formatHex,
    // Deprecated! Use color.formatHex.
    formatHex: color_formatHex,
    formatHex8: color_formatHex8,
    formatHsl: color_formatHsl,
    formatRgb: color_formatRgb,
    toString: color_formatRgb
  });
  function color_formatHex() {
    return this.rgb().formatHex();
  }
  __name(color_formatHex, "color_formatHex");
  function color_formatHex8() {
    return this.rgb().formatHex8();
  }
  __name(color_formatHex8, "color_formatHex8");
  function color_formatHsl() {
    return hslConvert(this).formatHsl();
  }
  __name(color_formatHsl, "color_formatHsl");
  function color_formatRgb() {
    return this.rgb().formatRgb();
  }
  __name(color_formatRgb, "color_formatRgb");
  function color(format2) {
    var m2, l;
    format2 = (format2 + "").trim().toLowerCase();
    return (m2 = reHex.exec(format2)) ? (l = m2[1].length, m2 = parseInt(m2[1], 16), l === 6 ? rgbn(m2) : l === 3 ? new Rgb(m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, (m2 & 15) << 4 | m2 & 15, 1) : l === 8 ? rgba(m2 >> 24 & 255, m2 >> 16 & 255, m2 >> 8 & 255, (m2 & 255) / 255) : l === 4 ? rgba(m2 >> 12 & 15 | m2 >> 8 & 240, m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, ((m2 & 15) << 4 | m2 & 15) / 255) : null) : (m2 = reRgbInteger.exec(format2)) ? new Rgb(m2[1], m2[2], m2[3], 1) : (m2 = reRgbPercent.exec(format2)) ? new Rgb(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, 1) : (m2 = reRgbaInteger.exec(format2)) ? rgba(m2[1], m2[2], m2[3], m2[4]) : (m2 = reRgbaPercent.exec(format2)) ? rgba(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, m2[4]) : (m2 = reHslPercent.exec(format2)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, 1) : (m2 = reHslaPercent.exec(format2)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, m2[4]) : named.hasOwnProperty(format2) ? rgbn(named[format2]) : format2 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
  }
  __name(color, "color");
  function rgbn(n2) {
    return new Rgb(n2 >> 16 & 255, n2 >> 8 & 255, n2 & 255, 1);
  }
  __name(rgbn, "rgbn");
  function rgba(r2, g, b, a2) {
    if (a2 <= 0) r2 = g = b = NaN;
    return new Rgb(r2, g, b, a2);
  }
  __name(rgba, "rgba");
  function rgbConvert(o2) {
    if (!(o2 instanceof Color)) o2 = color(o2);
    if (!o2) return new Rgb();
    o2 = o2.rgb();
    return new Rgb(o2.r, o2.g, o2.b, o2.opacity);
  }
  __name(rgbConvert, "rgbConvert");
  function rgb$1(r2, g, b, opacity) {
    return arguments.length === 1 ? rgbConvert(r2) : new Rgb(r2, g, b, opacity == null ? 1 : opacity);
  }
  __name(rgb$1, "rgb$1");
  function Rgb(r2, g, b, opacity) {
    this.r = +r2;
    this.g = +g;
    this.b = +b;
    this.opacity = +opacity;
  }
  __name(Rgb, "Rgb");
  define(Rgb, rgb$1, extend(Color, {
    brighter(k2) {
      k2 = k2 == null ? brighter : Math.pow(brighter, k2);
      return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
    },
    darker(k2) {
      k2 = k2 == null ? darker : Math.pow(darker, k2);
      return new Rgb(this.r * k2, this.g * k2, this.b * k2, this.opacity);
    },
    rgb() {
      return this;
    },
    clamp() {
      return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
    },
    displayable() {
      return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
    },
    hex: rgb_formatHex,
    // Deprecated! Use color.formatHex.
    formatHex: rgb_formatHex,
    formatHex8: rgb_formatHex8,
    formatRgb: rgb_formatRgb,
    toString: rgb_formatRgb
  }));
  function rgb_formatHex() {
    return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
  }
  __name(rgb_formatHex, "rgb_formatHex");
  function rgb_formatHex8() {
    return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
  }
  __name(rgb_formatHex8, "rgb_formatHex8");
  function rgb_formatRgb() {
    const a2 = clampa(this.opacity);
    return `${a2 === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a2 === 1 ? ")" : `, ${a2})`}`;
  }
  __name(rgb_formatRgb, "rgb_formatRgb");
  function clampa(opacity) {
    return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
  }
  __name(clampa, "clampa");
  function clampi(value) {
    return Math.max(0, Math.min(255, Math.round(value) || 0));
  }
  __name(clampi, "clampi");
  function hex(value) {
    value = clampi(value);
    return (value < 16 ? "0" : "") + value.toString(16);
  }
  __name(hex, "hex");
  function hsla(h, s2, l, a2) {
    if (a2 <= 0) h = s2 = l = NaN;
    else if (l <= 0 || l >= 1) h = s2 = NaN;
    else if (s2 <= 0) h = NaN;
    return new Hsl(h, s2, l, a2);
  }
  __name(hsla, "hsla");
  function hslConvert(o2) {
    if (o2 instanceof Hsl) return new Hsl(o2.h, o2.s, o2.l, o2.opacity);
    if (!(o2 instanceof Color)) o2 = color(o2);
    if (!o2) return new Hsl();
    if (o2 instanceof Hsl) return o2;
    o2 = o2.rgb();
    var r2 = o2.r / 255, g = o2.g / 255, b = o2.b / 255, min2 = Math.min(r2, g, b), max2 = Math.max(r2, g, b), h = NaN, s2 = max2 - min2, l = (max2 + min2) / 2;
    if (s2) {
      if (r2 === max2) h = (g - b) / s2 + (g < b) * 6;
      else if (g === max2) h = (b - r2) / s2 + 2;
      else h = (r2 - g) / s2 + 4;
      s2 /= l < 0.5 ? max2 + min2 : 2 - max2 - min2;
      h *= 60;
    } else {
      s2 = l > 0 && l < 1 ? 0 : h;
    }
    return new Hsl(h, s2, l, o2.opacity);
  }
  __name(hslConvert, "hslConvert");
  function hsl(h, s2, l, opacity) {
    return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s2, l, opacity == null ? 1 : opacity);
  }
  __name(hsl, "hsl");
  function Hsl(h, s2, l, opacity) {
    this.h = +h;
    this.s = +s2;
    this.l = +l;
    this.opacity = +opacity;
  }
  __name(Hsl, "Hsl");
  define(Hsl, hsl, extend(Color, {
    brighter(k2) {
      k2 = k2 == null ? brighter : Math.pow(brighter, k2);
      return new Hsl(this.h, this.s, this.l * k2, this.opacity);
    },
    darker(k2) {
      k2 = k2 == null ? darker : Math.pow(darker, k2);
      return new Hsl(this.h, this.s, this.l * k2, this.opacity);
    },
    rgb() {
      var h = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h) || isNaN(this.s) ? 0 : this.s, l = this.l, m2 = l + (l < 0.5 ? l : 1 - l) * s2, m1 = 2 * l - m2;
      return new Rgb(
        hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
        hsl2rgb(h, m1, m2),
        hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
        this.opacity
      );
    },
    clamp() {
      return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
    },
    displayable() {
      return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
    },
    formatHsl() {
      const a2 = clampa(this.opacity);
      return `${a2 === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a2 === 1 ? ")" : `, ${a2})`}`;
    }
  }));
  function clamph(value) {
    value = (value || 0) % 360;
    return value < 0 ? value + 360 : value;
  }
  __name(clamph, "clamph");
  function clampt(value) {
    return Math.max(0, Math.min(1, value || 0));
  }
  __name(clampt, "clampt");
  function hsl2rgb(h, m1, m2) {
    return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
  }
  __name(hsl2rgb, "hsl2rgb");
  const constant = /* @__PURE__ */ __name((x2) => () => x2, "constant");
  function linear$1(a2, d) {
    return function(t2) {
      return a2 + t2 * d;
    };
  }
  __name(linear$1, "linear$1");
  function exponential(a2, b, y2) {
    return a2 = Math.pow(a2, y2), b = Math.pow(b, y2) - a2, y2 = 1 / y2, function(t2) {
      return Math.pow(a2 + t2 * b, y2);
    };
  }
  __name(exponential, "exponential");
  function gamma(y2) {
    return (y2 = +y2) === 1 ? nogamma : function(a2, b) {
      return b - a2 ? exponential(a2, b, y2) : constant(isNaN(a2) ? b : a2);
    };
  }
  __name(gamma, "gamma");
  function nogamma(a2, b) {
    var d = b - a2;
    return d ? linear$1(a2, d) : constant(isNaN(a2) ? b : a2);
  }
  __name(nogamma, "nogamma");
  const rgb = (/* @__PURE__ */ __name((function rgbGamma(y2) {
    var color2 = gamma(y2);
    function rgb2(start, end) {
      var r2 = color2((start = rgb$1(start)).r, (end = rgb$1(end)).r), g = color2(start.g, end.g), b = color2(start.b, end.b), opacity = nogamma(start.opacity, end.opacity);
      return function(t2) {
        start.r = r2(t2);
        start.g = g(t2);
        start.b = b(t2);
        start.opacity = opacity(t2);
        return start + "";
      };
    }
    __name(rgb2, "rgb");
    rgb2.gamma = rgbGamma;
    return rgb2;
  }), "rgbGamma"))(1);
  function numberArray(a2, b) {
    if (!b) b = [];
    var n2 = a2 ? Math.min(b.length, a2.length) : 0, c2 = b.slice(), i2;
    return function(t2) {
      for (i2 = 0; i2 < n2; ++i2) c2[i2] = a2[i2] * (1 - t2) + b[i2] * t2;
      return c2;
    };
  }
  __name(numberArray, "numberArray");
  function isNumberArray(x2) {
    return ArrayBuffer.isView(x2) && !(x2 instanceof DataView);
  }
  __name(isNumberArray, "isNumberArray");
  function genericArray(a2, b) {
    var nb = b ? b.length : 0, na = a2 ? Math.min(nb, a2.length) : 0, x2 = new Array(na), c2 = new Array(nb), i2;
    for (i2 = 0; i2 < na; ++i2) x2[i2] = interpolate(a2[i2], b[i2]);
    for (; i2 < nb; ++i2) c2[i2] = b[i2];
    return function(t2) {
      for (i2 = 0; i2 < na; ++i2) c2[i2] = x2[i2](t2);
      return c2;
    };
  }
  __name(genericArray, "genericArray");
  function date$1(a2, b) {
    var d = /* @__PURE__ */ new Date();
    return a2 = +a2, b = +b, function(t2) {
      return d.setTime(a2 * (1 - t2) + b * t2), d;
    };
  }
  __name(date$1, "date$1");
  function interpolateNumber$1(a2, b) {
    return a2 = +a2, b = +b, function(t2) {
      return a2 * (1 - t2) + b * t2;
    };
  }
  __name(interpolateNumber$1, "interpolateNumber$1");
  function object(a2, b) {
    var i2 = {}, c2 = {}, k2;
    if (a2 === null || typeof a2 !== "object") a2 = {};
    if (b === null || typeof b !== "object") b = {};
    for (k2 in b) {
      if (k2 in a2) {
        i2[k2] = interpolate(a2[k2], b[k2]);
      } else {
        c2[k2] = b[k2];
      }
    }
    return function(t2) {
      for (k2 in i2) c2[k2] = i2[k2](t2);
      return c2;
    };
  }
  __name(object, "object");
  var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, reB = new RegExp(reA.source, "g");
  function zero(b) {
    return function() {
      return b;
    };
  }
  __name(zero, "zero");
  function one(b) {
    return function(t2) {
      return b(t2) + "";
    };
  }
  __name(one, "one");
  function string(a2, b) {
    var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i2 = -1, s2 = [], q = [];
    a2 = a2 + "", b = b + "";
    while ((am = reA.exec(a2)) && (bm = reB.exec(b))) {
      if ((bs = bm.index) > bi) {
        bs = b.slice(bi, bs);
        if (s2[i2]) s2[i2] += bs;
        else s2[++i2] = bs;
      }
      if ((am = am[0]) === (bm = bm[0])) {
        if (s2[i2]) s2[i2] += bm;
        else s2[++i2] = bm;
      } else {
        s2[++i2] = null;
        q.push({ i: i2, x: interpolateNumber$1(am, bm) });
      }
      bi = reB.lastIndex;
    }
    if (bi < b.length) {
      bs = b.slice(bi);
      if (s2[i2]) s2[i2] += bs;
      else s2[++i2] = bs;
    }
    return s2.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t2) {
      for (var i3 = 0, o2; i3 < b; ++i3) s2[(o2 = q[i3]).i] = o2.x(t2);
      return s2.join("");
    });
  }
  __name(string, "string");
  function interpolate(a2, b) {
    var t2 = typeof b, c2;
    return b == null || t2 === "boolean" ? constant(b) : (t2 === "number" ? interpolateNumber$1 : t2 === "string" ? (c2 = color(b)) ? (b = c2, rgb) : string : b instanceof color ? rgb : b instanceof Date ? date$1 : isNumberArray(b) ? numberArray : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object : interpolateNumber$1)(a2, b);
  }
  __name(interpolate, "interpolate");
  function interpolateRound(a2, b) {
    return a2 = +a2, b = +b, function(t2) {
      return Math.round(a2 * (1 - t2) + b * t2);
    };
  }
  __name(interpolateRound, "interpolateRound");
  function piecewise(interpolate$1, values) {
    if (values === void 0) values = interpolate$1, interpolate$1 = interpolate;
    var i2 = 0, n2 = values.length - 1, v = values[0], I = new Array(n2 < 0 ? 0 : n2);
    while (i2 < n2) I[i2] = interpolate$1(v, v = values[++i2]);
    return function(t2) {
      var i3 = Math.max(0, Math.min(n2 - 1, Math.floor(t2 *= n2)));
      return I[i3](t2 - i3);
    };
  }
  __name(piecewise, "piecewise");
  function constants(x2) {
    return function() {
      return x2;
    };
  }
  __name(constants, "constants");
  function number$1(x2) {
    return +x2;
  }
  __name(number$1, "number$1");
  var unit = [0, 1];
  function identity$5(x2) {
    return x2;
  }
  __name(identity$5, "identity$5");
  function normalize(a2, b) {
    return (b -= a2 = +a2) ? function(x2) {
      return (x2 - a2) / b;
    } : constants(isNaN(b) ? NaN : 0.5);
  }
  __name(normalize, "normalize");
  function clamper(a2, b) {
    var t2;
    if (a2 > b) t2 = a2, a2 = b, b = t2;
    return function(x2) {
      return Math.max(a2, Math.min(b, x2));
    };
  }
  __name(clamper, "clamper");
  function bimap(domain, range2, interpolate2) {
    var d0 = domain[0], d1 = domain[1], r0 = range2[0], r1 = range2[1];
    if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate2(r1, r0);
    else d0 = normalize(d0, d1), r0 = interpolate2(r0, r1);
    return function(x2) {
      return r0(d0(x2));
    };
  }
  __name(bimap, "bimap");
  function polymap(domain, range2, interpolate2) {
    var j = Math.min(domain.length, range2.length) - 1, d = new Array(j), r2 = new Array(j), i2 = -1;
    if (domain[j] < domain[0]) {
      domain = domain.slice().reverse();
      range2 = range2.slice().reverse();
    }
    while (++i2 < j) {
      d[i2] = normalize(domain[i2], domain[i2 + 1]);
      r2[i2] = interpolate2(range2[i2], range2[i2 + 1]);
    }
    return function(x2) {
      var i3 = bisectRight(domain, x2, 1, j) - 1;
      return r2[i3](d[i3](x2));
    };
  }
  __name(polymap, "polymap");
  function copy$1(source, target) {
    return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
  }
  __name(copy$1, "copy$1");
  function transformer$2() {
    var domain = unit, range2 = unit, interpolate$1 = interpolate, transform, untransform, unknown, clamp2 = identity$5, piecewise2, output, input;
    function rescale() {
      var n2 = Math.min(domain.length, range2.length);
      if (clamp2 !== identity$5) clamp2 = clamper(domain[0], domain[n2 - 1]);
      piecewise2 = n2 > 2 ? polymap : bimap;
      output = input = null;
      return scale;
    }
    __name(rescale, "rescale");
    function scale(x2) {
      return x2 == null || isNaN(x2 = +x2) ? unknown : (output || (output = piecewise2(domain.map(transform), range2, interpolate$1)))(transform(clamp2(x2)));
    }
    __name(scale, "scale");
    scale.invert = function(y2) {
      return clamp2(untransform((input || (input = piecewise2(range2, domain.map(transform), interpolateNumber$1)))(y2)));
    };
    scale.domain = function(_) {
      return arguments.length ? (domain = Array.from(_, number$1), rescale()) : domain.slice();
    };
    scale.range = function(_) {
      return arguments.length ? (range2 = Array.from(_), rescale()) : range2.slice();
    };
    scale.rangeRound = function(_) {
      return range2 = Array.from(_), interpolate$1 = interpolateRound, rescale();
    };
    scale.clamp = function(_) {
      return arguments.length ? (clamp2 = _ ? true : identity$5, rescale()) : clamp2 !== identity$5;
    };
    scale.interpolate = function(_) {
      return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1;
    };
    scale.unknown = function(_) {
      return arguments.length ? (unknown = _, scale) : unknown;
    };
    return function(t2, u2) {
      transform = t2, untransform = u2;
      return rescale();
    };
  }
  __name(transformer$2, "transformer$2");
  function continuous() {
    return transformer$2()(identity$5, identity$5);
  }
  __name(continuous, "continuous");
  function formatDecimal(x2) {
    return Math.abs(x2 = Math.round(x2)) >= 1e21 ? x2.toLocaleString("en").replace(/,/g, "") : x2.toString(10);
  }
  __name(formatDecimal, "formatDecimal");
  function formatDecimalParts(x2, p2) {
    if (!isFinite(x2) || x2 === 0) return null;
    var i2 = (x2 = p2 ? x2.toExponential(p2 - 1) : x2.toExponential()).indexOf("e"), coefficient = x2.slice(0, i2);
    return [
      coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
      +x2.slice(i2 + 1)
    ];
  }
  __name(formatDecimalParts, "formatDecimalParts");
  function exponent(x2) {
    return x2 = formatDecimalParts(Math.abs(x2)), x2 ? x2[1] : NaN;
  }
  __name(exponent, "exponent");
  function formatGroup(grouping, thousands) {
    return function(value, width) {
      var i2 = value.length, t2 = [], j = 0, g = grouping[0], length = 0;
      while (i2 > 0 && g > 0) {
        if (length + g + 1 > width) g = Math.max(1, width - length);
        t2.push(value.substring(i2 -= g, i2 + g));
        if ((length += g + 1) > width) break;
        g = grouping[j = (j + 1) % grouping.length];
      }
      return t2.reverse().join(thousands);
    };
  }
  __name(formatGroup, "formatGroup");
  function formatNumerals(numerals) {
    return function(value) {
      return value.replace(/[0-9]/g, function(i2) {
        return numerals[+i2];
      });
    };
  }
  __name(formatNumerals, "formatNumerals");
  var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
  function formatSpecifier(specifier) {
    if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
    var match;
    return new FormatSpecifier({
      fill: match[1],
      align: match[2],
      sign: match[3],
      symbol: match[4],
      zero: match[5],
      width: match[6],
      comma: match[7],
      precision: match[8] && match[8].slice(1),
      trim: match[9],
      type: match[10]
    });
  }
  __name(formatSpecifier, "formatSpecifier");
  formatSpecifier.prototype = FormatSpecifier.prototype;
  function FormatSpecifier(specifier) {
    this.fill = specifier.fill === void 0 ? " " : specifier.fill + "";
    this.align = specifier.align === void 0 ? ">" : specifier.align + "";
    this.sign = specifier.sign === void 0 ? "-" : specifier.sign + "";
    this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + "";
    this.zero = !!specifier.zero;
    this.width = specifier.width === void 0 ? void 0 : +specifier.width;
    this.comma = !!specifier.comma;
    this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision;
    this.trim = !!specifier.trim;
    this.type = specifier.type === void 0 ? "" : specifier.type + "";
  }
  __name(FormatSpecifier, "FormatSpecifier");
  FormatSpecifier.prototype.toString = function() {
    return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
  };
  function formatTrim(s2) {
    out: for (var n2 = s2.length, i2 = 1, i0 = -1, i1; i2 < n2; ++i2) {
      switch (s2[i2]) {
        case ".":
          i0 = i1 = i2;
          break;
        case "0":
          if (i0 === 0) i0 = i2;
          i1 = i2;
          break;
        default:
          if (!+s2[i2]) break out;
          if (i0 > 0) i0 = 0;
          break;
      }
    }
    return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2;
  }
  __name(formatTrim, "formatTrim");
  var prefixExponent;
  function formatPrefixAuto(x2, p2) {
    var d = formatDecimalParts(x2, p2);
    if (!d) return prefixExponent = void 0, x2.toPrecision(p2);
    var coefficient = d[0], exponent2 = d[1], i2 = exponent2 - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent2 / 3))) * 3) + 1, n2 = coefficient.length;
    return i2 === n2 ? coefficient : i2 > n2 ? coefficient + new Array(i2 - n2 + 1).join("0") : i2 > 0 ? coefficient.slice(0, i2) + "." + coefficient.slice(i2) : "0." + new Array(1 - i2).join("0") + formatDecimalParts(x2, Math.max(0, p2 + i2 - 1))[0];
  }
  __name(formatPrefixAuto, "formatPrefixAuto");
  function formatRounded(x2, p2) {
    var d = formatDecimalParts(x2, p2);
    if (!d) return x2 + "";
    var coefficient = d[0], exponent2 = d[1];
    return exponent2 < 0 ? "0." + new Array(-exponent2).join("0") + coefficient : coefficient.length > exponent2 + 1 ? coefficient.slice(0, exponent2 + 1) + "." + coefficient.slice(exponent2 + 1) : coefficient + new Array(exponent2 - coefficient.length + 2).join("0");
  }
  __name(formatRounded, "formatRounded");
  const formatTypes = {
    "%": /* @__PURE__ */ __name((x2, p2) => (x2 * 100).toFixed(p2), "%"),
    "b": /* @__PURE__ */ __name((x2) => Math.round(x2).toString(2), "b"),
    "c": /* @__PURE__ */ __name((x2) => x2 + "", "c"),
    "d": formatDecimal,
    "e": /* @__PURE__ */ __name((x2, p2) => x2.toExponential(p2), "e"),
    "f": /* @__PURE__ */ __name((x2, p2) => x2.toFixed(p2), "f"),
    "g": /* @__PURE__ */ __name((x2, p2) => x2.toPrecision(p2), "g"),
    "o": /* @__PURE__ */ __name((x2) => Math.round(x2).toString(8), "o"),
    "p": /* @__PURE__ */ __name((x2, p2) => formatRounded(x2 * 100, p2), "p"),
    "r": formatRounded,
    "s": formatPrefixAuto,
    "X": /* @__PURE__ */ __name((x2) => Math.round(x2).toString(16).toUpperCase(), "X"),
    "x": /* @__PURE__ */ __name((x2) => Math.round(x2).toString(16), "x")
  };
  function identity$4(x2) {
    return x2;
  }
  __name(identity$4, "identity$4");
  var map$1 = Array.prototype.map, prefixes = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
  function formatLocale$1(locale2) {
    var group = locale2.grouping === void 0 || locale2.thousands === void 0 ? identity$4 : formatGroup(map$1.call(locale2.grouping, Number), locale2.thousands + ""), currencyPrefix = locale2.currency === void 0 ? "" : locale2.currency[0] + "", currencySuffix = locale2.currency === void 0 ? "" : locale2.currency[1] + "", decimal = locale2.decimal === void 0 ? "." : locale2.decimal + "", numerals = locale2.numerals === void 0 ? identity$4 : formatNumerals(map$1.call(locale2.numerals, String)), percent = locale2.percent === void 0 ? "%" : locale2.percent + "", minus = locale2.minus === void 0 ? "−" : locale2.minus + "", nan = locale2.nan === void 0 ? "NaN" : locale2.nan + "";
    function newFormat(specifier, options2) {
      specifier = formatSpecifier(specifier);
      var fill = specifier.fill, align = specifier.align, sign2 = specifier.sign, symbol = specifier.symbol, zero2 = specifier.zero, width = specifier.width, comma = specifier.comma, precision = specifier.precision, trim = specifier.trim, type = specifier.type;
      if (type === "n") comma = true, type = "g";
      else if (!formatTypes[type]) precision === void 0 && (precision = 12), trim = true, type = "g";
      if (zero2 || fill === "0" && align === "=") zero2 = true, fill = "0", align = "=";
      var prefix2 = (options2 && options2.prefix !== void 0 ? options2.prefix : "") + (symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : ""), suffix = (symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "") + (options2 && options2.suffix !== void 0 ? options2.suffix : "");
      var formatType = formatTypes[type], maybeSuffix = /[defgprs%]/.test(type);
      precision = precision === void 0 ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision));
      function format2(value) {
        var valuePrefix = prefix2, valueSuffix = suffix, i2, n2, c2;
        if (type === "c") {
          valueSuffix = formatType(value) + valueSuffix;
          value = "";
        } else {
          value = +value;
          var valueNegative = value < 0 || 1 / value < 0;
          value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
          if (trim) value = formatTrim(value);
          if (valueNegative && +value === 0 && sign2 !== "+") valueNegative = false;
          valuePrefix = (valueNegative ? sign2 === "(" ? sign2 : minus : sign2 === "-" || sign2 === "(" ? "" : sign2) + valuePrefix;
          valueSuffix = (type === "s" && !isNaN(value) && prefixExponent !== void 0 ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign2 === "(" ? ")" : "");
          if (maybeSuffix) {
            i2 = -1, n2 = value.length;
            while (++i2 < n2) {
              if (c2 = value.charCodeAt(i2), 48 > c2 || c2 > 57) {
                valueSuffix = (c2 === 46 ? decimal + value.slice(i2 + 1) : value.slice(i2)) + valueSuffix;
                value = value.slice(0, i2);
                break;
              }
            }
          }
        }
        if (comma && !zero2) value = group(value, Infinity);
        var length = valuePrefix.length + value.length + valueSuffix.length, padding = length < width ? new Array(width - length + 1).join(fill) : "";
        if (comma && zero2) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
        switch (align) {
          case "<":
            value = valuePrefix + value + valueSuffix + padding;
            break;
          case "=":
            value = valuePrefix + padding + value + valueSuffix;
            break;
          case "^":
            value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length);
            break;
          default:
            value = padding + valuePrefix + value + valueSuffix;
            break;
        }
        return numerals(value);
      }
      __name(format2, "format");
      format2.toString = function() {
        return specifier + "";
      };
      return format2;
    }
    __name(newFormat, "newFormat");
    function formatPrefix2(specifier, value) {
      var e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, k2 = Math.pow(10, -e), f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier), { suffix: prefixes[8 + e / 3] });
      return function(value2) {
        return f(k2 * value2);
      };
    }
    __name(formatPrefix2, "formatPrefix");
    return {
      format: newFormat,
      formatPrefix: formatPrefix2
    };
  }
  __name(formatLocale$1, "formatLocale$1");
  var locale$1;
  var format;
  var formatPrefix;
  defaultLocale$1({
    thousands: ",",
    grouping: [3],
    currency: ["$", ""]
  });
  function defaultLocale$1(definition) {
    locale$1 = formatLocale$1(definition);
    format = locale$1.format;
    formatPrefix = locale$1.formatPrefix;
    return locale$1;
  }
  __name(defaultLocale$1, "defaultLocale$1");
  function precisionFixed(step) {
    return Math.max(0, -exponent(Math.abs(step)));
  }
  __name(precisionFixed, "precisionFixed");
  function precisionPrefix(step, value) {
    return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
  }
  __name(precisionPrefix, "precisionPrefix");
  function precisionRound(step, max2) {
    step = Math.abs(step), max2 = Math.abs(max2) - step;
    return Math.max(0, exponent(max2) - exponent(step)) + 1;
  }
  __name(precisionRound, "precisionRound");
  function tickFormat(start, stop, count2, specifier) {
    var step = tickStep(start, stop, count2), precision;
    specifier = formatSpecifier(specifier == null ? ",f" : specifier);
    switch (specifier.type) {
      case "s": {
        var value = Math.max(Math.abs(start), Math.abs(stop));
        if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;
        return formatPrefix(specifier, value);
      }
      case "":
      case "e":
      case "g":
      case "p":
      case "r": {
        if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
        break;
      }
      case "f":
      case "%": {
        if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
        break;
      }
    }
    return format(specifier);
  }
  __name(tickFormat, "tickFormat");
  function linearish(scale) {
    var domain = scale.domain;
    scale.ticks = function(count2) {
      var d = domain();
      return ticks(d[0], d[d.length - 1], count2 == null ? 10 : count2);
    };
    scale.tickFormat = function(count2, specifier) {
      var d = domain();
      return tickFormat(d[0], d[d.length - 1], count2 == null ? 10 : count2, specifier);
    };
    scale.nice = function(count2) {
      if (count2 == null) count2 = 10;
      var d = domain();
      var i0 = 0;
      var i1 = d.length - 1;
      var start = d[i0];
      var stop = d[i1];
      var prestep;
      var step;
      var maxIter = 10;
      if (stop < start) {
        step = start, start = stop, stop = step;
        step = i0, i0 = i1, i1 = step;
      }
      while (maxIter-- > 0) {
        step = tickIncrement(start, stop, count2);
        if (step === prestep) {
          d[i0] = start;
          d[i1] = stop;
          return domain(d);
        } else if (step > 0) {
          start = Math.floor(start / step) * step;
          stop = Math.ceil(stop / step) * step;
        } else if (step < 0) {
          start = Math.ceil(start * step) / step;
          stop = Math.floor(stop * step) / step;
        } else {
          break;
        }
        prestep = step;
      }
      return scale;
    };
    return scale;
  }
  __name(linearish, "linearish");
  function linear() {
    var scale = continuous();
    scale.copy = function() {
      return copy$1(scale, linear());
    };
    initRange.apply(scale, arguments);
    return linearish(scale);
  }
  __name(linear, "linear");
  function identity$3(domain) {
    var unknown;
    function scale(x2) {
      return x2 == null || isNaN(x2 = +x2) ? unknown : x2;
    }
    __name(scale, "scale");
    scale.invert = scale;
    scale.domain = scale.range = function(_) {
      return arguments.length ? (domain = Array.from(_, number$1), scale) : domain.slice();
    };
    scale.unknown = function(_) {
      return arguments.length ? (unknown = _, scale) : unknown;
    };
    scale.copy = function() {
      return identity$3(domain).unknown(unknown);
    };
    domain = arguments.length ? Array.from(domain, number$1) : [0, 1];
    return linearish(scale);
  }
  __name(identity$3, "identity$3");
  function nice(domain, interval) {
    domain = domain.slice();
    var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], t2;
    if (x1 < x0) {
      t2 = i0, i0 = i1, i1 = t2;
      t2 = x0, x0 = x1, x1 = t2;
    }
    domain[i0] = interval.floor(x0);
    domain[i1] = interval.ceil(x1);
    return domain;
  }
  __name(nice, "nice");
  function transformLog(x2) {
    return Math.log(x2);
  }
  __name(transformLog, "transformLog");
  function transformExp(x2) {
    return Math.exp(x2);
  }
  __name(transformExp, "transformExp");
  function transformLogn(x2) {
    return -Math.log(-x2);
  }
  __name(transformLogn, "transformLogn");
  function transformExpn(x2) {
    return -Math.exp(-x2);
  }
  __name(transformExpn, "transformExpn");
  function pow10(x2) {
    return isFinite(x2) ? +("1e" + x2) : x2 < 0 ? 0 : x2;
  }
  __name(pow10, "pow10");
  function powp(base) {
    return base === 10 ? pow10 : base === Math.E ? Math.exp : (x2) => Math.pow(base, x2);
  }
  __name(powp, "powp");
  function logp(base) {
    return base === Math.E ? Math.log : base === 10 && Math.log10 || base === 2 && Math.log2 || (base = Math.log(base), (x2) => Math.log(x2) / base);
  }
  __name(logp, "logp");
  function reflect(f) {
    return (x2, k2) => -f(-x2, k2);
  }
  __name(reflect, "reflect");
  function loggish(transform) {
    const scale = transform(transformLog, transformExp);
    const domain = scale.domain;
    let base = 10;
    let logs;
    let pows;
    function rescale() {
      logs = logp(base), pows = powp(base);
      if (domain()[0] < 0) {
        logs = reflect(logs), pows = reflect(pows);
        transform(transformLogn, transformExpn);
      } else {
        transform(transformLog, transformExp);
      }
      return scale;
    }
    __name(rescale, "rescale");
    scale.base = function(_) {
      return arguments.length ? (base = +_, rescale()) : base;
    };
    scale.domain = function(_) {
      return arguments.length ? (domain(_), rescale()) : domain();
    };
    scale.ticks = (count2) => {
      const d = domain();
      let u2 = d[0];
      let v = d[d.length - 1];
      const r2 = v < u2;
      if (r2) [u2, v] = [v, u2];
      let i2 = logs(u2);
      let j = logs(v);
      let k2;
      let t2;
      const n2 = count2 == null ? 10 : +count2;
      let z = [];
      if (!(base % 1) && j - i2 < n2) {
        i2 = Math.floor(i2), j = Math.ceil(j);
        if (u2 > 0) for (; i2 <= j; ++i2) {
          for (k2 = 1; k2 < base; ++k2) {
            t2 = i2 < 0 ? k2 / pows(-i2) : k2 * pows(i2);
            if (t2 < u2) continue;
            if (t2 > v) break;
            z.push(t2);
          }
        }
        else for (; i2 <= j; ++i2) {
          for (k2 = base - 1; k2 >= 1; --k2) {
            t2 = i2 > 0 ? k2 / pows(-i2) : k2 * pows(i2);
            if (t2 < u2) continue;
            if (t2 > v) break;
            z.push(t2);
          }
        }
        if (z.length * 2 < n2) z = ticks(u2, v, n2);
      } else {
        z = ticks(i2, j, Math.min(j - i2, n2)).map(pows);
      }
      return r2 ? z.reverse() : z;
    };
    scale.tickFormat = (count2, specifier) => {
      if (count2 == null) count2 = 10;
      if (specifier == null) specifier = base === 10 ? "s" : ",";
      if (typeof specifier !== "function") {
        if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;
        specifier = format(specifier);
      }
      if (count2 === Infinity) return specifier;
      const k2 = Math.max(1, base * count2 / scale.ticks().length);
      return (d) => {
        let i2 = d / pows(Math.round(logs(d)));
        if (i2 * base < base - 0.5) i2 *= base;
        return i2 <= k2 ? specifier(d) : "";
      };
    };
    scale.nice = () => {
      return domain(nice(domain(), {
        floor: /* @__PURE__ */ __name((x2) => pows(Math.floor(logs(x2))), "floor"),
        ceil: /* @__PURE__ */ __name((x2) => pows(Math.ceil(logs(x2))), "ceil")
      }));
    };
    return scale;
  }
  __name(loggish, "loggish");
  function log() {
    const scale = loggish(transformer$2()).domain([1, 10]);
    scale.copy = () => copy$1(scale, log()).base(scale.base());
    initRange.apply(scale, arguments);
    return scale;
  }
  __name(log, "log");
  function transformSymlog(c2) {
    return function(x2) {
      return Math.sign(x2) * Math.log1p(Math.abs(x2 / c2));
    };
  }
  __name(transformSymlog, "transformSymlog");
  function transformSymexp(c2) {
    return function(x2) {
      return Math.sign(x2) * Math.expm1(Math.abs(x2)) * c2;
    };
  }
  __name(transformSymexp, "transformSymexp");
  function symlogish(transform) {
    var c2 = 1, scale = transform(transformSymlog(c2), transformSymexp(c2));
    scale.constant = function(_) {
      return arguments.length ? transform(transformSymlog(c2 = +_), transformSymexp(c2)) : c2;
    };
    return linearish(scale);
  }
  __name(symlogish, "symlogish");
  function symlog() {
    var scale = symlogish(transformer$2());
    scale.copy = function() {
      return copy$1(scale, symlog()).constant(scale.constant());
    };
    return initRange.apply(scale, arguments);
  }
  __name(symlog, "symlog");
  function transformPow(exponent2) {
    return function(x2) {
      return x2 < 0 ? -Math.pow(-x2, exponent2) : Math.pow(x2, exponent2);
    };
  }
  __name(transformPow, "transformPow");
  function transformSqrt(x2) {
    return x2 < 0 ? -Math.sqrt(-x2) : Math.sqrt(x2);
  }
  __name(transformSqrt, "transformSqrt");
  function transformSquare(x2) {
    return x2 < 0 ? -x2 * x2 : x2 * x2;
  }
  __name(transformSquare, "transformSquare");
  function powish(transform) {
    var scale = transform(identity$5, identity$5), exponent2 = 1;
    function rescale() {
      return exponent2 === 1 ? transform(identity$5, identity$5) : exponent2 === 0.5 ? transform(transformSqrt, transformSquare) : transform(transformPow(exponent2), transformPow(1 / exponent2));
    }
    __name(rescale, "rescale");
    scale.exponent = function(_) {
      return arguments.length ? (exponent2 = +_, rescale()) : exponent2;
    };
    return linearish(scale);
  }
  __name(powish, "powish");
  function pow() {
    var scale = powish(transformer$2());
    scale.copy = function() {
      return copy$1(scale, pow()).exponent(scale.exponent());
    };
    initRange.apply(scale, arguments);
    return scale;
  }
  __name(pow, "pow");
  function sqrt() {
    return pow.apply(null, arguments).exponent(0.5);
  }
  __name(sqrt, "sqrt");
  function square(x2) {
    return Math.sign(x2) * x2 * x2;
  }
  __name(square, "square");
  function unsquare(x2) {
    return Math.sign(x2) * Math.sqrt(Math.abs(x2));
  }
  __name(unsquare, "unsquare");
  function radial() {
    var squared = continuous(), range2 = [0, 1], round2 = false, unknown;
    function scale(x2) {
      var y2 = unsquare(squared(x2));
      return isNaN(y2) ? unknown : round2 ? Math.round(y2) : y2;
    }
    __name(scale, "scale");
    scale.invert = function(y2) {
      return squared.invert(square(y2));
    };
    scale.domain = function(_) {
      return arguments.length ? (squared.domain(_), scale) : squared.domain();
    };
    scale.range = function(_) {
      return arguments.length ? (squared.range((range2 = Array.from(_, number$1)).map(square)), scale) : range2.slice();
    };
    scale.rangeRound = function(_) {
      return scale.range(_).round(true);
    };
    scale.round = function(_) {
      return arguments.length ? (round2 = !!_, scale) : round2;
    };
    scale.clamp = function(_) {
      return arguments.length ? (squared.clamp(_), scale) : squared.clamp();
    };
    scale.unknown = function(_) {
      return arguments.length ? (unknown = _, scale) : unknown;
    };
    scale.copy = function() {
      return radial(squared.domain(), range2).round(round2).clamp(squared.clamp()).unknown(unknown);
    };
    initRange.apply(scale, arguments);
    return linearish(scale);
  }
  __name(radial, "radial");
  function quantile() {
    var domain = [], range2 = [], thresholds = [], unknown;
    function rescale() {
      var i2 = 0, n2 = Math.max(1, range2.length);
      thresholds = new Array(n2 - 1);
      while (++i2 < n2) thresholds[i2 - 1] = quantileSorted(domain, i2 / n2);
      return scale;
    }
    __name(rescale, "rescale");
    function scale(x2) {
      return x2 == null || isNaN(x2 = +x2) ? unknown : range2[bisectRight(thresholds, x2)];
    }
    __name(scale, "scale");
    scale.invertExtent = function(y2) {
      var i2 = range2.indexOf(y2);
      return i2 < 0 ? [NaN, NaN] : [
        i2 > 0 ? thresholds[i2 - 1] : domain[0],
        i2 < thresholds.length ? thresholds[i2] : domain[domain.length - 1]
      ];
    };
    scale.domain = function(_) {
      if (!arguments.length) return domain.slice();
      domain = [];
      for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);
      domain.sort(ascending);
      return rescale();
    };
    scale.range = function(_) {
      return arguments.length ? (range2 = Array.from(_), rescale()) : range2.slice();
    };
    scale.unknown = function(_) {
      return arguments.length ? (unknown = _, scale) : unknown;
    };
    scale.quantiles = function() {
      return thresholds.slice();
    };
    scale.copy = function() {
      return quantile().domain(domain).range(range2).unknown(unknown);
    };
    return initRange.apply(scale, arguments);
  }
  __name(quantile, "quantile");
  function quantize() {
    var x0 = 0, x1 = 1, n2 = 1, domain = [0.5], range2 = [0, 1], unknown;
    function scale(x2) {
      return x2 != null && x2 <= x2 ? range2[bisectRight(domain, x2, 0, n2)] : unknown;
    }
    __name(scale, "scale");
    function rescale() {
      var i2 = -1;
      domain = new Array(n2);
      while (++i2 < n2) domain[i2] = ((i2 + 1) * x1 - (i2 - n2) * x0) / (n2 + 1);
      return scale;
    }
    __name(rescale, "rescale");
    scale.domain = function(_) {
      return arguments.length ? ([x0, x1] = _, x0 = +x0, x1 = +x1, rescale()) : [x0, x1];
    };
    scale.range = function(_) {
      return arguments.length ? (n2 = (range2 = Array.from(_)).length - 1, rescale()) : range2.slice();
    };
    scale.invertExtent = function(y2) {
      var i2 = range2.indexOf(y2);
      return i2 < 0 ? [NaN, NaN] : i2 < 1 ? [x0, domain[0]] : i2 >= n2 ? [domain[n2 - 1], x1] : [domain[i2 - 1], domain[i2]];
    };
    scale.unknown = function(_) {
      return arguments.length ? (unknown = _, scale) : scale;
    };
    scale.thresholds = function() {
      return domain.slice();
    };
    scale.copy = function() {
      return quantize().domain([x0, x1]).range(range2).unknown(unknown);
    };
    return initRange.apply(linearish(scale), arguments);
  }
  __name(quantize, "quantize");
  function threshold() {
    var domain = [0.5], range2 = [0, 1], unknown, n2 = 1;
    function scale(x2) {
      return x2 != null && x2 <= x2 ? range2[bisectRight(domain, x2, 0, n2)] : unknown;
    }
    __name(scale, "scale");
    scale.domain = function(_) {
      return arguments.length ? (domain = Array.from(_), n2 = Math.min(domain.length, range2.length - 1), scale) : domain.slice();
    };
    scale.range = function(_) {
      return arguments.length ? (range2 = Array.from(_), n2 = Math.min(domain.length, range2.length - 1), scale) : range2.slice();
    };
    scale.invertExtent = function(y2) {
      var i2 = range2.indexOf(y2);
      return [domain[i2 - 1], domain[i2]];
    };
    scale.unknown = function(_) {
      return arguments.length ? (unknown = _, scale) : unknown;
    };
    scale.copy = function() {
      return threshold().domain(domain).range(range2).unknown(unknown);
    };
    return initRange.apply(scale, arguments);
  }
  __name(threshold, "threshold");
  const t0 = /* @__PURE__ */ new Date(), t1 = /* @__PURE__ */ new Date();
  function timeInterval(floori, offseti, count2, field) {
    function interval(date2) {
      return floori(date2 = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+date2)), date2;
    }
    __name(interval, "interval");
    interval.floor = (date2) => {
      return floori(date2 = /* @__PURE__ */ new Date(+date2)), date2;
    };
    interval.ceil = (date2) => {
      return floori(date2 = new Date(date2 - 1)), offseti(date2, 1), floori(date2), date2;
    };
    interval.round = (date2) => {
      const d0 = interval(date2), d1 = interval.ceil(date2);
      return date2 - d0 < d1 - date2 ? d0 : d1;
    };
    interval.offset = (date2, step) => {
      return offseti(date2 = /* @__PURE__ */ new Date(+date2), step == null ? 1 : Math.floor(step)), date2;
    };
    interval.range = (start, stop, step) => {
      const range2 = [];
      start = interval.ceil(start);
      step = step == null ? 1 : Math.floor(step);
      if (!(start < stop) || !(step > 0)) return range2;
      let previous;
      do
        range2.push(previous = /* @__PURE__ */ new Date(+start)), offseti(start, step), floori(start);
      while (previous < start && start < stop);
      return range2;
    };
    interval.filter = (test) => {
      return timeInterval((date2) => {
        if (date2 >= date2) while (floori(date2), !test(date2)) date2.setTime(date2 - 1);
      }, (date2, step) => {
        if (date2 >= date2) {
          if (step < 0) while (++step <= 0) {
            while (offseti(date2, -1), !test(date2)) {
            }
          }
          else while (--step >= 0) {
            while (offseti(date2, 1), !test(date2)) {
            }
          }
        }
      });
    };
    if (count2) {
      interval.count = (start, end) => {
        t0.setTime(+start), t1.setTime(+end);
        floori(t0), floori(t1);
        return Math.floor(count2(t0, t1));
      };
      interval.every = (step) => {
        step = Math.floor(step);
        return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval : interval.filter(field ? (d) => field(d) % step === 0 : (d) => interval.count(0, d) % step === 0);
      };
    }
    return interval;
  }
  __name(timeInterval, "timeInterval");
  const millisecond = timeInterval(() => {
  }, (date2, step) => {
    date2.setTime(+date2 + step);
  }, (start, end) => {
    return end - start;
  });
  millisecond.every = (k2) => {
    k2 = Math.floor(k2);
    if (!isFinite(k2) || !(k2 > 0)) return null;
    if (!(k2 > 1)) return millisecond;
    return timeInterval((date2) => {
      date2.setTime(Math.floor(date2 / k2) * k2);
    }, (date2, step) => {
      date2.setTime(+date2 + step * k2);
    }, (start, end) => {
      return (end - start) / k2;
    });
  };
  millisecond.range;
  const durationSecond = 1e3;
  const durationMinute = durationSecond * 60;
  const durationHour = durationMinute * 60;
  const durationDay = durationHour * 24;
  const durationWeek = durationDay * 7;
  const durationMonth = durationDay * 30;
  const durationYear = durationDay * 365;
  const second = timeInterval((date2) => {
    date2.setTime(date2 - date2.getMilliseconds());
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationSecond);
  }, (start, end) => {
    return (end - start) / durationSecond;
  }, (date2) => {
    return date2.getUTCSeconds();
  });
  second.range;
  const timeMinute = timeInterval((date2) => {
    date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond);
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationMinute);
  }, (start, end) => {
    return (end - start) / durationMinute;
  }, (date2) => {
    return date2.getMinutes();
  });
  timeMinute.range;
  const utcMinute = timeInterval((date2) => {
    date2.setUTCSeconds(0, 0);
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationMinute);
  }, (start, end) => {
    return (end - start) / durationMinute;
  }, (date2) => {
    return date2.getUTCMinutes();
  });
  utcMinute.range;
  const timeHour = timeInterval((date2) => {
    date2.setTime(date2 - date2.getMilliseconds() - date2.getSeconds() * durationSecond - date2.getMinutes() * durationMinute);
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationHour);
  }, (start, end) => {
    return (end - start) / durationHour;
  }, (date2) => {
    return date2.getHours();
  });
  timeHour.range;
  const utcHour = timeInterval((date2) => {
    date2.setUTCMinutes(0, 0, 0);
  }, (date2, step) => {
    date2.setTime(+date2 + step * durationHour);
  }, (start, end) => {
    return (end - start) / durationHour;
  }, (date2) => {
    return date2.getUTCHours();
  });
  utcHour.range;
  const timeDay = timeInterval(
    (date2) => date2.setHours(0, 0, 0, 0),
    (date2, step) => date2.setDate(date2.getDate() + step),
    (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
    (date2) => date2.getDate() - 1
  );
  timeDay.range;
  const utcDay = timeInterval((date2) => {
    date2.setUTCHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setUTCDate(date2.getUTCDate() + step);
  }, (start, end) => {
    return (end - start) / durationDay;
  }, (date2) => {
    return date2.getUTCDate() - 1;
  });
  utcDay.range;
  const unixDay = timeInterval((date2) => {
    date2.setUTCHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setUTCDate(date2.getUTCDate() + step);
  }, (start, end) => {
    return (end - start) / durationDay;
  }, (date2) => {
    return Math.floor(date2 / durationDay);
  });
  unixDay.range;
  function timeWeekday(i2) {
    return timeInterval((date2) => {
      date2.setDate(date2.getDate() - (date2.getDay() + 7 - i2) % 7);
      date2.setHours(0, 0, 0, 0);
    }, (date2, step) => {
      date2.setDate(date2.getDate() + step * 7);
    }, (start, end) => {
      return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
    });
  }
  __name(timeWeekday, "timeWeekday");
  const timeSunday = timeWeekday(0);
  const timeMonday = timeWeekday(1);
  const timeTuesday = timeWeekday(2);
  const timeWednesday = timeWeekday(3);
  const timeThursday = timeWeekday(4);
  const timeFriday = timeWeekday(5);
  const timeSaturday = timeWeekday(6);
  timeSunday.range;
  timeMonday.range;
  timeTuesday.range;
  timeWednesday.range;
  timeThursday.range;
  timeFriday.range;
  timeSaturday.range;
  function utcWeekday(i2) {
    return timeInterval((date2) => {
      date2.setUTCDate(date2.getUTCDate() - (date2.getUTCDay() + 7 - i2) % 7);
      date2.setUTCHours(0, 0, 0, 0);
    }, (date2, step) => {
      date2.setUTCDate(date2.getUTCDate() + step * 7);
    }, (start, end) => {
      return (end - start) / durationWeek;
    });
  }
  __name(utcWeekday, "utcWeekday");
  const utcSunday = utcWeekday(0);
  const utcMonday = utcWeekday(1);
  const utcTuesday = utcWeekday(2);
  const utcWednesday = utcWeekday(3);
  const utcThursday = utcWeekday(4);
  const utcFriday = utcWeekday(5);
  const utcSaturday = utcWeekday(6);
  utcSunday.range;
  utcMonday.range;
  utcTuesday.range;
  utcWednesday.range;
  utcThursday.range;
  utcFriday.range;
  utcSaturday.range;
  const timeMonth = timeInterval((date2) => {
    date2.setDate(1);
    date2.setHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setMonth(date2.getMonth() + step);
  }, (start, end) => {
    return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
  }, (date2) => {
    return date2.getMonth();
  });
  timeMonth.range;
  const utcMonth = timeInterval((date2) => {
    date2.setUTCDate(1);
    date2.setUTCHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setUTCMonth(date2.getUTCMonth() + step);
  }, (start, end) => {
    return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
  }, (date2) => {
    return date2.getUTCMonth();
  });
  utcMonth.range;
  const timeYear = timeInterval((date2) => {
    date2.setMonth(0, 1);
    date2.setHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setFullYear(date2.getFullYear() + step);
  }, (start, end) => {
    return end.getFullYear() - start.getFullYear();
  }, (date2) => {
    return date2.getFullYear();
  });
  timeYear.every = (k2) => {
    return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => {
      date2.setFullYear(Math.floor(date2.getFullYear() / k2) * k2);
      date2.setMonth(0, 1);
      date2.setHours(0, 0, 0, 0);
    }, (date2, step) => {
      date2.setFullYear(date2.getFullYear() + step * k2);
    });
  };
  timeYear.range;
  const utcYear = timeInterval((date2) => {
    date2.setUTCMonth(0, 1);
    date2.setUTCHours(0, 0, 0, 0);
  }, (date2, step) => {
    date2.setUTCFullYear(date2.getUTCFullYear() + step);
  }, (start, end) => {
    return end.getUTCFullYear() - start.getUTCFullYear();
  }, (date2) => {
    return date2.getUTCFullYear();
  });
  utcYear.every = (k2) => {
    return !isFinite(k2 = Math.floor(k2)) || !(k2 > 0) ? null : timeInterval((date2) => {
      date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / k2) * k2);
      date2.setUTCMonth(0, 1);
      date2.setUTCHours(0, 0, 0, 0);
    }, (date2, step) => {
      date2.setUTCFullYear(date2.getUTCFullYear() + step * k2);
    });
  };
  utcYear.range;
  function ticker(year, month, week, day, hour, minute) {
    const tickIntervals = [
      [second, 1, durationSecond],
      [second, 5, 5 * durationSecond],
      [second, 15, 15 * durationSecond],
      [second, 30, 30 * durationSecond],
      [minute, 1, durationMinute],
      [minute, 5, 5 * durationMinute],
      [minute, 15, 15 * durationMinute],
      [minute, 30, 30 * durationMinute],
      [hour, 1, durationHour],
      [hour, 3, 3 * durationHour],
      [hour, 6, 6 * durationHour],
      [hour, 12, 12 * durationHour],
      [day, 1, durationDay],
      [day, 2, 2 * durationDay],
      [week, 1, durationWeek],
      [month, 1, durationMonth],
      [month, 3, 3 * durationMonth],
      [year, 1, durationYear]
    ];
    function ticks2(start, stop, count2) {
      const reverse2 = stop < start;
      if (reverse2) [start, stop] = [stop, start];
      const interval = count2 && typeof count2.range === "function" ? count2 : tickInterval(start, stop, count2);
      const ticks3 = interval ? interval.range(start, +stop + 1) : [];
      return reverse2 ? ticks3.reverse() : ticks3;
    }
    __name(ticks2, "ticks");
    function tickInterval(start, stop, count2) {
      const target = Math.abs(stop - start) / count2;
      const i2 = bisector(([, , step2]) => step2).right(tickIntervals, target);
      if (i2 === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count2));
      if (i2 === 0) return millisecond.every(Math.max(tickStep(start, stop, count2), 1));
      const [t2, step] = tickIntervals[target / tickIntervals[i2 - 1][2] < tickIntervals[i2][2] / target ? i2 - 1 : i2];
      return t2.every(step);
    }
    __name(tickInterval, "tickInterval");
    return [ticks2, tickInterval];
  }
  __name(ticker, "ticker");
  const [utcTicks, utcTickInterval] = ticker(utcYear, utcMonth, utcSunday, unixDay, utcHour, utcMinute);
  const [timeTicks, timeTickInterval] = ticker(timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute);
  function localDate(d) {
    if (0 <= d.y && d.y < 100) {
      var date2 = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
      date2.setFullYear(d.y);
      return date2;
    }
    return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
  }
  __name(localDate, "localDate");
  function utcDate(d) {
    if (0 <= d.y && d.y < 100) {
      var date2 = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
      date2.setUTCFullYear(d.y);
      return date2;
    }
    return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
  }
  __name(utcDate, "utcDate");
  function newDate(y2, m2, d) {
    return { y: y2, m: m2, d, H: 0, M: 0, S: 0, L: 0 };
  }
  __name(newDate, "newDate");
  function formatLocale(locale2) {
    var locale_dateTime = locale2.dateTime, locale_date = locale2.date, locale_time = locale2.time, locale_periods = locale2.periods, locale_weekdays = locale2.days, locale_shortWeekdays = locale2.shortDays, locale_months = locale2.months, locale_shortMonths = locale2.shortMonths;
    var periodRe = formatRe(locale_periods), periodLookup = formatLookup(locale_periods), weekdayRe = formatRe(locale_weekdays), weekdayLookup = formatLookup(locale_weekdays), shortWeekdayRe = formatRe(locale_shortWeekdays), shortWeekdayLookup = formatLookup(locale_shortWeekdays), monthRe = formatRe(locale_months), monthLookup = formatLookup(locale_months), shortMonthRe = formatRe(locale_shortMonths), shortMonthLookup = formatLookup(locale_shortMonths);
    var formats = {
      "a": formatShortWeekday,
      "A": formatWeekday,
      "b": formatShortMonth,
      "B": formatMonth,
      "c": null,
      "d": formatDayOfMonth,
      "e": formatDayOfMonth,
      "f": formatMicroseconds,
      "g": formatYearISO,
      "G": formatFullYearISO,
      "H": formatHour24,
      "I": formatHour12,
      "j": formatDayOfYear,
      "L": formatMilliseconds,
      "m": formatMonthNumber,
      "M": formatMinutes,
      "p": formatPeriod,
      "q": formatQuarter,
      "Q": formatUnixTimestamp,
      "s": formatUnixTimestampSeconds,
      "S": formatSeconds,
      "u": formatWeekdayNumberMonday,
      "U": formatWeekNumberSunday,
      "V": formatWeekNumberISO,
      "w": formatWeekdayNumberSunday,
      "W": formatWeekNumberMonday,
      "x": null,
      "X": null,
      "y": formatYear,
      "Y": formatFullYear,
      "Z": formatZone,
      "%": formatLiteralPercent
    };
    var utcFormats = {
      "a": formatUTCShortWeekday,
      "A": formatUTCWeekday,
      "b": formatUTCShortMonth,
      "B": formatUTCMonth,
      "c": null,
      "d": formatUTCDayOfMonth,
      "e": formatUTCDayOfMonth,
      "f": formatUTCMicroseconds,
      "g": formatUTCYearISO,
      "G": formatUTCFullYearISO,
      "H": formatUTCHour24,
      "I": formatUTCHour12,
      "j": formatUTCDayOfYear,
      "L": formatUTCMilliseconds,
      "m": formatUTCMonthNumber,
      "M": formatUTCMinutes,
      "p": formatUTCPeriod,
      "q": formatUTCQuarter,
      "Q": formatUnixTimestamp,
      "s": formatUnixTimestampSeconds,
      "S": formatUTCSeconds,
      "u": formatUTCWeekdayNumberMonday,
      "U": formatUTCWeekNumberSunday,
      "V": formatUTCWeekNumberISO,
      "w": formatUTCWeekdayNumberSunday,
      "W": formatUTCWeekNumberMonday,
      "x": null,
      "X": null,
      "y": formatUTCYear,
      "Y": formatUTCFullYear,
      "Z": formatUTCZone,
      "%": formatLiteralPercent
    };
    var parses = {
      "a": parseShortWeekday,
      "A": parseWeekday,
      "b": parseShortMonth,
      "B": parseMonth,
      "c": parseLocaleDateTime,
      "d": parseDayOfMonth,
      "e": parseDayOfMonth,
      "f": parseMicroseconds,
      "g": parseYear,
      "G": parseFullYear,
      "H": parseHour24,
      "I": parseHour24,
      "j": parseDayOfYear,
      "L": parseMilliseconds,
      "m": parseMonthNumber,
      "M": parseMinutes,
      "p": parsePeriod,
      "q": parseQuarter,
      "Q": parseUnixTimestamp,
      "s": parseUnixTimestampSeconds,
      "S": parseSeconds,
      "u": parseWeekdayNumberMonday,
      "U": parseWeekNumberSunday,
      "V": parseWeekNumberISO,
      "w": parseWeekdayNumberSunday,
      "W": parseWeekNumberMonday,
      "x": parseLocaleDate,
      "X": parseLocaleTime,
      "y": parseYear,
      "Y": parseFullYear,
      "Z": parseZone,
      "%": parseLiteralPercent
    };
    formats.x = newFormat(locale_date, formats);
    formats.X = newFormat(locale_time, formats);
    formats.c = newFormat(locale_dateTime, formats);
    utcFormats.x = newFormat(locale_date, utcFormats);
    utcFormats.X = newFormat(locale_time, utcFormats);
    utcFormats.c = newFormat(locale_dateTime, utcFormats);
    function newFormat(specifier, formats2) {
      return function(date2) {
        var string2 = [], i2 = -1, j = 0, n2 = specifier.length, c2, pad2, format2;
        if (!(date2 instanceof Date)) date2 = /* @__PURE__ */ new Date(+date2);
        while (++i2 < n2) {
          if (specifier.charCodeAt(i2) === 37) {
            string2.push(specifier.slice(j, i2));
            if ((pad2 = pads[c2 = specifier.charAt(++i2)]) != null) c2 = specifier.charAt(++i2);
            else pad2 = c2 === "e" ? " " : "0";
            if (format2 = formats2[c2]) c2 = format2(date2, pad2);
            string2.push(c2);
            j = i2 + 1;
          }
        }
        string2.push(specifier.slice(j, i2));
        return string2.join("");
      };
    }
    __name(newFormat, "newFormat");
    function newParse(specifier, Z2) {
      return function(string2) {
        var d = newDate(1900, void 0, 1), i2 = parseSpecifier(d, specifier, string2 += "", 0), week, day;
        if (i2 != string2.length) return null;
        if ("Q" in d) return new Date(d.Q);
        if ("s" in d) return new Date(d.s * 1e3 + ("L" in d ? d.L : 0));
        if (Z2 && !("Z" in d)) d.Z = 0;
        if ("p" in d) d.H = d.H % 12 + d.p * 12;
        if (d.m === void 0) d.m = "q" in d ? d.q : 0;
        if ("V" in d) {
          if (d.V < 1 || d.V > 53) return null;
          if (!("w" in d)) d.w = 1;
          if ("Z" in d) {
            week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();
            week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);
            week = utcDay.offset(week, (d.V - 1) * 7);
            d.y = week.getUTCFullYear();
            d.m = week.getUTCMonth();
            d.d = week.getUTCDate() + (d.w + 6) % 7;
          } else {
            week = localDate(newDate(d.y, 0, 1)), day = week.getDay();
            week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);
            week = timeDay.offset(week, (d.V - 1) * 7);
            d.y = week.getFullYear();
            d.m = week.getMonth();
            d.d = week.getDate() + (d.w + 6) % 7;
          }
        } else if ("W" in d || "U" in d) {
          if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
          day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();
          d.m = 0;
          d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
        }
        if ("Z" in d) {
          d.H += d.Z / 100 | 0;
          d.M += d.Z % 100;
          return utcDate(d);
        }
        return localDate(d);
      };
    }
    __name(newParse, "newParse");
    function parseSpecifier(d, specifier, string2, j) {
      var i2 = 0, n2 = specifier.length, m2 = string2.length, c2, parse2;
      while (i2 < n2) {
        if (j >= m2) return -1;
        c2 = specifier.charCodeAt(i2++);
        if (c2 === 37) {
          c2 = specifier.charAt(i2++);
          parse2 = parses[c2 in pads ? specifier.charAt(i2++) : c2];
          if (!parse2 || (j = parse2(d, string2, j)) < 0) return -1;
        } else if (c2 != string2.charCodeAt(j++)) {
          return -1;
        }
      }
      return j;
    }
    __name(parseSpecifier, "parseSpecifier");
    function parsePeriod(d, string2, i2) {
      var n2 = periodRe.exec(string2.slice(i2));
      return n2 ? (d.p = periodLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
    }
    __name(parsePeriod, "parsePeriod");
    function parseShortWeekday(d, string2, i2) {
      var n2 = shortWeekdayRe.exec(string2.slice(i2));
      return n2 ? (d.w = shortWeekdayLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
    }
    __name(parseShortWeekday, "parseShortWeekday");
    function parseWeekday(d, string2, i2) {
      var n2 = weekdayRe.exec(string2.slice(i2));
      return n2 ? (d.w = weekdayLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
    }
    __name(parseWeekday, "parseWeekday");
    function parseShortMonth(d, string2, i2) {
      var n2 = shortMonthRe.exec(string2.slice(i2));
      return n2 ? (d.m = shortMonthLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
    }
    __name(parseShortMonth, "parseShortMonth");
    function parseMonth(d, string2, i2) {
      var n2 = monthRe.exec(string2.slice(i2));
      return n2 ? (d.m = monthLookup.get(n2[0].toLowerCase()), i2 + n2[0].length) : -1;
    }
    __name(parseMonth, "parseMonth");
    function parseLocaleDateTime(d, string2, i2) {
      return parseSpecifier(d, locale_dateTime, string2, i2);
    }
    __name(parseLocaleDateTime, "parseLocaleDateTime");
    function parseLocaleDate(d, string2, i2) {
      return parseSpecifier(d, locale_date, string2, i2);
    }
    __name(parseLocaleDate, "parseLocaleDate");
    function parseLocaleTime(d, string2, i2) {
      return parseSpecifier(d, locale_time, string2, i2);
    }
    __name(parseLocaleTime, "parseLocaleTime");
    function formatShortWeekday(d) {
      return locale_shortWeekdays[d.getDay()];
    }
    __name(formatShortWeekday, "formatShortWeekday");
    function formatWeekday(d) {
      return locale_weekdays[d.getDay()];
    }
    __name(formatWeekday, "formatWeekday");
    function formatShortMonth(d) {
      return locale_shortMonths[d.getMonth()];
    }
    __name(formatShortMonth, "formatShortMonth");
    function formatMonth(d) {
      return locale_months[d.getMonth()];
    }
    __name(formatMonth, "formatMonth");
    function formatPeriod(d) {
      return locale_periods[+(d.getHours() >= 12)];
    }
    __name(formatPeriod, "formatPeriod");
    function formatQuarter(d) {
      return 1 + ~~(d.getMonth() / 3);
    }
    __name(formatQuarter, "formatQuarter");
    function formatUTCShortWeekday(d) {
      return locale_shortWeekdays[d.getUTCDay()];
    }
    __name(formatUTCShortWeekday, "formatUTCShortWeekday");
    function formatUTCWeekday(d) {
      return locale_weekdays[d.getUTCDay()];
    }
    __name(formatUTCWeekday, "formatUTCWeekday");
    function formatUTCShortMonth(d) {
      return locale_shortMonths[d.getUTCMonth()];
    }
    __name(formatUTCShortMonth, "formatUTCShortMonth");
    function formatUTCMonth(d) {
      return locale_months[d.getUTCMonth()];
    }
    __name(formatUTCMonth, "formatUTCMonth");
    function formatUTCPeriod(d) {
      return locale_periods[+(d.getUTCHours() >= 12)];
    }
    __name(formatUTCPeriod, "formatUTCPeriod");
    function formatUTCQuarter(d) {
      return 1 + ~~(d.getUTCMonth() / 3);
    }
    __name(formatUTCQuarter, "formatUTCQuarter");
    return {
      format: /* @__PURE__ */ __name(function(specifier) {
        var f = newFormat(specifier += "", formats);
        f.toString = function() {
          return specifier;
        };
        return f;
      }, "format"),
      parse: /* @__PURE__ */ __name(function(specifier) {
        var p2 = newParse(specifier += "", false);
        p2.toString = function() {
          return specifier;
        };
        return p2;
      }, "parse"),
      utcFormat: /* @__PURE__ */ __name(function(specifier) {
        var f = newFormat(specifier += "", utcFormats);
        f.toString = function() {
          return specifier;
        };
        return f;
      }, "utcFormat"),
      utcParse: /* @__PURE__ */ __name(function(specifier) {
        var p2 = newParse(specifier += "", true);
        p2.toString = function() {
          return specifier;
        };
        return p2;
      }, "utcParse")
    };
  }
  __name(formatLocale, "formatLocale");
  var pads = { "-": "", "_": " ", "0": "0" }, numberRe = /^\s*\d+/, percentRe = /^%/, requoteRe = /[\\^$*+?|[\]().{}]/g;
  function pad(value, fill, width) {
    var sign2 = value < 0 ? "-" : "", string2 = (sign2 ? -value : value) + "", length = string2.length;
    return sign2 + (length < width ? new Array(width - length + 1).join(fill) + string2 : string2);
  }
  __name(pad, "pad");
  function requote(s2) {
    return s2.replace(requoteRe, "\\$&");
  }
  __name(requote, "requote");
  function formatRe(names) {
    return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
  }
  __name(formatRe, "formatRe");
  function formatLookup(names) {
    return new Map(names.map((name, i2) => [name.toLowerCase(), i2]));
  }
  __name(formatLookup, "formatLookup");
  function parseWeekdayNumberSunday(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 1));
    return n2 ? (d.w = +n2[0], i2 + n2[0].length) : -1;
  }
  __name(parseWeekdayNumberSunday, "parseWeekdayNumberSunday");
  function parseWeekdayNumberMonday(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 1));
    return n2 ? (d.u = +n2[0], i2 + n2[0].length) : -1;
  }
  __name(parseWeekdayNumberMonday, "parseWeekdayNumberMonday");
  function parseWeekNumberSunday(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
    return n2 ? (d.U = +n2[0], i2 + n2[0].length) : -1;
  }
  __name(parseWeekNumberSunday, "parseWeekNumberSunday");
  function parseWeekNumberISO(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
    return n2 ? (d.V = +n2[0], i2 + n2[0].length) : -1;
  }
  __name(parseWeekNumberISO, "parseWeekNumberISO");
  function parseWeekNumberMonday(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
    return n2 ? (d.W = +n2[0], i2 + n2[0].length) : -1;
  }
  __name(parseWeekNumberMonday, "parseWeekNumberMonday");
  function parseFullYear(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 4));
    return n2 ? (d.y = +n2[0], i2 + n2[0].length) : -1;
  }
  __name(parseFullYear, "parseFullYear");
  function parseYear(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
    return n2 ? (d.y = +n2[0] + (+n2[0] > 68 ? 1900 : 2e3), i2 + n2[0].length) : -1;
  }
  __name(parseYear, "parseYear");
  function parseZone(d, string2, i2) {
    var n2 = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string2.slice(i2, i2 + 6));
    return n2 ? (d.Z = n2[1] ? 0 : -(n2[2] + (n2[3] || "00")), i2 + n2[0].length) : -1;
  }
  __name(parseZone, "parseZone");
  function parseQuarter(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 1));
    return n2 ? (d.q = n2[0] * 3 - 3, i2 + n2[0].length) : -1;
  }
  __name(parseQuarter, "parseQuarter");
  function parseMonthNumber(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
    return n2 ? (d.m = n2[0] - 1, i2 + n2[0].length) : -1;
  }
  __name(parseMonthNumber, "parseMonthNumber");
  function parseDayOfMonth(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
    return n2 ? (d.d = +n2[0], i2 + n2[0].length) : -1;
  }
  __name(parseDayOfMonth, "parseDayOfMonth");
  function parseDayOfYear(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 3));
    return n2 ? (d.m = 0, d.d = +n2[0], i2 + n2[0].length) : -1;
  }
  __name(parseDayOfYear, "parseDayOfYear");
  function parseHour24(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
    return n2 ? (d.H = +n2[0], i2 + n2[0].length) : -1;
  }
  __name(parseHour24, "parseHour24");
  function parseMinutes(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
    return n2 ? (d.M = +n2[0], i2 + n2[0].length) : -1;
  }
  __name(parseMinutes, "parseMinutes");
  function parseSeconds(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 2));
    return n2 ? (d.S = +n2[0], i2 + n2[0].length) : -1;
  }
  __name(parseSeconds, "parseSeconds");
  function parseMilliseconds(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 3));
    return n2 ? (d.L = +n2[0], i2 + n2[0].length) : -1;
  }
  __name(parseMilliseconds, "parseMilliseconds");
  function parseMicroseconds(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2, i2 + 6));
    return n2 ? (d.L = Math.floor(n2[0] / 1e3), i2 + n2[0].length) : -1;
  }
  __name(parseMicroseconds, "parseMicroseconds");
  function parseLiteralPercent(d, string2, i2) {
    var n2 = percentRe.exec(string2.slice(i2, i2 + 1));
    return n2 ? i2 + n2[0].length : -1;
  }
  __name(parseLiteralPercent, "parseLiteralPercent");
  function parseUnixTimestamp(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2));
    return n2 ? (d.Q = +n2[0], i2 + n2[0].length) : -1;
  }
  __name(parseUnixTimestamp, "parseUnixTimestamp");
  function parseUnixTimestampSeconds(d, string2, i2) {
    var n2 = numberRe.exec(string2.slice(i2));
    return n2 ? (d.s = +n2[0], i2 + n2[0].length) : -1;
  }
  __name(parseUnixTimestampSeconds, "parseUnixTimestampSeconds");
  function formatDayOfMonth(d, p2) {
    return pad(d.getDate(), p2, 2);
  }
  __name(formatDayOfMonth, "formatDayOfMonth");
  function formatHour24(d, p2) {
    return pad(d.getHours(), p2, 2);
  }
  __name(formatHour24, "formatHour24");
  function formatHour12(d, p2) {
    return pad(d.getHours() % 12 || 12, p2, 2);
  }
  __name(formatHour12, "formatHour12");
  function formatDayOfYear(d, p2) {
    return pad(1 + timeDay.count(timeYear(d), d), p2, 3);
  }
  __name(formatDayOfYear, "formatDayOfYear");
  function formatMilliseconds(d, p2) {
    return pad(d.getMilliseconds(), p2, 3);
  }
  __name(formatMilliseconds, "formatMilliseconds");
  function formatMicroseconds(d, p2) {
    return formatMilliseconds(d, p2) + "000";
  }
  __name(formatMicroseconds, "formatMicroseconds");
  function formatMonthNumber(d, p2) {
    return pad(d.getMonth() + 1, p2, 2);
  }
  __name(formatMonthNumber, "formatMonthNumber");
  function formatMinutes(d, p2) {
    return pad(d.getMinutes(), p2, 2);
  }
  __name(formatMinutes, "formatMinutes");
  function formatSeconds(d, p2) {
    return pad(d.getSeconds(), p2, 2);
  }
  __name(formatSeconds, "formatSeconds");
  function formatWeekdayNumberMonday(d) {
    var day = d.getDay();
    return day === 0 ? 7 : day;
  }
  __name(formatWeekdayNumberMonday, "formatWeekdayNumberMonday");
  function formatWeekNumberSunday(d, p2) {
    return pad(timeSunday.count(timeYear(d) - 1, d), p2, 2);
  }
  __name(formatWeekNumberSunday, "formatWeekNumberSunday");
  function dISO(d) {
    var day = d.getDay();
    return day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d);
  }
  __name(dISO, "dISO");
  function formatWeekNumberISO(d, p2) {
    d = dISO(d);
    return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p2, 2);
  }
  __name(formatWeekNumberISO, "formatWeekNumberISO");
  function formatWeekdayNumberSunday(d) {
    return d.getDay();
  }
  __name(formatWeekdayNumberSunday, "formatWeekdayNumberSunday");
  function formatWeekNumberMonday(d, p2) {
    return pad(timeMonday.count(timeYear(d) - 1, d), p2, 2);
  }
  __name(formatWeekNumberMonday, "formatWeekNumberMonday");
  function formatYear(d, p2) {
    return pad(d.getFullYear() % 100, p2, 2);
  }
  __name(formatYear, "formatYear");
  function formatYearISO(d, p2) {
    d = dISO(d);
    return pad(d.getFullYear() % 100, p2, 2);
  }
  __name(formatYearISO, "formatYearISO");
  function formatFullYear(d, p2) {
    return pad(d.getFullYear() % 1e4, p2, 4);
  }
  __name(formatFullYear, "formatFullYear");
  function formatFullYearISO(d, p2) {
    var day = d.getDay();
    d = day >= 4 || day === 0 ? timeThursday(d) : timeThursday.ceil(d);
    return pad(d.getFullYear() % 1e4, p2, 4);
  }
  __name(formatFullYearISO, "formatFullYearISO");
  function formatZone(d) {
    var z = d.getTimezoneOffset();
    return (z > 0 ? "-" : (z *= -1, "+")) + pad(z / 60 | 0, "0", 2) + pad(z % 60, "0", 2);
  }
  __name(formatZone, "formatZone");
  function formatUTCDayOfMonth(d, p2) {
    return pad(d.getUTCDate(), p2, 2);
  }
  __name(formatUTCDayOfMonth, "formatUTCDayOfMonth");
  function formatUTCHour24(d, p2) {
    return pad(d.getUTCHours(), p2, 2);
  }
  __name(formatUTCHour24, "formatUTCHour24");
  function formatUTCHour12(d, p2) {
    return pad(d.getUTCHours() % 12 || 12, p2, 2);
  }
  __name(formatUTCHour12, "formatUTCHour12");
  function formatUTCDayOfYear(d, p2) {
    return pad(1 + utcDay.count(utcYear(d), d), p2, 3);
  }
  __name(formatUTCDayOfYear, "formatUTCDayOfYear");
  function formatUTCMilliseconds(d, p2) {
    return pad(d.getUTCMilliseconds(), p2, 3);
  }
  __name(formatUTCMilliseconds, "formatUTCMilliseconds");
  function formatUTCMicroseconds(d, p2) {
    return formatUTCMilliseconds(d, p2) + "000";
  }
  __name(formatUTCMicroseconds, "formatUTCMicroseconds");
  function formatUTCMonthNumber(d, p2) {
    return pad(d.getUTCMonth() + 1, p2, 2);
  }
  __name(formatUTCMonthNumber, "formatUTCMonthNumber");
  function formatUTCMinutes(d, p2) {
    return pad(d.getUTCMinutes(), p2, 2);
  }
  __name(formatUTCMinutes, "formatUTCMinutes");
  function formatUTCSeconds(d, p2) {
    return pad(d.getUTCSeconds(), p2, 2);
  }
  __name(formatUTCSeconds, "formatUTCSeconds");
  function formatUTCWeekdayNumberMonday(d) {
    var dow = d.getUTCDay();
    return dow === 0 ? 7 : dow;
  }
  __name(formatUTCWeekdayNumberMonday, "formatUTCWeekdayNumberMonday");
  function formatUTCWeekNumberSunday(d, p2) {
    return pad(utcSunday.count(utcYear(d) - 1, d), p2, 2);
  }
  __name(formatUTCWeekNumberSunday, "formatUTCWeekNumberSunday");
  function UTCdISO(d) {
    var day = d.getUTCDay();
    return day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d);
  }
  __name(UTCdISO, "UTCdISO");
  function formatUTCWeekNumberISO(d, p2) {
    d = UTCdISO(d);
    return pad(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p2, 2);
  }
  __name(formatUTCWeekNumberISO, "formatUTCWeekNumberISO");
  function formatUTCWeekdayNumberSunday(d) {
    return d.getUTCDay();
  }
  __name(formatUTCWeekdayNumberSunday, "formatUTCWeekdayNumberSunday");
  function formatUTCWeekNumberMonday(d, p2) {
    return pad(utcMonday.count(utcYear(d) - 1, d), p2, 2);
  }
  __name(formatUTCWeekNumberMonday, "formatUTCWeekNumberMonday");
  function formatUTCYear(d, p2) {
    return pad(d.getUTCFullYear() % 100, p2, 2);
  }
  __name(formatUTCYear, "formatUTCYear");
  function formatUTCYearISO(d, p2) {
    d = UTCdISO(d);
    return pad(d.getUTCFullYear() % 100, p2, 2);
  }
  __name(formatUTCYearISO, "formatUTCYearISO");
  function formatUTCFullYear(d, p2) {
    return pad(d.getUTCFullYear() % 1e4, p2, 4);
  }
  __name(formatUTCFullYear, "formatUTCFullYear");
  function formatUTCFullYearISO(d, p2) {
    var day = d.getUTCDay();
    d = day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d);
    return pad(d.getUTCFullYear() % 1e4, p2, 4);
  }
  __name(formatUTCFullYearISO, "formatUTCFullYearISO");
  function formatUTCZone() {
    return "+0000";
  }
  __name(formatUTCZone, "formatUTCZone");
  function formatLiteralPercent() {
    return "%";
  }
  __name(formatLiteralPercent, "formatLiteralPercent");
  function formatUnixTimestamp(d) {
    return +d;
  }
  __name(formatUnixTimestamp, "formatUnixTimestamp");
  function formatUnixTimestampSeconds(d) {
    return Math.floor(+d / 1e3);
  }
  __name(formatUnixTimestampSeconds, "formatUnixTimestampSeconds");
  var locale;
  var timeFormat;
  var utcFormat;
  defaultLocale({
    dateTime: "%x, %X",
    date: "%-m/%-d/%Y",
    time: "%-I:%M:%S %p",
    periods: ["AM", "PM"],
    days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
    shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
    months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
    shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
  });
  function defaultLocale(definition) {
    locale = formatLocale(definition);
    timeFormat = locale.format;
    locale.parse;
    utcFormat = locale.utcFormat;
    locale.utcParse;
    return locale;
  }
  __name(defaultLocale, "defaultLocale");
  function date(t2) {
    return new Date(t2);
  }
  __name(date, "date");
  function number(t2) {
    return t2 instanceof Date ? +t2 : +/* @__PURE__ */ new Date(+t2);
  }
  __name(number, "number");
  function calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second2, format2) {
    var scale = continuous(), invert = scale.invert, domain = scale.domain;
    var formatMillisecond = format2(".%L"), formatSecond = format2(":%S"), formatMinute = format2("%I:%M"), formatHour = format2("%I %p"), formatDay = format2("%a %d"), formatWeek = format2("%b %d"), formatMonth = format2("%B"), formatYear2 = format2("%Y");
    function tickFormat2(date2) {
      return (second2(date2) < date2 ? formatMillisecond : minute(date2) < date2 ? formatSecond : hour(date2) < date2 ? formatMinute : day(date2) < date2 ? formatHour : month(date2) < date2 ? week(date2) < date2 ? formatDay : formatWeek : year(date2) < date2 ? formatMonth : formatYear2)(date2);
    }
    __name(tickFormat2, "tickFormat");
    scale.invert = function(y2) {
      return new Date(invert(y2));
    };
    scale.domain = function(_) {
      return arguments.length ? domain(Array.from(_, number)) : domain().map(date);
    };
    scale.ticks = function(interval) {
      var d = domain();
      return ticks2(d[0], d[d.length - 1], interval == null ? 10 : interval);
    };
    scale.tickFormat = function(count2, specifier) {
      return specifier == null ? tickFormat2 : format2(specifier);
    };
    scale.nice = function(interval) {
      var d = domain();
      if (!interval || typeof interval.range !== "function") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);
      return interval ? domain(nice(d, interval)) : scale;
    };
    scale.copy = function() {
      return copy$1(scale, calendar(ticks2, tickInterval, year, month, week, day, hour, minute, second2, format2));
    };
    return scale;
  }
  __name(calendar, "calendar");
  function time() {
    return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
  }
  __name(time, "time");
  function utcTime() {
    return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, utcFormat).domain([Date.UTC(2e3, 0, 1), Date.UTC(2e3, 0, 2)]), arguments);
  }
  __name(utcTime, "utcTime");
  function transformer$1() {
    var x0 = 0, x1 = 1, t02, t12, k10, transform, interpolator = identity$5, clamp2 = false, unknown;
    function scale(x2) {
      return x2 == null || isNaN(x2 = +x2) ? unknown : interpolator(k10 === 0 ? 0.5 : (x2 = (transform(x2) - t02) * k10, clamp2 ? Math.max(0, Math.min(1, x2)) : x2));
    }
    __name(scale, "scale");
    scale.domain = function(_) {
      return arguments.length ? ([x0, x1] = _, t02 = transform(x0 = +x0), t12 = transform(x1 = +x1), k10 = t02 === t12 ? 0 : 1 / (t12 - t02), scale) : [x0, x1];
    };
    scale.clamp = function(_) {
      return arguments.length ? (clamp2 = !!_, scale) : clamp2;
    };
    scale.interpolator = function(_) {
      return arguments.length ? (interpolator = _, scale) : interpolator;
    };
    function range2(interpolate2) {
      return function(_) {
        var r0, r1;
        return arguments.length ? ([r0, r1] = _, interpolator = interpolate2(r0, r1), scale) : [interpolator(0), interpolator(1)];
      };
    }
    __name(range2, "range");
    scale.range = range2(interpolate);
    scale.rangeRound = range2(interpolateRound);
    scale.unknown = function(_) {
      return arguments.length ? (unknown = _, scale) : unknown;
    };
    return function(t2) {
      transform = t2, t02 = t2(x0), t12 = t2(x1), k10 = t02 === t12 ? 0 : 1 / (t12 - t02);
      return scale;
    };
  }
  __name(transformer$1, "transformer$1");
  function copy(source, target) {
    return target.domain(source.domain()).interpolator(source.interpolator()).clamp(source.clamp()).unknown(source.unknown());
  }
  __name(copy, "copy");
  function sequential() {
    var scale = linearish(transformer$1()(identity$5));
    scale.copy = function() {
      return copy(scale, sequential());
    };
    return initInterpolator.apply(scale, arguments);
  }
  __name(sequential, "sequential");
  function sequentialLog() {
    var scale = loggish(transformer$1()).domain([1, 10]);
    scale.copy = function() {
      return copy(scale, sequentialLog()).base(scale.base());
    };
    return initInterpolator.apply(scale, arguments);
  }
  __name(sequentialLog, "sequentialLog");
  function sequentialSymlog() {
    var scale = symlogish(transformer$1());
    scale.copy = function() {
      return copy(scale, sequentialSymlog()).constant(scale.constant());
    };
    return initInterpolator.apply(scale, arguments);
  }
  __name(sequentialSymlog, "sequentialSymlog");
  function sequentialPow() {
    var scale = powish(transformer$1());
    scale.copy = function() {
      return copy(scale, sequentialPow()).exponent(scale.exponent());
    };
    return initInterpolator.apply(scale, arguments);
  }
  __name(sequentialPow, "sequentialPow");
  function sequentialSqrt() {
    return sequentialPow.apply(null, arguments).exponent(0.5);
  }
  __name(sequentialSqrt, "sequentialSqrt");
  function sequentialQuantile() {
    var domain = [], interpolator = identity$5;
    function scale(x2) {
      if (x2 != null && !isNaN(x2 = +x2)) return interpolator((bisectRight(domain, x2, 1) - 1) / (domain.length - 1));
    }
    __name(scale, "scale");
    scale.domain = function(_) {
      if (!arguments.length) return domain.slice();
      domain = [];
      for (let d of _) if (d != null && !isNaN(d = +d)) domain.push(d);
      domain.sort(ascending);
      return scale;
    };
    scale.interpolator = function(_) {
      return arguments.length ? (interpolator = _, scale) : interpolator;
    };
    scale.range = function() {
      return domain.map((d, i2) => interpolator(i2 / (domain.length - 1)));
    };
    scale.quantiles = function(n2) {
      return Array.from({ length: n2 + 1 }, (_, i2) => quantile$1(domain, i2 / n2));
    };
    scale.copy = function() {
      return sequentialQuantile(interpolator).domain(domain);
    };
    return initInterpolator.apply(scale, arguments);
  }
  __name(sequentialQuantile, "sequentialQuantile");
  function transformer() {
    var x0 = 0, x1 = 0.5, x2 = 1, s2 = 1, t02, t12, t2, k10, k21, interpolator = identity$5, transform, clamp2 = false, unknown;
    function scale(x3) {
      return isNaN(x3 = +x3) ? unknown : (x3 = 0.5 + ((x3 = +transform(x3)) - t12) * (s2 * x3 < s2 * t12 ? k10 : k21), interpolator(clamp2 ? Math.max(0, Math.min(1, x3)) : x3));
    }
    __name(scale, "scale");
    scale.domain = function(_) {
      return arguments.length ? ([x0, x1, x2] = _, t02 = transform(x0 = +x0), t12 = transform(x1 = +x1), t2 = transform(x2 = +x2), k10 = t02 === t12 ? 0 : 0.5 / (t12 - t02), k21 = t12 === t2 ? 0 : 0.5 / (t2 - t12), s2 = t12 < t02 ? -1 : 1, scale) : [x0, x1, x2];
    };
    scale.clamp = function(_) {
      return arguments.length ? (clamp2 = !!_, scale) : clamp2;
    };
    scale.interpolator = function(_) {
      return arguments.length ? (interpolator = _, scale) : interpolator;
    };
    function range2(interpolate2) {
      return function(_) {
        var r0, r1, r2;
        return arguments.length ? ([r0, r1, r2] = _, interpolator = piecewise(interpolate2, [r0, r1, r2]), scale) : [interpolator(0), interpolator(0.5), interpolator(1)];
      };
    }
    __name(range2, "range");
    scale.range = range2(interpolate);
    scale.rangeRound = range2(interpolateRound);
    scale.unknown = function(_) {
      return arguments.length ? (unknown = _, scale) : unknown;
    };
    return function(t3) {
      transform = t3, t02 = t3(x0), t12 = t3(x1), t2 = t3(x2), k10 = t02 === t12 ? 0 : 0.5 / (t12 - t02), k21 = t12 === t2 ? 0 : 0.5 / (t2 - t12), s2 = t12 < t02 ? -1 : 1;
      return scale;
    };
  }
  __name(transformer, "transformer");
  function diverging() {
    var scale = linearish(transformer()(identity$5));
    scale.copy = function() {
      return copy(scale, diverging());
    };
    return initInterpolator.apply(scale, arguments);
  }
  __name(diverging, "diverging");
  function divergingLog() {
    var scale = loggish(transformer()).domain([0.1, 1, 10]);
    scale.copy = function() {
      return copy(scale, divergingLog()).base(scale.base());
    };
    return initInterpolator.apply(scale, arguments);
  }
  __name(divergingLog, "divergingLog");
  function divergingSymlog() {
    var scale = symlogish(transformer());
    scale.copy = function() {
      return copy(scale, divergingSymlog()).constant(scale.constant());
    };
    return initInterpolator.apply(scale, arguments);
  }
  __name(divergingSymlog, "divergingSymlog");
  function divergingPow() {
    var scale = powish(transformer());
    scale.copy = function() {
      return copy(scale, divergingPow()).exponent(scale.exponent());
    };
    return initInterpolator.apply(scale, arguments);
  }
  __name(divergingPow, "divergingPow");
  function divergingSqrt() {
    return divergingPow.apply(null, arguments).exponent(0.5);
  }
  __name(divergingSqrt, "divergingSqrt");
  const d3Scales = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    scaleBand: band,
    scaleDiverging: diverging,
    scaleDivergingLog: divergingLog,
    scaleDivergingPow: divergingPow,
    scaleDivergingSqrt: divergingSqrt,
    scaleDivergingSymlog: divergingSymlog,
    scaleIdentity: identity$3,
    scaleImplicit: implicit,
    scaleLinear: linear,
    scaleLog: log,
    scaleOrdinal: ordinal,
    scalePoint: point,
    scalePow: pow,
    scaleQuantile: quantile,
    scaleQuantize: quantize,
    scaleRadial: radial,
    scaleSequential: sequential,
    scaleSequentialLog: sequentialLog,
    scaleSequentialPow: sequentialPow,
    scaleSequentialQuantile: sequentialQuantile,
    scaleSequentialSqrt: sequentialSqrt,
    scaleSequentialSymlog: sequentialSymlog,
    scaleSqrt: sqrt,
    scaleSymlog: symlog,
    scaleThreshold: threshold,
    scaleTime: time,
    scaleUtc: utcTime,
    tickFormat
  }, Symbol.toStringTag, { value: "Module" }));
  var _baseExtremum;
  var hasRequired_baseExtremum;
  function require_baseExtremum() {
    if (hasRequired_baseExtremum) return _baseExtremum;
    hasRequired_baseExtremum = 1;
    var isSymbol = requireIsSymbol();
    function baseExtremum(array2, iteratee, comparator) {
      var index2 = -1, length = array2.length;
      while (++index2 < length) {
        var value = array2[index2], current = iteratee(value);
        if (current != null && (computed === void 0 ? current === current && !isSymbol(current) : comparator(current, computed))) {
          var computed = current, result = value;
        }
      }
      return result;
    }
    __name(baseExtremum, "baseExtremum");
    _baseExtremum = baseExtremum;
    return _baseExtremum;
  }
  __name(require_baseExtremum, "require_baseExtremum");
  var _baseGt;
  var hasRequired_baseGt;
  function require_baseGt() {
    if (hasRequired_baseGt) return _baseGt;
    hasRequired_baseGt = 1;
    function baseGt(value, other) {
      return value > other;
    }
    __name(baseGt, "baseGt");
    _baseGt = baseGt;
    return _baseGt;
  }
  __name(require_baseGt, "require_baseGt");
  var max_1;
  var hasRequiredMax;
  function requireMax() {
    if (hasRequiredMax) return max_1;
    hasRequiredMax = 1;
    var baseExtremum = require_baseExtremum(), baseGt = require_baseGt(), identity2 = requireIdentity();
    function max2(array2) {
      return array2 && array2.length ? baseExtremum(array2, identity2, baseGt) : void 0;
    }
    __name(max2, "max");
    max_1 = max2;
    return max_1;
  }
  __name(requireMax, "requireMax");
  var maxExports = requireMax();
  const max = /* @__PURE__ */ getDefaultExportFromCjs(maxExports);
  var _baseLt;
  var hasRequired_baseLt;
  function require_baseLt() {
    if (hasRequired_baseLt) return _baseLt;
    hasRequired_baseLt = 1;
    function baseLt(value, other) {
      return value < other;
    }
    __name(baseLt, "baseLt");
    _baseLt = baseLt;
    return _baseLt;
  }
  __name(require_baseLt, "require_baseLt");
  var min_1;
  var hasRequiredMin;
  function requireMin() {
    if (hasRequiredMin) return min_1;
    hasRequiredMin = 1;
    var baseExtremum = require_baseExtremum(), baseLt = require_baseLt(), identity2 = requireIdentity();
    function min2(array2) {
      return array2 && array2.length ? baseExtremum(array2, identity2, baseLt) : void 0;
    }
    __name(min2, "min");
    min_1 = min2;
    return min_1;
  }
  __name(requireMin, "requireMin");
  var minExports = requireMin();
  const min = /* @__PURE__ */ getDefaultExportFromCjs(minExports);
  var map_1;
  var hasRequiredMap;
  function requireMap() {
    if (hasRequiredMap) return map_1;
    hasRequiredMap = 1;
    var arrayMap = require_arrayMap(), baseIteratee = require_baseIteratee(), baseMap = require_baseMap(), isArray2 = requireIsArray();
    function map2(collection, iteratee) {
      var func = isArray2(collection) ? arrayMap : baseMap;
      return func(collection, baseIteratee(iteratee, 3));
    }
    __name(map2, "map");
    map_1 = map2;
    return map_1;
  }
  __name(requireMap, "requireMap");
  var flatMap_1;
  var hasRequiredFlatMap;
  function requireFlatMap() {
    if (hasRequiredFlatMap) return flatMap_1;
    hasRequiredFlatMap = 1;
    var baseFlatten = require_baseFlatten(), map2 = requireMap();
    function flatMap2(collection, iteratee) {
      return baseFlatten(map2(collection, iteratee), 1);
    }
    __name(flatMap2, "flatMap");
    flatMap_1 = flatMap2;
    return flatMap_1;
  }
  __name(requireFlatMap, "requireFlatMap");
  var flatMapExports = requireFlatMap();
  const flatMap = /* @__PURE__ */ getDefaultExportFromCjs(flatMapExports);
  var isEqual_1;
  var hasRequiredIsEqual;
  function requireIsEqual() {
    if (hasRequiredIsEqual) return isEqual_1;
    hasRequiredIsEqual = 1;
    var baseIsEqual2 = require_baseIsEqual();
    function isEqual2(value, other) {
      return baseIsEqual2(value, other);
    }
    __name(isEqual2, "isEqual");
    isEqual_1 = isEqual2;
    return isEqual_1;
  }
  __name(requireIsEqual, "requireIsEqual");
  var isEqualExports = requireIsEqual();
  const isEqual$1 = /* @__PURE__ */ getDefaultExportFromCjs(isEqualExports);
  var MAX_DIGITS = 1e9, defaults = {
    // These values must be integers within the stated ranges (inclusive).
    // Most of these values can be changed during run-time using `Decimal.config`.
    // The maximum number of significant digits of the result of a calculation or base conversion.
    // E.g. `Decimal.config({ precision: 20 });`
    precision: 20,
    // 1 to MAX_DIGITS
    // The rounding mode used by default by `toInteger`, `toDecimalPlaces`, `toExponential`,
    // `toFixed`, `toPrecision` and `toSignificantDigits`.
    //
    // ROUND_UP         0 Away from zero.
    // ROUND_DOWN       1 Towards zero.
    // ROUND_CEIL       2 Towards +Infinity.
    // ROUND_FLOOR      3 Towards -Infinity.
    // ROUND_HALF_UP    4 Towards nearest neighbour. If equidistant, up.
    // ROUND_HALF_DOWN  5 Towards nearest neighbour. If equidistant, down.
    // ROUND_HALF_EVEN  6 Towards nearest neighbour. If equidistant, towards even neighbour.
    // ROUND_HALF_CEIL  7 Towards nearest neighbour. If equidistant, towards +Infinity.
    // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.
    //
    // E.g.
    // `Decimal.rounding = 4;`
    // `Decimal.rounding = Decimal.ROUND_HALF_UP;`
    rounding: 4,
    // 0 to 8
    // The exponent value at and beneath which `toString` returns exponential notation.
    // JavaScript numbers: -7
    toExpNeg: -7,
    // 0 to -MAX_E
    // The exponent value at and above which `toString` returns exponential notation.
    // JavaScript numbers: 21
    toExpPos: 21,
    // 0 to MAX_E
    // The natural logarithm of 10.
    // 115 digits
    LN10: "2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"
  }, Decimal, external = true, decimalError = "[DecimalError] ", invalidArgument = decimalError + "Invalid argument: ", exponentOutOfRange = decimalError + "Exponent out of range: ", mathfloor = Math.floor, mathpow = Math.pow, isDecimal = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, ONE, BASE = 1e7, LOG_BASE = 7, MAX_SAFE_INTEGER$2 = 9007199254740991, MAX_E = mathfloor(MAX_SAFE_INTEGER$2 / LOG_BASE), P$1 = {};
  P$1.absoluteValue = P$1.abs = function() {
    var x2 = new this.constructor(this);
    if (x2.s) x2.s = 1;
    return x2;
  };
  P$1.comparedTo = P$1.cmp = function(y2) {
    var i2, j, xdL, ydL, x2 = this;
    y2 = new x2.constructor(y2);
    if (x2.s !== y2.s) return x2.s || -y2.s;
    if (x2.e !== y2.e) return x2.e > y2.e ^ x2.s < 0 ? 1 : -1;
    xdL = x2.d.length;
    ydL = y2.d.length;
    for (i2 = 0, j = xdL < ydL ? xdL : ydL; i2 < j; ++i2) {
      if (x2.d[i2] !== y2.d[i2]) return x2.d[i2] > y2.d[i2] ^ x2.s < 0 ? 1 : -1;
    }
    return xdL === ydL ? 0 : xdL > ydL ^ x2.s < 0 ? 1 : -1;
  };
  P$1.decimalPlaces = P$1.dp = function() {
    var x2 = this, w = x2.d.length - 1, dp = (w - x2.e) * LOG_BASE;
    w = x2.d[w];
    if (w) for (; w % 10 == 0; w /= 10) dp--;
    return dp < 0 ? 0 : dp;
  };
  P$1.dividedBy = P$1.div = function(y2) {
    return divide(this, new this.constructor(y2));
  };
  P$1.dividedToIntegerBy = P$1.idiv = function(y2) {
    var x2 = this, Ctor = x2.constructor;
    return round(divide(x2, new Ctor(y2), 0, 1), Ctor.precision);
  };
  P$1.equals = P$1.eq = function(y2) {
    return !this.cmp(y2);
  };
  P$1.exponent = function() {
    return getBase10Exponent(this);
  };
  P$1.greaterThan = P$1.gt = function(y2) {
    return this.cmp(y2) > 0;
  };
  P$1.greaterThanOrEqualTo = P$1.gte = function(y2) {
    return this.cmp(y2) >= 0;
  };
  P$1.isInteger = P$1.isint = function() {
    return this.e > this.d.length - 2;
  };
  P$1.isNegative = P$1.isneg = function() {
    return this.s < 0;
  };
  P$1.isPositive = P$1.ispos = function() {
    return this.s > 0;
  };
  P$1.isZero = function() {
    return this.s === 0;
  };
  P$1.lessThan = P$1.lt = function(y2) {
    return this.cmp(y2) < 0;
  };
  P$1.lessThanOrEqualTo = P$1.lte = function(y2) {
    return this.cmp(y2) < 1;
  };
  P$1.logarithm = P$1.log = function(base) {
    var r2, x2 = this, Ctor = x2.constructor, pr = Ctor.precision, wpr = pr + 5;
    if (base === void 0) {
      base = new Ctor(10);
    } else {
      base = new Ctor(base);
      if (base.s < 1 || base.eq(ONE)) throw Error(decimalError + "NaN");
    }
    if (x2.s < 1) throw Error(decimalError + (x2.s ? "NaN" : "-Infinity"));
    if (x2.eq(ONE)) return new Ctor(0);
    external = false;
    r2 = divide(ln(x2, wpr), ln(base, wpr), wpr);
    external = true;
    return round(r2, pr);
  };
  P$1.minus = P$1.sub = function(y2) {
    var x2 = this;
    y2 = new x2.constructor(y2);
    return x2.s == y2.s ? subtract(x2, y2) : add(x2, (y2.s = -y2.s, y2));
  };
  P$1.modulo = P$1.mod = function(y2) {
    var q, x2 = this, Ctor = x2.constructor, pr = Ctor.precision;
    y2 = new Ctor(y2);
    if (!y2.s) throw Error(decimalError + "NaN");
    if (!x2.s) return round(new Ctor(x2), pr);
    external = false;
    q = divide(x2, y2, 0, 1).times(y2);
    external = true;
    return x2.minus(q);
  };
  P$1.naturalExponential = P$1.exp = function() {
    return exp(this);
  };
  P$1.naturalLogarithm = P$1.ln = function() {
    return ln(this);
  };
  P$1.negated = P$1.neg = function() {
    var x2 = new this.constructor(this);
    x2.s = -x2.s || 0;
    return x2;
  };
  P$1.plus = P$1.add = function(y2) {
    var x2 = this;
    y2 = new x2.constructor(y2);
    return x2.s == y2.s ? add(x2, y2) : subtract(x2, (y2.s = -y2.s, y2));
  };
  P$1.precision = P$1.sd = function(z) {
    var e, sd, w, x2 = this;
    if (z !== void 0 && z !== !!z && z !== 1 && z !== 0) throw Error(invalidArgument + z);
    e = getBase10Exponent(x2) + 1;
    w = x2.d.length - 1;
    sd = w * LOG_BASE + 1;
    w = x2.d[w];
    if (w) {
      for (; w % 10 == 0; w /= 10) sd--;
      for (w = x2.d[0]; w >= 10; w /= 10) sd++;
    }
    return z && e > sd ? e : sd;
  };
  P$1.squareRoot = P$1.sqrt = function() {
    var e, n2, pr, r2, s2, t2, wpr, x2 = this, Ctor = x2.constructor;
    if (x2.s < 1) {
      if (!x2.s) return new Ctor(0);
      throw Error(decimalError + "NaN");
    }
    e = getBase10Exponent(x2);
    external = false;
    s2 = Math.sqrt(+x2);
    if (s2 == 0 || s2 == 1 / 0) {
      n2 = digitsToString(x2.d);
      if ((n2.length + e) % 2 == 0) n2 += "0";
      s2 = Math.sqrt(n2);
      e = mathfloor((e + 1) / 2) - (e < 0 || e % 2);
      if (s2 == 1 / 0) {
        n2 = "5e" + e;
      } else {
        n2 = s2.toExponential();
        n2 = n2.slice(0, n2.indexOf("e") + 1) + e;
      }
      r2 = new Ctor(n2);
    } else {
      r2 = new Ctor(s2.toString());
    }
    pr = Ctor.precision;
    s2 = wpr = pr + 3;
    for (; ; ) {
      t2 = r2;
      r2 = t2.plus(divide(x2, t2, wpr + 2)).times(0.5);
      if (digitsToString(t2.d).slice(0, wpr) === (n2 = digitsToString(r2.d)).slice(0, wpr)) {
        n2 = n2.slice(wpr - 3, wpr + 1);
        if (s2 == wpr && n2 == "4999") {
          round(t2, pr + 1, 0);
          if (t2.times(t2).eq(x2)) {
            r2 = t2;
            break;
          }
        } else if (n2 != "9999") {
          break;
        }
        wpr += 4;
      }
    }
    external = true;
    return round(r2, pr);
  };
  P$1.times = P$1.mul = function(y2) {
    var carry, e, i2, k2, r2, rL, t2, xdL, ydL, x2 = this, Ctor = x2.constructor, xd = x2.d, yd = (y2 = new Ctor(y2)).d;
    if (!x2.s || !y2.s) return new Ctor(0);
    y2.s *= x2.s;
    e = x2.e + y2.e;
    xdL = xd.length;
    ydL = yd.length;
    if (xdL < ydL) {
      r2 = xd;
      xd = yd;
      yd = r2;
      rL = xdL;
      xdL = ydL;
      ydL = rL;
    }
    r2 = [];
    rL = xdL + ydL;
    for (i2 = rL; i2--; ) r2.push(0);
    for (i2 = ydL; --i2 >= 0; ) {
      carry = 0;
      for (k2 = xdL + i2; k2 > i2; ) {
        t2 = r2[k2] + yd[i2] * xd[k2 - i2 - 1] + carry;
        r2[k2--] = t2 % BASE | 0;
        carry = t2 / BASE | 0;
      }
      r2[k2] = (r2[k2] + carry) % BASE | 0;
    }
    for (; !r2[--rL]; ) r2.pop();
    if (carry) ++e;
    else r2.shift();
    y2.d = r2;
    y2.e = e;
    return external ? round(y2, Ctor.precision) : y2;
  };
  P$1.toDecimalPlaces = P$1.todp = function(dp, rm) {
    var x2 = this, Ctor = x2.constructor;
    x2 = new Ctor(x2);
    if (dp === void 0) return x2;
    checkInt32(dp, 0, MAX_DIGITS);
    if (rm === void 0) rm = Ctor.rounding;
    else checkInt32(rm, 0, 8);
    return round(x2, dp + getBase10Exponent(x2) + 1, rm);
  };
  P$1.toExponential = function(dp, rm) {
    var str, x2 = this, Ctor = x2.constructor;
    if (dp === void 0) {
      str = toString$1(x2, true);
    } else {
      checkInt32(dp, 0, MAX_DIGITS);
      if (rm === void 0) rm = Ctor.rounding;
      else checkInt32(rm, 0, 8);
      x2 = round(new Ctor(x2), dp + 1, rm);
      str = toString$1(x2, true, dp + 1);
    }
    return str;
  };
  P$1.toFixed = function(dp, rm) {
    var str, y2, x2 = this, Ctor = x2.constructor;
    if (dp === void 0) return toString$1(x2);
    checkInt32(dp, 0, MAX_DIGITS);
    if (rm === void 0) rm = Ctor.rounding;
    else checkInt32(rm, 0, 8);
    y2 = round(new Ctor(x2), dp + getBase10Exponent(x2) + 1, rm);
    str = toString$1(y2.abs(), false, dp + getBase10Exponent(y2) + 1);
    return x2.isneg() && !x2.isZero() ? "-" + str : str;
  };
  P$1.toInteger = P$1.toint = function() {
    var x2 = this, Ctor = x2.constructor;
    return round(new Ctor(x2), getBase10Exponent(x2) + 1, Ctor.rounding);
  };
  P$1.toNumber = function() {
    return +this;
  };
  P$1.toPower = P$1.pow = function(y2) {
    var e, k2, pr, r2, sign2, yIsInt, x2 = this, Ctor = x2.constructor, guard = 12, yn = +(y2 = new Ctor(y2));
    if (!y2.s) return new Ctor(ONE);
    x2 = new Ctor(x2);
    if (!x2.s) {
      if (y2.s < 1) throw Error(decimalError + "Infinity");
      return x2;
    }
    if (x2.eq(ONE)) return x2;
    pr = Ctor.precision;
    if (y2.eq(ONE)) return round(x2, pr);
    e = y2.e;
    k2 = y2.d.length - 1;
    yIsInt = e >= k2;
    sign2 = x2.s;
    if (!yIsInt) {
      if (sign2 < 0) throw Error(decimalError + "NaN");
    } else if ((k2 = yn < 0 ? -yn : yn) <= MAX_SAFE_INTEGER$2) {
      r2 = new Ctor(ONE);
      e = Math.ceil(pr / LOG_BASE + 4);
      external = false;
      for (; ; ) {
        if (k2 % 2) {
          r2 = r2.times(x2);
          truncate(r2.d, e);
        }
        k2 = mathfloor(k2 / 2);
        if (k2 === 0) break;
        x2 = x2.times(x2);
        truncate(x2.d, e);
      }
      external = true;
      return y2.s < 0 ? new Ctor(ONE).div(r2) : round(r2, pr);
    }
    sign2 = sign2 < 0 && y2.d[Math.max(e, k2)] & 1 ? -1 : 1;
    x2.s = 1;
    external = false;
    r2 = y2.times(ln(x2, pr + guard));
    external = true;
    r2 = exp(r2);
    r2.s = sign2;
    return r2;
  };
  P$1.toPrecision = function(sd, rm) {
    var e, str, x2 = this, Ctor = x2.constructor;
    if (sd === void 0) {
      e = getBase10Exponent(x2);
      str = toString$1(x2, e <= Ctor.toExpNeg || e >= Ctor.toExpPos);
    } else {
      checkInt32(sd, 1, MAX_DIGITS);
      if (rm === void 0) rm = Ctor.rounding;
      else checkInt32(rm, 0, 8);
      x2 = round(new Ctor(x2), sd, rm);
      e = getBase10Exponent(x2);
      str = toString$1(x2, sd <= e || e <= Ctor.toExpNeg, sd);
    }
    return str;
  };
  P$1.toSignificantDigits = P$1.tosd = function(sd, rm) {
    var x2 = this, Ctor = x2.constructor;
    if (sd === void 0) {
      sd = Ctor.precision;
      rm = Ctor.rounding;
    } else {
      checkInt32(sd, 1, MAX_DIGITS);
      if (rm === void 0) rm = Ctor.rounding;
      else checkInt32(rm, 0, 8);
    }
    return round(new Ctor(x2), sd, rm);
  };
  P$1.toString = P$1.valueOf = P$1.val = P$1.toJSON = P$1[Symbol.for("nodejs.util.inspect.custom")] = function() {
    var x2 = this, e = getBase10Exponent(x2), Ctor = x2.constructor;
    return toString$1(x2, e <= Ctor.toExpNeg || e >= Ctor.toExpPos);
  };
  function add(x2, y2) {
    var carry, d, e, i2, k2, len, xd, yd, Ctor = x2.constructor, pr = Ctor.precision;
    if (!x2.s || !y2.s) {
      if (!y2.s) y2 = new Ctor(x2);
      return external ? round(y2, pr) : y2;
    }
    xd = x2.d;
    yd = y2.d;
    k2 = x2.e;
    e = y2.e;
    xd = xd.slice();
    i2 = k2 - e;
    if (i2) {
      if (i2 < 0) {
        d = xd;
        i2 = -i2;
        len = yd.length;
      } else {
        d = yd;
        e = k2;
        len = xd.length;
      }
      k2 = Math.ceil(pr / LOG_BASE);
      len = k2 > len ? k2 + 1 : len + 1;
      if (i2 > len) {
        i2 = len;
        d.length = 1;
      }
      d.reverse();
      for (; i2--; ) d.push(0);
      d.reverse();
    }
    len = xd.length;
    i2 = yd.length;
    if (len - i2 < 0) {
      i2 = len;
      d = yd;
      yd = xd;
      xd = d;
    }
    for (carry = 0; i2; ) {
      carry = (xd[--i2] = xd[i2] + yd[i2] + carry) / BASE | 0;
      xd[i2] %= BASE;
    }
    if (carry) {
      xd.unshift(carry);
      ++e;
    }
    for (len = xd.length; xd[--len] == 0; ) xd.pop();
    y2.d = xd;
    y2.e = e;
    return external ? round(y2, pr) : y2;
  }
  __name(add, "add");
  function checkInt32(i2, min2, max2) {
    if (i2 !== ~~i2 || i2 < min2 || i2 > max2) {
      throw Error(invalidArgument + i2);
    }
  }
  __name(checkInt32, "checkInt32");
  function digitsToString(d) {
    var i2, k2, ws, indexOfLastWord = d.length - 1, str = "", w = d[0];
    if (indexOfLastWord > 0) {
      str += w;
      for (i2 = 1; i2 < indexOfLastWord; i2++) {
        ws = d[i2] + "";
        k2 = LOG_BASE - ws.length;
        if (k2) str += getZeroString(k2);
        str += ws;
      }
      w = d[i2];
      ws = w + "";
      k2 = LOG_BASE - ws.length;
      if (k2) str += getZeroString(k2);
    } else if (w === 0) {
      return "0";
    }
    for (; w % 10 === 0; ) w /= 10;
    return str + w;
  }
  __name(digitsToString, "digitsToString");
  var divide = /* @__PURE__ */ (function() {
    function multiplyInteger(x2, k2) {
      var temp, carry = 0, i2 = x2.length;
      for (x2 = x2.slice(); i2--; ) {
        temp = x2[i2] * k2 + carry;
        x2[i2] = temp % BASE | 0;
        carry = temp / BASE | 0;
      }
      if (carry) x2.unshift(carry);
      return x2;
    }
    __name(multiplyInteger, "multiplyInteger");
    function compare(a2, b, aL, bL) {
      var i2, r2;
      if (aL != bL) {
        r2 = aL > bL ? 1 : -1;
      } else {
        for (i2 = r2 = 0; i2 < aL; i2++) {
          if (a2[i2] != b[i2]) {
            r2 = a2[i2] > b[i2] ? 1 : -1;
            break;
          }
        }
      }
      return r2;
    }
    __name(compare, "compare");
    function subtract2(a2, b, aL) {
      var i2 = 0;
      for (; aL--; ) {
        a2[aL] -= i2;
        i2 = a2[aL] < b[aL] ? 1 : 0;
        a2[aL] = i2 * BASE + a2[aL] - b[aL];
      }
      for (; !a2[0] && a2.length > 1; ) a2.shift();
    }
    __name(subtract2, "subtract");
    return function(x2, y2, pr, dp) {
      var cmp, e, i2, k2, prod, prodL, q, qd, rem, remL, rem0, sd, t2, xi, xL, yd0, yL, yz, Ctor = x2.constructor, sign2 = x2.s == y2.s ? 1 : -1, xd = x2.d, yd = y2.d;
      if (!x2.s) return new Ctor(x2);
      if (!y2.s) throw Error(decimalError + "Division by zero");
      e = x2.e - y2.e;
      yL = yd.length;
      xL = xd.length;
      q = new Ctor(sign2);
      qd = q.d = [];
      for (i2 = 0; yd[i2] == (xd[i2] || 0); ) ++i2;
      if (yd[i2] > (xd[i2] || 0)) --e;
      if (pr == null) {
        sd = pr = Ctor.precision;
      } else if (dp) {
        sd = pr + (getBase10Exponent(x2) - getBase10Exponent(y2)) + 1;
      } else {
        sd = pr;
      }
      if (sd < 0) return new Ctor(0);
      sd = sd / LOG_BASE + 2 | 0;
      i2 = 0;
      if (yL == 1) {
        k2 = 0;
        yd = yd[0];
        sd++;
        for (; (i2 < xL || k2) && sd--; i2++) {
          t2 = k2 * BASE + (xd[i2] || 0);
          qd[i2] = t2 / yd | 0;
          k2 = t2 % yd | 0;
        }
      } else {
        k2 = BASE / (yd[0] + 1) | 0;
        if (k2 > 1) {
          yd = multiplyInteger(yd, k2);
          xd = multiplyInteger(xd, k2);
          yL = yd.length;
          xL = xd.length;
        }
        xi = yL;
        rem = xd.slice(0, yL);
        remL = rem.length;
        for (; remL < yL; ) rem[remL++] = 0;
        yz = yd.slice();
        yz.unshift(0);
        yd0 = yd[0];
        if (yd[1] >= BASE / 2) ++yd0;
        do {
          k2 = 0;
          cmp = compare(yd, rem, yL, remL);
          if (cmp < 0) {
            rem0 = rem[0];
            if (yL != remL) rem0 = rem0 * BASE + (rem[1] || 0);
            k2 = rem0 / yd0 | 0;
            if (k2 > 1) {
              if (k2 >= BASE) k2 = BASE - 1;
              prod = multiplyInteger(yd, k2);
              prodL = prod.length;
              remL = rem.length;
              cmp = compare(prod, rem, prodL, remL);
              if (cmp == 1) {
                k2--;
                subtract2(prod, yL < prodL ? yz : yd, prodL);
              }
            } else {
              if (k2 == 0) cmp = k2 = 1;
              prod = yd.slice();
            }
            prodL = prod.length;
            if (prodL < remL) prod.unshift(0);
            subtract2(rem, prod, remL);
            if (cmp == -1) {
              remL = rem.length;
              cmp = compare(yd, rem, yL, remL);
              if (cmp < 1) {
                k2++;
                subtract2(rem, yL < remL ? yz : yd, remL);
              }
            }
            remL = rem.length;
          } else if (cmp === 0) {
            k2++;
            rem = [0];
          }
          qd[i2++] = k2;
          if (cmp && rem[0]) {
            rem[remL++] = xd[xi] || 0;
          } else {
            rem = [xd[xi]];
            remL = 1;
          }
        } while ((xi++ < xL || rem[0] !== void 0) && sd--);
      }
      if (!qd[0]) qd.shift();
      q.e = e;
      return round(q, dp ? pr + getBase10Exponent(q) + 1 : pr);
    };
  })();
  function exp(x2, sd) {
    var denominator, guard, pow2, sum, t2, wpr, i2 = 0, k2 = 0, Ctor = x2.constructor, pr = Ctor.precision;
    if (getBase10Exponent(x2) > 16) throw Error(exponentOutOfRange + getBase10Exponent(x2));
    if (!x2.s) return new Ctor(ONE);
    {
      external = false;
      wpr = pr;
    }
    t2 = new Ctor(0.03125);
    while (x2.abs().gte(0.1)) {
      x2 = x2.times(t2);
      k2 += 5;
    }
    guard = Math.log(mathpow(2, k2)) / Math.LN10 * 2 + 5 | 0;
    wpr += guard;
    denominator = pow2 = sum = new Ctor(ONE);
    Ctor.precision = wpr;
    for (; ; ) {
      pow2 = round(pow2.times(x2), wpr);
      denominator = denominator.times(++i2);
      t2 = sum.plus(divide(pow2, denominator, wpr));
      if (digitsToString(t2.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {
        while (k2--) sum = round(sum.times(sum), wpr);
        Ctor.precision = pr;
        return sd == null ? (external = true, round(sum, pr)) : sum;
      }
      sum = t2;
    }
  }
  __name(exp, "exp");
  function getBase10Exponent(x2) {
    var e = x2.e * LOG_BASE, w = x2.d[0];
    for (; w >= 10; w /= 10) e++;
    return e;
  }
  __name(getBase10Exponent, "getBase10Exponent");
  function getLn10(Ctor, sd, pr) {
    if (sd > Ctor.LN10.sd()) {
      external = true;
      if (pr) Ctor.precision = pr;
      throw Error(decimalError + "LN10 precision limit exceeded");
    }
    return round(new Ctor(Ctor.LN10), sd);
  }
  __name(getLn10, "getLn10");
  function getZeroString(k2) {
    var zs = "";
    for (; k2--; ) zs += "0";
    return zs;
  }
  __name(getZeroString, "getZeroString");
  function ln(y2, sd) {
    var c2, c0, denominator, e, numerator, sum, t2, wpr, x2, n2 = 1, guard = 10, x3 = y2, xd = x3.d, Ctor = x3.constructor, pr = Ctor.precision;
    if (x3.s < 1) throw Error(decimalError + (x3.s ? "NaN" : "-Infinity"));
    if (x3.eq(ONE)) return new Ctor(0);
    if (sd == null) {
      external = false;
      wpr = pr;
    } else {
      wpr = sd;
    }
    if (x3.eq(10)) {
      if (sd == null) external = true;
      return getLn10(Ctor, wpr);
    }
    wpr += guard;
    Ctor.precision = wpr;
    c2 = digitsToString(xd);
    c0 = c2.charAt(0);
    e = getBase10Exponent(x3);
    if (Math.abs(e) < 15e14) {
      while (c0 < 7 && c0 != 1 || c0 == 1 && c2.charAt(1) > 3) {
        x3 = x3.times(y2);
        c2 = digitsToString(x3.d);
        c0 = c2.charAt(0);
        n2++;
      }
      e = getBase10Exponent(x3);
      if (c0 > 1) {
        x3 = new Ctor("0." + c2);
        e++;
      } else {
        x3 = new Ctor(c0 + "." + c2.slice(1));
      }
    } else {
      t2 = getLn10(Ctor, wpr + 2, pr).times(e + "");
      x3 = ln(new Ctor(c0 + "." + c2.slice(1)), wpr - guard).plus(t2);
      Ctor.precision = pr;
      return sd == null ? (external = true, round(x3, pr)) : x3;
    }
    sum = numerator = x3 = divide(x3.minus(ONE), x3.plus(ONE), wpr);
    x2 = round(x3.times(x3), wpr);
    denominator = 3;
    for (; ; ) {
      numerator = round(numerator.times(x2), wpr);
      t2 = sum.plus(divide(numerator, new Ctor(denominator), wpr));
      if (digitsToString(t2.d).slice(0, wpr) === digitsToString(sum.d).slice(0, wpr)) {
        sum = sum.times(2);
        if (e !== 0) sum = sum.plus(getLn10(Ctor, wpr + 2, pr).times(e + ""));
        sum = divide(sum, new Ctor(n2), wpr);
        Ctor.precision = pr;
        return sd == null ? (external = true, round(sum, pr)) : sum;
      }
      sum = t2;
      denominator += 2;
    }
  }
  __name(ln, "ln");
  function parseDecimal(x2, str) {
    var e, i2, len;
    if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
    if ((i2 = str.search(/e/i)) > 0) {
      if (e < 0) e = i2;
      e += +str.slice(i2 + 1);
      str = str.substring(0, i2);
    } else if (e < 0) {
      e = str.length;
    }
    for (i2 = 0; str.charCodeAt(i2) === 48; ) ++i2;
    for (len = str.length; str.charCodeAt(len - 1) === 48; ) --len;
    str = str.slice(i2, len);
    if (str) {
      len -= i2;
      e = e - i2 - 1;
      x2.e = mathfloor(e / LOG_BASE);
      x2.d = [];
      i2 = (e + 1) % LOG_BASE;
      if (e < 0) i2 += LOG_BASE;
      if (i2 < len) {
        if (i2) x2.d.push(+str.slice(0, i2));
        for (len -= LOG_BASE; i2 < len; ) x2.d.push(+str.slice(i2, i2 += LOG_BASE));
        str = str.slice(i2);
        i2 = LOG_BASE - str.length;
      } else {
        i2 -= len;
      }
      for (; i2--; ) str += "0";
      x2.d.push(+str);
      if (external && (x2.e > MAX_E || x2.e < -MAX_E)) throw Error(exponentOutOfRange + e);
    } else {
      x2.s = 0;
      x2.e = 0;
      x2.d = [0];
    }
    return x2;
  }
  __name(parseDecimal, "parseDecimal");
  function round(x2, sd, rm) {
    var i2, j, k2, n2, rd, doRound, w, xdi, xd = x2.d;
    for (n2 = 1, k2 = xd[0]; k2 >= 10; k2 /= 10) n2++;
    i2 = sd - n2;
    if (i2 < 0) {
      i2 += LOG_BASE;
      j = sd;
      w = xd[xdi = 0];
    } else {
      xdi = Math.ceil((i2 + 1) / LOG_BASE);
      k2 = xd.length;
      if (xdi >= k2) return x2;
      w = k2 = xd[xdi];
      for (n2 = 1; k2 >= 10; k2 /= 10) n2++;
      i2 %= LOG_BASE;
      j = i2 - LOG_BASE + n2;
    }
    if (rm !== void 0) {
      k2 = mathpow(10, n2 - j - 1);
      rd = w / k2 % 10 | 0;
      doRound = sd < 0 || xd[xdi + 1] !== void 0 || w % k2;
      doRound = rm < 4 ? (rd || doRound) && (rm == 0 || rm == (x2.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || doRound || rm == 6 && // Check whether the digit to the left of the rounding digit is odd.
      (i2 > 0 ? j > 0 ? w / mathpow(10, n2 - j) : 0 : xd[xdi - 1]) % 10 & 1 || rm == (x2.s < 0 ? 8 : 7));
    }
    if (sd < 1 || !xd[0]) {
      if (doRound) {
        k2 = getBase10Exponent(x2);
        xd.length = 1;
        sd = sd - k2 - 1;
        xd[0] = mathpow(10, (LOG_BASE - sd % LOG_BASE) % LOG_BASE);
        x2.e = mathfloor(-sd / LOG_BASE) || 0;
      } else {
        xd.length = 1;
        xd[0] = x2.e = x2.s = 0;
      }
      return x2;
    }
    if (i2 == 0) {
      xd.length = xdi;
      k2 = 1;
      xdi--;
    } else {
      xd.length = xdi + 1;
      k2 = mathpow(10, LOG_BASE - i2);
      xd[xdi] = j > 0 ? (w / mathpow(10, n2 - j) % mathpow(10, j) | 0) * k2 : 0;
    }
    if (doRound) {
      for (; ; ) {
        if (xdi == 0) {
          if ((xd[0] += k2) == BASE) {
            xd[0] = 1;
            ++x2.e;
          }
          break;
        } else {
          xd[xdi] += k2;
          if (xd[xdi] != BASE) break;
          xd[xdi--] = 0;
          k2 = 1;
        }
      }
    }
    for (i2 = xd.length; xd[--i2] === 0; ) xd.pop();
    if (external && (x2.e > MAX_E || x2.e < -MAX_E)) {
      throw Error(exponentOutOfRange + getBase10Exponent(x2));
    }
    return x2;
  }
  __name(round, "round");
  function subtract(x2, y2) {
    var d, e, i2, j, k2, len, xd, xe2, xLTy, yd, Ctor = x2.constructor, pr = Ctor.precision;
    if (!x2.s || !y2.s) {
      if (y2.s) y2.s = -y2.s;
      else y2 = new Ctor(x2);
      return external ? round(y2, pr) : y2;
    }
    xd = x2.d;
    yd = y2.d;
    e = y2.e;
    xe2 = x2.e;
    xd = xd.slice();
    k2 = xe2 - e;
    if (k2) {
      xLTy = k2 < 0;
      if (xLTy) {
        d = xd;
        k2 = -k2;
        len = yd.length;
      } else {
        d = yd;
        e = xe2;
        len = xd.length;
      }
      i2 = Math.max(Math.ceil(pr / LOG_BASE), len) + 2;
      if (k2 > i2) {
        k2 = i2;
        d.length = 1;
      }
      d.reverse();
      for (i2 = k2; i2--; ) d.push(0);
      d.reverse();
    } else {
      i2 = xd.length;
      len = yd.length;
      xLTy = i2 < len;
      if (xLTy) len = i2;
      for (i2 = 0; i2 < len; i2++) {
        if (xd[i2] != yd[i2]) {
          xLTy = xd[i2] < yd[i2];
          break;
        }
      }
      k2 = 0;
    }
    if (xLTy) {
      d = xd;
      xd = yd;
      yd = d;
      y2.s = -y2.s;
    }
    len = xd.length;
    for (i2 = yd.length - len; i2 > 0; --i2) xd[len++] = 0;
    for (i2 = yd.length; i2 > k2; ) {
      if (xd[--i2] < yd[i2]) {
        for (j = i2; j && xd[--j] === 0; ) xd[j] = BASE - 1;
        --xd[j];
        xd[i2] += BASE;
      }
      xd[i2] -= yd[i2];
    }
    for (; xd[--len] === 0; ) xd.pop();
    for (; xd[0] === 0; xd.shift()) --e;
    if (!xd[0]) return new Ctor(0);
    y2.d = xd;
    y2.e = e;
    return external ? round(y2, pr) : y2;
  }
  __name(subtract, "subtract");
  function toString$1(x2, isExp, sd) {
    var k2, e = getBase10Exponent(x2), str = digitsToString(x2.d), len = str.length;
    if (isExp) {
      if (sd && (k2 = sd - len) > 0) {
        str = str.charAt(0) + "." + str.slice(1) + getZeroString(k2);
      } else if (len > 1) {
        str = str.charAt(0) + "." + str.slice(1);
      }
      str = str + (e < 0 ? "e" : "e+") + e;
    } else if (e < 0) {
      str = "0." + getZeroString(-e - 1) + str;
      if (sd && (k2 = sd - len) > 0) str += getZeroString(k2);
    } else if (e >= len) {
      str += getZeroString(e + 1 - len);
      if (sd && (k2 = sd - e - 1) > 0) str = str + "." + getZeroString(k2);
    } else {
      if ((k2 = e + 1) < len) str = str.slice(0, k2) + "." + str.slice(k2);
      if (sd && (k2 = sd - len) > 0) {
        if (e + 1 === len) str += ".";
        str += getZeroString(k2);
      }
    }
    return x2.s < 0 ? "-" + str : str;
  }
  __name(toString$1, "toString$1");
  function truncate(arr, len) {
    if (arr.length > len) {
      arr.length = len;
      return true;
    }
  }
  __name(truncate, "truncate");
  function clone(obj) {
    var i2, p2, ps;
    function Decimal2(value) {
      var x2 = this;
      if (!(x2 instanceof Decimal2)) return new Decimal2(value);
      x2.constructor = Decimal2;
      if (value instanceof Decimal2) {
        x2.s = value.s;
        x2.e = value.e;
        x2.d = (value = value.d) ? value.slice() : value;
        return;
      }
      if (typeof value === "number") {
        if (value * 0 !== 0) {
          throw Error(invalidArgument + value);
        }
        if (value > 0) {
          x2.s = 1;
        } else if (value < 0) {
          value = -value;
          x2.s = -1;
        } else {
          x2.s = 0;
          x2.e = 0;
          x2.d = [0];
          return;
        }
        if (value === ~~value && value < 1e7) {
          x2.e = 0;
          x2.d = [value];
          return;
        }
        return parseDecimal(x2, value.toString());
      } else if (typeof value !== "string") {
        throw Error(invalidArgument + value);
      }
      if (value.charCodeAt(0) === 45) {
        value = value.slice(1);
        x2.s = -1;
      } else {
        x2.s = 1;
      }
      if (isDecimal.test(value)) parseDecimal(x2, value);
      else throw Error(invalidArgument + value);
    }
    __name(Decimal2, "Decimal");
    Decimal2.prototype = P$1;
    Decimal2.ROUND_UP = 0;
    Decimal2.ROUND_DOWN = 1;
    Decimal2.ROUND_CEIL = 2;
    Decimal2.ROUND_FLOOR = 3;
    Decimal2.ROUND_HALF_UP = 4;
    Decimal2.ROUND_HALF_DOWN = 5;
    Decimal2.ROUND_HALF_EVEN = 6;
    Decimal2.ROUND_HALF_CEIL = 7;
    Decimal2.ROUND_HALF_FLOOR = 8;
    Decimal2.clone = clone;
    Decimal2.config = Decimal2.set = config;
    if (obj === void 0) obj = {};
    if (obj) {
      ps = ["precision", "rounding", "toExpNeg", "toExpPos", "LN10"];
      for (i2 = 0; i2 < ps.length; ) if (!obj.hasOwnProperty(p2 = ps[i2++])) obj[p2] = this[p2];
    }
    Decimal2.config(obj);
    return Decimal2;
  }
  __name(clone, "clone");
  function config(obj) {
    if (!obj || typeof obj !== "object") {
      throw Error(decimalError + "Object expected");
    }
    var i2, p2, v, ps = [
      "precision",
      1,
      MAX_DIGITS,
      "rounding",
      0,
      8,
      "toExpNeg",
      -1 / 0,
      0,
      "toExpPos",
      0,
      1 / 0
    ];
    for (i2 = 0; i2 < ps.length; i2 += 3) {
      if ((v = obj[p2 = ps[i2]]) !== void 0) {
        if (mathfloor(v) === v && v >= ps[i2 + 1] && v <= ps[i2 + 2]) this[p2] = v;
        else throw Error(invalidArgument + p2 + ": " + v);
      }
    }
    if ((v = obj[p2 = "LN10"]) !== void 0) {
      if (v == Math.LN10) this[p2] = new this(v);
      else throw Error(invalidArgument + p2 + ": " + v);
    }
    return this;
  }
  __name(config, "config");
  var Decimal = clone(defaults);
  ONE = new Decimal(1);
  const Decimal$1 = Decimal;
  function _toConsumableArray$a(arr) {
    return _arrayWithoutHoles$a(arr) || _iterableToArray$b(arr) || _unsupportedIterableToArray$g(arr) || _nonIterableSpread$a();
  }
  __name(_toConsumableArray$a, "_toConsumableArray$a");
  function _nonIterableSpread$a() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableSpread$a, "_nonIterableSpread$a");
  function _unsupportedIterableToArray$g(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$g(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$g(o2, minLen);
  }
  __name(_unsupportedIterableToArray$g, "_unsupportedIterableToArray$g");
  function _iterableToArray$b(iter) {
    if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
  }
  __name(_iterableToArray$b, "_iterableToArray$b");
  function _arrayWithoutHoles$a(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray$g(arr);
  }
  __name(_arrayWithoutHoles$a, "_arrayWithoutHoles$a");
  function _arrayLikeToArray$g(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
      arr2[i2] = arr[i2];
    }
    return arr2;
  }
  __name(_arrayLikeToArray$g, "_arrayLikeToArray$g");
  var identity$2 = /* @__PURE__ */ __name(function identity2(i2) {
    return i2;
  }, "identity");
  var PLACE_HOLDER = {};
  var isPlaceHolder = /* @__PURE__ */ __name(function isPlaceHolder2(val) {
    return val === PLACE_HOLDER;
  }, "isPlaceHolder");
  var curry0 = /* @__PURE__ */ __name(function curry02(fn) {
    return /* @__PURE__ */ __name(function _curried() {
      if (arguments.length === 0 || arguments.length === 1 && isPlaceHolder(arguments.length <= 0 ? void 0 : arguments[0])) {
        return _curried;
      }
      return fn.apply(void 0, arguments);
    }, "_curried");
  }, "curry0");
  var curryN = /* @__PURE__ */ __name(function curryN2(n2, fn) {
    if (n2 === 1) {
      return fn;
    }
    return curry0(function() {
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      var argsLength = args.filter(function(arg) {
        return arg !== PLACE_HOLDER;
      }).length;
      if (argsLength >= n2) {
        return fn.apply(void 0, args);
      }
      return curryN2(n2 - argsLength, curry0(function() {
        for (var _len2 = arguments.length, restArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
          restArgs[_key2] = arguments[_key2];
        }
        var newArgs = args.map(function(arg) {
          return isPlaceHolder(arg) ? restArgs.shift() : arg;
        });
        return fn.apply(void 0, _toConsumableArray$a(newArgs).concat(restArgs));
      }));
    });
  }, "curryN");
  var curry = /* @__PURE__ */ __name(function curry2(fn) {
    return curryN(fn.length, fn);
  }, "curry");
  var range$1 = /* @__PURE__ */ __name(function range2(begin, end) {
    var arr = [];
    for (var i2 = begin; i2 < end; ++i2) {
      arr[i2 - begin] = i2;
    }
    return arr;
  }, "range");
  var map = curry(function(fn, arr) {
    if (Array.isArray(arr)) {
      return arr.map(fn);
    }
    return Object.keys(arr).map(function(key) {
      return arr[key];
    }).map(fn);
  });
  var compose = /* @__PURE__ */ __name(function compose2() {
    for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
      args[_key3] = arguments[_key3];
    }
    if (!args.length) {
      return identity$2;
    }
    var fns = args.reverse();
    var firstFn = fns[0];
    var tailsFn = fns.slice(1);
    return function() {
      return tailsFn.reduce(function(res, fn) {
        return fn(res);
      }, firstFn.apply(void 0, arguments));
    };
  }, "compose");
  var reverse = /* @__PURE__ */ __name(function reverse2(arr) {
    if (Array.isArray(arr)) {
      return arr.reverse();
    }
    return arr.split("").reverse.join("");
  }, "reverse");
  var memoize$1 = /* @__PURE__ */ __name(function memoize2(fn) {
    var lastArgs = null;
    var lastResult2 = null;
    return function() {
      for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
        args[_key4] = arguments[_key4];
      }
      if (lastArgs && args.every(function(val, i2) {
        return val === lastArgs[i2];
      })) {
        return lastResult2;
      }
      lastArgs = args;
      lastResult2 = fn.apply(void 0, args);
      return lastResult2;
    };
  }, "memoize");
  function getDigitCount(value) {
    var result;
    if (value === 0) {
      result = 1;
    } else {
      result = Math.floor(new Decimal$1(value).abs().log(10).toNumber()) + 1;
    }
    return result;
  }
  __name(getDigitCount, "getDigitCount");
  function rangeStep(start, end, step) {
    var num = new Decimal$1(start);
    var i2 = 0;
    var result = [];
    while (num.lt(end) && i2 < 1e5) {
      result.push(num.toNumber());
      num = num.add(step);
      i2++;
    }
    return result;
  }
  __name(rangeStep, "rangeStep");
  var interpolateNumber = curry(function(a2, b, t2) {
    var newA = +a2;
    var newB = +b;
    return newA + t2 * (newB - newA);
  });
  var uninterpolateNumber = curry(function(a2, b, x2) {
    var diff = b - +a2;
    diff = diff || Infinity;
    return (x2 - a2) / diff;
  });
  var uninterpolateTruncation = curry(function(a2, b, x2) {
    var diff = b - +a2;
    diff = diff || Infinity;
    return Math.max(0, Math.min(1, (x2 - a2) / diff));
  });
  const Arithmetic = {
    rangeStep,
    getDigitCount,
    interpolateNumber,
    uninterpolateNumber,
    uninterpolateTruncation
  };
  function _toConsumableArray$9(arr) {
    return _arrayWithoutHoles$9(arr) || _iterableToArray$a(arr) || _unsupportedIterableToArray$f(arr) || _nonIterableSpread$9();
  }
  __name(_toConsumableArray$9, "_toConsumableArray$9");
  function _nonIterableSpread$9() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableSpread$9, "_nonIterableSpread$9");
  function _iterableToArray$a(iter) {
    if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
  }
  __name(_iterableToArray$a, "_iterableToArray$a");
  function _arrayWithoutHoles$9(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray$f(arr);
  }
  __name(_arrayWithoutHoles$9, "_arrayWithoutHoles$9");
  function _slicedToArray$8(arr, i2) {
    return _arrayWithHoles$9(arr) || _iterableToArrayLimit$8(arr, i2) || _unsupportedIterableToArray$f(arr, i2) || _nonIterableRest$9();
  }
  __name(_slicedToArray$8, "_slicedToArray$8");
  function _nonIterableRest$9() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableRest$9, "_nonIterableRest$9");
  function _unsupportedIterableToArray$f(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$f(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$f(o2, minLen);
  }
  __name(_unsupportedIterableToArray$f, "_unsupportedIterableToArray$f");
  function _arrayLikeToArray$f(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
      arr2[i2] = arr[i2];
    }
    return arr2;
  }
  __name(_arrayLikeToArray$f, "_arrayLikeToArray$f");
  function _iterableToArrayLimit$8(arr, i2) {
    if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
    var _arr = [];
    var _n2 = true;
    var _d = false;
    var _e2 = void 0;
    try {
      for (var _i = arr[Symbol.iterator](), _s; !(_n2 = (_s = _i.next()).done); _n2 = true) {
        _arr.push(_s.value);
        if (i2 && _arr.length === i2) break;
      }
    } catch (err) {
      _d = true;
      _e2 = err;
    } finally {
      try {
        if (!_n2 && _i["return"] != null) _i["return"]();
      } finally {
        if (_d) throw _e2;
      }
    }
    return _arr;
  }
  __name(_iterableToArrayLimit$8, "_iterableToArrayLimit$8");
  function _arrayWithHoles$9(arr) {
    if (Array.isArray(arr)) return arr;
  }
  __name(_arrayWithHoles$9, "_arrayWithHoles$9");
  function getValidInterval(_ref) {
    var _ref2 = _slicedToArray$8(_ref, 2), min2 = _ref2[0], max2 = _ref2[1];
    var validMin = min2, validMax = max2;
    if (min2 > max2) {
      validMin = max2;
      validMax = min2;
    }
    return [validMin, validMax];
  }
  __name(getValidInterval, "getValidInterval");
  function getFormatStep(roughStep, allowDecimals, correctionFactor) {
    if (roughStep.lte(0)) {
      return new Decimal$1(0);
    }
    var digitCount = Arithmetic.getDigitCount(roughStep.toNumber());
    var digitCountValue = new Decimal$1(10).pow(digitCount);
    var stepRatio = roughStep.div(digitCountValue);
    var stepRatioScale = digitCount !== 1 ? 0.05 : 0.1;
    var amendStepRatio = new Decimal$1(Math.ceil(stepRatio.div(stepRatioScale).toNumber())).add(correctionFactor).mul(stepRatioScale);
    var formatStep = amendStepRatio.mul(digitCountValue);
    return allowDecimals ? formatStep : new Decimal$1(Math.ceil(formatStep));
  }
  __name(getFormatStep, "getFormatStep");
  function getTickOfSingleValue(value, tickCount, allowDecimals) {
    var step = 1;
    var middle = new Decimal$1(value);
    if (!middle.isint() && allowDecimals) {
      var absVal = Math.abs(value);
      if (absVal < 1) {
        step = new Decimal$1(10).pow(Arithmetic.getDigitCount(value) - 1);
        middle = new Decimal$1(Math.floor(middle.div(step).toNumber())).mul(step);
      } else if (absVal > 1) {
        middle = new Decimal$1(Math.floor(value));
      }
    } else if (value === 0) {
      middle = new Decimal$1(Math.floor((tickCount - 1) / 2));
    } else if (!allowDecimals) {
      middle = new Decimal$1(Math.floor(value));
    }
    var middleIndex = Math.floor((tickCount - 1) / 2);
    var fn = compose(map(function(n2) {
      return middle.add(new Decimal$1(n2 - middleIndex).mul(step)).toNumber();
    }), range$1);
    return fn(0, tickCount);
  }
  __name(getTickOfSingleValue, "getTickOfSingleValue");
  function calculateStep(min2, max2, tickCount, allowDecimals) {
    var correctionFactor = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0;
    if (!Number.isFinite((max2 - min2) / (tickCount - 1))) {
      return {
        step: new Decimal$1(0),
        tickMin: new Decimal$1(0),
        tickMax: new Decimal$1(0)
      };
    }
    var step = getFormatStep(new Decimal$1(max2).sub(min2).div(tickCount - 1), allowDecimals, correctionFactor);
    var middle;
    if (min2 <= 0 && max2 >= 0) {
      middle = new Decimal$1(0);
    } else {
      middle = new Decimal$1(min2).add(max2).div(2);
      middle = middle.sub(new Decimal$1(middle).mod(step));
    }
    var belowCount = Math.ceil(middle.sub(min2).div(step).toNumber());
    var upCount = Math.ceil(new Decimal$1(max2).sub(middle).div(step).toNumber());
    var scaleCount = belowCount + upCount + 1;
    if (scaleCount > tickCount) {
      return calculateStep(min2, max2, tickCount, allowDecimals, correctionFactor + 1);
    }
    if (scaleCount < tickCount) {
      upCount = max2 > 0 ? upCount + (tickCount - scaleCount) : upCount;
      belowCount = max2 > 0 ? belowCount : belowCount + (tickCount - scaleCount);
    }
    return {
      step,
      tickMin: middle.sub(new Decimal$1(belowCount).mul(step)),
      tickMax: middle.add(new Decimal$1(upCount).mul(step))
    };
  }
  __name(calculateStep, "calculateStep");
  function getNiceTickValuesFn(_ref3) {
    var _ref4 = _slicedToArray$8(_ref3, 2), min2 = _ref4[0], max2 = _ref4[1];
    var tickCount = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 6;
    var allowDecimals = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
    var count2 = Math.max(tickCount, 2);
    var _getValidInterval = getValidInterval([min2, max2]), _getValidInterval2 = _slicedToArray$8(_getValidInterval, 2), cormin = _getValidInterval2[0], cormax = _getValidInterval2[1];
    if (cormin === -Infinity || cormax === Infinity) {
      var _values = cormax === Infinity ? [cormin].concat(_toConsumableArray$9(range$1(0, tickCount - 1).map(function() {
        return Infinity;
      }))) : [].concat(_toConsumableArray$9(range$1(0, tickCount - 1).map(function() {
        return -Infinity;
      })), [cormax]);
      return min2 > max2 ? reverse(_values) : _values;
    }
    if (cormin === cormax) {
      return getTickOfSingleValue(cormin, tickCount, allowDecimals);
    }
    var _calculateStep = calculateStep(cormin, cormax, count2, allowDecimals), step = _calculateStep.step, tickMin = _calculateStep.tickMin, tickMax = _calculateStep.tickMax;
    var values = Arithmetic.rangeStep(tickMin, tickMax.add(new Decimal$1(0.1).mul(step)), step);
    return min2 > max2 ? reverse(values) : values;
  }
  __name(getNiceTickValuesFn, "getNiceTickValuesFn");
  function getTickValuesFixedDomainFn(_ref7, tickCount) {
    var _ref8 = _slicedToArray$8(_ref7, 2), min2 = _ref8[0], max2 = _ref8[1];
    var allowDecimals = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
    var _getValidInterval5 = getValidInterval([min2, max2]), _getValidInterval6 = _slicedToArray$8(_getValidInterval5, 2), cormin = _getValidInterval6[0], cormax = _getValidInterval6[1];
    if (cormin === -Infinity || cormax === Infinity) {
      return [min2, max2];
    }
    if (cormin === cormax) {
      return [cormin];
    }
    var count2 = Math.max(tickCount, 2);
    var step = getFormatStep(new Decimal$1(cormax).sub(cormin).div(count2 - 1), allowDecimals, 0);
    var values = [].concat(_toConsumableArray$9(Arithmetic.rangeStep(new Decimal$1(cormin), new Decimal$1(cormax).sub(new Decimal$1(0.99).mul(step)), step)), [cormax]);
    return min2 > max2 ? reverse(values) : values;
  }
  __name(getTickValuesFixedDomainFn, "getTickValuesFixedDomainFn");
  var getNiceTickValues = memoize$1(getNiceTickValuesFn);
  var getTickValuesFixedDomain = memoize$1(getTickValuesFixedDomainFn);
  var _excluded$d = ["offset", "layout", "width", "dataKey", "data", "dataPointFormatter", "xAxis", "yAxis"];
  function _typeof$z(o2) {
    "@babel/helpers - typeof";
    return _typeof$z = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o22) {
      return typeof o22;
    } : function(o22) {
      return o22 && "function" == typeof Symbol && o22.constructor === Symbol && o22 !== Symbol.prototype ? "symbol" : typeof o22;
    }, _typeof$z(o2);
  }
  __name(_typeof$z, "_typeof$z");
  function _extends$o() {
    _extends$o = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$o.apply(this, arguments);
  }
  __name(_extends$o, "_extends$o");
  function _slicedToArray$7(arr, i2) {
    return _arrayWithHoles$8(arr) || _iterableToArrayLimit$7(arr, i2) || _unsupportedIterableToArray$e(arr, i2) || _nonIterableRest$8();
  }
  __name(_slicedToArray$7, "_slicedToArray$7");
  function _nonIterableRest$8() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableRest$8, "_nonIterableRest$8");
  function _unsupportedIterableToArray$e(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$e(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$e(o2, minLen);
  }
  __name(_unsupportedIterableToArray$e, "_unsupportedIterableToArray$e");
  function _arrayLikeToArray$e(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$e, "_arrayLikeToArray$e");
  function _iterableToArrayLimit$7(r2, l) {
    var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
    if (null != t2) {
      var e, n2, i2, u2, a2 = [], f = true, o2 = false;
      try {
        if (i2 = (t2 = t2.call(r2)).next, 0 === l) ;
        else for (; !(f = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l); f = true) ;
      } catch (r22) {
        o2 = true, n2 = r22;
      } finally {
        try {
          if (!f && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
        } finally {
          if (o2) throw n2;
        }
      }
      return a2;
    }
  }
  __name(_iterableToArrayLimit$7, "_iterableToArrayLimit$7");
  function _arrayWithHoles$8(arr) {
    if (Array.isArray(arr)) return arr;
  }
  __name(_arrayWithHoles$8, "_arrayWithHoles$8");
  function _objectWithoutProperties$d(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$d(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$d, "_objectWithoutProperties$d");
  function _objectWithoutPropertiesLoose$d(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$d, "_objectWithoutPropertiesLoose$d");
  function _classCallCheck$g(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$g, "_classCallCheck$g");
  function _defineProperties$g(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$y(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$g, "_defineProperties$g");
  function _createClass$g(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$g(Constructor.prototype, protoProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$g, "_createClass$g");
  function _callSuper$d(t2, o2, e) {
    return o2 = _getPrototypeOf$e(o2), _possibleConstructorReturn$e(t2, _isNativeReflectConstruct$e() ? Reflect.construct(o2, e || [], _getPrototypeOf$e(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$d, "_callSuper$d");
  function _possibleConstructorReturn$e(self2, call) {
    if (call && (_typeof$z(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$e(self2);
  }
  __name(_possibleConstructorReturn$e, "_possibleConstructorReturn$e");
  function _assertThisInitialized$e(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$e, "_assertThisInitialized$e");
  function _isNativeReflectConstruct$e() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t22) {
    }
    return (_isNativeReflectConstruct$e = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct2"))();
  }
  __name(_isNativeReflectConstruct$e, "_isNativeReflectConstruct$e");
  function _getPrototypeOf$e(o2) {
    _getPrototypeOf$e = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o22) {
      return o22.__proto__ || Object.getPrototypeOf(o22);
    }, "_getPrototypeOf2");
    return _getPrototypeOf$e(o2);
  }
  __name(_getPrototypeOf$e, "_getPrototypeOf$e");
  function _inherits$e(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$e(subClass, superClass);
  }
  __name(_inherits$e, "_inherits$e");
  function _setPrototypeOf$e(o2, p2) {
    _setPrototypeOf$e = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o22, p22) {
      o22.__proto__ = p22;
      return o22;
    }, "_setPrototypeOf2");
    return _setPrototypeOf$e(o2, p2);
  }
  __name(_setPrototypeOf$e, "_setPrototypeOf$e");
  function _defineProperty$y(obj, key, value) {
    key = _toPropertyKey$y(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$y, "_defineProperty$y");
  function _toPropertyKey$y(t2) {
    var i2 = _toPrimitive$y(t2, "string");
    return "symbol" == _typeof$z(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$y, "_toPropertyKey$y");
  function _toPrimitive$y(t2, r2) {
    if ("object" != _typeof$z(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$z(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$y, "_toPrimitive$y");
  var ErrorBar = /* @__PURE__ */ (function(_React$Component) {
    function ErrorBar2() {
      _classCallCheck$g(this, ErrorBar2);
      return _callSuper$d(this, ErrorBar2, arguments);
    }
    __name(ErrorBar2, "ErrorBar2");
    _inherits$e(ErrorBar2, _React$Component);
    return _createClass$g(ErrorBar2, [{
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _this$props = this.props, offset2 = _this$props.offset, layout = _this$props.layout, width = _this$props.width, dataKey = _this$props.dataKey, data = _this$props.data, dataPointFormatter = _this$props.dataPointFormatter, xAxis = _this$props.xAxis, yAxis = _this$props.yAxis, others = _objectWithoutProperties$d(_this$props, _excluded$d);
        var svgProps = filterProps(others, false);
        !!(this.props.direction === "x" && xAxis.type !== "number") ? invariant(false) : void 0;
        var errorBars = data.map(function(entry) {
          var _dataPointFormatter = dataPointFormatter(entry, dataKey), x2 = _dataPointFormatter.x, y2 = _dataPointFormatter.y, value = _dataPointFormatter.value, errorVal = _dataPointFormatter.errorVal;
          if (!errorVal) {
            return null;
          }
          var lineCoordinates = [];
          var lowBound, highBound;
          if (Array.isArray(errorVal)) {
            var _errorVal = _slicedToArray$7(errorVal, 2);
            lowBound = _errorVal[0];
            highBound = _errorVal[1];
          } else {
            lowBound = highBound = errorVal;
          }
          if (layout === "vertical") {
            var scale = xAxis.scale;
            var yMid = y2 + offset2;
            var yMin = yMid + width;
            var yMax = yMid - width;
            var xMin = scale(value - lowBound);
            var xMax = scale(value + highBound);
            lineCoordinates.push({
              x1: xMax,
              y1: yMin,
              x2: xMax,
              y2: yMax
            });
            lineCoordinates.push({
              x1: xMin,
              y1: yMid,
              x2: xMax,
              y2: yMid
            });
            lineCoordinates.push({
              x1: xMin,
              y1: yMin,
              x2: xMin,
              y2: yMax
            });
          } else if (layout === "horizontal") {
            var _scale = yAxis.scale;
            var xMid = x2 + offset2;
            var _xMin = xMid - width;
            var _xMax = xMid + width;
            var _yMin = _scale(value - lowBound);
            var _yMax = _scale(value + highBound);
            lineCoordinates.push({
              x1: _xMin,
              y1: _yMax,
              x2: _xMax,
              y2: _yMax
            });
            lineCoordinates.push({
              x1: xMid,
              y1: _yMin,
              x2: xMid,
              y2: _yMax
            });
            lineCoordinates.push({
              x1: _xMin,
              y1: _yMin,
              x2: _xMax,
              y2: _yMin
            });
          }
          return /* @__PURE__ */ React.createElement(Layer, _extends$o({
            className: "recharts-errorBar",
            key: "bar-".concat(lineCoordinates.map(function(c2) {
              return "".concat(c2.x1, "-").concat(c2.x2, "-").concat(c2.y1, "-").concat(c2.y2);
            }))
          }, svgProps), lineCoordinates.map(function(coordinates) {
            return /* @__PURE__ */ React.createElement("line", _extends$o({}, coordinates, {
              key: "line-".concat(coordinates.x1, "-").concat(coordinates.x2, "-").concat(coordinates.y1, "-").concat(coordinates.y2)
            }));
          }));
        });
        return /* @__PURE__ */ React.createElement(Layer, {
          className: "recharts-errorBars"
        }, errorBars);
      }, "render")
    }]);
  })(React.Component);
  _defineProperty$y(ErrorBar, "defaultProps", {
    stroke: "black",
    strokeWidth: 1.5,
    width: 5,
    offset: 0,
    layout: "horizontal"
  });
  _defineProperty$y(ErrorBar, "displayName", "ErrorBar");
  function _typeof$y(o2) {
    "@babel/helpers - typeof";
    return _typeof$y = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$y(o2);
  }
  __name(_typeof$y, "_typeof$y");
  function ownKeys$u(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$u, "ownKeys$u");
  function _objectSpread$u(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$u(Object(t2), true).forEach(function(r3) {
        _defineProperty$x(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$u(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$u, "_objectSpread$u");
  function _defineProperty$x(obj, key, value) {
    key = _toPropertyKey$x(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$x, "_defineProperty$x");
  function _toPropertyKey$x(t2) {
    var i2 = _toPrimitive$x(t2, "string");
    return "symbol" == _typeof$y(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$x, "_toPropertyKey$x");
  function _toPrimitive$x(t2, r2) {
    if ("object" != _typeof$y(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$y(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$x, "_toPrimitive$x");
  var getLegendProps = /* @__PURE__ */ __name(function getLegendProps2(_ref) {
    var children = _ref.children, formattedGraphicalItems = _ref.formattedGraphicalItems, legendWidth = _ref.legendWidth, legendContent = _ref.legendContent;
    var legendItem = findChildByType(children, Legend);
    if (!legendItem) {
      return null;
    }
    var legendDefaultProps = Legend.defaultProps;
    var legendProps = legendDefaultProps !== void 0 ? _objectSpread$u(_objectSpread$u({}, legendDefaultProps), legendItem.props) : {};
    var legendData;
    if (legendItem.props && legendItem.props.payload) {
      legendData = legendItem.props && legendItem.props.payload;
    } else if (legendContent === "children") {
      legendData = (formattedGraphicalItems || []).reduce(function(result, _ref2) {
        var item = _ref2.item, props = _ref2.props;
        var data = props.sectors || props.data || [];
        return result.concat(data.map(function(entry) {
          return {
            type: legendItem.props.iconType || item.props.legendType,
            value: entry.name,
            color: entry.fill,
            payload: entry
          };
        }));
      }, []);
    } else {
      legendData = (formattedGraphicalItems || []).map(function(_ref3) {
        var item = _ref3.item;
        var itemDefaultProps = item.type.defaultProps;
        var itemProps = itemDefaultProps !== void 0 ? _objectSpread$u(_objectSpread$u({}, itemDefaultProps), item.props) : {};
        var dataKey = itemProps.dataKey, name = itemProps.name, legendType = itemProps.legendType, hide2 = itemProps.hide;
        return {
          inactive: hide2,
          dataKey,
          type: legendProps.iconType || legendType || "square",
          color: getMainColorOfGraphicItem(item),
          value: name || dataKey,
          // @ts-expect-error property strokeDasharray is required in Payload but optional in props
          payload: itemProps
        };
      });
    }
    return _objectSpread$u(_objectSpread$u(_objectSpread$u({}, legendProps), Legend.getWithHeight(legendItem, legendWidth)), {}, {
      payload: legendData,
      item: legendItem
    });
  }, "getLegendProps");
  function _typeof$x(o2) {
    "@babel/helpers - typeof";
    return _typeof$x = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$x(o2);
  }
  __name(_typeof$x, "_typeof$x");
  function _toConsumableArray$8(arr) {
    return _arrayWithoutHoles$8(arr) || _iterableToArray$9(arr) || _unsupportedIterableToArray$d(arr) || _nonIterableSpread$8();
  }
  __name(_toConsumableArray$8, "_toConsumableArray$8");
  function _nonIterableSpread$8() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableSpread$8, "_nonIterableSpread$8");
  function _unsupportedIterableToArray$d(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$d(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$d(o2, minLen);
  }
  __name(_unsupportedIterableToArray$d, "_unsupportedIterableToArray$d");
  function _iterableToArray$9(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  }
  __name(_iterableToArray$9, "_iterableToArray$9");
  function _arrayWithoutHoles$8(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray$d(arr);
  }
  __name(_arrayWithoutHoles$8, "_arrayWithoutHoles$8");
  function _arrayLikeToArray$d(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$d, "_arrayLikeToArray$d");
  function ownKeys$t(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$t, "ownKeys$t");
  function _objectSpread$t(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$t(Object(t2), true).forEach(function(r3) {
        _defineProperty$w(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$t(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$t, "_objectSpread$t");
  function _defineProperty$w(obj, key, value) {
    key = _toPropertyKey$w(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$w, "_defineProperty$w");
  function _toPropertyKey$w(t2) {
    var i2 = _toPrimitive$w(t2, "string");
    return "symbol" == _typeof$x(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$w, "_toPropertyKey$w");
  function _toPrimitive$w(t2, r2) {
    if ("object" != _typeof$x(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$x(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$w, "_toPrimitive$w");
  function getValueByDataKey(obj, dataKey, defaultValue) {
    if (isNil(obj) || isNil(dataKey)) {
      return defaultValue;
    }
    if (isNumOrStr(dataKey)) {
      return get$1(obj, dataKey, defaultValue);
    }
    if (isFunction$2(dataKey)) {
      return dataKey(obj);
    }
    return defaultValue;
  }
  __name(getValueByDataKey, "getValueByDataKey");
  function getDomainOfDataByKey(data, key, type, filterNil) {
    var flattenData = flatMap(data, function(entry) {
      return getValueByDataKey(entry, key);
    });
    if (type === "number") {
      var domain = flattenData.filter(function(entry) {
        return isNumber(entry) || parseFloat(entry);
      });
      return domain.length ? [min(domain), max(domain)] : [Infinity, -Infinity];
    }
    var validateData = filterNil ? flattenData.filter(function(entry) {
      return !isNil(entry);
    }) : flattenData;
    return validateData.map(function(entry) {
      return isNumOrStr(entry) || entry instanceof Date ? entry : "";
    });
  }
  __name(getDomainOfDataByKey, "getDomainOfDataByKey");
  var calculateActiveTickIndex = /* @__PURE__ */ __name(function calculateActiveTickIndex2(coordinate) {
    var _ticks$length;
    var ticks2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
    var unsortedTicks = arguments.length > 2 ? arguments[2] : void 0;
    var axis = arguments.length > 3 ? arguments[3] : void 0;
    var index2 = -1;
    var len = (_ticks$length = ticks2 === null || ticks2 === void 0 ? void 0 : ticks2.length) !== null && _ticks$length !== void 0 ? _ticks$length : 0;
    if (len <= 1) {
      return 0;
    }
    if (axis && axis.axisType === "angleAxis" && Math.abs(Math.abs(axis.range[1] - axis.range[0]) - 360) <= 1e-6) {
      var range2 = axis.range;
      for (var i2 = 0; i2 < len; i2++) {
        var before = i2 > 0 ? unsortedTicks[i2 - 1].coordinate : unsortedTicks[len - 1].coordinate;
        var cur = unsortedTicks[i2].coordinate;
        var after = i2 >= len - 1 ? unsortedTicks[0].coordinate : unsortedTicks[i2 + 1].coordinate;
        var sameDirectionCoord = void 0;
        if (mathSign(cur - before) !== mathSign(after - cur)) {
          var diffInterval = [];
          if (mathSign(after - cur) === mathSign(range2[1] - range2[0])) {
            sameDirectionCoord = after;
            var curInRange = cur + range2[1] - range2[0];
            diffInterval[0] = Math.min(curInRange, (curInRange + before) / 2);
            diffInterval[1] = Math.max(curInRange, (curInRange + before) / 2);
          } else {
            sameDirectionCoord = before;
            var afterInRange = after + range2[1] - range2[0];
            diffInterval[0] = Math.min(cur, (afterInRange + cur) / 2);
            diffInterval[1] = Math.max(cur, (afterInRange + cur) / 2);
          }
          var sameInterval = [Math.min(cur, (sameDirectionCoord + cur) / 2), Math.max(cur, (sameDirectionCoord + cur) / 2)];
          if (coordinate > sameInterval[0] && coordinate <= sameInterval[1] || coordinate >= diffInterval[0] && coordinate <= diffInterval[1]) {
            index2 = unsortedTicks[i2].index;
            break;
          }
        } else {
          var minValue = Math.min(before, after);
          var maxValue = Math.max(before, after);
          if (coordinate > (minValue + cur) / 2 && coordinate <= (maxValue + cur) / 2) {
            index2 = unsortedTicks[i2].index;
            break;
          }
        }
      }
    } else {
      for (var _i = 0; _i < len; _i++) {
        if (_i === 0 && coordinate <= (ticks2[_i].coordinate + ticks2[_i + 1].coordinate) / 2 || _i > 0 && _i < len - 1 && coordinate > (ticks2[_i].coordinate + ticks2[_i - 1].coordinate) / 2 && coordinate <= (ticks2[_i].coordinate + ticks2[_i + 1].coordinate) / 2 || _i === len - 1 && coordinate > (ticks2[_i].coordinate + ticks2[_i - 1].coordinate) / 2) {
          index2 = ticks2[_i].index;
          break;
        }
      }
    }
    return index2;
  }, "calculateActiveTickIndex");
  var getMainColorOfGraphicItem = /* @__PURE__ */ __name(function getMainColorOfGraphicItem2(item) {
    var _item$type;
    var _ref = item, displayName2 = _ref.type.displayName;
    var defaultedProps = (_item$type = item.type) !== null && _item$type !== void 0 && _item$type.defaultProps ? _objectSpread$t(_objectSpread$t({}, item.type.defaultProps), item.props) : item.props;
    var stroke = defaultedProps.stroke, fill = defaultedProps.fill;
    var result;
    switch (displayName2) {
      case "Line":
        result = stroke;
        break;
      case "Area":
      case "Radar":
        result = stroke && stroke !== "none" ? stroke : fill;
        break;
      default:
        result = fill;
        break;
    }
    return result;
  }, "getMainColorOfGraphicItem");
  var getBarSizeList = /* @__PURE__ */ __name(function getBarSizeList2(_ref2) {
    var globalSize = _ref2.barSize, totalSize = _ref2.totalSize, _ref2$stackGroups = _ref2.stackGroups, stackGroups = _ref2$stackGroups === void 0 ? {} : _ref2$stackGroups;
    if (!stackGroups) {
      return {};
    }
    var result = {};
    var numericAxisIds = Object.keys(stackGroups);
    for (var i2 = 0, len = numericAxisIds.length; i2 < len; i2++) {
      var sgs = stackGroups[numericAxisIds[i2]].stackGroups;
      var stackIds = Object.keys(sgs);
      for (var j = 0, sLen = stackIds.length; j < sLen; j++) {
        var _sgs$stackIds$j = sgs[stackIds[j]], items = _sgs$stackIds$j.items, cateAxisId = _sgs$stackIds$j.cateAxisId;
        var barItems = items.filter(function(item) {
          return getDisplayName(item.type).indexOf("Bar") >= 0;
        });
        if (barItems && barItems.length) {
          var barItemDefaultProps = barItems[0].type.defaultProps;
          var barItemProps = barItemDefaultProps !== void 0 ? _objectSpread$t(_objectSpread$t({}, barItemDefaultProps), barItems[0].props) : barItems[0].props;
          var selfSize = barItemProps.barSize;
          var cateId = barItemProps[cateAxisId];
          if (!result[cateId]) {
            result[cateId] = [];
          }
          var barSize = isNil(selfSize) ? globalSize : selfSize;
          result[cateId].push({
            item: barItems[0],
            stackList: barItems.slice(1),
            barSize: isNil(barSize) ? void 0 : getPercentValue(barSize, totalSize, 0)
          });
        }
      }
    }
    return result;
  }, "getBarSizeList");
  var getBarPosition = /* @__PURE__ */ __name(function getBarPosition2(_ref3) {
    var barGap = _ref3.barGap, barCategoryGap = _ref3.barCategoryGap, bandSize = _ref3.bandSize, _ref3$sizeList = _ref3.sizeList, sizeList = _ref3$sizeList === void 0 ? [] : _ref3$sizeList, maxBarSize = _ref3.maxBarSize;
    var len = sizeList.length;
    if (len < 1) return null;
    var realBarGap = getPercentValue(barGap, bandSize, 0, true);
    var result;
    var initialValue = [];
    if (sizeList[0].barSize === +sizeList[0].barSize) {
      var useFull = false;
      var fullBarSize = bandSize / len;
      var sum = sizeList.reduce(function(res, entry) {
        return res + entry.barSize || 0;
      }, 0);
      sum += (len - 1) * realBarGap;
      if (sum >= bandSize) {
        sum -= (len - 1) * realBarGap;
        realBarGap = 0;
      }
      if (sum >= bandSize && fullBarSize > 0) {
        useFull = true;
        fullBarSize *= 0.9;
        sum = len * fullBarSize;
      }
      var offset2 = (bandSize - sum) / 2 >> 0;
      var prev = {
        offset: offset2 - realBarGap,
        size: 0
      };
      result = sizeList.reduce(function(res, entry) {
        var newPosition = {
          item: entry.item,
          position: {
            offset: prev.offset + prev.size + realBarGap,
            // @ts-expect-error the type check above does not check for type number explicitly
            size: useFull ? fullBarSize : entry.barSize
          }
        };
        var newRes = [].concat(_toConsumableArray$8(res), [newPosition]);
        prev = newRes[newRes.length - 1].position;
        if (entry.stackList && entry.stackList.length) {
          entry.stackList.forEach(function(item) {
            newRes.push({
              item,
              position: prev
            });
          });
        }
        return newRes;
      }, initialValue);
    } else {
      var _offset = getPercentValue(barCategoryGap, bandSize, 0, true);
      if (bandSize - 2 * _offset - (len - 1) * realBarGap <= 0) {
        realBarGap = 0;
      }
      var originalSize = (bandSize - 2 * _offset - (len - 1) * realBarGap) / len;
      if (originalSize > 1) {
        originalSize >>= 0;
      }
      var size2 = maxBarSize === +maxBarSize ? Math.min(originalSize, maxBarSize) : originalSize;
      result = sizeList.reduce(function(res, entry, i2) {
        var newRes = [].concat(_toConsumableArray$8(res), [{
          item: entry.item,
          position: {
            offset: _offset + (originalSize + realBarGap) * i2 + (originalSize - size2) / 2,
            size: size2
          }
        }]);
        if (entry.stackList && entry.stackList.length) {
          entry.stackList.forEach(function(item) {
            newRes.push({
              item,
              position: newRes[newRes.length - 1].position
            });
          });
        }
        return newRes;
      }, initialValue);
    }
    return result;
  }, "getBarPosition");
  var appendOffsetOfLegend = /* @__PURE__ */ __name(function appendOffsetOfLegend2(offset2, _unused, props, legendBox) {
    var children = props.children, width = props.width, margin = props.margin;
    var legendWidth = width - (margin.left || 0) - (margin.right || 0);
    var legendProps = getLegendProps({
      children,
      legendWidth
    });
    if (legendProps) {
      var _ref4 = legendBox || {}, boxWidth = _ref4.width, boxHeight = _ref4.height;
      var align = legendProps.align, verticalAlign = legendProps.verticalAlign, layout = legendProps.layout;
      if ((layout === "vertical" || layout === "horizontal" && verticalAlign === "middle") && align !== "center" && isNumber(offset2[align])) {
        return _objectSpread$t(_objectSpread$t({}, offset2), {}, _defineProperty$w({}, align, offset2[align] + (boxWidth || 0)));
      }
      if ((layout === "horizontal" || layout === "vertical" && align === "center") && verticalAlign !== "middle" && isNumber(offset2[verticalAlign])) {
        return _objectSpread$t(_objectSpread$t({}, offset2), {}, _defineProperty$w({}, verticalAlign, offset2[verticalAlign] + (boxHeight || 0)));
      }
    }
    return offset2;
  }, "appendOffsetOfLegend");
  var isErrorBarRelevantForAxis = /* @__PURE__ */ __name(function isErrorBarRelevantForAxis2(layout, axisType, direction) {
    if (isNil(axisType)) {
      return true;
    }
    if (layout === "horizontal") {
      return axisType === "yAxis";
    }
    if (layout === "vertical") {
      return axisType === "xAxis";
    }
    if (direction === "x") {
      return axisType === "xAxis";
    }
    if (direction === "y") {
      return axisType === "yAxis";
    }
    return true;
  }, "isErrorBarRelevantForAxis");
  var getDomainOfErrorBars = /* @__PURE__ */ __name(function getDomainOfErrorBars2(data, item, dataKey, layout, axisType) {
    var children = item.props.children;
    var errorBars = findAllByType(children, ErrorBar).filter(function(errorBarChild) {
      return isErrorBarRelevantForAxis(layout, axisType, errorBarChild.props.direction);
    });
    if (errorBars && errorBars.length) {
      var keys2 = errorBars.map(function(errorBarChild) {
        return errorBarChild.props.dataKey;
      });
      return data.reduce(function(result, entry) {
        var entryValue = getValueByDataKey(entry, dataKey);
        if (isNil(entryValue)) return result;
        var mainValue = Array.isArray(entryValue) ? [min(entryValue), max(entryValue)] : [entryValue, entryValue];
        var errorDomain = keys2.reduce(function(prevErrorArr, k2) {
          var errorValue = getValueByDataKey(entry, k2, 0);
          var lowerValue = mainValue[0] - Math.abs(Array.isArray(errorValue) ? errorValue[0] : errorValue);
          var upperValue = mainValue[1] + Math.abs(Array.isArray(errorValue) ? errorValue[1] : errorValue);
          return [Math.min(lowerValue, prevErrorArr[0]), Math.max(upperValue, prevErrorArr[1])];
        }, [Infinity, -Infinity]);
        return [Math.min(errorDomain[0], result[0]), Math.max(errorDomain[1], result[1])];
      }, [Infinity, -Infinity]);
    }
    return null;
  }, "getDomainOfErrorBars");
  var parseErrorBarsOfAxis = /* @__PURE__ */ __name(function parseErrorBarsOfAxis2(data, items, dataKey, axisType, layout) {
    var domains = items.map(function(item) {
      return getDomainOfErrorBars(data, item, dataKey, layout, axisType);
    }).filter(function(entry) {
      return !isNil(entry);
    });
    if (domains && domains.length) {
      return domains.reduce(function(result, entry) {
        return [Math.min(result[0], entry[0]), Math.max(result[1], entry[1])];
      }, [Infinity, -Infinity]);
    }
    return null;
  }, "parseErrorBarsOfAxis");
  var getDomainOfItemsWithSameAxis = /* @__PURE__ */ __name(function getDomainOfItemsWithSameAxis2(data, items, type, layout, filterNil) {
    var domains = items.map(function(item) {
      var dataKey = item.props.dataKey;
      if (type === "number" && dataKey) {
        return getDomainOfErrorBars(data, item, dataKey, layout) || getDomainOfDataByKey(data, dataKey, type, filterNil);
      }
      return getDomainOfDataByKey(data, dataKey, type, filterNil);
    });
    if (type === "number") {
      return domains.reduce(
        // @ts-expect-error if (type === number) means that the domain is numerical type
        // - but this link is missing in the type definition
        function(result, entry) {
          return [Math.min(result[0], entry[0]), Math.max(result[1], entry[1])];
        },
        [Infinity, -Infinity]
      );
    }
    var tag = {};
    return domains.reduce(function(result, entry) {
      for (var i2 = 0, len = entry.length; i2 < len; i2++) {
        if (!tag[entry[i2]]) {
          tag[entry[i2]] = true;
          result.push(entry[i2]);
        }
      }
      return result;
    }, []);
  }, "getDomainOfItemsWithSameAxis");
  var isCategoricalAxis = /* @__PURE__ */ __name(function isCategoricalAxis2(layout, axisType) {
    return layout === "horizontal" && axisType === "xAxis" || layout === "vertical" && axisType === "yAxis" || layout === "centric" && axisType === "angleAxis" || layout === "radial" && axisType === "radiusAxis";
  }, "isCategoricalAxis");
  var getCoordinatesOfGrid = /* @__PURE__ */ __name(function getCoordinatesOfGrid2(ticks2, minValue, maxValue, syncWithTicks) {
    if (syncWithTicks) {
      return ticks2.map(function(entry) {
        return entry.coordinate;
      });
    }
    var hasMin, hasMax;
    var values = ticks2.map(function(entry) {
      if (entry.coordinate === minValue) {
        hasMin = true;
      }
      if (entry.coordinate === maxValue) {
        hasMax = true;
      }
      return entry.coordinate;
    });
    if (!hasMin) {
      values.push(minValue);
    }
    if (!hasMax) {
      values.push(maxValue);
    }
    return values;
  }, "getCoordinatesOfGrid");
  var getTicksOfAxis = /* @__PURE__ */ __name(function getTicksOfAxis2(axis, isGrid, isAll) {
    if (!axis) return null;
    var scale = axis.scale;
    var duplicateDomain = axis.duplicateDomain, type = axis.type, range2 = axis.range;
    var offsetForBand = axis.realScaleType === "scaleBand" ? scale.bandwidth() / 2 : 2;
    var offset2 = (isGrid || isAll) && type === "category" && scale.bandwidth ? scale.bandwidth() / offsetForBand : 0;
    offset2 = axis.axisType === "angleAxis" && (range2 === null || range2 === void 0 ? void 0 : range2.length) >= 2 ? mathSign(range2[0] - range2[1]) * 2 * offset2 : offset2;
    if (isGrid && (axis.ticks || axis.niceTicks)) {
      var result = (axis.ticks || axis.niceTicks).map(function(entry) {
        var scaleContent = duplicateDomain ? duplicateDomain.indexOf(entry) : entry;
        return {
          // If the scaleContent is not a number, the coordinate will be NaN.
          // That could be the case for example with a PointScale and a string as domain.
          coordinate: scale(scaleContent) + offset2,
          value: entry,
          offset: offset2
        };
      });
      return result.filter(function(row) {
        return !isNan(row.coordinate);
      });
    }
    if (axis.isCategorical && axis.categoricalDomain) {
      return axis.categoricalDomain.map(function(entry, index2) {
        return {
          coordinate: scale(entry) + offset2,
          value: entry,
          index: index2,
          offset: offset2
        };
      });
    }
    if (scale.ticks && !isAll) {
      return scale.ticks(axis.tickCount).map(function(entry) {
        return {
          coordinate: scale(entry) + offset2,
          value: entry,
          offset: offset2
        };
      });
    }
    return scale.domain().map(function(entry, index2) {
      return {
        coordinate: scale(entry) + offset2,
        value: duplicateDomain ? duplicateDomain[entry] : entry,
        index: index2,
        offset: offset2
      };
    });
  }, "getTicksOfAxis");
  var handlerWeakMap = /* @__PURE__ */ new WeakMap();
  var combineEventHandlers = /* @__PURE__ */ __name(function combineEventHandlers2(defaultHandler, childHandler) {
    if (typeof childHandler !== "function") {
      return defaultHandler;
    }
    if (!handlerWeakMap.has(defaultHandler)) {
      handlerWeakMap.set(defaultHandler, /* @__PURE__ */ new WeakMap());
    }
    var childWeakMap = handlerWeakMap.get(defaultHandler);
    if (childWeakMap.has(childHandler)) {
      return childWeakMap.get(childHandler);
    }
    var combineHandler = /* @__PURE__ */ __name(function combineHandler2() {
      defaultHandler.apply(void 0, arguments);
      childHandler.apply(void 0, arguments);
    }, "combineHandler");
    childWeakMap.set(childHandler, combineHandler);
    return combineHandler;
  }, "combineEventHandlers");
  var parseScale = /* @__PURE__ */ __name(function parseScale2(axis, chartType, hasBar) {
    var scale = axis.scale, type = axis.type, layout = axis.layout, axisType = axis.axisType;
    if (scale === "auto") {
      if (layout === "radial" && axisType === "radiusAxis") {
        return {
          scale: band(),
          realScaleType: "band"
        };
      }
      if (layout === "radial" && axisType === "angleAxis") {
        return {
          scale: linear(),
          realScaleType: "linear"
        };
      }
      if (type === "category" && chartType && (chartType.indexOf("LineChart") >= 0 || chartType.indexOf("AreaChart") >= 0 || chartType.indexOf("ComposedChart") >= 0 && !hasBar)) {
        return {
          scale: point(),
          realScaleType: "point"
        };
      }
      if (type === "category") {
        return {
          scale: band(),
          realScaleType: "band"
        };
      }
      return {
        scale: linear(),
        realScaleType: "linear"
      };
    }
    if (isString$1(scale)) {
      var name = "scale".concat(upperFirst(scale));
      return {
        scale: (d3Scales[name] || point)(),
        realScaleType: d3Scales[name] ? name : "point"
      };
    }
    return isFunction$2(scale) ? {
      scale
    } : {
      scale: point(),
      realScaleType: "point"
    };
  }, "parseScale");
  var EPS = 1e-4;
  var checkDomainOfScale = /* @__PURE__ */ __name(function checkDomainOfScale2(scale) {
    var domain = scale.domain();
    if (!domain || domain.length <= 2) {
      return;
    }
    var len = domain.length;
    var range2 = scale.range();
    var minValue = Math.min(range2[0], range2[1]) - EPS;
    var maxValue = Math.max(range2[0], range2[1]) + EPS;
    var first = scale(domain[0]);
    var last2 = scale(domain[len - 1]);
    if (first < minValue || first > maxValue || last2 < minValue || last2 > maxValue) {
      scale.domain([domain[0], domain[len - 1]]);
    }
  }, "checkDomainOfScale");
  var findPositionOfBar = /* @__PURE__ */ __name(function findPositionOfBar2(barPosition, child) {
    if (!barPosition) {
      return null;
    }
    for (var i2 = 0, len = barPosition.length; i2 < len; i2++) {
      if (barPosition[i2].item === child) {
        return barPosition[i2].position;
      }
    }
    return null;
  }, "findPositionOfBar");
  var truncateByDomain = /* @__PURE__ */ __name(function truncateByDomain2(value, domain) {
    if (!domain || domain.length !== 2 || !isNumber(domain[0]) || !isNumber(domain[1])) {
      return value;
    }
    var minValue = Math.min(domain[0], domain[1]);
    var maxValue = Math.max(domain[0], domain[1]);
    var result = [value[0], value[1]];
    if (!isNumber(value[0]) || value[0] < minValue) {
      result[0] = minValue;
    }
    if (!isNumber(value[1]) || value[1] > maxValue) {
      result[1] = maxValue;
    }
    if (result[0] > maxValue) {
      result[0] = maxValue;
    }
    if (result[1] < minValue) {
      result[1] = minValue;
    }
    return result;
  }, "truncateByDomain");
  var offsetSign = /* @__PURE__ */ __name(function offsetSign2(series) {
    var n2 = series.length;
    if (n2 <= 0) {
      return;
    }
    for (var j = 0, m2 = series[0].length; j < m2; ++j) {
      var positive = 0;
      var negative = 0;
      for (var i2 = 0; i2 < n2; ++i2) {
        var value = isNan(series[i2][j][1]) ? series[i2][j][0] : series[i2][j][1];
        if (value >= 0) {
          series[i2][j][0] = positive;
          series[i2][j][1] = positive + value;
          positive = series[i2][j][1];
        } else {
          series[i2][j][0] = negative;
          series[i2][j][1] = negative + value;
          negative = series[i2][j][1];
        }
      }
    }
  }, "offsetSign");
  var offsetPositive = /* @__PURE__ */ __name(function offsetPositive2(series) {
    var n2 = series.length;
    if (n2 <= 0) {
      return;
    }
    for (var j = 0, m2 = series[0].length; j < m2; ++j) {
      var positive = 0;
      for (var i2 = 0; i2 < n2; ++i2) {
        var value = isNan(series[i2][j][1]) ? series[i2][j][0] : series[i2][j][1];
        if (value >= 0) {
          series[i2][j][0] = positive;
          series[i2][j][1] = positive + value;
          positive = series[i2][j][1];
        } else {
          series[i2][j][0] = 0;
          series[i2][j][1] = 0;
        }
      }
    }
  }, "offsetPositive");
  var STACK_OFFSET_MAP = {
    sign: offsetSign,
    // @ts-expect-error definitelytyped types are incorrect
    expand: stackOffsetExpand,
    // @ts-expect-error definitelytyped types are incorrect
    none: stackOffsetNone,
    // @ts-expect-error definitelytyped types are incorrect
    silhouette: stackOffsetSilhouette,
    // @ts-expect-error definitelytyped types are incorrect
    wiggle: stackOffsetWiggle,
    positive: offsetPositive
  };
  var getStackedData = /* @__PURE__ */ __name(function getStackedData2(data, stackItems, offsetType) {
    var dataKeys = stackItems.map(function(item) {
      return item.props.dataKey;
    });
    var offsetAccessor = STACK_OFFSET_MAP[offsetType];
    var stack = shapeStack().keys(dataKeys).value(function(d, key) {
      return +getValueByDataKey(d, key, 0);
    }).order(stackOrderNone).offset(offsetAccessor);
    return stack(data);
  }, "getStackedData");
  var getStackGroupsByAxisId = /* @__PURE__ */ __name(function getStackGroupsByAxisId2(data, _items, numericAxisId, cateAxisId, offsetType, reverseStackOrder) {
    if (!data) {
      return null;
    }
    var items = reverseStackOrder ? _items.reverse() : _items;
    var parentStackGroupsInitialValue = {};
    var stackGroups = items.reduce(function(result, item) {
      var _item$type2;
      var defaultedProps = (_item$type2 = item.type) !== null && _item$type2 !== void 0 && _item$type2.defaultProps ? _objectSpread$t(_objectSpread$t({}, item.type.defaultProps), item.props) : item.props;
      var stackId = defaultedProps.stackId, hide2 = defaultedProps.hide;
      if (hide2) {
        return result;
      }
      var axisId = defaultedProps[numericAxisId];
      var parentGroup = result[axisId] || {
        hasStack: false,
        stackGroups: {}
      };
      if (isNumOrStr(stackId)) {
        var childGroup = parentGroup.stackGroups[stackId] || {
          numericAxisId,
          cateAxisId,
          items: []
        };
        childGroup.items.push(item);
        parentGroup.hasStack = true;
        parentGroup.stackGroups[stackId] = childGroup;
      } else {
        parentGroup.stackGroups[uniqueId("_stackId_")] = {
          numericAxisId,
          cateAxisId,
          items: [item]
        };
      }
      return _objectSpread$t(_objectSpread$t({}, result), {}, _defineProperty$w({}, axisId, parentGroup));
    }, parentStackGroupsInitialValue);
    var axisStackGroupsInitialValue = {};
    return Object.keys(stackGroups).reduce(function(result, axisId) {
      var group = stackGroups[axisId];
      if (group.hasStack) {
        var stackGroupsInitialValue = {};
        group.stackGroups = Object.keys(group.stackGroups).reduce(function(res, stackId) {
          var g = group.stackGroups[stackId];
          return _objectSpread$t(_objectSpread$t({}, res), {}, _defineProperty$w({}, stackId, {
            numericAxisId,
            cateAxisId,
            items: g.items,
            stackedData: getStackedData(data, g.items, offsetType)
          }));
        }, stackGroupsInitialValue);
      }
      return _objectSpread$t(_objectSpread$t({}, result), {}, _defineProperty$w({}, axisId, group));
    }, axisStackGroupsInitialValue);
  }, "getStackGroupsByAxisId");
  var getTicksOfScale = /* @__PURE__ */ __name(function getTicksOfScale2(scale, opts) {
    var realScaleType = opts.realScaleType, type = opts.type, tickCount = opts.tickCount, originalDomain = opts.originalDomain, allowDecimals = opts.allowDecimals;
    var scaleType = realScaleType || opts.scale;
    if (scaleType !== "auto" && scaleType !== "linear") {
      return null;
    }
    if (tickCount && type === "number" && originalDomain && (originalDomain[0] === "auto" || originalDomain[1] === "auto")) {
      var domain = scale.domain();
      if (!domain.length) {
        return null;
      }
      var tickValues = getNiceTickValues(domain, tickCount, allowDecimals);
      scale.domain([min(tickValues), max(tickValues)]);
      return {
        niceTicks: tickValues
      };
    }
    if (tickCount && type === "number") {
      var _domain = scale.domain();
      var _tickValues = getTickValuesFixedDomain(_domain, tickCount, allowDecimals);
      return {
        niceTicks: _tickValues
      };
    }
    return null;
  }, "getTicksOfScale");
  function getCateCoordinateOfLine(_ref5) {
    var axis = _ref5.axis, ticks2 = _ref5.ticks, bandSize = _ref5.bandSize, entry = _ref5.entry, index2 = _ref5.index, dataKey = _ref5.dataKey;
    if (axis.type === "category") {
      if (!axis.allowDuplicatedCategory && axis.dataKey && !isNil(entry[axis.dataKey])) {
        var matchedTick = findEntryInArray(ticks2, "value", entry[axis.dataKey]);
        if (matchedTick) {
          return matchedTick.coordinate + bandSize / 2;
        }
      }
      return ticks2[index2] ? ticks2[index2].coordinate + bandSize / 2 : null;
    }
    var value = getValueByDataKey(entry, !isNil(dataKey) ? dataKey : axis.dataKey);
    return !isNil(value) ? axis.scale(value) : null;
  }
  __name(getCateCoordinateOfLine, "getCateCoordinateOfLine");
  var getCateCoordinateOfBar = /* @__PURE__ */ __name(function getCateCoordinateOfBar2(_ref6) {
    var axis = _ref6.axis, ticks2 = _ref6.ticks, offset2 = _ref6.offset, bandSize = _ref6.bandSize, entry = _ref6.entry, index2 = _ref6.index;
    if (axis.type === "category") {
      return ticks2[index2] ? ticks2[index2].coordinate + offset2 : null;
    }
    var value = getValueByDataKey(entry, axis.dataKey, axis.domain[index2]);
    return !isNil(value) ? axis.scale(value) - bandSize / 2 + offset2 : null;
  }, "getCateCoordinateOfBar");
  var getBaseValueOfBar = /* @__PURE__ */ __name(function getBaseValueOfBar2(_ref7) {
    var numericAxis = _ref7.numericAxis;
    var domain = numericAxis.scale.domain();
    if (numericAxis.type === "number") {
      var minValue = Math.min(domain[0], domain[1]);
      var maxValue = Math.max(domain[0], domain[1]);
      if (minValue <= 0 && maxValue >= 0) {
        return 0;
      }
      if (maxValue < 0) {
        return maxValue;
      }
      return minValue;
    }
    return domain[0];
  }, "getBaseValueOfBar");
  var getStackedDataOfItem = /* @__PURE__ */ __name(function getStackedDataOfItem2(item, stackGroups) {
    var _item$type3;
    var defaultedProps = (_item$type3 = item.type) !== null && _item$type3 !== void 0 && _item$type3.defaultProps ? _objectSpread$t(_objectSpread$t({}, item.type.defaultProps), item.props) : item.props;
    var stackId = defaultedProps.stackId;
    if (isNumOrStr(stackId)) {
      var group = stackGroups[stackId];
      if (group) {
        var itemIndex = group.items.indexOf(item);
        return itemIndex >= 0 ? group.stackedData[itemIndex] : null;
      }
    }
    return null;
  }, "getStackedDataOfItem");
  var getDomainOfSingle = /* @__PURE__ */ __name(function getDomainOfSingle2(data) {
    return data.reduce(function(result, entry) {
      return [min(entry.concat([result[0]]).filter(isNumber)), max(entry.concat([result[1]]).filter(isNumber))];
    }, [Infinity, -Infinity]);
  }, "getDomainOfSingle");
  var getDomainOfStackGroups = /* @__PURE__ */ __name(function getDomainOfStackGroups2(stackGroups, startIndex, endIndex) {
    return Object.keys(stackGroups).reduce(function(result, stackId) {
      var group = stackGroups[stackId];
      var stackedData = group.stackedData;
      var domain = stackedData.reduce(function(res, entry) {
        var s2 = getDomainOfSingle(entry.slice(startIndex, endIndex + 1));
        return [Math.min(res[0], s2[0]), Math.max(res[1], s2[1])];
      }, [Infinity, -Infinity]);
      return [Math.min(domain[0], result[0]), Math.max(domain[1], result[1])];
    }, [Infinity, -Infinity]).map(function(result) {
      return result === Infinity || result === -Infinity ? 0 : result;
    });
  }, "getDomainOfStackGroups");
  var MIN_VALUE_REG = /^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/;
  var MAX_VALUE_REG = /^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/;
  var parseSpecifiedDomain = /* @__PURE__ */ __name(function parseSpecifiedDomain2(specifiedDomain, dataDomain, allowDataOverflow) {
    if (isFunction$2(specifiedDomain)) {
      return specifiedDomain(dataDomain, allowDataOverflow);
    }
    if (!Array.isArray(specifiedDomain)) {
      return dataDomain;
    }
    var domain = [];
    if (isNumber(specifiedDomain[0])) {
      domain[0] = allowDataOverflow ? specifiedDomain[0] : Math.min(specifiedDomain[0], dataDomain[0]);
    } else if (MIN_VALUE_REG.test(specifiedDomain[0])) {
      var value = +MIN_VALUE_REG.exec(specifiedDomain[0])[1];
      domain[0] = dataDomain[0] - value;
    } else if (isFunction$2(specifiedDomain[0])) {
      domain[0] = specifiedDomain[0](dataDomain[0]);
    } else {
      domain[0] = dataDomain[0];
    }
    if (isNumber(specifiedDomain[1])) {
      domain[1] = allowDataOverflow ? specifiedDomain[1] : Math.max(specifiedDomain[1], dataDomain[1]);
    } else if (MAX_VALUE_REG.test(specifiedDomain[1])) {
      var _value = +MAX_VALUE_REG.exec(specifiedDomain[1])[1];
      domain[1] = dataDomain[1] + _value;
    } else if (isFunction$2(specifiedDomain[1])) {
      domain[1] = specifiedDomain[1](dataDomain[1]);
    } else {
      domain[1] = dataDomain[1];
    }
    return domain;
  }, "parseSpecifiedDomain");
  var getBandSizeOfAxis = /* @__PURE__ */ __name(function getBandSizeOfAxis2(axis, ticks2, isBar) {
    if (axis && axis.scale && axis.scale.bandwidth) {
      var bandWidth = axis.scale.bandwidth();
      if (!isBar || bandWidth > 0) {
        return bandWidth;
      }
    }
    if (axis && ticks2 && ticks2.length >= 2) {
      var orderedTicks = sortBy(ticks2, function(o2) {
        return o2.coordinate;
      });
      var bandSize = Infinity;
      for (var i2 = 1, len = orderedTicks.length; i2 < len; i2++) {
        var cur = orderedTicks[i2];
        var prev = orderedTicks[i2 - 1];
        bandSize = Math.min((cur.coordinate || 0) - (prev.coordinate || 0), bandSize);
      }
      return bandSize === Infinity ? 0 : bandSize;
    }
    return isBar ? void 0 : 0;
  }, "getBandSizeOfAxis");
  var parseDomainOfCategoryAxis = /* @__PURE__ */ __name(function parseDomainOfCategoryAxis2(specifiedDomain, calculatedDomain, axisChild) {
    if (!specifiedDomain || !specifiedDomain.length) {
      return calculatedDomain;
    }
    if (isEqual$1(specifiedDomain, get$1(axisChild, "type.defaultProps.domain"))) {
      return calculatedDomain;
    }
    return specifiedDomain;
  }, "parseDomainOfCategoryAxis");
  var getTooltipItem = /* @__PURE__ */ __name(function getTooltipItem2(graphicalItem, payload) {
    var defaultedProps = graphicalItem.type.defaultProps ? _objectSpread$t(_objectSpread$t({}, graphicalItem.type.defaultProps), graphicalItem.props) : graphicalItem.props;
    var dataKey = defaultedProps.dataKey, name = defaultedProps.name, unit2 = defaultedProps.unit, formatter = defaultedProps.formatter, tooltipType = defaultedProps.tooltipType, chartType = defaultedProps.chartType, hide2 = defaultedProps.hide;
    return _objectSpread$t(_objectSpread$t({}, filterProps(graphicalItem, false)), {}, {
      dataKey,
      unit: unit2,
      formatter,
      name: name || dataKey,
      color: getMainColorOfGraphicItem(graphicalItem),
      value: getValueByDataKey(payload, dataKey),
      type: tooltipType,
      payload,
      chartType,
      hide: hide2
    });
  }, "getTooltipItem");
  function _typeof$w(o2) {
    "@babel/helpers - typeof";
    return _typeof$w = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$w(o2);
  }
  __name(_typeof$w, "_typeof$w");
  function ownKeys$s(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$s, "ownKeys$s");
  function _objectSpread$s(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$s(Object(t2), true).forEach(function(r3) {
        _defineProperty$v(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$s(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$s, "_objectSpread$s");
  function _defineProperty$v(obj, key, value) {
    key = _toPropertyKey$v(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$v, "_defineProperty$v");
  function _toPropertyKey$v(t2) {
    var i2 = _toPrimitive$v(t2, "string");
    return "symbol" == _typeof$w(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$v, "_toPropertyKey$v");
  function _toPrimitive$v(t2, r2) {
    if ("object" != _typeof$w(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$w(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$v, "_toPrimitive$v");
  function _slicedToArray$6(arr, i2) {
    return _arrayWithHoles$7(arr) || _iterableToArrayLimit$6(arr, i2) || _unsupportedIterableToArray$c(arr, i2) || _nonIterableRest$7();
  }
  __name(_slicedToArray$6, "_slicedToArray$6");
  function _nonIterableRest$7() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableRest$7, "_nonIterableRest$7");
  function _unsupportedIterableToArray$c(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$c(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$c(o2, minLen);
  }
  __name(_unsupportedIterableToArray$c, "_unsupportedIterableToArray$c");
  function _arrayLikeToArray$c(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$c, "_arrayLikeToArray$c");
  function _iterableToArrayLimit$6(r2, l) {
    var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
    if (null != t2) {
      var e, n2, i2, u2, a2 = [], f = true, o2 = false;
      try {
        if (i2 = (t2 = t2.call(r2)).next, 0 === l) ;
        else for (; !(f = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l); f = true) ;
      } catch (r3) {
        o2 = true, n2 = r3;
      } finally {
        try {
          if (!f && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
        } finally {
          if (o2) throw n2;
        }
      }
      return a2;
    }
  }
  __name(_iterableToArrayLimit$6, "_iterableToArrayLimit$6");
  function _arrayWithHoles$7(arr) {
    if (Array.isArray(arr)) return arr;
  }
  __name(_arrayWithHoles$7, "_arrayWithHoles$7");
  var RADIAN$1 = Math.PI / 180;
  var radianToDegree = /* @__PURE__ */ __name(function radianToDegree2(angleInRadian) {
    return angleInRadian * 180 / Math.PI;
  }, "radianToDegree");
  var polarToCartesian = /* @__PURE__ */ __name(function polarToCartesian2(cx2, cy, radius, angle) {
    return {
      x: cx2 + Math.cos(-RADIAN$1 * angle) * radius,
      y: cy + Math.sin(-RADIAN$1 * angle) * radius
    };
  }, "polarToCartesian");
  var getMaxRadius = /* @__PURE__ */ __name(function getMaxRadius2(width, height) {
    var offset2 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
      top: 0,
      right: 0,
      bottom: 0,
      left: 0
    };
    return Math.min(Math.abs(width - (offset2.left || 0) - (offset2.right || 0)), Math.abs(height - (offset2.top || 0) - (offset2.bottom || 0))) / 2;
  }, "getMaxRadius");
  var formatAxisMap$1 = /* @__PURE__ */ __name(function formatAxisMap2(props, axisMap, offset2, axisType, chartName) {
    var width = props.width, height = props.height;
    var startAngle = props.startAngle, endAngle = props.endAngle;
    var cx2 = getPercentValue(props.cx, width, width / 2);
    var cy = getPercentValue(props.cy, height, height / 2);
    var maxRadius = getMaxRadius(width, height, offset2);
    var innerRadius = getPercentValue(props.innerRadius, maxRadius, 0);
    var outerRadius = getPercentValue(props.outerRadius, maxRadius, maxRadius * 0.8);
    var ids = Object.keys(axisMap);
    return ids.reduce(function(result, id) {
      var axis = axisMap[id];
      var domain = axis.domain, reversed = axis.reversed;
      var range2;
      if (isNil(axis.range)) {
        if (axisType === "angleAxis") {
          range2 = [startAngle, endAngle];
        } else if (axisType === "radiusAxis") {
          range2 = [innerRadius, outerRadius];
        }
        if (reversed) {
          range2 = [range2[1], range2[0]];
        }
      } else {
        range2 = axis.range;
        var _range = range2;
        var _range2 = _slicedToArray$6(_range, 2);
        startAngle = _range2[0];
        endAngle = _range2[1];
      }
      var _parseScale = parseScale(axis, chartName), realScaleType = _parseScale.realScaleType, scale = _parseScale.scale;
      scale.domain(domain).range(range2);
      checkDomainOfScale(scale);
      var ticks2 = getTicksOfScale(scale, _objectSpread$s(_objectSpread$s({}, axis), {}, {
        realScaleType
      }));
      var finalAxis = _objectSpread$s(_objectSpread$s(_objectSpread$s({}, axis), ticks2), {}, {
        range: range2,
        radius: outerRadius,
        realScaleType,
        scale,
        cx: cx2,
        cy,
        innerRadius,
        outerRadius,
        startAngle,
        endAngle
      });
      return _objectSpread$s(_objectSpread$s({}, result), {}, _defineProperty$v({}, id, finalAxis));
    }, {});
  }, "formatAxisMap");
  var distanceBetweenPoints = /* @__PURE__ */ __name(function distanceBetweenPoints2(point2, anotherPoint) {
    var x1 = point2.x, y1 = point2.y;
    var x2 = anotherPoint.x, y2 = anotherPoint.y;
    return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
  }, "distanceBetweenPoints");
  var getAngleOfPoint = /* @__PURE__ */ __name(function getAngleOfPoint2(_ref, _ref2) {
    var x2 = _ref.x, y2 = _ref.y;
    var cx2 = _ref2.cx, cy = _ref2.cy;
    var radius = distanceBetweenPoints({
      x: x2,
      y: y2
    }, {
      x: cx2,
      y: cy
    });
    if (radius <= 0) {
      return {
        radius
      };
    }
    var cos2 = (x2 - cx2) / radius;
    var angleInRadian = Math.acos(cos2);
    if (y2 > cy) {
      angleInRadian = 2 * Math.PI - angleInRadian;
    }
    return {
      radius,
      angle: radianToDegree(angleInRadian),
      angleInRadian
    };
  }, "getAngleOfPoint");
  var formatAngleOfSector = /* @__PURE__ */ __name(function formatAngleOfSector2(_ref3) {
    var startAngle = _ref3.startAngle, endAngle = _ref3.endAngle;
    var startCnt = Math.floor(startAngle / 360);
    var endCnt = Math.floor(endAngle / 360);
    var min2 = Math.min(startCnt, endCnt);
    return {
      startAngle: startAngle - min2 * 360,
      endAngle: endAngle - min2 * 360
    };
  }, "formatAngleOfSector");
  var reverseFormatAngleOfSetor = /* @__PURE__ */ __name(function reverseFormatAngleOfSetor2(angle, _ref4) {
    var startAngle = _ref4.startAngle, endAngle = _ref4.endAngle;
    var startCnt = Math.floor(startAngle / 360);
    var endCnt = Math.floor(endAngle / 360);
    var min2 = Math.min(startCnt, endCnt);
    return angle + min2 * 360;
  }, "reverseFormatAngleOfSetor");
  var inRangeOfSector = /* @__PURE__ */ __name(function inRangeOfSector2(_ref5, sector) {
    var x2 = _ref5.x, y2 = _ref5.y;
    var _getAngleOfPoint = getAngleOfPoint({
      x: x2,
      y: y2
    }, sector), radius = _getAngleOfPoint.radius, angle = _getAngleOfPoint.angle;
    var innerRadius = sector.innerRadius, outerRadius = sector.outerRadius;
    if (radius < innerRadius || radius > outerRadius) {
      return false;
    }
    if (radius === 0) {
      return true;
    }
    var _formatAngleOfSector = formatAngleOfSector(sector), startAngle = _formatAngleOfSector.startAngle, endAngle = _formatAngleOfSector.endAngle;
    var formatAngle = angle;
    var inRange;
    if (startAngle <= endAngle) {
      while (formatAngle > endAngle) {
        formatAngle -= 360;
      }
      while (formatAngle < startAngle) {
        formatAngle += 360;
      }
      inRange = formatAngle >= startAngle && formatAngle <= endAngle;
    } else {
      while (formatAngle > startAngle) {
        formatAngle -= 360;
      }
      while (formatAngle < endAngle) {
        formatAngle += 360;
      }
      inRange = formatAngle >= endAngle && formatAngle <= startAngle;
    }
    if (inRange) {
      return _objectSpread$s(_objectSpread$s({}, sector), {}, {
        radius,
        angle: reverseFormatAngleOfSetor(formatAngle, sector)
      });
    }
    return null;
  }, "inRangeOfSector");
  var getTickClassName = /* @__PURE__ */ __name(function getTickClassName2(tick) {
    return !/* @__PURE__ */ reactExports.isValidElement(tick) && !isFunction$2(tick) && typeof tick !== "boolean" ? tick.className : "";
  }, "getTickClassName");
  function _typeof$v(o2) {
    "@babel/helpers - typeof";
    return _typeof$v = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$v(o2);
  }
  __name(_typeof$v, "_typeof$v");
  var _excluded$c = ["offset"];
  function _toConsumableArray$7(arr) {
    return _arrayWithoutHoles$7(arr) || _iterableToArray$8(arr) || _unsupportedIterableToArray$b(arr) || _nonIterableSpread$7();
  }
  __name(_toConsumableArray$7, "_toConsumableArray$7");
  function _nonIterableSpread$7() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableSpread$7, "_nonIterableSpread$7");
  function _unsupportedIterableToArray$b(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$b(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$b(o2, minLen);
  }
  __name(_unsupportedIterableToArray$b, "_unsupportedIterableToArray$b");
  function _iterableToArray$8(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  }
  __name(_iterableToArray$8, "_iterableToArray$8");
  function _arrayWithoutHoles$7(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray$b(arr);
  }
  __name(_arrayWithoutHoles$7, "_arrayWithoutHoles$7");
  function _arrayLikeToArray$b(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$b, "_arrayLikeToArray$b");
  function _objectWithoutProperties$c(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$c(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$c, "_objectWithoutProperties$c");
  function _objectWithoutPropertiesLoose$c(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$c, "_objectWithoutPropertiesLoose$c");
  function ownKeys$r(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$r, "ownKeys$r");
  function _objectSpread$r(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$r(Object(t2), true).forEach(function(r3) {
        _defineProperty$u(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$r(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$r, "_objectSpread$r");
  function _defineProperty$u(obj, key, value) {
    key = _toPropertyKey$u(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$u, "_defineProperty$u");
  function _toPropertyKey$u(t2) {
    var i2 = _toPrimitive$u(t2, "string");
    return "symbol" == _typeof$v(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$u, "_toPropertyKey$u");
  function _toPrimitive$u(t2, r2) {
    if ("object" != _typeof$v(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$v(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$u, "_toPrimitive$u");
  function _extends$n() {
    _extends$n = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$n.apply(this, arguments);
  }
  __name(_extends$n, "_extends$n");
  var getLabel = /* @__PURE__ */ __name(function getLabel2(props) {
    var value = props.value, formatter = props.formatter;
    var label = isNil(props.children) ? value : props.children;
    if (isFunction$2(formatter)) {
      return formatter(label);
    }
    return label;
  }, "getLabel");
  var getDeltaAngle$1 = /* @__PURE__ */ __name(function getDeltaAngle2(startAngle, endAngle) {
    var sign2 = mathSign(endAngle - startAngle);
    var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 360);
    return sign2 * deltaAngle;
  }, "getDeltaAngle");
  var renderRadialLabel = /* @__PURE__ */ __name(function renderRadialLabel2(labelProps, label, attrs) {
    var position = labelProps.position, viewBox = labelProps.viewBox, offset2 = labelProps.offset, className = labelProps.className;
    var _ref = viewBox, cx2 = _ref.cx, cy = _ref.cy, innerRadius = _ref.innerRadius, outerRadius = _ref.outerRadius, startAngle = _ref.startAngle, endAngle = _ref.endAngle, clockWise = _ref.clockWise;
    var radius = (innerRadius + outerRadius) / 2;
    var deltaAngle = getDeltaAngle$1(startAngle, endAngle);
    var sign2 = deltaAngle >= 0 ? 1 : -1;
    var labelAngle, direction;
    if (position === "insideStart") {
      labelAngle = startAngle + sign2 * offset2;
      direction = clockWise;
    } else if (position === "insideEnd") {
      labelAngle = endAngle - sign2 * offset2;
      direction = !clockWise;
    } else if (position === "end") {
      labelAngle = endAngle + sign2 * offset2;
      direction = clockWise;
    }
    direction = deltaAngle <= 0 ? direction : !direction;
    var startPoint = polarToCartesian(cx2, cy, radius, labelAngle);
    var endPoint = polarToCartesian(cx2, cy, radius, labelAngle + (direction ? 1 : -1) * 359);
    var path = "M".concat(startPoint.x, ",").concat(startPoint.y, "\n    A").concat(radius, ",").concat(radius, ",0,1,").concat(direction ? 0 : 1, ",\n    ").concat(endPoint.x, ",").concat(endPoint.y);
    var id = isNil(labelProps.id) ? uniqueId("recharts-radial-line-") : labelProps.id;
    return /* @__PURE__ */ React.createElement("text", _extends$n({}, attrs, {
      dominantBaseline: "central",
      className: clsx("recharts-radial-bar-label", className)
    }), /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("path", {
      id,
      d: path
    })), /* @__PURE__ */ React.createElement("textPath", {
      xlinkHref: "#".concat(id)
    }, label));
  }, "renderRadialLabel");
  var getAttrsOfPolarLabel = /* @__PURE__ */ __name(function getAttrsOfPolarLabel2(props) {
    var viewBox = props.viewBox, offset2 = props.offset, position = props.position;
    var _ref2 = viewBox, cx2 = _ref2.cx, cy = _ref2.cy, innerRadius = _ref2.innerRadius, outerRadius = _ref2.outerRadius, startAngle = _ref2.startAngle, endAngle = _ref2.endAngle;
    var midAngle = (startAngle + endAngle) / 2;
    if (position === "outside") {
      var _polarToCartesian = polarToCartesian(cx2, cy, outerRadius + offset2, midAngle), _x2 = _polarToCartesian.x, _y = _polarToCartesian.y;
      return {
        x: _x2,
        y: _y,
        textAnchor: _x2 >= cx2 ? "start" : "end",
        verticalAnchor: "middle"
      };
    }
    if (position === "center") {
      return {
        x: cx2,
        y: cy,
        textAnchor: "middle",
        verticalAnchor: "middle"
      };
    }
    if (position === "centerTop") {
      return {
        x: cx2,
        y: cy,
        textAnchor: "middle",
        verticalAnchor: "start"
      };
    }
    if (position === "centerBottom") {
      return {
        x: cx2,
        y: cy,
        textAnchor: "middle",
        verticalAnchor: "end"
      };
    }
    var r2 = (innerRadius + outerRadius) / 2;
    var _polarToCartesian2 = polarToCartesian(cx2, cy, r2, midAngle), x2 = _polarToCartesian2.x, y2 = _polarToCartesian2.y;
    return {
      x: x2,
      y: y2,
      textAnchor: "middle",
      verticalAnchor: "middle"
    };
  }, "getAttrsOfPolarLabel");
  var getAttrsOfCartesianLabel = /* @__PURE__ */ __name(function getAttrsOfCartesianLabel2(props) {
    var viewBox = props.viewBox, parentViewBox = props.parentViewBox, offset2 = props.offset, position = props.position;
    var _ref3 = viewBox, x2 = _ref3.x, y2 = _ref3.y, width = _ref3.width, height = _ref3.height;
    var verticalSign = height >= 0 ? 1 : -1;
    var verticalOffset = verticalSign * offset2;
    var verticalEnd = verticalSign > 0 ? "end" : "start";
    var verticalStart = verticalSign > 0 ? "start" : "end";
    var horizontalSign = width >= 0 ? 1 : -1;
    var horizontalOffset = horizontalSign * offset2;
    var horizontalEnd = horizontalSign > 0 ? "end" : "start";
    var horizontalStart = horizontalSign > 0 ? "start" : "end";
    if (position === "top") {
      var attrs = {
        x: x2 + width / 2,
        y: y2 - verticalSign * offset2,
        textAnchor: "middle",
        verticalAnchor: verticalEnd
      };
      return _objectSpread$r(_objectSpread$r({}, attrs), parentViewBox ? {
        height: Math.max(y2 - parentViewBox.y, 0),
        width
      } : {});
    }
    if (position === "bottom") {
      var _attrs = {
        x: x2 + width / 2,
        y: y2 + height + verticalOffset,
        textAnchor: "middle",
        verticalAnchor: verticalStart
      };
      return _objectSpread$r(_objectSpread$r({}, _attrs), parentViewBox ? {
        height: Math.max(parentViewBox.y + parentViewBox.height - (y2 + height), 0),
        width
      } : {});
    }
    if (position === "left") {
      var _attrs2 = {
        x: x2 - horizontalOffset,
        y: y2 + height / 2,
        textAnchor: horizontalEnd,
        verticalAnchor: "middle"
      };
      return _objectSpread$r(_objectSpread$r({}, _attrs2), parentViewBox ? {
        width: Math.max(_attrs2.x - parentViewBox.x, 0),
        height
      } : {});
    }
    if (position === "right") {
      var _attrs3 = {
        x: x2 + width + horizontalOffset,
        y: y2 + height / 2,
        textAnchor: horizontalStart,
        verticalAnchor: "middle"
      };
      return _objectSpread$r(_objectSpread$r({}, _attrs3), parentViewBox ? {
        width: Math.max(parentViewBox.x + parentViewBox.width - _attrs3.x, 0),
        height
      } : {});
    }
    var sizeAttrs = parentViewBox ? {
      width,
      height
    } : {};
    if (position === "insideLeft") {
      return _objectSpread$r({
        x: x2 + horizontalOffset,
        y: y2 + height / 2,
        textAnchor: horizontalStart,
        verticalAnchor: "middle"
      }, sizeAttrs);
    }
    if (position === "insideRight") {
      return _objectSpread$r({
        x: x2 + width - horizontalOffset,
        y: y2 + height / 2,
        textAnchor: horizontalEnd,
        verticalAnchor: "middle"
      }, sizeAttrs);
    }
    if (position === "insideTop") {
      return _objectSpread$r({
        x: x2 + width / 2,
        y: y2 + verticalOffset,
        textAnchor: "middle",
        verticalAnchor: verticalStart
      }, sizeAttrs);
    }
    if (position === "insideBottom") {
      return _objectSpread$r({
        x: x2 + width / 2,
        y: y2 + height - verticalOffset,
        textAnchor: "middle",
        verticalAnchor: verticalEnd
      }, sizeAttrs);
    }
    if (position === "insideTopLeft") {
      return _objectSpread$r({
        x: x2 + horizontalOffset,
        y: y2 + verticalOffset,
        textAnchor: horizontalStart,
        verticalAnchor: verticalStart
      }, sizeAttrs);
    }
    if (position === "insideTopRight") {
      return _objectSpread$r({
        x: x2 + width - horizontalOffset,
        y: y2 + verticalOffset,
        textAnchor: horizontalEnd,
        verticalAnchor: verticalStart
      }, sizeAttrs);
    }
    if (position === "insideBottomLeft") {
      return _objectSpread$r({
        x: x2 + horizontalOffset,
        y: y2 + height - verticalOffset,
        textAnchor: horizontalStart,
        verticalAnchor: verticalEnd
      }, sizeAttrs);
    }
    if (position === "insideBottomRight") {
      return _objectSpread$r({
        x: x2 + width - horizontalOffset,
        y: y2 + height - verticalOffset,
        textAnchor: horizontalEnd,
        verticalAnchor: verticalEnd
      }, sizeAttrs);
    }
    if (isObject$2(position) && (isNumber(position.x) || isPercent(position.x)) && (isNumber(position.y) || isPercent(position.y))) {
      return _objectSpread$r({
        x: x2 + getPercentValue(position.x, width),
        y: y2 + getPercentValue(position.y, height),
        textAnchor: "end",
        verticalAnchor: "end"
      }, sizeAttrs);
    }
    return _objectSpread$r({
      x: x2 + width / 2,
      y: y2 + height / 2,
      textAnchor: "middle",
      verticalAnchor: "middle"
    }, sizeAttrs);
  }, "getAttrsOfCartesianLabel");
  var isPolar = /* @__PURE__ */ __name(function isPolar2(viewBox) {
    return "cx" in viewBox && isNumber(viewBox.cx);
  }, "isPolar");
  function Label(_ref4) {
    var _ref4$offset = _ref4.offset, offset2 = _ref4$offset === void 0 ? 5 : _ref4$offset, restProps = _objectWithoutProperties$c(_ref4, _excluded$c);
    var props = _objectSpread$r({
      offset: offset2
    }, restProps);
    var viewBox = props.viewBox, position = props.position, value = props.value, children = props.children, content = props.content, _props$className = props.className, className = _props$className === void 0 ? "" : _props$className, textBreakAll = props.textBreakAll;
    if (!viewBox || isNil(value) && isNil(children) && !/* @__PURE__ */ reactExports.isValidElement(content) && !isFunction$2(content)) {
      return null;
    }
    if (/* @__PURE__ */ reactExports.isValidElement(content)) {
      return /* @__PURE__ */ reactExports.cloneElement(content, props);
    }
    var label;
    if (isFunction$2(content)) {
      label = /* @__PURE__ */ reactExports.createElement(content, props);
      if (/* @__PURE__ */ reactExports.isValidElement(label)) {
        return label;
      }
    } else {
      label = getLabel(props);
    }
    var isPolarLabel = isPolar(viewBox);
    var attrs = filterProps(props, true);
    if (isPolarLabel && (position === "insideStart" || position === "insideEnd" || position === "end")) {
      return renderRadialLabel(props, label, attrs);
    }
    var positionAttrs = isPolarLabel ? getAttrsOfPolarLabel(props) : getAttrsOfCartesianLabel(props);
    return /* @__PURE__ */ React.createElement(Text, _extends$n({
      className: clsx("recharts-label", className)
    }, attrs, positionAttrs, {
      breakAll: textBreakAll
    }), label);
  }
  __name(Label, "Label");
  Label.displayName = "Label";
  var parseViewBox = /* @__PURE__ */ __name(function parseViewBox2(props) {
    var cx2 = props.cx, cy = props.cy, angle = props.angle, startAngle = props.startAngle, endAngle = props.endAngle, r2 = props.r, radius = props.radius, innerRadius = props.innerRadius, outerRadius = props.outerRadius, x2 = props.x, y2 = props.y, top = props.top, left = props.left, width = props.width, height = props.height, clockWise = props.clockWise, labelViewBox = props.labelViewBox;
    if (labelViewBox) {
      return labelViewBox;
    }
    if (isNumber(width) && isNumber(height)) {
      if (isNumber(x2) && isNumber(y2)) {
        return {
          x: x2,
          y: y2,
          width,
          height
        };
      }
      if (isNumber(top) && isNumber(left)) {
        return {
          x: top,
          y: left,
          width,
          height
        };
      }
    }
    if (isNumber(x2) && isNumber(y2)) {
      return {
        x: x2,
        y: y2,
        width: 0,
        height: 0
      };
    }
    if (isNumber(cx2) && isNumber(cy)) {
      return {
        cx: cx2,
        cy,
        startAngle: startAngle || angle || 0,
        endAngle: endAngle || angle || 0,
        innerRadius: innerRadius || 0,
        outerRadius: outerRadius || radius || r2 || 0,
        clockWise
      };
    }
    if (props.viewBox) {
      return props.viewBox;
    }
    return {};
  }, "parseViewBox");
  var parseLabel = /* @__PURE__ */ __name(function parseLabel2(label, viewBox) {
    if (!label) {
      return null;
    }
    if (label === true) {
      return /* @__PURE__ */ React.createElement(Label, {
        key: "label-implicit",
        viewBox
      });
    }
    if (isNumOrStr(label)) {
      return /* @__PURE__ */ React.createElement(Label, {
        key: "label-implicit",
        viewBox,
        value: label
      });
    }
    if (/* @__PURE__ */ reactExports.isValidElement(label)) {
      if (label.type === Label) {
        return /* @__PURE__ */ reactExports.cloneElement(label, {
          key: "label-implicit",
          viewBox
        });
      }
      return /* @__PURE__ */ React.createElement(Label, {
        key: "label-implicit",
        content: label,
        viewBox
      });
    }
    if (isFunction$2(label)) {
      return /* @__PURE__ */ React.createElement(Label, {
        key: "label-implicit",
        content: label,
        viewBox
      });
    }
    if (isObject$2(label)) {
      return /* @__PURE__ */ React.createElement(Label, _extends$n({
        viewBox
      }, label, {
        key: "label-implicit"
      }));
    }
    return null;
  }, "parseLabel");
  var renderCallByParent$1 = /* @__PURE__ */ __name(function renderCallByParent2(parentProps, viewBox) {
    var checkPropsLabel = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
    if (!parentProps || !parentProps.children && checkPropsLabel && !parentProps.label) {
      return null;
    }
    var children = parentProps.children;
    var parentViewBox = parseViewBox(parentProps);
    var explicitChildren = findAllByType(children, Label).map(function(child, index2) {
      return /* @__PURE__ */ reactExports.cloneElement(child, {
        viewBox: viewBox || parentViewBox,
        // eslint-disable-next-line react/no-array-index-key
        key: "label-".concat(index2)
      });
    });
    if (!checkPropsLabel) {
      return explicitChildren;
    }
    var implicitLabel = parseLabel(parentProps.label, viewBox || parentViewBox);
    return [implicitLabel].concat(_toConsumableArray$7(explicitChildren));
  }, "renderCallByParent");
  Label.parseViewBox = parseViewBox;
  Label.renderCallByParent = renderCallByParent$1;
  var last_1;
  var hasRequiredLast;
  function requireLast() {
    if (hasRequiredLast) return last_1;
    hasRequiredLast = 1;
    function last2(array2) {
      var length = array2 == null ? 0 : array2.length;
      return length ? array2[length - 1] : void 0;
    }
    __name(last2, "last");
    last_1 = last2;
    return last_1;
  }
  __name(requireLast, "requireLast");
  var lastExports = requireLast();
  const last = /* @__PURE__ */ getDefaultExportFromCjs(lastExports);
  function _typeof$u(o2) {
    "@babel/helpers - typeof";
    return _typeof$u = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$u(o2);
  }
  __name(_typeof$u, "_typeof$u");
  var _excluded$b = ["valueAccessor"], _excluded2$5 = ["data", "dataKey", "clockWise", "id", "textBreakAll"];
  function _toConsumableArray$6(arr) {
    return _arrayWithoutHoles$6(arr) || _iterableToArray$7(arr) || _unsupportedIterableToArray$a(arr) || _nonIterableSpread$6();
  }
  __name(_toConsumableArray$6, "_toConsumableArray$6");
  function _nonIterableSpread$6() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableSpread$6, "_nonIterableSpread$6");
  function _unsupportedIterableToArray$a(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$a(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$a(o2, minLen);
  }
  __name(_unsupportedIterableToArray$a, "_unsupportedIterableToArray$a");
  function _iterableToArray$7(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  }
  __name(_iterableToArray$7, "_iterableToArray$7");
  function _arrayWithoutHoles$6(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray$a(arr);
  }
  __name(_arrayWithoutHoles$6, "_arrayWithoutHoles$6");
  function _arrayLikeToArray$a(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$a, "_arrayLikeToArray$a");
  function _extends$m() {
    _extends$m = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$m.apply(this, arguments);
  }
  __name(_extends$m, "_extends$m");
  function ownKeys$q(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$q, "ownKeys$q");
  function _objectSpread$q(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$q(Object(t2), true).forEach(function(r3) {
        _defineProperty$t(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$q(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$q, "_objectSpread$q");
  function _defineProperty$t(obj, key, value) {
    key = _toPropertyKey$t(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$t, "_defineProperty$t");
  function _toPropertyKey$t(t2) {
    var i2 = _toPrimitive$t(t2, "string");
    return "symbol" == _typeof$u(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$t, "_toPropertyKey$t");
  function _toPrimitive$t(t2, r2) {
    if ("object" != _typeof$u(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$u(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$t, "_toPrimitive$t");
  function _objectWithoutProperties$b(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$b(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$b, "_objectWithoutProperties$b");
  function _objectWithoutPropertiesLoose$b(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$b, "_objectWithoutPropertiesLoose$b");
  var defaultAccessor = /* @__PURE__ */ __name(function defaultAccessor2(entry) {
    return Array.isArray(entry.value) ? last(entry.value) : entry.value;
  }, "defaultAccessor");
  function LabelList(_ref) {
    var _ref$valueAccessor = _ref.valueAccessor, valueAccessor = _ref$valueAccessor === void 0 ? defaultAccessor : _ref$valueAccessor, restProps = _objectWithoutProperties$b(_ref, _excluded$b);
    var data = restProps.data, dataKey = restProps.dataKey, clockWise = restProps.clockWise, id = restProps.id, textBreakAll = restProps.textBreakAll, others = _objectWithoutProperties$b(restProps, _excluded2$5);
    if (!data || !data.length) {
      return null;
    }
    return /* @__PURE__ */ React.createElement(Layer, {
      className: "recharts-label-list"
    }, data.map(function(entry, index2) {
      var value = isNil(dataKey) ? valueAccessor(entry, index2) : getValueByDataKey(entry && entry.payload, dataKey);
      var idProps = isNil(id) ? {} : {
        id: "".concat(id, "-").concat(index2)
      };
      return /* @__PURE__ */ React.createElement(Label, _extends$m({}, filterProps(entry, true), others, idProps, {
        parentViewBox: entry.parentViewBox,
        value,
        textBreakAll,
        viewBox: Label.parseViewBox(isNil(clockWise) ? entry : _objectSpread$q(_objectSpread$q({}, entry), {}, {
          clockWise
        })),
        key: "label-".concat(index2),
        index: index2
      }));
    }));
  }
  __name(LabelList, "LabelList");
  LabelList.displayName = "LabelList";
  function parseLabelList(label, data) {
    if (!label) {
      return null;
    }
    if (label === true) {
      return /* @__PURE__ */ React.createElement(LabelList, {
        key: "labelList-implicit",
        data
      });
    }
    if (/* @__PURE__ */ React.isValidElement(label) || isFunction$2(label)) {
      return /* @__PURE__ */ React.createElement(LabelList, {
        key: "labelList-implicit",
        data,
        content: label
      });
    }
    if (isObject$2(label)) {
      return /* @__PURE__ */ React.createElement(LabelList, _extends$m({
        data
      }, label, {
        key: "labelList-implicit"
      }));
    }
    return null;
  }
  __name(parseLabelList, "parseLabelList");
  function renderCallByParent(parentProps, data) {
    var checkPropsLabel = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
    if (!parentProps || !parentProps.children && checkPropsLabel && !parentProps.label) {
      return null;
    }
    var children = parentProps.children;
    var explicitChildren = findAllByType(children, LabelList).map(function(child, index2) {
      return /* @__PURE__ */ reactExports.cloneElement(child, {
        data,
        // eslint-disable-next-line react/no-array-index-key
        key: "labelList-".concat(index2)
      });
    });
    if (!checkPropsLabel) {
      return explicitChildren;
    }
    var implicitLabelList = parseLabelList(parentProps.label, data);
    return [implicitLabelList].concat(_toConsumableArray$6(explicitChildren));
  }
  __name(renderCallByParent, "renderCallByParent");
  LabelList.renderCallByParent = renderCallByParent;
  function _typeof$t(o2) {
    "@babel/helpers - typeof";
    return _typeof$t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$t(o2);
  }
  __name(_typeof$t, "_typeof$t");
  function _extends$l() {
    _extends$l = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$l.apply(this, arguments);
  }
  __name(_extends$l, "_extends$l");
  function ownKeys$p(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$p, "ownKeys$p");
  function _objectSpread$p(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$p(Object(t2), true).forEach(function(r3) {
        _defineProperty$s(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$p(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$p, "_objectSpread$p");
  function _defineProperty$s(obj, key, value) {
    key = _toPropertyKey$s(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$s, "_defineProperty$s");
  function _toPropertyKey$s(t2) {
    var i2 = _toPrimitive$s(t2, "string");
    return "symbol" == _typeof$t(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$s, "_toPropertyKey$s");
  function _toPrimitive$s(t2, r2) {
    if ("object" != _typeof$t(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$t(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$s, "_toPrimitive$s");
  var getDeltaAngle = /* @__PURE__ */ __name(function getDeltaAngle2(startAngle, endAngle) {
    var sign2 = mathSign(endAngle - startAngle);
    var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 359.999);
    return sign2 * deltaAngle;
  }, "getDeltaAngle");
  var getTangentCircle = /* @__PURE__ */ __name(function getTangentCircle2(_ref) {
    var cx2 = _ref.cx, cy = _ref.cy, radius = _ref.radius, angle = _ref.angle, sign2 = _ref.sign, isExternal = _ref.isExternal, cornerRadius = _ref.cornerRadius, cornerIsExternal = _ref.cornerIsExternal;
    var centerRadius = cornerRadius * (isExternal ? 1 : -1) + radius;
    var theta = Math.asin(cornerRadius / centerRadius) / RADIAN$1;
    var centerAngle = cornerIsExternal ? angle : angle + sign2 * theta;
    var center = polarToCartesian(cx2, cy, centerRadius, centerAngle);
    var circleTangency = polarToCartesian(cx2, cy, radius, centerAngle);
    var lineTangencyAngle = cornerIsExternal ? angle - sign2 * theta : angle;
    var lineTangency = polarToCartesian(cx2, cy, centerRadius * Math.cos(theta * RADIAN$1), lineTangencyAngle);
    return {
      center,
      circleTangency,
      lineTangency,
      theta
    };
  }, "getTangentCircle");
  var getSectorPath = /* @__PURE__ */ __name(function getSectorPath2(_ref2) {
    var cx2 = _ref2.cx, cy = _ref2.cy, innerRadius = _ref2.innerRadius, outerRadius = _ref2.outerRadius, startAngle = _ref2.startAngle, endAngle = _ref2.endAngle;
    var angle = getDeltaAngle(startAngle, endAngle);
    var tempEndAngle = startAngle + angle;
    var outerStartPoint = polarToCartesian(cx2, cy, outerRadius, startAngle);
    var outerEndPoint = polarToCartesian(cx2, cy, outerRadius, tempEndAngle);
    var path = "M ".concat(outerStartPoint.x, ",").concat(outerStartPoint.y, "\n    A ").concat(outerRadius, ",").concat(outerRadius, ",0,\n    ").concat(+(Math.abs(angle) > 180), ",").concat(+(startAngle > tempEndAngle), ",\n    ").concat(outerEndPoint.x, ",").concat(outerEndPoint.y, "\n  ");
    if (innerRadius > 0) {
      var innerStartPoint = polarToCartesian(cx2, cy, innerRadius, startAngle);
      var innerEndPoint = polarToCartesian(cx2, cy, innerRadius, tempEndAngle);
      path += "L ".concat(innerEndPoint.x, ",").concat(innerEndPoint.y, "\n            A ").concat(innerRadius, ",").concat(innerRadius, ",0,\n            ").concat(+(Math.abs(angle) > 180), ",").concat(+(startAngle <= tempEndAngle), ",\n            ").concat(innerStartPoint.x, ",").concat(innerStartPoint.y, " Z");
    } else {
      path += "L ".concat(cx2, ",").concat(cy, " Z");
    }
    return path;
  }, "getSectorPath");
  var getSectorWithCorner = /* @__PURE__ */ __name(function getSectorWithCorner2(_ref3) {
    var cx2 = _ref3.cx, cy = _ref3.cy, innerRadius = _ref3.innerRadius, outerRadius = _ref3.outerRadius, cornerRadius = _ref3.cornerRadius, forceCornerRadius = _ref3.forceCornerRadius, cornerIsExternal = _ref3.cornerIsExternal, startAngle = _ref3.startAngle, endAngle = _ref3.endAngle;
    var sign2 = mathSign(endAngle - startAngle);
    var _getTangentCircle = getTangentCircle({
      cx: cx2,
      cy,
      radius: outerRadius,
      angle: startAngle,
      sign: sign2,
      cornerRadius,
      cornerIsExternal
    }), soct = _getTangentCircle.circleTangency, solt = _getTangentCircle.lineTangency, sot = _getTangentCircle.theta;
    var _getTangentCircle2 = getTangentCircle({
      cx: cx2,
      cy,
      radius: outerRadius,
      angle: endAngle,
      sign: -sign2,
      cornerRadius,
      cornerIsExternal
    }), eoct = _getTangentCircle2.circleTangency, eolt = _getTangentCircle2.lineTangency, eot = _getTangentCircle2.theta;
    var outerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sot - eot;
    if (outerArcAngle < 0) {
      if (forceCornerRadius) {
        return "M ".concat(solt.x, ",").concat(solt.y, "\n        a").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,1,").concat(cornerRadius * 2, ",0\n        a").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,1,").concat(-cornerRadius * 2, ",0\n      ");
      }
      return getSectorPath({
        cx: cx2,
        cy,
        innerRadius,
        outerRadius,
        startAngle,
        endAngle
      });
    }
    var path = "M ".concat(solt.x, ",").concat(solt.y, "\n    A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign2 < 0), ",").concat(soct.x, ",").concat(soct.y, "\n    A").concat(outerRadius, ",").concat(outerRadius, ",0,").concat(+(outerArcAngle > 180), ",").concat(+(sign2 < 0), ",").concat(eoct.x, ",").concat(eoct.y, "\n    A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign2 < 0), ",").concat(eolt.x, ",").concat(eolt.y, "\n  ");
    if (innerRadius > 0) {
      var _getTangentCircle3 = getTangentCircle({
        cx: cx2,
        cy,
        radius: innerRadius,
        angle: startAngle,
        sign: sign2,
        isExternal: true,
        cornerRadius,
        cornerIsExternal
      }), sict = _getTangentCircle3.circleTangency, silt = _getTangentCircle3.lineTangency, sit = _getTangentCircle3.theta;
      var _getTangentCircle4 = getTangentCircle({
        cx: cx2,
        cy,
        radius: innerRadius,
        angle: endAngle,
        sign: -sign2,
        isExternal: true,
        cornerRadius,
        cornerIsExternal
      }), eict = _getTangentCircle4.circleTangency, eilt = _getTangentCircle4.lineTangency, eit = _getTangentCircle4.theta;
      var innerArcAngle = cornerIsExternal ? Math.abs(startAngle - endAngle) : Math.abs(startAngle - endAngle) - sit - eit;
      if (innerArcAngle < 0 && cornerRadius === 0) {
        return "".concat(path, "L").concat(cx2, ",").concat(cy, "Z");
      }
      path += "L".concat(eilt.x, ",").concat(eilt.y, "\n      A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign2 < 0), ",").concat(eict.x, ",").concat(eict.y, "\n      A").concat(innerRadius, ",").concat(innerRadius, ",0,").concat(+(innerArcAngle > 180), ",").concat(+(sign2 > 0), ",").concat(sict.x, ",").concat(sict.y, "\n      A").concat(cornerRadius, ",").concat(cornerRadius, ",0,0,").concat(+(sign2 < 0), ",").concat(silt.x, ",").concat(silt.y, "Z");
    } else {
      path += "L".concat(cx2, ",").concat(cy, "Z");
    }
    return path;
  }, "getSectorWithCorner");
  var defaultProps$3 = {
    cx: 0,
    cy: 0,
    innerRadius: 0,
    outerRadius: 0,
    startAngle: 0,
    endAngle: 0,
    cornerRadius: 0,
    forceCornerRadius: false,
    cornerIsExternal: false
  };
  var Sector = /* @__PURE__ */ __name(function Sector2(sectorProps) {
    var props = _objectSpread$p(_objectSpread$p({}, defaultProps$3), sectorProps);
    var cx2 = props.cx, cy = props.cy, innerRadius = props.innerRadius, outerRadius = props.outerRadius, cornerRadius = props.cornerRadius, forceCornerRadius = props.forceCornerRadius, cornerIsExternal = props.cornerIsExternal, startAngle = props.startAngle, endAngle = props.endAngle, className = props.className;
    if (outerRadius < innerRadius || startAngle === endAngle) {
      return null;
    }
    var layerClass = clsx("recharts-sector", className);
    var deltaRadius = outerRadius - innerRadius;
    var cr = getPercentValue(cornerRadius, deltaRadius, 0, true);
    var path;
    if (cr > 0 && Math.abs(startAngle - endAngle) < 360) {
      path = getSectorWithCorner({
        cx: cx2,
        cy,
        innerRadius,
        outerRadius,
        cornerRadius: Math.min(cr, deltaRadius / 2),
        forceCornerRadius,
        cornerIsExternal,
        startAngle,
        endAngle
      });
    } else {
      path = getSectorPath({
        cx: cx2,
        cy,
        innerRadius,
        outerRadius,
        startAngle,
        endAngle
      });
    }
    return /* @__PURE__ */ React.createElement("path", _extends$l({}, filterProps(props, true), {
      className: layerClass,
      d: path,
      role: "img"
    }));
  }, "Sector");
  function _typeof$s(o2) {
    "@babel/helpers - typeof";
    return _typeof$s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$s(o2);
  }
  __name(_typeof$s, "_typeof$s");
  function _extends$k() {
    _extends$k = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$k.apply(this, arguments);
  }
  __name(_extends$k, "_extends$k");
  function ownKeys$o(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$o, "ownKeys$o");
  function _objectSpread$o(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$o(Object(t2), true).forEach(function(r3) {
        _defineProperty$r(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$o(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$o, "_objectSpread$o");
  function _defineProperty$r(obj, key, value) {
    key = _toPropertyKey$r(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$r, "_defineProperty$r");
  function _toPropertyKey$r(t2) {
    var i2 = _toPrimitive$r(t2, "string");
    return "symbol" == _typeof$s(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$r, "_toPropertyKey$r");
  function _toPrimitive$r(t2, r2) {
    if ("object" != _typeof$s(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$s(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$r, "_toPrimitive$r");
  var CURVE_FACTORIES = {
    curveBasisClosed,
    curveBasisOpen,
    curveBasis,
    curveBumpX: bumpX,
    curveBumpY: bumpY,
    curveLinearClosed,
    curveLinear,
    curveMonotoneX: monotoneX,
    curveMonotoneY: monotoneY,
    curveNatural,
    curveStep,
    curveStepAfter: stepAfter,
    curveStepBefore: stepBefore
  };
  var defined = /* @__PURE__ */ __name(function defined2(p2) {
    return p2.x === +p2.x && p2.y === +p2.y;
  }, "defined");
  var getX = /* @__PURE__ */ __name(function getX2(p2) {
    return p2.x;
  }, "getX");
  var getY = /* @__PURE__ */ __name(function getY2(p2) {
    return p2.y;
  }, "getY");
  var getCurveFactory = /* @__PURE__ */ __name(function getCurveFactory2(type, layout) {
    if (isFunction$2(type)) {
      return type;
    }
    var name = "curve".concat(upperFirst(type));
    if ((name === "curveMonotone" || name === "curveBump") && layout) {
      return CURVE_FACTORIES["".concat(name).concat(layout === "vertical" ? "Y" : "X")];
    }
    return CURVE_FACTORIES[name] || curveLinear;
  }, "getCurveFactory");
  var getPath$1 = /* @__PURE__ */ __name(function getPath2(_ref) {
    var _ref$type = _ref.type, type = _ref$type === void 0 ? "linear" : _ref$type, _ref$points = _ref.points, points = _ref$points === void 0 ? [] : _ref$points, baseLine = _ref.baseLine, layout = _ref.layout, _ref$connectNulls = _ref.connectNulls, connectNulls = _ref$connectNulls === void 0 ? false : _ref$connectNulls;
    var curveFactory = getCurveFactory(type, layout);
    var formatPoints = connectNulls ? points.filter(function(entry) {
      return defined(entry);
    }) : points;
    var lineFunction;
    if (Array.isArray(baseLine)) {
      var formatBaseLine = connectNulls ? baseLine.filter(function(base) {
        return defined(base);
      }) : baseLine;
      var areaPoints = formatPoints.map(function(entry, index2) {
        return _objectSpread$o(_objectSpread$o({}, entry), {}, {
          base: formatBaseLine[index2]
        });
      });
      if (layout === "vertical") {
        lineFunction = shapeArea().y(getY).x1(getX).x0(function(d) {
          return d.base.x;
        });
      } else {
        lineFunction = shapeArea().x(getX).y1(getY).y0(function(d) {
          return d.base.y;
        });
      }
      lineFunction.defined(defined).curve(curveFactory);
      return lineFunction(areaPoints);
    }
    if (layout === "vertical" && isNumber(baseLine)) {
      lineFunction = shapeArea().y(getY).x1(getX).x0(baseLine);
    } else if (isNumber(baseLine)) {
      lineFunction = shapeArea().x(getX).y1(getY).y0(baseLine);
    } else {
      lineFunction = shapeLine().x(getX).y(getY);
    }
    lineFunction.defined(defined).curve(curveFactory);
    return lineFunction(formatPoints);
  }, "getPath");
  var Curve = /* @__PURE__ */ __name(function Curve2(props) {
    var className = props.className, points = props.points, path = props.path, pathRef = props.pathRef;
    if ((!points || !points.length) && !path) {
      return null;
    }
    var realPath = points && points.length ? getPath$1(props) : path;
    return /* @__PURE__ */ reactExports.createElement("path", _extends$k({}, filterProps(props, false), adaptEventHandlers(props), {
      className: clsx("recharts-curve", className),
      d: realPath,
      ref: pathRef
    }));
  }, "Curve");
  var propTypes = { exports: {} };
  var ReactPropTypesSecret_1;
  var hasRequiredReactPropTypesSecret;
  function requireReactPropTypesSecret() {
    if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
    hasRequiredReactPropTypesSecret = 1;
    var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
    ReactPropTypesSecret_1 = ReactPropTypesSecret;
    return ReactPropTypesSecret_1;
  }
  __name(requireReactPropTypesSecret, "requireReactPropTypesSecret");
  var factoryWithThrowingShims;
  var hasRequiredFactoryWithThrowingShims;
  function requireFactoryWithThrowingShims() {
    if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
    hasRequiredFactoryWithThrowingShims = 1;
    var ReactPropTypesSecret = /* @__PURE__ */ requireReactPropTypesSecret();
    function emptyFunction() {
    }
    __name(emptyFunction, "emptyFunction");
    function emptyFunctionWithReset() {
    }
    __name(emptyFunctionWithReset, "emptyFunctionWithReset");
    emptyFunctionWithReset.resetWarningCache = emptyFunction;
    factoryWithThrowingShims = /* @__PURE__ */ __name(function() {
      function shim2(props, propName, componentName, location, propFullName, secret) {
        if (secret === ReactPropTypesSecret) {
          return;
        }
        var err = new Error(
          "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
        );
        err.name = "Invariant Violation";
        throw err;
      }
      __name(shim2, "shim");
      shim2.isRequired = shim2;
      function getShim() {
        return shim2;
      }
      __name(getShim, "getShim");
      var ReactPropTypes = {
        array: shim2,
        bigint: shim2,
        bool: shim2,
        func: shim2,
        number: shim2,
        object: shim2,
        string: shim2,
        symbol: shim2,
        any: shim2,
        arrayOf: getShim,
        element: shim2,
        elementType: shim2,
        instanceOf: getShim,
        node: shim2,
        objectOf: getShim,
        oneOf: getShim,
        oneOfType: getShim,
        shape: getShim,
        exact: getShim,
        checkPropTypes: emptyFunctionWithReset,
        resetWarningCache: emptyFunction
      };
      ReactPropTypes.PropTypes = ReactPropTypes;
      return ReactPropTypes;
    }, "factoryWithThrowingShims");
    return factoryWithThrowingShims;
  }
  __name(requireFactoryWithThrowingShims, "requireFactoryWithThrowingShims");
  var hasRequiredPropTypes;
  function requirePropTypes() {
    if (hasRequiredPropTypes) return propTypes.exports;
    hasRequiredPropTypes = 1;
    {
      propTypes.exports = /* @__PURE__ */ requireFactoryWithThrowingShims()();
    }
    return propTypes.exports;
  }
  __name(requirePropTypes, "requirePropTypes");
  var propTypesExports = /* @__PURE__ */ requirePropTypes();
  const PropTypes = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
  const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
  const { hasOwnProperty: hasOwnProperty$9 } = Object.prototype;
  function combineComparators(comparatorA, comparatorB) {
    return /* @__PURE__ */ __name(function isEqual2(a2, b, state) {
      return comparatorA(a2, b, state) && comparatorB(a2, b, state);
    }, "isEqual");
  }
  __name(combineComparators, "combineComparators");
  function createIsCircular(areItemsEqual) {
    return /* @__PURE__ */ __name(function isCircular(a2, b, state) {
      if (!a2 || !b || typeof a2 !== "object" || typeof b !== "object") {
        return areItemsEqual(a2, b, state);
      }
      const { cache } = state;
      const cachedA = cache.get(a2);
      const cachedB = cache.get(b);
      if (cachedA && cachedB) {
        return cachedA === b && cachedB === a2;
      }
      cache.set(a2, b);
      cache.set(b, a2);
      const result = areItemsEqual(a2, b, state);
      cache.delete(a2);
      cache.delete(b);
      return result;
    }, "isCircular");
  }
  __name(createIsCircular, "createIsCircular");
  function getShortTag(value) {
    return value != null ? value[Symbol.toStringTag] : void 0;
  }
  __name(getShortTag, "getShortTag");
  function getStrictProperties(object2) {
    return getOwnPropertyNames(object2).concat(getOwnPropertySymbols(object2));
  }
  __name(getStrictProperties, "getStrictProperties");
  const hasOwn = (
    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
    Object.hasOwn || ((object2, property) => hasOwnProperty$9.call(object2, property))
  );
  function sameValueZeroEqual(a2, b) {
    return a2 === b || !a2 && !b && a2 !== a2 && b !== b;
  }
  __name(sameValueZeroEqual, "sameValueZeroEqual");
  const PREACT_VNODE = "__v";
  const PREACT_OWNER = "__o";
  const REACT_OWNER = "_owner";
  const { getOwnPropertyDescriptor, keys: keys$1 } = Object;
  function areArrayBuffersEqual(a2, b) {
    return a2.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a2), new Uint8Array(b));
  }
  __name(areArrayBuffersEqual, "areArrayBuffersEqual");
  function areArraysEqual(a2, b, state) {
    let index2 = a2.length;
    if (b.length !== index2) {
      return false;
    }
    while (index2-- > 0) {
      if (!state.equals(a2[index2], b[index2], index2, index2, a2, b, state)) {
        return false;
      }
    }
    return true;
  }
  __name(areArraysEqual, "areArraysEqual");
  function areDataViewsEqual(a2, b) {
    return a2.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a2.buffer, a2.byteOffset, a2.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength));
  }
  __name(areDataViewsEqual, "areDataViewsEqual");
  function areDatesEqual(a2, b) {
    return sameValueZeroEqual(a2.getTime(), b.getTime());
  }
  __name(areDatesEqual, "areDatesEqual");
  function areErrorsEqual(a2, b) {
    return a2.name === b.name && a2.message === b.message && a2.cause === b.cause && a2.stack === b.stack;
  }
  __name(areErrorsEqual, "areErrorsEqual");
  function areFunctionsEqual(a2, b) {
    return a2 === b;
  }
  __name(areFunctionsEqual, "areFunctionsEqual");
  function areMapsEqual(a2, b, state) {
    const size2 = a2.size;
    if (size2 !== b.size) {
      return false;
    }
    if (!size2) {
      return true;
    }
    const matchedIndices = new Array(size2);
    const aIterable = a2.entries();
    let aResult;
    let bResult;
    let index2 = 0;
    while (aResult = aIterable.next()) {
      if (aResult.done) {
        break;
      }
      const bIterable = b.entries();
      let hasMatch = false;
      let matchIndex = 0;
      while (bResult = bIterable.next()) {
        if (bResult.done) {
          break;
        }
        if (matchedIndices[matchIndex]) {
          matchIndex++;
          continue;
        }
        const aEntry = aResult.value;
        const bEntry = bResult.value;
        if (state.equals(aEntry[0], bEntry[0], index2, matchIndex, a2, b, state) && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a2, b, state)) {
          hasMatch = matchedIndices[matchIndex] = true;
          break;
        }
        matchIndex++;
      }
      if (!hasMatch) {
        return false;
      }
      index2++;
    }
    return true;
  }
  __name(areMapsEqual, "areMapsEqual");
  const areNumbersEqual = sameValueZeroEqual;
  function areObjectsEqual(a2, b, state) {
    const properties = keys$1(a2);
    let index2 = properties.length;
    if (keys$1(b).length !== index2) {
      return false;
    }
    while (index2-- > 0) {
      if (!isPropertyEqual(a2, b, state, properties[index2])) {
        return false;
      }
    }
    return true;
  }
  __name(areObjectsEqual, "areObjectsEqual");
  function areObjectsEqualStrict(a2, b, state) {
    const properties = getStrictProperties(a2);
    let index2 = properties.length;
    if (getStrictProperties(b).length !== index2) {
      return false;
    }
    let property;
    let descriptorA;
    let descriptorB;
    while (index2-- > 0) {
      property = properties[index2];
      if (!isPropertyEqual(a2, b, state, property)) {
        return false;
      }
      descriptorA = getOwnPropertyDescriptor(a2, property);
      descriptorB = getOwnPropertyDescriptor(b, property);
      if ((descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)) {
        return false;
      }
    }
    return true;
  }
  __name(areObjectsEqualStrict, "areObjectsEqualStrict");
  function arePrimitiveWrappersEqual(a2, b) {
    return sameValueZeroEqual(a2.valueOf(), b.valueOf());
  }
  __name(arePrimitiveWrappersEqual, "arePrimitiveWrappersEqual");
  function areRegExpsEqual(a2, b) {
    return a2.source === b.source && a2.flags === b.flags;
  }
  __name(areRegExpsEqual, "areRegExpsEqual");
  function areSetsEqual(a2, b, state) {
    const size2 = a2.size;
    if (size2 !== b.size) {
      return false;
    }
    if (!size2) {
      return true;
    }
    const matchedIndices = new Array(size2);
    const aIterable = a2.values();
    let aResult;
    let bResult;
    while (aResult = aIterable.next()) {
      if (aResult.done) {
        break;
      }
      const bIterable = b.values();
      let hasMatch = false;
      let matchIndex = 0;
      while (bResult = bIterable.next()) {
        if (bResult.done) {
          break;
        }
        if (!matchedIndices[matchIndex] && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a2, b, state)) {
          hasMatch = matchedIndices[matchIndex] = true;
          break;
        }
        matchIndex++;
      }
      if (!hasMatch) {
        return false;
      }
    }
    return true;
  }
  __name(areSetsEqual, "areSetsEqual");
  function areTypedArraysEqual(a2, b) {
    let index2 = a2.byteLength;
    if (b.byteLength !== index2 || a2.byteOffset !== b.byteOffset) {
      return false;
    }
    while (index2-- > 0) {
      if (a2[index2] !== b[index2]) {
        return false;
      }
    }
    return true;
  }
  __name(areTypedArraysEqual, "areTypedArraysEqual");
  function areUrlsEqual(a2, b) {
    return a2.hostname === b.hostname && a2.pathname === b.pathname && a2.protocol === b.protocol && a2.port === b.port && a2.hash === b.hash && a2.username === b.username && a2.password === b.password;
  }
  __name(areUrlsEqual, "areUrlsEqual");
  function isPropertyEqual(a2, b, state, property) {
    if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && (a2.$$typeof || b.$$typeof)) {
      return true;
    }
    return hasOwn(b, property) && state.equals(a2[property], b[property], property, property, a2, b, state);
  }
  __name(isPropertyEqual, "isPropertyEqual");
  const ARRAY_BUFFER_TAG = "[object ArrayBuffer]";
  const ARGUMENTS_TAG = "[object Arguments]";
  const BOOLEAN_TAG = "[object Boolean]";
  const DATA_VIEW_TAG = "[object DataView]";
  const DATE_TAG = "[object Date]";
  const ERROR_TAG = "[object Error]";
  const MAP_TAG = "[object Map]";
  const NUMBER_TAG = "[object Number]";
  const OBJECT_TAG = "[object Object]";
  const REG_EXP_TAG = "[object RegExp]";
  const SET_TAG = "[object Set]";
  const STRING_TAG = "[object String]";
  const TYPED_ARRAY_TAGS = {
    "[object Int8Array]": true,
    "[object Uint8Array]": true,
    "[object Uint8ClampedArray]": true,
    "[object Int16Array]": true,
    "[object Uint16Array]": true,
    "[object Int32Array]": true,
    "[object Uint32Array]": true,
    "[object Float16Array]": true,
    "[object Float32Array]": true,
    "[object Float64Array]": true,
    "[object BigInt64Array]": true,
    "[object BigUint64Array]": true
  };
  const URL_TAG = "[object URL]";
  const toString = Object.prototype.toString;
  function createEqualityComparator({ areArrayBuffersEqual: areArrayBuffersEqual2, areArraysEqual: areArraysEqual2, areDataViewsEqual: areDataViewsEqual2, areDatesEqual: areDatesEqual2, areErrorsEqual: areErrorsEqual2, areFunctionsEqual: areFunctionsEqual2, areMapsEqual: areMapsEqual2, areNumbersEqual: areNumbersEqual2, areObjectsEqual: areObjectsEqual2, arePrimitiveWrappersEqual: arePrimitiveWrappersEqual2, areRegExpsEqual: areRegExpsEqual2, areSetsEqual: areSetsEqual2, areTypedArraysEqual: areTypedArraysEqual2, areUrlsEqual: areUrlsEqual2, unknownTagComparators }) {
    return /* @__PURE__ */ __name(function comparator(a2, b, state) {
      if (a2 === b) {
        return true;
      }
      if (a2 == null || b == null) {
        return false;
      }
      const type = typeof a2;
      if (type !== typeof b) {
        return false;
      }
      if (type !== "object") {
        if (type === "number") {
          return areNumbersEqual2(a2, b, state);
        }
        if (type === "function") {
          return areFunctionsEqual2(a2, b, state);
        }
        return false;
      }
      const constructor = a2.constructor;
      if (constructor !== b.constructor) {
        return false;
      }
      if (constructor === Object) {
        return areObjectsEqual2(a2, b, state);
      }
      if (Array.isArray(a2)) {
        return areArraysEqual2(a2, b, state);
      }
      if (constructor === Date) {
        return areDatesEqual2(a2, b, state);
      }
      if (constructor === RegExp) {
        return areRegExpsEqual2(a2, b, state);
      }
      if (constructor === Map) {
        return areMapsEqual2(a2, b, state);
      }
      if (constructor === Set) {
        return areSetsEqual2(a2, b, state);
      }
      const tag = toString.call(a2);
      if (tag === DATE_TAG) {
        return areDatesEqual2(a2, b, state);
      }
      if (tag === REG_EXP_TAG) {
        return areRegExpsEqual2(a2, b, state);
      }
      if (tag === MAP_TAG) {
        return areMapsEqual2(a2, b, state);
      }
      if (tag === SET_TAG) {
        return areSetsEqual2(a2, b, state);
      }
      if (tag === OBJECT_TAG) {
        return typeof a2.then !== "function" && typeof b.then !== "function" && areObjectsEqual2(a2, b, state);
      }
      if (tag === URL_TAG) {
        return areUrlsEqual2(a2, b, state);
      }
      if (tag === ERROR_TAG) {
        return areErrorsEqual2(a2, b, state);
      }
      if (tag === ARGUMENTS_TAG) {
        return areObjectsEqual2(a2, b, state);
      }
      if (TYPED_ARRAY_TAGS[tag]) {
        return areTypedArraysEqual2(a2, b, state);
      }
      if (tag === ARRAY_BUFFER_TAG) {
        return areArrayBuffersEqual2(a2, b, state);
      }
      if (tag === DATA_VIEW_TAG) {
        return areDataViewsEqual2(a2, b, state);
      }
      if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {
        return arePrimitiveWrappersEqual2(a2, b, state);
      }
      if (unknownTagComparators) {
        let unknownTagComparator = unknownTagComparators[tag];
        if (!unknownTagComparator) {
          const shortTag = getShortTag(a2);
          if (shortTag) {
            unknownTagComparator = unknownTagComparators[shortTag];
          }
        }
        if (unknownTagComparator) {
          return unknownTagComparator(a2, b, state);
        }
      }
      return false;
    }, "comparator");
  }
  __name(createEqualityComparator, "createEqualityComparator");
  function createEqualityComparatorConfig({ circular, createCustomConfig, strict }) {
    let config2 = {
      areArrayBuffersEqual,
      areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
      areDataViewsEqual,
      areDatesEqual,
      areErrorsEqual,
      areFunctionsEqual,
      areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
      areNumbersEqual,
      areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
      arePrimitiveWrappersEqual,
      areRegExpsEqual,
      areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
      areTypedArraysEqual: strict ? combineComparators(areTypedArraysEqual, areObjectsEqualStrict) : areTypedArraysEqual,
      areUrlsEqual,
      unknownTagComparators: void 0
    };
    if (createCustomConfig) {
      config2 = Object.assign({}, config2, createCustomConfig(config2));
    }
    if (circular) {
      const areArraysEqual2 = createIsCircular(config2.areArraysEqual);
      const areMapsEqual2 = createIsCircular(config2.areMapsEqual);
      const areObjectsEqual2 = createIsCircular(config2.areObjectsEqual);
      const areSetsEqual2 = createIsCircular(config2.areSetsEqual);
      config2 = Object.assign({}, config2, {
        areArraysEqual: areArraysEqual2,
        areMapsEqual: areMapsEqual2,
        areObjectsEqual: areObjectsEqual2,
        areSetsEqual: areSetsEqual2
      });
    }
    return config2;
  }
  __name(createEqualityComparatorConfig, "createEqualityComparatorConfig");
  function createInternalEqualityComparator(compare) {
    return function(a2, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
      return compare(a2, b, state);
    };
  }
  __name(createInternalEqualityComparator, "createInternalEqualityComparator");
  function createIsEqual({ circular, comparator, createState, equals, strict }) {
    if (createState) {
      return /* @__PURE__ */ __name(function isEqual2(a2, b) {
        const { cache = circular ? /* @__PURE__ */ new WeakMap() : void 0, meta } = createState();
        return comparator(a2, b, {
          cache,
          equals,
          meta,
          strict
        });
      }, "isEqual");
    }
    if (circular) {
      return /* @__PURE__ */ __name(function isEqual2(a2, b) {
        return comparator(a2, b, {
          cache: /* @__PURE__ */ new WeakMap(),
          equals,
          meta: void 0,
          strict
        });
      }, "isEqual");
    }
    const state = {
      cache: void 0,
      equals,
      meta: void 0,
      strict
    };
    return /* @__PURE__ */ __name(function isEqual2(a2, b) {
      return comparator(a2, b, state);
    }, "isEqual");
  }
  __name(createIsEqual, "createIsEqual");
  const deepEqual$1 = createCustomEqual();
  createCustomEqual({ strict: true });
  createCustomEqual({ circular: true });
  createCustomEqual({
    circular: true,
    strict: true
  });
  createCustomEqual({
    createInternalComparator: /* @__PURE__ */ __name(() => sameValueZeroEqual, "createInternalComparator")
  });
  createCustomEqual({
    strict: true,
    createInternalComparator: /* @__PURE__ */ __name(() => sameValueZeroEqual, "createInternalComparator")
  });
  createCustomEqual({
    circular: true,
    createInternalComparator: /* @__PURE__ */ __name(() => sameValueZeroEqual, "createInternalComparator")
  });
  createCustomEqual({
    circular: true,
    createInternalComparator: /* @__PURE__ */ __name(() => sameValueZeroEqual, "createInternalComparator"),
    strict: true
  });
  function createCustomEqual(options2 = {}) {
    const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false } = options2;
    const config2 = createEqualityComparatorConfig(options2);
    const comparator = createEqualityComparator(config2);
    const equals = createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator);
    return createIsEqual({ circular, comparator, createState, equals, strict });
  }
  __name(createCustomEqual, "createCustomEqual");
  function safeRequestAnimationFrame(callback) {
    if (typeof requestAnimationFrame !== "undefined") requestAnimationFrame(callback);
  }
  __name(safeRequestAnimationFrame, "safeRequestAnimationFrame");
  function setRafTimeout(callback) {
    var timeout = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
    var currTime = -1;
    var shouldUpdate = /* @__PURE__ */ __name(function shouldUpdate2(now) {
      if (currTime < 0) {
        currTime = now;
      }
      if (now - currTime > timeout) {
        callback(now);
        currTime = -1;
      } else {
        safeRequestAnimationFrame(shouldUpdate2);
      }
    }, "shouldUpdate");
    requestAnimationFrame(shouldUpdate);
  }
  __name(setRafTimeout, "setRafTimeout");
  function _typeof$r(o2) {
    "@babel/helpers - typeof";
    return _typeof$r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$r(o2);
  }
  __name(_typeof$r, "_typeof$r");
  function _toArray(arr) {
    return _arrayWithHoles$6(arr) || _iterableToArray$6(arr) || _unsupportedIterableToArray$9(arr) || _nonIterableRest$6();
  }
  __name(_toArray, "_toArray");
  function _nonIterableRest$6() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableRest$6, "_nonIterableRest$6");
  function _unsupportedIterableToArray$9(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$9(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$9(o2, minLen);
  }
  __name(_unsupportedIterableToArray$9, "_unsupportedIterableToArray$9");
  function _arrayLikeToArray$9(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$9, "_arrayLikeToArray$9");
  function _iterableToArray$6(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  }
  __name(_iterableToArray$6, "_iterableToArray$6");
  function _arrayWithHoles$6(arr) {
    if (Array.isArray(arr)) return arr;
  }
  __name(_arrayWithHoles$6, "_arrayWithHoles$6");
  function createAnimateManager() {
    var currStyle = {};
    var handleChange = /* @__PURE__ */ __name(function handleChange2() {
      return null;
    }, "handleChange");
    var shouldStop = false;
    var setStyle = /* @__PURE__ */ __name(function setStyle2(_style) {
      if (shouldStop) {
        return;
      }
      if (Array.isArray(_style)) {
        if (!_style.length) {
          return;
        }
        var styles = _style;
        var _styles = _toArray(styles), curr = _styles[0], restStyles = _styles.slice(1);
        if (typeof curr === "number") {
          setRafTimeout(setStyle2.bind(null, restStyles), curr);
          return;
        }
        setStyle2(curr);
        setRafTimeout(setStyle2.bind(null, restStyles));
        return;
      }
      if (_typeof$r(_style) === "object") {
        currStyle = _style;
        handleChange(currStyle);
      }
      if (typeof _style === "function") {
        _style();
      }
    }, "setStyle");
    return {
      stop: /* @__PURE__ */ __name(function stop() {
        shouldStop = true;
      }, "stop"),
      start: /* @__PURE__ */ __name(function start(style) {
        shouldStop = false;
        setStyle(style);
      }, "start"),
      subscribe: /* @__PURE__ */ __name(function subscribe2(_handleChange) {
        handleChange = _handleChange;
        return function() {
          handleChange = /* @__PURE__ */ __name(function handleChange2() {
            return null;
          }, "handleChange");
        };
      }, "subscribe")
    };
  }
  __name(createAnimateManager, "createAnimateManager");
  function _typeof$q(o2) {
    "@babel/helpers - typeof";
    return _typeof$q = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o22) {
      return typeof o22;
    } : function(o22) {
      return o22 && "function" == typeof Symbol && o22.constructor === Symbol && o22 !== Symbol.prototype ? "symbol" : typeof o22;
    }, _typeof$q(o2);
  }
  __name(_typeof$q, "_typeof$q");
  function ownKeys$n(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r22) {
        return Object.getOwnPropertyDescriptor(e, r22).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$n, "ownKeys$n");
  function _objectSpread$n(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$n(Object(t2), true).forEach(function(r22) {
        _defineProperty$q(e, r22, t2[r22]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$n(Object(t2)).forEach(function(r22) {
        Object.defineProperty(e, r22, Object.getOwnPropertyDescriptor(t2, r22));
      });
    }
    return e;
  }
  __name(_objectSpread$n, "_objectSpread$n");
  function _defineProperty$q(obj, key, value) {
    key = _toPropertyKey$q(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$q, "_defineProperty$q");
  function _toPropertyKey$q(arg) {
    var key = _toPrimitive$q(arg, "string");
    return _typeof$q(key) === "symbol" ? key : String(key);
  }
  __name(_toPropertyKey$q, "_toPropertyKey$q");
  function _toPrimitive$q(input, hint) {
    if (_typeof$q(input) !== "object" || input === null) return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint);
      if (_typeof$q(res) !== "object") return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  __name(_toPrimitive$q, "_toPrimitive$q");
  var getIntersectionKeys = /* @__PURE__ */ __name(function getIntersectionKeys2(preObj, nextObj) {
    return [Object.keys(preObj), Object.keys(nextObj)].reduce(function(a2, b) {
      return a2.filter(function(c2) {
        return b.includes(c2);
      });
    });
  }, "getIntersectionKeys2");
  var identity$1 = /* @__PURE__ */ __name(function identity2(param) {
    return param;
  }, "identity2");
  var getDashCase = /* @__PURE__ */ __name(function getDashCase2(name) {
    return name.replace(/([A-Z])/g, function(v) {
      return "-".concat(v.toLowerCase());
    });
  }, "getDashCase2");
  var mapObject = /* @__PURE__ */ __name(function mapObject2(fn, obj) {
    return Object.keys(obj).reduce(function(res, key) {
      return _objectSpread$n(_objectSpread$n({}, res), {}, _defineProperty$q({}, key, fn(key, obj[key])));
    }, {});
  }, "mapObject2");
  var getTransitionVal = /* @__PURE__ */ __name(function getTransitionVal2(props, duration, easing) {
    return props.map(function(prop) {
      return "".concat(getDashCase(prop), " ").concat(duration, "ms ").concat(easing);
    }).join(",");
  }, "getTransitionVal2");
  function _slicedToArray$5(arr, i2) {
    return _arrayWithHoles$5(arr) || _iterableToArrayLimit$5(arr, i2) || _unsupportedIterableToArray$8(arr, i2) || _nonIterableRest$5();
  }
  __name(_slicedToArray$5, "_slicedToArray$5");
  function _nonIterableRest$5() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableRest$5, "_nonIterableRest$5");
  function _iterableToArrayLimit$5(r2, l) {
    var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
    if (null != t2) {
      var e, n2, i2, u2, a2 = [], f = true, o2 = false;
      try {
        if (i2 = (t2 = t2.call(r2)).next, 0 === l) ;
        else for (; !(f = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l); f = true) ;
      } catch (r3) {
        o2 = true, n2 = r3;
      } finally {
        try {
          if (!f && null != t2.return && (u2 = t2.return(), Object(u2) !== u2)) return;
        } finally {
          if (o2) throw n2;
        }
      }
      return a2;
    }
  }
  __name(_iterableToArrayLimit$5, "_iterableToArrayLimit$5");
  function _arrayWithHoles$5(arr) {
    if (Array.isArray(arr)) return arr;
  }
  __name(_arrayWithHoles$5, "_arrayWithHoles$5");
  function _toConsumableArray$5(arr) {
    return _arrayWithoutHoles$5(arr) || _iterableToArray$5(arr) || _unsupportedIterableToArray$8(arr) || _nonIterableSpread$5();
  }
  __name(_toConsumableArray$5, "_toConsumableArray$5");
  function _nonIterableSpread$5() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableSpread$5, "_nonIterableSpread$5");
  function _unsupportedIterableToArray$8(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$8(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$8(o2, minLen);
  }
  __name(_unsupportedIterableToArray$8, "_unsupportedIterableToArray$8");
  function _iterableToArray$5(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  }
  __name(_iterableToArray$5, "_iterableToArray$5");
  function _arrayWithoutHoles$5(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray$8(arr);
  }
  __name(_arrayWithoutHoles$5, "_arrayWithoutHoles$5");
  function _arrayLikeToArray$8(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$8, "_arrayLikeToArray$8");
  var ACCURACY = 1e-4;
  var cubicBezierFactor = /* @__PURE__ */ __name(function cubicBezierFactor2(c1, c2) {
    return [0, 3 * c1, 3 * c2 - 6 * c1, 3 * c1 - 3 * c2 + 1];
  }, "cubicBezierFactor");
  var multyTime = /* @__PURE__ */ __name(function multyTime2(params, t2) {
    return params.map(function(param, i2) {
      return param * Math.pow(t2, i2);
    }).reduce(function(pre, curr) {
      return pre + curr;
    });
  }, "multyTime");
  var cubicBezier = /* @__PURE__ */ __name(function cubicBezier2(c1, c2) {
    return function(t2) {
      var params = cubicBezierFactor(c1, c2);
      return multyTime(params, t2);
    };
  }, "cubicBezier");
  var derivativeCubicBezier = /* @__PURE__ */ __name(function derivativeCubicBezier2(c1, c2) {
    return function(t2) {
      var params = cubicBezierFactor(c1, c2);
      var newParams = [].concat(_toConsumableArray$5(params.map(function(param, i2) {
        return param * i2;
      }).slice(1)), [0]);
      return multyTime(newParams, t2);
    };
  }, "derivativeCubicBezier");
  var configBezier = /* @__PURE__ */ __name(function configBezier2() {
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    var x1 = args[0], y1 = args[1], x2 = args[2], y2 = args[3];
    if (args.length === 1) {
      switch (args[0]) {
        case "linear":
          x1 = 0;
          y1 = 0;
          x2 = 1;
          y2 = 1;
          break;
        case "ease":
          x1 = 0.25;
          y1 = 0.1;
          x2 = 0.25;
          y2 = 1;
          break;
        case "ease-in":
          x1 = 0.42;
          y1 = 0;
          x2 = 1;
          y2 = 1;
          break;
        case "ease-out":
          x1 = 0.42;
          y1 = 0;
          x2 = 0.58;
          y2 = 1;
          break;
        case "ease-in-out":
          x1 = 0;
          y1 = 0;
          x2 = 0.58;
          y2 = 1;
          break;
        default: {
          var easing = args[0].split("(");
          if (easing[0] === "cubic-bezier" && easing[1].split(")")[0].split(",").length === 4) {
            var _easing$1$split$0$spl = easing[1].split(")")[0].split(",").map(function(x3) {
              return parseFloat(x3);
            });
            var _easing$1$split$0$spl2 = _slicedToArray$5(_easing$1$split$0$spl, 4);
            x1 = _easing$1$split$0$spl2[0];
            y1 = _easing$1$split$0$spl2[1];
            x2 = _easing$1$split$0$spl2[2];
            y2 = _easing$1$split$0$spl2[3];
          }
        }
      }
    }
    var curveX = cubicBezier(x1, x2);
    var curveY = cubicBezier(y1, y2);
    var derCurveX = derivativeCubicBezier(x1, x2);
    var rangeValue = /* @__PURE__ */ __name(function rangeValue2(value) {
      if (value > 1) {
        return 1;
      }
      if (value < 0) {
        return 0;
      }
      return value;
    }, "rangeValue");
    var bezier = /* @__PURE__ */ __name(function bezier2(_t) {
      var t2 = _t > 1 ? 1 : _t;
      var x3 = t2;
      for (var i2 = 0; i2 < 8; ++i2) {
        var evalT = curveX(x3) - t2;
        var derVal = derCurveX(x3);
        if (Math.abs(evalT - t2) < ACCURACY || derVal < ACCURACY) {
          return curveY(x3);
        }
        x3 = rangeValue(x3 - evalT / derVal);
      }
      return curveY(x3);
    }, "bezier");
    bezier.isStepper = false;
    return bezier;
  }, "configBezier");
  var configSpring = /* @__PURE__ */ __name(function configSpring2() {
    var config2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    var _config$stiff = config2.stiff, stiff = _config$stiff === void 0 ? 100 : _config$stiff, _config$damping = config2.damping, damping = _config$damping === void 0 ? 8 : _config$damping, _config$dt = config2.dt, dt = _config$dt === void 0 ? 17 : _config$dt;
    var stepper = /* @__PURE__ */ __name(function stepper2(currX, destX, currV) {
      var FSpring = -(currX - destX) * stiff;
      var FDamping = currV * damping;
      var newV = currV + (FSpring - FDamping) * dt / 1e3;
      var newX = currV * dt / 1e3 + currX;
      if (Math.abs(newX - destX) < ACCURACY && Math.abs(newV) < ACCURACY) {
        return [destX, 0];
      }
      return [newX, newV];
    }, "stepper");
    stepper.isStepper = true;
    stepper.dt = dt;
    return stepper;
  }, "configSpring");
  var configEasing = /* @__PURE__ */ __name(function configEasing2() {
    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
      args[_key2] = arguments[_key2];
    }
    var easing = args[0];
    if (typeof easing === "string") {
      switch (easing) {
        case "ease":
        case "ease-in-out":
        case "ease-out":
        case "ease-in":
        case "linear":
          return configBezier(easing);
        case "spring":
          return configSpring();
        default:
          if (easing.split("(")[0] === "cubic-bezier") {
            return configBezier(easing);
          }
      }
    }
    if (typeof easing === "function") {
      return easing;
    }
    return null;
  }, "configEasing");
  function _typeof$p(o2) {
    "@babel/helpers - typeof";
    return _typeof$p = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$p(o2);
  }
  __name(_typeof$p, "_typeof$p");
  function _toConsumableArray$4(arr) {
    return _arrayWithoutHoles$4(arr) || _iterableToArray$4(arr) || _unsupportedIterableToArray$7(arr) || _nonIterableSpread$4();
  }
  __name(_toConsumableArray$4, "_toConsumableArray$4");
  function _nonIterableSpread$4() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableSpread$4, "_nonIterableSpread$4");
  function _iterableToArray$4(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  }
  __name(_iterableToArray$4, "_iterableToArray$4");
  function _arrayWithoutHoles$4(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray$7(arr);
  }
  __name(_arrayWithoutHoles$4, "_arrayWithoutHoles$4");
  function ownKeys$m(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$m, "ownKeys$m");
  function _objectSpread$m(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$m(Object(t2), true).forEach(function(r3) {
        _defineProperty$p(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$m(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$m, "_objectSpread$m");
  function _defineProperty$p(obj, key, value) {
    key = _toPropertyKey$p(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$p, "_defineProperty$p");
  function _toPropertyKey$p(arg) {
    var key = _toPrimitive$p(arg, "string");
    return _typeof$p(key) === "symbol" ? key : String(key);
  }
  __name(_toPropertyKey$p, "_toPropertyKey$p");
  function _toPrimitive$p(input, hint) {
    if (_typeof$p(input) !== "object" || input === null) return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint);
      if (_typeof$p(res) !== "object") return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  __name(_toPrimitive$p, "_toPrimitive$p");
  function _slicedToArray$4(arr, i2) {
    return _arrayWithHoles$4(arr) || _iterableToArrayLimit$4(arr, i2) || _unsupportedIterableToArray$7(arr, i2) || _nonIterableRest$4();
  }
  __name(_slicedToArray$4, "_slicedToArray$4");
  function _nonIterableRest$4() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableRest$4, "_nonIterableRest$4");
  function _unsupportedIterableToArray$7(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$7(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$7(o2, minLen);
  }
  __name(_unsupportedIterableToArray$7, "_unsupportedIterableToArray$7");
  function _arrayLikeToArray$7(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$7, "_arrayLikeToArray$7");
  function _iterableToArrayLimit$4(r2, l) {
    var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
    if (null != t2) {
      var e, n2, i2, u2, a2 = [], f = true, o2 = false;
      try {
        if (i2 = (t2 = t2.call(r2)).next, 0 === l) ;
        else for (; !(f = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l); f = true) ;
      } catch (r3) {
        o2 = true, n2 = r3;
      } finally {
        try {
          if (!f && null != t2.return && (u2 = t2.return(), Object(u2) !== u2)) return;
        } finally {
          if (o2) throw n2;
        }
      }
      return a2;
    }
  }
  __name(_iterableToArrayLimit$4, "_iterableToArrayLimit$4");
  function _arrayWithHoles$4(arr) {
    if (Array.isArray(arr)) return arr;
  }
  __name(_arrayWithHoles$4, "_arrayWithHoles$4");
  var alpha = /* @__PURE__ */ __name(function alpha2(begin, end, k2) {
    return begin + (end - begin) * k2;
  }, "alpha");
  var needContinue = /* @__PURE__ */ __name(function needContinue2(_ref) {
    var from = _ref.from, to = _ref.to;
    return from !== to;
  }, "needContinue");
  var calStepperVals = /* @__PURE__ */ __name(function calStepperVals2(easing, preVals, steps) {
    var nextStepVals = mapObject(function(key, val) {
      if (needContinue(val)) {
        var _easing = easing(val.from, val.to, val.velocity), _easing2 = _slicedToArray$4(_easing, 2), newX = _easing2[0], newV = _easing2[1];
        return _objectSpread$m(_objectSpread$m({}, val), {}, {
          from: newX,
          velocity: newV
        });
      }
      return val;
    }, preVals);
    if (steps < 1) {
      return mapObject(function(key, val) {
        if (needContinue(val)) {
          return _objectSpread$m(_objectSpread$m({}, val), {}, {
            velocity: alpha(val.velocity, nextStepVals[key].velocity, steps),
            from: alpha(val.from, nextStepVals[key].from, steps)
          });
        }
        return val;
      }, preVals);
    }
    return calStepperVals2(easing, nextStepVals, steps - 1);
  }, "calStepperVals");
  const configUpdate = /* @__PURE__ */ __name((function(from, to, easing, duration, render) {
    var interKeys = getIntersectionKeys(from, to);
    var timingStyle = interKeys.reduce(function(res, key) {
      return _objectSpread$m(_objectSpread$m({}, res), {}, _defineProperty$p({}, key, [from[key], to[key]]));
    }, {});
    var stepperStyle = interKeys.reduce(function(res, key) {
      return _objectSpread$m(_objectSpread$m({}, res), {}, _defineProperty$p({}, key, {
        from: from[key],
        velocity: 0,
        to: to[key]
      }));
    }, {});
    var cafId = -1;
    var preTime;
    var beginTime;
    var update = /* @__PURE__ */ __name(function update2() {
      return null;
    }, "update");
    var getCurrStyle = /* @__PURE__ */ __name(function getCurrStyle2() {
      return mapObject(function(key, val) {
        return val.from;
      }, stepperStyle);
    }, "getCurrStyle");
    var shouldStopAnimation = /* @__PURE__ */ __name(function shouldStopAnimation2() {
      return !Object.values(stepperStyle).filter(needContinue).length;
    }, "shouldStopAnimation");
    var stepperUpdate = /* @__PURE__ */ __name(function stepperUpdate2(now) {
      if (!preTime) {
        preTime = now;
      }
      var deltaTime = now - preTime;
      var steps = deltaTime / easing.dt;
      stepperStyle = calStepperVals(easing, stepperStyle, steps);
      render(_objectSpread$m(_objectSpread$m(_objectSpread$m({}, from), to), getCurrStyle()));
      preTime = now;
      if (!shouldStopAnimation()) {
        cafId = requestAnimationFrame(update);
      }
    }, "stepperUpdate");
    var timingUpdate = /* @__PURE__ */ __name(function timingUpdate2(now) {
      if (!beginTime) {
        beginTime = now;
      }
      var t2 = (now - beginTime) / duration;
      var currStyle = mapObject(function(key, val) {
        return alpha.apply(void 0, _toConsumableArray$4(val).concat([easing(t2)]));
      }, timingStyle);
      render(_objectSpread$m(_objectSpread$m(_objectSpread$m({}, from), to), currStyle));
      if (t2 < 1) {
        cafId = requestAnimationFrame(update);
      } else {
        var finalStyle = mapObject(function(key, val) {
          return alpha.apply(void 0, _toConsumableArray$4(val).concat([easing(1)]));
        }, timingStyle);
        render(_objectSpread$m(_objectSpread$m(_objectSpread$m({}, from), to), finalStyle));
      }
    }, "timingUpdate");
    update = easing.isStepper ? stepperUpdate : timingUpdate;
    return function() {
      requestAnimationFrame(update);
      return function() {
        cancelAnimationFrame(cafId);
      };
    };
  }), "configUpdate");
  function _typeof$o(o2) {
    "@babel/helpers - typeof";
    return _typeof$o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$o(o2);
  }
  __name(_typeof$o, "_typeof$o");
  var _excluded$a = ["children", "begin", "duration", "attributeName", "easing", "isActive", "steps", "from", "to", "canBegin", "onAnimationEnd", "shouldReAnimate", "onAnimationReStart"];
  function _objectWithoutProperties$a(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$a(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$a, "_objectWithoutProperties$a");
  function _objectWithoutPropertiesLoose$a(source, excluded) {
    if (source == null) return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i2;
    for (i2 = 0; i2 < sourceKeys.length; i2++) {
      key = sourceKeys[i2];
      if (excluded.indexOf(key) >= 0) continue;
      target[key] = source[key];
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$a, "_objectWithoutPropertiesLoose$a");
  function _toConsumableArray$3(arr) {
    return _arrayWithoutHoles$3(arr) || _iterableToArray$3(arr) || _unsupportedIterableToArray$6(arr) || _nonIterableSpread$3();
  }
  __name(_toConsumableArray$3, "_toConsumableArray$3");
  function _nonIterableSpread$3() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableSpread$3, "_nonIterableSpread$3");
  function _unsupportedIterableToArray$6(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$6(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$6(o2, minLen);
  }
  __name(_unsupportedIterableToArray$6, "_unsupportedIterableToArray$6");
  function _iterableToArray$3(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  }
  __name(_iterableToArray$3, "_iterableToArray$3");
  function _arrayWithoutHoles$3(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray$6(arr);
  }
  __name(_arrayWithoutHoles$3, "_arrayWithoutHoles$3");
  function _arrayLikeToArray$6(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$6, "_arrayLikeToArray$6");
  function ownKeys$l(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$l, "ownKeys$l");
  function _objectSpread$l(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$l(Object(t2), true).forEach(function(r3) {
        _defineProperty$o(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$l(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$l, "_objectSpread$l");
  function _defineProperty$o(obj, key, value) {
    key = _toPropertyKey$o(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$o, "_defineProperty$o");
  function _classCallCheck$f(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$f, "_classCallCheck$f");
  function _defineProperties$f(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$o(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$f, "_defineProperties$f");
  function _createClass$f(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$f(Constructor.prototype, protoProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$f, "_createClass$f");
  function _toPropertyKey$o(arg) {
    var key = _toPrimitive$o(arg, "string");
    return _typeof$o(key) === "symbol" ? key : String(key);
  }
  __name(_toPropertyKey$o, "_toPropertyKey$o");
  function _toPrimitive$o(input, hint) {
    if (_typeof$o(input) !== "object" || input === null) return input;
    var prim = input[Symbol.toPrimitive];
    if (prim !== void 0) {
      var res = prim.call(input, hint);
      if (_typeof$o(res) !== "object") return res;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (hint === "string" ? String : Number)(input);
  }
  __name(_toPrimitive$o, "_toPrimitive$o");
  function _inherits$d(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$d(subClass, superClass);
  }
  __name(_inherits$d, "_inherits$d");
  function _setPrototypeOf$d(o2, p2) {
    _setPrototypeOf$d = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$d(o2, p2);
  }
  __name(_setPrototypeOf$d, "_setPrototypeOf$d");
  function _createSuper(Derived2) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct$d();
    return /* @__PURE__ */ __name(function _createSuperInternal() {
      var Super = _getPrototypeOf$d(Derived2), result;
      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf$d(this).constructor;
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
      return _possibleConstructorReturn$d(this, result);
    }, "_createSuperInternal");
  }
  __name(_createSuper, "_createSuper");
  function _possibleConstructorReturn$d(self2, call) {
    if (call && (_typeof$o(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$d(self2);
  }
  __name(_possibleConstructorReturn$d, "_possibleConstructorReturn$d");
  function _assertThisInitialized$d(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$d, "_assertThisInitialized$d");
  function _isNativeReflectConstruct$d() {
    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
    if (Reflect.construct.sham) return false;
    if (typeof Proxy === "function") return true;
    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
      return true;
    } catch (e) {
      return false;
    }
  }
  __name(_isNativeReflectConstruct$d, "_isNativeReflectConstruct$d");
  function _getPrototypeOf$d(o2) {
    _getPrototypeOf$d = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$d(o2);
  }
  __name(_getPrototypeOf$d, "_getPrototypeOf$d");
  var Animate = /* @__PURE__ */ (function(_PureComponent) {
    _inherits$d(Animate2, _PureComponent);
    var _super = _createSuper(Animate2);
    function Animate2(props, context) {
      var _this;
      _classCallCheck$f(this, Animate2);
      _this = _super.call(this, props, context);
      var _this$props = _this.props, isActive = _this$props.isActive, attributeName = _this$props.attributeName, from = _this$props.from, to = _this$props.to, steps = _this$props.steps, children = _this$props.children, duration = _this$props.duration;
      _this.handleStyleChange = _this.handleStyleChange.bind(_assertThisInitialized$d(_this));
      _this.changeStyle = _this.changeStyle.bind(_assertThisInitialized$d(_this));
      if (!isActive || duration <= 0) {
        _this.state = {
          style: {}
        };
        if (typeof children === "function") {
          _this.state = {
            style: to
          };
        }
        return _possibleConstructorReturn$d(_this);
      }
      if (steps && steps.length) {
        _this.state = {
          style: steps[0].style
        };
      } else if (from) {
        if (typeof children === "function") {
          _this.state = {
            style: from
          };
          return _possibleConstructorReturn$d(_this);
        }
        _this.state = {
          style: attributeName ? _defineProperty$o({}, attributeName, from) : from
        };
      } else {
        _this.state = {
          style: {}
        };
      }
      return _this;
    }
    __name(Animate2, "Animate");
    _createClass$f(Animate2, [{
      key: "componentDidMount",
      value: /* @__PURE__ */ __name(function componentDidMount() {
        var _this$props2 = this.props, isActive = _this$props2.isActive, canBegin = _this$props2.canBegin;
        this.mounted = true;
        if (!isActive || !canBegin) {
          return;
        }
        this.runAnimation(this.props);
      }, "componentDidMount")
    }, {
      key: "componentDidUpdate",
      value: /* @__PURE__ */ __name(function componentDidUpdate(prevProps) {
        var _this$props3 = this.props, isActive = _this$props3.isActive, canBegin = _this$props3.canBegin, attributeName = _this$props3.attributeName, shouldReAnimate = _this$props3.shouldReAnimate, to = _this$props3.to, currentFrom = _this$props3.from;
        var style = this.state.style;
        if (!canBegin) {
          return;
        }
        if (!isActive) {
          var newState = {
            style: attributeName ? _defineProperty$o({}, attributeName, to) : to
          };
          if (this.state && style) {
            if (attributeName && style[attributeName] !== to || !attributeName && style !== to) {
              this.setState(newState);
            }
          }
          return;
        }
        if (deepEqual$1(prevProps.to, to) && prevProps.canBegin && prevProps.isActive) {
          return;
        }
        var isTriggered = !prevProps.canBegin || !prevProps.isActive;
        if (this.manager) {
          this.manager.stop();
        }
        if (this.stopJSAnimation) {
          this.stopJSAnimation();
        }
        var from = isTriggered || shouldReAnimate ? currentFrom : prevProps.to;
        if (this.state && style) {
          var _newState = {
            style: attributeName ? _defineProperty$o({}, attributeName, from) : from
          };
          if (attributeName && style[attributeName] !== from || !attributeName && style !== from) {
            this.setState(_newState);
          }
        }
        this.runAnimation(_objectSpread$l(_objectSpread$l({}, this.props), {}, {
          from,
          begin: 0
        }));
      }, "componentDidUpdate")
    }, {
      key: "componentWillUnmount",
      value: /* @__PURE__ */ __name(function componentWillUnmount() {
        this.mounted = false;
        var onAnimationEnd = this.props.onAnimationEnd;
        if (this.unSubscribe) {
          this.unSubscribe();
        }
        if (this.manager) {
          this.manager.stop();
          this.manager = null;
        }
        if (this.stopJSAnimation) {
          this.stopJSAnimation();
        }
        if (onAnimationEnd) {
          onAnimationEnd();
        }
      }, "componentWillUnmount")
    }, {
      key: "handleStyleChange",
      value: /* @__PURE__ */ __name(function handleStyleChange(style) {
        this.changeStyle(style);
      }, "handleStyleChange")
    }, {
      key: "changeStyle",
      value: /* @__PURE__ */ __name(function changeStyle(style) {
        if (this.mounted) {
          this.setState({
            style
          });
        }
      }, "changeStyle")
    }, {
      key: "runJSAnimation",
      value: /* @__PURE__ */ __name(function runJSAnimation(props) {
        var _this2 = this;
        var from = props.from, to = props.to, duration = props.duration, easing = props.easing, begin = props.begin, onAnimationEnd = props.onAnimationEnd, onAnimationStart = props.onAnimationStart;
        var startAnimation = configUpdate(from, to, configEasing(easing), duration, this.changeStyle);
        var finalStartAnimation = /* @__PURE__ */ __name(function finalStartAnimation2() {
          _this2.stopJSAnimation = startAnimation();
        }, "finalStartAnimation");
        this.manager.start([onAnimationStart, begin, finalStartAnimation, duration, onAnimationEnd]);
      }, "runJSAnimation")
    }, {
      key: "runStepAnimation",
      value: /* @__PURE__ */ __name(function runStepAnimation(props) {
        var _this3 = this;
        var steps = props.steps, begin = props.begin, onAnimationStart = props.onAnimationStart;
        var _steps$ = steps[0], initialStyle = _steps$.style, _steps$$duration = _steps$.duration, initialTime = _steps$$duration === void 0 ? 0 : _steps$$duration;
        var addStyle = /* @__PURE__ */ __name(function addStyle2(sequence, nextItem, index2) {
          if (index2 === 0) {
            return sequence;
          }
          var duration = nextItem.duration, _nextItem$easing = nextItem.easing, easing = _nextItem$easing === void 0 ? "ease" : _nextItem$easing, style = nextItem.style, nextProperties = nextItem.properties, onAnimationEnd = nextItem.onAnimationEnd;
          var preItem = index2 > 0 ? steps[index2 - 1] : nextItem;
          var properties = nextProperties || Object.keys(style);
          if (typeof easing === "function" || easing === "spring") {
            return [].concat(_toConsumableArray$3(sequence), [_this3.runJSAnimation.bind(_this3, {
              from: preItem.style,
              to: style,
              duration,
              easing
            }), duration]);
          }
          var transition = getTransitionVal(properties, duration, easing);
          var newStyle = _objectSpread$l(_objectSpread$l(_objectSpread$l({}, preItem.style), style), {}, {
            transition
          });
          return [].concat(_toConsumableArray$3(sequence), [newStyle, duration, onAnimationEnd]).filter(identity$1);
        }, "addStyle");
        return this.manager.start([onAnimationStart].concat(_toConsumableArray$3(steps.reduce(addStyle, [initialStyle, Math.max(initialTime, begin)])), [props.onAnimationEnd]));
      }, "runStepAnimation")
    }, {
      key: "runAnimation",
      value: /* @__PURE__ */ __name(function runAnimation(props) {
        if (!this.manager) {
          this.manager = createAnimateManager();
        }
        var begin = props.begin, duration = props.duration, attributeName = props.attributeName, propsTo = props.to, easing = props.easing, onAnimationStart = props.onAnimationStart, onAnimationEnd = props.onAnimationEnd, steps = props.steps, children = props.children;
        var manager = this.manager;
        this.unSubscribe = manager.subscribe(this.handleStyleChange);
        if (typeof easing === "function" || typeof children === "function" || easing === "spring") {
          this.runJSAnimation(props);
          return;
        }
        if (steps.length > 1) {
          this.runStepAnimation(props);
          return;
        }
        var to = attributeName ? _defineProperty$o({}, attributeName, propsTo) : propsTo;
        var transition = getTransitionVal(Object.keys(to), duration, easing);
        manager.start([onAnimationStart, begin, _objectSpread$l(_objectSpread$l({}, to), {}, {
          transition
        }), duration, onAnimationEnd]);
      }, "runAnimation")
    }, {
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _this$props4 = this.props, children = _this$props4.children;
        _this$props4.begin;
        var duration = _this$props4.duration;
        _this$props4.attributeName;
        _this$props4.easing;
        var isActive = _this$props4.isActive;
        _this$props4.steps;
        _this$props4.from;
        _this$props4.to;
        _this$props4.canBegin;
        _this$props4.onAnimationEnd;
        _this$props4.shouldReAnimate;
        _this$props4.onAnimationReStart;
        var others = _objectWithoutProperties$a(_this$props4, _excluded$a);
        var count2 = reactExports.Children.count(children);
        var stateStyle = this.state.style;
        if (typeof children === "function") {
          return children(stateStyle);
        }
        if (!isActive || count2 === 0 || duration <= 0) {
          return children;
        }
        var cloneContainer = /* @__PURE__ */ __name(function cloneContainer2(container) {
          var _container$props = container.props, _container$props$styl = _container$props.style, style = _container$props$styl === void 0 ? {} : _container$props$styl, className = _container$props.className;
          var res = /* @__PURE__ */ reactExports.cloneElement(container, _objectSpread$l(_objectSpread$l({}, others), {}, {
            style: _objectSpread$l(_objectSpread$l({}, style), stateStyle),
            className
          }));
          return res;
        }, "cloneContainer");
        if (count2 === 1) {
          return cloneContainer(reactExports.Children.only(children));
        }
        return /* @__PURE__ */ React.createElement("div", null, reactExports.Children.map(children, function(child) {
          return cloneContainer(child);
        }));
      }, "render")
    }]);
    return Animate2;
  })(reactExports.PureComponent);
  Animate.displayName = "Animate";
  Animate.defaultProps = {
    begin: 0,
    duration: 1e3,
    from: "",
    to: "",
    attributeName: "",
    easing: "ease",
    isActive: true,
    canBegin: true,
    steps: [],
    onAnimationEnd: /* @__PURE__ */ __name(function onAnimationEnd() {
    }, "onAnimationEnd"),
    onAnimationStart: /* @__PURE__ */ __name(function onAnimationStart() {
    }, "onAnimationStart")
  };
  Animate.propTypes = {
    from: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
    to: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
    attributeName: PropTypes.string,
    // animation duration
    duration: PropTypes.number,
    begin: PropTypes.number,
    easing: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
    steps: PropTypes.arrayOf(PropTypes.shape({
      duration: PropTypes.number.isRequired,
      style: PropTypes.object.isRequired,
      easing: PropTypes.oneOfType([PropTypes.oneOf(["ease", "ease-in", "ease-out", "ease-in-out", "linear"]), PropTypes.func]),
      // transition css properties(dash case), optional
      properties: PropTypes.arrayOf("string"),
      onAnimationEnd: PropTypes.func
    })),
    children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
    isActive: PropTypes.bool,
    canBegin: PropTypes.bool,
    onAnimationEnd: PropTypes.func,
    // decide if it should reanimate with initial from style when props change
    shouldReAnimate: PropTypes.bool,
    onAnimationStart: PropTypes.func,
    onAnimationReStart: PropTypes.func
  };
  function _typeof$n(o2) {
    "@babel/helpers - typeof";
    return _typeof$n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$n(o2);
  }
  __name(_typeof$n, "_typeof$n");
  function _extends$j() {
    _extends$j = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$j.apply(this, arguments);
  }
  __name(_extends$j, "_extends$j");
  function _slicedToArray$3(arr, i2) {
    return _arrayWithHoles$3(arr) || _iterableToArrayLimit$3(arr, i2) || _unsupportedIterableToArray$5(arr, i2) || _nonIterableRest$3();
  }
  __name(_slicedToArray$3, "_slicedToArray$3");
  function _nonIterableRest$3() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableRest$3, "_nonIterableRest$3");
  function _unsupportedIterableToArray$5(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$5(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$5(o2, minLen);
  }
  __name(_unsupportedIterableToArray$5, "_unsupportedIterableToArray$5");
  function _arrayLikeToArray$5(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$5, "_arrayLikeToArray$5");
  function _iterableToArrayLimit$3(r2, l) {
    var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
    if (null != t2) {
      var e, n2, i2, u2, a2 = [], f = true, o2 = false;
      try {
        if (i2 = (t2 = t2.call(r2)).next, 0 === l) ;
        else for (; !(f = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l); f = true) ;
      } catch (r3) {
        o2 = true, n2 = r3;
      } finally {
        try {
          if (!f && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
        } finally {
          if (o2) throw n2;
        }
      }
      return a2;
    }
  }
  __name(_iterableToArrayLimit$3, "_iterableToArrayLimit$3");
  function _arrayWithHoles$3(arr) {
    if (Array.isArray(arr)) return arr;
  }
  __name(_arrayWithHoles$3, "_arrayWithHoles$3");
  function ownKeys$k(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$k, "ownKeys$k");
  function _objectSpread$k(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$k(Object(t2), true).forEach(function(r3) {
        _defineProperty$n(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$k(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$k, "_objectSpread$k");
  function _defineProperty$n(obj, key, value) {
    key = _toPropertyKey$n(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$n, "_defineProperty$n");
  function _toPropertyKey$n(t2) {
    var i2 = _toPrimitive$n(t2, "string");
    return "symbol" == _typeof$n(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$n, "_toPropertyKey$n");
  function _toPrimitive$n(t2, r2) {
    if ("object" != _typeof$n(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$n(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$n, "_toPrimitive$n");
  var getRectanglePath = /* @__PURE__ */ __name(function getRectanglePath2(x2, y2, width, height, radius) {
    var maxRadius = Math.min(Math.abs(width) / 2, Math.abs(height) / 2);
    var ySign = height >= 0 ? 1 : -1;
    var xSign = width >= 0 ? 1 : -1;
    var clockWise = height >= 0 && width >= 0 || height < 0 && width < 0 ? 1 : 0;
    var path;
    if (maxRadius > 0 && radius instanceof Array) {
      var newRadius = [0, 0, 0, 0];
      for (var i2 = 0, len = 4; i2 < len; i2++) {
        newRadius[i2] = radius[i2] > maxRadius ? maxRadius : radius[i2];
      }
      path = "M".concat(x2, ",").concat(y2 + ySign * newRadius[0]);
      if (newRadius[0] > 0) {
        path += "A ".concat(newRadius[0], ",").concat(newRadius[0], ",0,0,").concat(clockWise, ",").concat(x2 + xSign * newRadius[0], ",").concat(y2);
      }
      path += "L ".concat(x2 + width - xSign * newRadius[1], ",").concat(y2);
      if (newRadius[1] > 0) {
        path += "A ".concat(newRadius[1], ",").concat(newRadius[1], ",0,0,").concat(clockWise, ",\n        ").concat(x2 + width, ",").concat(y2 + ySign * newRadius[1]);
      }
      path += "L ".concat(x2 + width, ",").concat(y2 + height - ySign * newRadius[2]);
      if (newRadius[2] > 0) {
        path += "A ".concat(newRadius[2], ",").concat(newRadius[2], ",0,0,").concat(clockWise, ",\n        ").concat(x2 + width - xSign * newRadius[2], ",").concat(y2 + height);
      }
      path += "L ".concat(x2 + xSign * newRadius[3], ",").concat(y2 + height);
      if (newRadius[3] > 0) {
        path += "A ".concat(newRadius[3], ",").concat(newRadius[3], ",0,0,").concat(clockWise, ",\n        ").concat(x2, ",").concat(y2 + height - ySign * newRadius[3]);
      }
      path += "Z";
    } else if (maxRadius > 0 && radius === +radius && radius > 0) {
      var _newRadius = Math.min(maxRadius, radius);
      path = "M ".concat(x2, ",").concat(y2 + ySign * _newRadius, "\n            A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x2 + xSign * _newRadius, ",").concat(y2, "\n            L ").concat(x2 + width - xSign * _newRadius, ",").concat(y2, "\n            A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x2 + width, ",").concat(y2 + ySign * _newRadius, "\n            L ").concat(x2 + width, ",").concat(y2 + height - ySign * _newRadius, "\n            A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x2 + width - xSign * _newRadius, ",").concat(y2 + height, "\n            L ").concat(x2 + xSign * _newRadius, ",").concat(y2 + height, "\n            A ").concat(_newRadius, ",").concat(_newRadius, ",0,0,").concat(clockWise, ",").concat(x2, ",").concat(y2 + height - ySign * _newRadius, " Z");
    } else {
      path = "M ".concat(x2, ",").concat(y2, " h ").concat(width, " v ").concat(height, " h ").concat(-width, " Z");
    }
    return path;
  }, "getRectanglePath");
  var isInRectangle = /* @__PURE__ */ __name(function isInRectangle2(point2, rect) {
    if (!point2 || !rect) {
      return false;
    }
    var px = point2.x, py = point2.y;
    var x2 = rect.x, y2 = rect.y, width = rect.width, height = rect.height;
    if (Math.abs(width) > 0 && Math.abs(height) > 0) {
      var minX = Math.min(x2, x2 + width);
      var maxX = Math.max(x2, x2 + width);
      var minY = Math.min(y2, y2 + height);
      var maxY = Math.max(y2, y2 + height);
      return px >= minX && px <= maxX && py >= minY && py <= maxY;
    }
    return false;
  }, "isInRectangle");
  var defaultProps$2 = {
    x: 0,
    y: 0,
    width: 0,
    height: 0,
    // The radius of border
    // The radius of four corners when radius is a number
    // The radius of left-top, right-top, right-bottom, left-bottom when radius is an array
    radius: 0,
    isAnimationActive: false,
    isUpdateAnimationActive: false,
    animationBegin: 0,
    animationDuration: 1500,
    animationEasing: "ease"
  };
  var Rectangle = /* @__PURE__ */ __name(function Rectangle2(rectangleProps) {
    var props = _objectSpread$k(_objectSpread$k({}, defaultProps$2), rectangleProps);
    var pathRef = reactExports.useRef();
    var _useState = reactExports.useState(-1), _useState2 = _slicedToArray$3(_useState, 2), totalLength = _useState2[0], setTotalLength = _useState2[1];
    reactExports.useEffect(function() {
      if (pathRef.current && pathRef.current.getTotalLength) {
        try {
          var pathTotalLength = pathRef.current.getTotalLength();
          if (pathTotalLength) {
            setTotalLength(pathTotalLength);
          }
        } catch (err) {
        }
      }
    }, []);
    var x2 = props.x, y2 = props.y, width = props.width, height = props.height, radius = props.radius, className = props.className;
    var animationEasing = props.animationEasing, animationDuration = props.animationDuration, animationBegin = props.animationBegin, isAnimationActive = props.isAnimationActive, isUpdateAnimationActive = props.isUpdateAnimationActive;
    if (x2 !== +x2 || y2 !== +y2 || width !== +width || height !== +height || width === 0 || height === 0) {
      return null;
    }
    var layerClass = clsx("recharts-rectangle", className);
    if (!isUpdateAnimationActive) {
      return /* @__PURE__ */ React.createElement("path", _extends$j({}, filterProps(props, true), {
        className: layerClass,
        d: getRectanglePath(x2, y2, width, height, radius)
      }));
    }
    return /* @__PURE__ */ React.createElement(Animate, {
      canBegin: totalLength > 0,
      from: {
        width,
        height,
        x: x2,
        y: y2
      },
      to: {
        width,
        height,
        x: x2,
        y: y2
      },
      duration: animationDuration,
      animationEasing,
      isActive: isUpdateAnimationActive
    }, function(_ref) {
      var currWidth = _ref.width, currHeight = _ref.height, currX = _ref.x, currY = _ref.y;
      return /* @__PURE__ */ React.createElement(Animate, {
        canBegin: totalLength > 0,
        from: "0px ".concat(totalLength === -1 ? 1 : totalLength, "px"),
        to: "".concat(totalLength, "px 0px"),
        attributeName: "strokeDasharray",
        begin: animationBegin,
        duration: animationDuration,
        isActive: isAnimationActive,
        easing: animationEasing
      }, /* @__PURE__ */ React.createElement("path", _extends$j({}, filterProps(props, true), {
        className: layerClass,
        d: getRectanglePath(currX, currY, currWidth, currHeight, radius),
        ref: pathRef
      })));
    });
  }, "Rectangle");
  var _excluded$9 = ["points", "className", "baseLinePoints", "connectNulls"];
  function _extends$i() {
    _extends$i = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$i.apply(this, arguments);
  }
  __name(_extends$i, "_extends$i");
  function _objectWithoutProperties$9(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$9(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$9, "_objectWithoutProperties$9");
  function _objectWithoutPropertiesLoose$9(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$9, "_objectWithoutPropertiesLoose$9");
  function _toConsumableArray$2(arr) {
    return _arrayWithoutHoles$2(arr) || _iterableToArray$2(arr) || _unsupportedIterableToArray$4(arr) || _nonIterableSpread$2();
  }
  __name(_toConsumableArray$2, "_toConsumableArray$2");
  function _nonIterableSpread$2() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableSpread$2, "_nonIterableSpread$2");
  function _unsupportedIterableToArray$4(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$4(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$4(o2, minLen);
  }
  __name(_unsupportedIterableToArray$4, "_unsupportedIterableToArray$4");
  function _iterableToArray$2(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  }
  __name(_iterableToArray$2, "_iterableToArray$2");
  function _arrayWithoutHoles$2(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray$4(arr);
  }
  __name(_arrayWithoutHoles$2, "_arrayWithoutHoles$2");
  function _arrayLikeToArray$4(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$4, "_arrayLikeToArray$4");
  var isValidatePoint = /* @__PURE__ */ __name(function isValidatePoint2(point2) {
    return point2 && point2.x === +point2.x && point2.y === +point2.y;
  }, "isValidatePoint");
  var getParsedPoints = /* @__PURE__ */ __name(function getParsedPoints2() {
    var points = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
    var segmentPoints = [[]];
    points.forEach(function(entry) {
      if (isValidatePoint(entry)) {
        segmentPoints[segmentPoints.length - 1].push(entry);
      } else if (segmentPoints[segmentPoints.length - 1].length > 0) {
        segmentPoints.push([]);
      }
    });
    if (isValidatePoint(points[0])) {
      segmentPoints[segmentPoints.length - 1].push(points[0]);
    }
    if (segmentPoints[segmentPoints.length - 1].length <= 0) {
      segmentPoints = segmentPoints.slice(0, -1);
    }
    return segmentPoints;
  }, "getParsedPoints");
  var getSinglePolygonPath = /* @__PURE__ */ __name(function getSinglePolygonPath2(points, connectNulls) {
    var segmentPoints = getParsedPoints(points);
    if (connectNulls) {
      segmentPoints = [segmentPoints.reduce(function(res, segPoints) {
        return [].concat(_toConsumableArray$2(res), _toConsumableArray$2(segPoints));
      }, [])];
    }
    var polygonPath = segmentPoints.map(function(segPoints) {
      return segPoints.reduce(function(path, point2, index2) {
        return "".concat(path).concat(index2 === 0 ? "M" : "L").concat(point2.x, ",").concat(point2.y);
      }, "");
    }).join("");
    return segmentPoints.length === 1 ? "".concat(polygonPath, "Z") : polygonPath;
  }, "getSinglePolygonPath");
  var getRanglePath = /* @__PURE__ */ __name(function getRanglePath2(points, baseLinePoints, connectNulls) {
    var outerPath = getSinglePolygonPath(points, connectNulls);
    return "".concat(outerPath.slice(-1) === "Z" ? outerPath.slice(0, -1) : outerPath, "L").concat(getSinglePolygonPath(baseLinePoints.reverse(), connectNulls).slice(1));
  }, "getRanglePath");
  var Polygon = /* @__PURE__ */ __name(function Polygon2(props) {
    var points = props.points, className = props.className, baseLinePoints = props.baseLinePoints, connectNulls = props.connectNulls, others = _objectWithoutProperties$9(props, _excluded$9);
    if (!points || !points.length) {
      return null;
    }
    var layerClass = clsx("recharts-polygon", className);
    if (baseLinePoints && baseLinePoints.length) {
      var hasStroke = others.stroke && others.stroke !== "none";
      var rangePath = getRanglePath(points, baseLinePoints, connectNulls);
      return /* @__PURE__ */ React.createElement("g", {
        className: layerClass
      }, /* @__PURE__ */ React.createElement("path", _extends$i({}, filterProps(others, true), {
        fill: rangePath.slice(-1) === "Z" ? others.fill : "none",
        stroke: "none",
        d: rangePath
      })), hasStroke ? /* @__PURE__ */ React.createElement("path", _extends$i({}, filterProps(others, true), {
        fill: "none",
        d: getSinglePolygonPath(points, connectNulls)
      })) : null, hasStroke ? /* @__PURE__ */ React.createElement("path", _extends$i({}, filterProps(others, true), {
        fill: "none",
        d: getSinglePolygonPath(baseLinePoints, connectNulls)
      })) : null);
    }
    var singlePath = getSinglePolygonPath(points, connectNulls);
    return /* @__PURE__ */ React.createElement("path", _extends$i({}, filterProps(others, true), {
      fill: singlePath.slice(-1) === "Z" ? others.fill : "none",
      className: layerClass,
      d: singlePath
    }));
  }, "Polygon");
  function _extends$h() {
    _extends$h = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$h.apply(this, arguments);
  }
  __name(_extends$h, "_extends$h");
  var Dot = /* @__PURE__ */ __name(function Dot2(props) {
    var cx2 = props.cx, cy = props.cy, r2 = props.r, className = props.className;
    var layerClass = clsx("recharts-dot", className);
    if (cx2 === +cx2 && cy === +cy && r2 === +r2) {
      return /* @__PURE__ */ reactExports.createElement("circle", _extends$h({}, filterProps(props, false), adaptEventHandlers(props), {
        className: layerClass,
        cx: cx2,
        cy,
        r: r2
      }));
    }
    return null;
  }, "Dot");
  function _typeof$m(o2) {
    "@babel/helpers - typeof";
    return _typeof$m = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$m(o2);
  }
  __name(_typeof$m, "_typeof$m");
  var _excluded$8 = ["x", "y", "top", "left", "width", "height", "className"];
  function _extends$g() {
    _extends$g = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$g.apply(this, arguments);
  }
  __name(_extends$g, "_extends$g");
  function ownKeys$j(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$j, "ownKeys$j");
  function _objectSpread$j(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$j(Object(t2), true).forEach(function(r3) {
        _defineProperty$m(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$j(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$j, "_objectSpread$j");
  function _defineProperty$m(obj, key, value) {
    key = _toPropertyKey$m(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$m, "_defineProperty$m");
  function _toPropertyKey$m(t2) {
    var i2 = _toPrimitive$m(t2, "string");
    return "symbol" == _typeof$m(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$m, "_toPropertyKey$m");
  function _toPrimitive$m(t2, r2) {
    if ("object" != _typeof$m(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$m(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$m, "_toPrimitive$m");
  function _objectWithoutProperties$8(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$8(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$8, "_objectWithoutProperties$8");
  function _objectWithoutPropertiesLoose$8(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$8, "_objectWithoutPropertiesLoose$8");
  var getPath = /* @__PURE__ */ __name(function getPath2(x2, y2, width, height, top, left) {
    return "M".concat(x2, ",").concat(top, "v").concat(height, "M").concat(left, ",").concat(y2, "h").concat(width);
  }, "getPath");
  var Cross = /* @__PURE__ */ __name(function Cross2(_ref) {
    var _ref$x = _ref.x, x2 = _ref$x === void 0 ? 0 : _ref$x, _ref$y = _ref.y, y2 = _ref$y === void 0 ? 0 : _ref$y, _ref$top = _ref.top, top = _ref$top === void 0 ? 0 : _ref$top, _ref$left = _ref.left, left = _ref$left === void 0 ? 0 : _ref$left, _ref$width = _ref.width, width = _ref$width === void 0 ? 0 : _ref$width, _ref$height = _ref.height, height = _ref$height === void 0 ? 0 : _ref$height, className = _ref.className, rest = _objectWithoutProperties$8(_ref, _excluded$8);
    var props = _objectSpread$j({
      x: x2,
      y: y2,
      top,
      left,
      width,
      height
    }, rest);
    if (!isNumber(x2) || !isNumber(y2) || !isNumber(width) || !isNumber(height) || !isNumber(top) || !isNumber(left)) {
      return null;
    }
    return /* @__PURE__ */ React.createElement("path", _extends$g({}, filterProps(props, true), {
      className: clsx("recharts-cross", className),
      d: getPath(x2, y2, width, height, top, left)
    }));
  }, "Cross");
  var maxBy_1;
  var hasRequiredMaxBy;
  function requireMaxBy() {
    if (hasRequiredMaxBy) return maxBy_1;
    hasRequiredMaxBy = 1;
    var baseExtremum = require_baseExtremum(), baseGt = require_baseGt(), baseIteratee = require_baseIteratee();
    function maxBy2(array2, iteratee) {
      return array2 && array2.length ? baseExtremum(array2, baseIteratee(iteratee, 2), baseGt) : void 0;
    }
    __name(maxBy2, "maxBy");
    maxBy_1 = maxBy2;
    return maxBy_1;
  }
  __name(requireMaxBy, "requireMaxBy");
  var maxByExports = requireMaxBy();
  const maxBy = /* @__PURE__ */ getDefaultExportFromCjs(maxByExports);
  var minBy_1;
  var hasRequiredMinBy;
  function requireMinBy() {
    if (hasRequiredMinBy) return minBy_1;
    hasRequiredMinBy = 1;
    var baseExtremum = require_baseExtremum(), baseIteratee = require_baseIteratee(), baseLt = require_baseLt();
    function minBy2(array2, iteratee) {
      return array2 && array2.length ? baseExtremum(array2, baseIteratee(iteratee, 2), baseLt) : void 0;
    }
    __name(minBy2, "minBy");
    minBy_1 = minBy2;
    return minBy_1;
  }
  __name(requireMinBy, "requireMinBy");
  var minByExports = requireMinBy();
  const minBy = /* @__PURE__ */ getDefaultExportFromCjs(minByExports);
  var _excluded$7 = ["cx", "cy", "angle", "ticks", "axisLine"], _excluded2$4 = ["ticks", "tick", "angle", "tickFormatter", "stroke"];
  function _typeof$l(o2) {
    "@babel/helpers - typeof";
    return _typeof$l = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$l(o2);
  }
  __name(_typeof$l, "_typeof$l");
  function _extends$f() {
    _extends$f = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$f.apply(this, arguments);
  }
  __name(_extends$f, "_extends$f");
  function ownKeys$i(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$i, "ownKeys$i");
  function _objectSpread$i(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$i(Object(t2), true).forEach(function(r3) {
        _defineProperty$l(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$i(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$i, "_objectSpread$i");
  function _objectWithoutProperties$7(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$7(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$7, "_objectWithoutProperties$7");
  function _objectWithoutPropertiesLoose$7(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$7, "_objectWithoutPropertiesLoose$7");
  function _classCallCheck$e(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$e, "_classCallCheck$e");
  function _defineProperties$e(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$l(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$e, "_defineProperties$e");
  function _createClass$e(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$e(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties$e(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$e, "_createClass$e");
  function _callSuper$c(t2, o2, e) {
    return o2 = _getPrototypeOf$c(o2), _possibleConstructorReturn$c(t2, _isNativeReflectConstruct$c() ? Reflect.construct(o2, e || [], _getPrototypeOf$c(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$c, "_callSuper$c");
  function _possibleConstructorReturn$c(self2, call) {
    if (call && (_typeof$l(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$c(self2);
  }
  __name(_possibleConstructorReturn$c, "_possibleConstructorReturn$c");
  function _assertThisInitialized$c(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$c, "_assertThisInitialized$c");
  function _isNativeReflectConstruct$c() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$c = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$c, "_isNativeReflectConstruct$c");
  function _getPrototypeOf$c(o2) {
    _getPrototypeOf$c = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$c(o2);
  }
  __name(_getPrototypeOf$c, "_getPrototypeOf$c");
  function _inherits$c(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$c(subClass, superClass);
  }
  __name(_inherits$c, "_inherits$c");
  function _setPrototypeOf$c(o2, p2) {
    _setPrototypeOf$c = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$c(o2, p2);
  }
  __name(_setPrototypeOf$c, "_setPrototypeOf$c");
  function _defineProperty$l(obj, key, value) {
    key = _toPropertyKey$l(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$l, "_defineProperty$l");
  function _toPropertyKey$l(t2) {
    var i2 = _toPrimitive$l(t2, "string");
    return "symbol" == _typeof$l(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$l, "_toPropertyKey$l");
  function _toPrimitive$l(t2, r2) {
    if ("object" != _typeof$l(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$l(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$l, "_toPrimitive$l");
  var PolarRadiusAxis = /* @__PURE__ */ (function(_PureComponent) {
    function PolarRadiusAxis2() {
      _classCallCheck$e(this, PolarRadiusAxis2);
      return _callSuper$c(this, PolarRadiusAxis2, arguments);
    }
    __name(PolarRadiusAxis2, "PolarRadiusAxis");
    _inherits$c(PolarRadiusAxis2, _PureComponent);
    return _createClass$e(PolarRadiusAxis2, [{
      key: "getTickValueCoord",
      value: (
        /**
         * Calculate the coordinate of tick
         * @param  {Number} coordinate The radius of tick
         * @return {Object} (x, y)
         */
        /* @__PURE__ */ __name(function getTickValueCoord(_ref) {
          var coordinate = _ref.coordinate;
          var _this$props = this.props, angle = _this$props.angle, cx2 = _this$props.cx, cy = _this$props.cy;
          return polarToCartesian(cx2, cy, coordinate, angle);
        }, "getTickValueCoord")
      )
    }, {
      key: "getTickTextAnchor",
      value: /* @__PURE__ */ __name(function getTickTextAnchor() {
        var orientation = this.props.orientation;
        var textAnchor;
        switch (orientation) {
          case "left":
            textAnchor = "end";
            break;
          case "right":
            textAnchor = "start";
            break;
          default:
            textAnchor = "middle";
            break;
        }
        return textAnchor;
      }, "getTickTextAnchor")
    }, {
      key: "getViewBox",
      value: /* @__PURE__ */ __name(function getViewBox() {
        var _this$props2 = this.props, cx2 = _this$props2.cx, cy = _this$props2.cy, angle = _this$props2.angle, ticks2 = _this$props2.ticks;
        var maxRadiusTick = maxBy(ticks2, function(entry) {
          return entry.coordinate || 0;
        });
        var minRadiusTick = minBy(ticks2, function(entry) {
          return entry.coordinate || 0;
        });
        return {
          cx: cx2,
          cy,
          startAngle: angle,
          endAngle: angle,
          innerRadius: minRadiusTick.coordinate || 0,
          outerRadius: maxRadiusTick.coordinate || 0
        };
      }, "getViewBox")
    }, {
      key: "renderAxisLine",
      value: /* @__PURE__ */ __name(function renderAxisLine() {
        var _this$props3 = this.props, cx2 = _this$props3.cx, cy = _this$props3.cy, angle = _this$props3.angle, ticks2 = _this$props3.ticks, axisLine = _this$props3.axisLine, others = _objectWithoutProperties$7(_this$props3, _excluded$7);
        var extent = ticks2.reduce(function(result, entry) {
          return [Math.min(result[0], entry.coordinate), Math.max(result[1], entry.coordinate)];
        }, [Infinity, -Infinity]);
        var point0 = polarToCartesian(cx2, cy, extent[0], angle);
        var point1 = polarToCartesian(cx2, cy, extent[1], angle);
        var props = _objectSpread$i(_objectSpread$i(_objectSpread$i({}, filterProps(others, false)), {}, {
          fill: "none"
        }, filterProps(axisLine, false)), {}, {
          x1: point0.x,
          y1: point0.y,
          x2: point1.x,
          y2: point1.y
        });
        return /* @__PURE__ */ React.createElement("line", _extends$f({
          className: "recharts-polar-radius-axis-line"
        }, props));
      }, "renderAxisLine")
    }, {
      key: "renderTicks",
      value: /* @__PURE__ */ __name(function renderTicks() {
        var _this = this;
        var _this$props4 = this.props, ticks2 = _this$props4.ticks, tick = _this$props4.tick, angle = _this$props4.angle, tickFormatter = _this$props4.tickFormatter, stroke = _this$props4.stroke, others = _objectWithoutProperties$7(_this$props4, _excluded2$4);
        var textAnchor = this.getTickTextAnchor();
        var axisProps = filterProps(others, false);
        var customTickProps = filterProps(tick, false);
        var items = ticks2.map(function(entry, i2) {
          var coord = _this.getTickValueCoord(entry);
          var tickProps = _objectSpread$i(_objectSpread$i(_objectSpread$i(_objectSpread$i({
            textAnchor,
            transform: "rotate(".concat(90 - angle, ", ").concat(coord.x, ", ").concat(coord.y, ")")
          }, axisProps), {}, {
            stroke: "none",
            fill: stroke
          }, customTickProps), {}, {
            index: i2
          }, coord), {}, {
            payload: entry
          });
          return /* @__PURE__ */ React.createElement(Layer, _extends$f({
            className: clsx("recharts-polar-radius-axis-tick", getTickClassName(tick)),
            key: "tick-".concat(entry.coordinate)
          }, adaptEventsOfChild(_this.props, entry, i2)), PolarRadiusAxis2.renderTickItem(tick, tickProps, tickFormatter ? tickFormatter(entry.value, i2) : entry.value));
        });
        return /* @__PURE__ */ React.createElement(Layer, {
          className: "recharts-polar-radius-axis-ticks"
        }, items);
      }, "renderTicks")
    }, {
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _this$props5 = this.props, ticks2 = _this$props5.ticks, axisLine = _this$props5.axisLine, tick = _this$props5.tick;
        if (!ticks2 || !ticks2.length) {
          return null;
        }
        return /* @__PURE__ */ React.createElement(Layer, {
          className: clsx("recharts-polar-radius-axis", this.props.className)
        }, axisLine && this.renderAxisLine(), tick && this.renderTicks(), Label.renderCallByParent(this.props, this.getViewBox()));
      }, "render")
    }], [{
      key: "renderTickItem",
      value: /* @__PURE__ */ __name(function renderTickItem(option, props, value) {
        var tickItem;
        if (/* @__PURE__ */ React.isValidElement(option)) {
          tickItem = /* @__PURE__ */ React.cloneElement(option, props);
        } else if (isFunction$2(option)) {
          tickItem = option(props);
        } else {
          tickItem = /* @__PURE__ */ React.createElement(Text, _extends$f({}, props, {
            className: "recharts-polar-radius-axis-tick-value"
          }), value);
        }
        return tickItem;
      }, "renderTickItem")
    }]);
  })(reactExports.PureComponent);
  _defineProperty$l(PolarRadiusAxis, "displayName", "PolarRadiusAxis");
  _defineProperty$l(PolarRadiusAxis, "axisType", "radiusAxis");
  _defineProperty$l(PolarRadiusAxis, "defaultProps", {
    type: "number",
    radiusAxisId: 0,
    cx: 0,
    cy: 0,
    angle: 0,
    orientation: "right",
    stroke: "#ccc",
    axisLine: true,
    tick: true,
    tickCount: 5,
    allowDataOverflow: false,
    scale: "auto",
    allowDuplicatedCategory: true
  });
  function _typeof$k(o2) {
    "@babel/helpers - typeof";
    return _typeof$k = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$k(o2);
  }
  __name(_typeof$k, "_typeof$k");
  function _extends$e() {
    _extends$e = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$e.apply(this, arguments);
  }
  __name(_extends$e, "_extends$e");
  function ownKeys$h(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$h, "ownKeys$h");
  function _objectSpread$h(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$h(Object(t2), true).forEach(function(r3) {
        _defineProperty$k(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$h(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$h, "_objectSpread$h");
  function _classCallCheck$d(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$d, "_classCallCheck$d");
  function _defineProperties$d(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$k(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$d, "_defineProperties$d");
  function _createClass$d(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$d(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties$d(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$d, "_createClass$d");
  function _callSuper$b(t2, o2, e) {
    return o2 = _getPrototypeOf$b(o2), _possibleConstructorReturn$b(t2, _isNativeReflectConstruct$b() ? Reflect.construct(o2, e || [], _getPrototypeOf$b(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$b, "_callSuper$b");
  function _possibleConstructorReturn$b(self2, call) {
    if (call && (_typeof$k(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$b(self2);
  }
  __name(_possibleConstructorReturn$b, "_possibleConstructorReturn$b");
  function _assertThisInitialized$b(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$b, "_assertThisInitialized$b");
  function _isNativeReflectConstruct$b() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$b = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$b, "_isNativeReflectConstruct$b");
  function _getPrototypeOf$b(o2) {
    _getPrototypeOf$b = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$b(o2);
  }
  __name(_getPrototypeOf$b, "_getPrototypeOf$b");
  function _inherits$b(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$b(subClass, superClass);
  }
  __name(_inherits$b, "_inherits$b");
  function _setPrototypeOf$b(o2, p2) {
    _setPrototypeOf$b = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$b(o2, p2);
  }
  __name(_setPrototypeOf$b, "_setPrototypeOf$b");
  function _defineProperty$k(obj, key, value) {
    key = _toPropertyKey$k(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$k, "_defineProperty$k");
  function _toPropertyKey$k(t2) {
    var i2 = _toPrimitive$k(t2, "string");
    return "symbol" == _typeof$k(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$k, "_toPropertyKey$k");
  function _toPrimitive$k(t2, r2) {
    if ("object" != _typeof$k(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$k(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$k, "_toPrimitive$k");
  var RADIAN = Math.PI / 180;
  var eps = 1e-5;
  var PolarAngleAxis = /* @__PURE__ */ (function(_PureComponent) {
    function PolarAngleAxis2() {
      _classCallCheck$d(this, PolarAngleAxis2);
      return _callSuper$b(this, PolarAngleAxis2, arguments);
    }
    __name(PolarAngleAxis2, "PolarAngleAxis");
    _inherits$b(PolarAngleAxis2, _PureComponent);
    return _createClass$d(PolarAngleAxis2, [{
      key: "getTickLineCoord",
      value: (
        /**
         * Calculate the coordinate of line endpoint
         * @param  {Object} data The Data if ticks
         * @return {Object} (x0, y0): The start point of text,
         *                  (x1, y1): The end point close to text,
         *                  (x2, y2): The end point close to axis
         */
        /* @__PURE__ */ __name(function getTickLineCoord(data) {
          var _this$props = this.props, cx2 = _this$props.cx, cy = _this$props.cy, radius = _this$props.radius, orientation = _this$props.orientation, tickSize = _this$props.tickSize;
          var tickLineSize = tickSize || 8;
          var p1 = polarToCartesian(cx2, cy, radius, data.coordinate);
          var p2 = polarToCartesian(cx2, cy, radius + (orientation === "inner" ? -1 : 1) * tickLineSize, data.coordinate);
          return {
            x1: p1.x,
            y1: p1.y,
            x2: p2.x,
            y2: p2.y
          };
        }, "getTickLineCoord")
      )
      /**
       * Get the text-anchor of each tick
       * @param  {Object} data Data of ticks
       * @return {String} text-anchor
       */
    }, {
      key: "getTickTextAnchor",
      value: /* @__PURE__ */ __name(function getTickTextAnchor(data) {
        var orientation = this.props.orientation;
        var cos2 = Math.cos(-data.coordinate * RADIAN);
        var textAnchor;
        if (cos2 > eps) {
          textAnchor = orientation === "outer" ? "start" : "end";
        } else if (cos2 < -eps) {
          textAnchor = orientation === "outer" ? "end" : "start";
        } else {
          textAnchor = "middle";
        }
        return textAnchor;
      }, "getTickTextAnchor")
    }, {
      key: "renderAxisLine",
      value: /* @__PURE__ */ __name(function renderAxisLine() {
        var _this$props2 = this.props, cx2 = _this$props2.cx, cy = _this$props2.cy, radius = _this$props2.radius, axisLine = _this$props2.axisLine, axisLineType = _this$props2.axisLineType;
        var props = _objectSpread$h(_objectSpread$h({}, filterProps(this.props, false)), {}, {
          fill: "none"
        }, filterProps(axisLine, false));
        if (axisLineType === "circle") {
          return /* @__PURE__ */ React.createElement(Dot, _extends$e({
            className: "recharts-polar-angle-axis-line"
          }, props, {
            cx: cx2,
            cy,
            r: radius
          }));
        }
        var ticks2 = this.props.ticks;
        var points = ticks2.map(function(entry) {
          return polarToCartesian(cx2, cy, radius, entry.coordinate);
        });
        return /* @__PURE__ */ React.createElement(Polygon, _extends$e({
          className: "recharts-polar-angle-axis-line"
        }, props, {
          points
        }));
      }, "renderAxisLine")
    }, {
      key: "renderTicks",
      value: /* @__PURE__ */ __name(function renderTicks() {
        var _this = this;
        var _this$props3 = this.props, ticks2 = _this$props3.ticks, tick = _this$props3.tick, tickLine = _this$props3.tickLine, tickFormatter = _this$props3.tickFormatter, stroke = _this$props3.stroke;
        var axisProps = filterProps(this.props, false);
        var customTickProps = filterProps(tick, false);
        var tickLineProps = _objectSpread$h(_objectSpread$h({}, axisProps), {}, {
          fill: "none"
        }, filterProps(tickLine, false));
        var items = ticks2.map(function(entry, i2) {
          var lineCoord = _this.getTickLineCoord(entry);
          var textAnchor = _this.getTickTextAnchor(entry);
          var tickProps = _objectSpread$h(_objectSpread$h(_objectSpread$h({
            textAnchor
          }, axisProps), {}, {
            stroke: "none",
            fill: stroke
          }, customTickProps), {}, {
            index: i2,
            payload: entry,
            x: lineCoord.x2,
            y: lineCoord.y2
          });
          return /* @__PURE__ */ React.createElement(Layer, _extends$e({
            className: clsx("recharts-polar-angle-axis-tick", getTickClassName(tick)),
            key: "tick-".concat(entry.coordinate)
          }, adaptEventsOfChild(_this.props, entry, i2)), tickLine && /* @__PURE__ */ React.createElement("line", _extends$e({
            className: "recharts-polar-angle-axis-tick-line"
          }, tickLineProps, lineCoord)), tick && PolarAngleAxis2.renderTickItem(tick, tickProps, tickFormatter ? tickFormatter(entry.value, i2) : entry.value));
        });
        return /* @__PURE__ */ React.createElement(Layer, {
          className: "recharts-polar-angle-axis-ticks"
        }, items);
      }, "renderTicks")
    }, {
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _this$props4 = this.props, ticks2 = _this$props4.ticks, radius = _this$props4.radius, axisLine = _this$props4.axisLine;
        if (radius <= 0 || !ticks2 || !ticks2.length) {
          return null;
        }
        return /* @__PURE__ */ React.createElement(Layer, {
          className: clsx("recharts-polar-angle-axis", this.props.className)
        }, axisLine && this.renderAxisLine(), this.renderTicks());
      }, "render")
    }], [{
      key: "renderTickItem",
      value: /* @__PURE__ */ __name(function renderTickItem(option, props, value) {
        var tickItem;
        if (/* @__PURE__ */ React.isValidElement(option)) {
          tickItem = /* @__PURE__ */ React.cloneElement(option, props);
        } else if (isFunction$2(option)) {
          tickItem = option(props);
        } else {
          tickItem = /* @__PURE__ */ React.createElement(Text, _extends$e({}, props, {
            className: "recharts-polar-angle-axis-tick-value"
          }), value);
        }
        return tickItem;
      }, "renderTickItem")
    }]);
  })(reactExports.PureComponent);
  _defineProperty$k(PolarAngleAxis, "displayName", "PolarAngleAxis");
  _defineProperty$k(PolarAngleAxis, "axisType", "angleAxis");
  _defineProperty$k(PolarAngleAxis, "defaultProps", {
    type: "category",
    angleAxisId: 0,
    scale: "auto",
    cx: 0,
    cy: 0,
    orientation: "outer",
    axisLine: true,
    tickLine: true,
    tickSize: 8,
    tick: true,
    hide: false,
    allowDuplicatedCategory: true
  });
  var _getPrototype;
  var hasRequired_getPrototype;
  function require_getPrototype() {
    if (hasRequired_getPrototype) return _getPrototype;
    hasRequired_getPrototype = 1;
    var overArg2 = require_overArg();
    var getPrototype = overArg2(Object.getPrototypeOf, Object);
    _getPrototype = getPrototype;
    return _getPrototype;
  }
  __name(require_getPrototype, "require_getPrototype");
  var isPlainObject_1;
  var hasRequiredIsPlainObject;
  function requireIsPlainObject() {
    if (hasRequiredIsPlainObject) return isPlainObject_1;
    hasRequiredIsPlainObject = 1;
    var baseGetTag2 = require_baseGetTag(), getPrototype = require_getPrototype(), isObjectLike2 = requireIsObjectLike();
    var objectTag2 = "[object Object]";
    var funcProto2 = Function.prototype, objectProto2 = Object.prototype;
    var funcToString2 = funcProto2.toString;
    var hasOwnProperty2 = objectProto2.hasOwnProperty;
    var objectCtorString = funcToString2.call(Object);
    function isPlainObject2(value) {
      if (!isObjectLike2(value) || baseGetTag2(value) != objectTag2) {
        return false;
      }
      var proto = getPrototype(value);
      if (proto === null) {
        return true;
      }
      var Ctor = hasOwnProperty2.call(proto, "constructor") && proto.constructor;
      return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString2.call(Ctor) == objectCtorString;
    }
    __name(isPlainObject2, "isPlainObject");
    isPlainObject_1 = isPlainObject2;
    return isPlainObject_1;
  }
  __name(requireIsPlainObject, "requireIsPlainObject");
  var isPlainObjectExports = requireIsPlainObject();
  const isPlainObject$1 = /* @__PURE__ */ getDefaultExportFromCjs(isPlainObjectExports);
  var isBoolean_1;
  var hasRequiredIsBoolean;
  function requireIsBoolean() {
    if (hasRequiredIsBoolean) return isBoolean_1;
    hasRequiredIsBoolean = 1;
    var baseGetTag2 = require_baseGetTag(), isObjectLike2 = requireIsObjectLike();
    var boolTag2 = "[object Boolean]";
    function isBoolean2(value) {
      return value === true || value === false || isObjectLike2(value) && baseGetTag2(value) == boolTag2;
    }
    __name(isBoolean2, "isBoolean");
    isBoolean_1 = isBoolean2;
    return isBoolean_1;
  }
  __name(requireIsBoolean, "requireIsBoolean");
  var isBooleanExports = requireIsBoolean();
  const isBoolean$1 = /* @__PURE__ */ getDefaultExportFromCjs(isBooleanExports);
  function _typeof$j(o2) {
    "@babel/helpers - typeof";
    return _typeof$j = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$j(o2);
  }
  __name(_typeof$j, "_typeof$j");
  function _extends$d() {
    _extends$d = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$d.apply(this, arguments);
  }
  __name(_extends$d, "_extends$d");
  function _slicedToArray$2(arr, i2) {
    return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i2) || _unsupportedIterableToArray$3(arr, i2) || _nonIterableRest$2();
  }
  __name(_slicedToArray$2, "_slicedToArray$2");
  function _nonIterableRest$2() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableRest$2, "_nonIterableRest$2");
  function _unsupportedIterableToArray$3(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$3(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$3(o2, minLen);
  }
  __name(_unsupportedIterableToArray$3, "_unsupportedIterableToArray$3");
  function _arrayLikeToArray$3(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$3, "_arrayLikeToArray$3");
  function _iterableToArrayLimit$2(r2, l) {
    var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
    if (null != t2) {
      var e, n2, i2, u2, a2 = [], f = true, o2 = false;
      try {
        if (i2 = (t2 = t2.call(r2)).next, 0 === l) ;
        else for (; !(f = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l); f = true) ;
      } catch (r3) {
        o2 = true, n2 = r3;
      } finally {
        try {
          if (!f && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
        } finally {
          if (o2) throw n2;
        }
      }
      return a2;
    }
  }
  __name(_iterableToArrayLimit$2, "_iterableToArrayLimit$2");
  function _arrayWithHoles$2(arr) {
    if (Array.isArray(arr)) return arr;
  }
  __name(_arrayWithHoles$2, "_arrayWithHoles$2");
  function ownKeys$g(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$g, "ownKeys$g");
  function _objectSpread$g(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$g(Object(t2), true).forEach(function(r3) {
        _defineProperty$j(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$g(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$g, "_objectSpread$g");
  function _defineProperty$j(obj, key, value) {
    key = _toPropertyKey$j(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$j, "_defineProperty$j");
  function _toPropertyKey$j(t2) {
    var i2 = _toPrimitive$j(t2, "string");
    return "symbol" == _typeof$j(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$j, "_toPropertyKey$j");
  function _toPrimitive$j(t2, r2) {
    if ("object" != _typeof$j(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$j(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$j, "_toPrimitive$j");
  var getTrapezoidPath = /* @__PURE__ */ __name(function getTrapezoidPath2(x2, y2, upperWidth, lowerWidth, height) {
    var widthGap = upperWidth - lowerWidth;
    var path;
    path = "M ".concat(x2, ",").concat(y2);
    path += "L ".concat(x2 + upperWidth, ",").concat(y2);
    path += "L ".concat(x2 + upperWidth - widthGap / 2, ",").concat(y2 + height);
    path += "L ".concat(x2 + upperWidth - widthGap / 2 - lowerWidth, ",").concat(y2 + height);
    path += "L ".concat(x2, ",").concat(y2, " Z");
    return path;
  }, "getTrapezoidPath");
  var defaultProps$1 = {
    x: 0,
    y: 0,
    upperWidth: 0,
    lowerWidth: 0,
    height: 0,
    isUpdateAnimationActive: false,
    animationBegin: 0,
    animationDuration: 1500,
    animationEasing: "ease"
  };
  var Trapezoid = /* @__PURE__ */ __name(function Trapezoid2(props) {
    var trapezoidProps = _objectSpread$g(_objectSpread$g({}, defaultProps$1), props);
    var pathRef = reactExports.useRef();
    var _useState = reactExports.useState(-1), _useState2 = _slicedToArray$2(_useState, 2), totalLength = _useState2[0], setTotalLength = _useState2[1];
    reactExports.useEffect(function() {
      if (pathRef.current && pathRef.current.getTotalLength) {
        try {
          var pathTotalLength = pathRef.current.getTotalLength();
          if (pathTotalLength) {
            setTotalLength(pathTotalLength);
          }
        } catch (err) {
        }
      }
    }, []);
    var x2 = trapezoidProps.x, y2 = trapezoidProps.y, upperWidth = trapezoidProps.upperWidth, lowerWidth = trapezoidProps.lowerWidth, height = trapezoidProps.height, className = trapezoidProps.className;
    var animationEasing = trapezoidProps.animationEasing, animationDuration = trapezoidProps.animationDuration, animationBegin = trapezoidProps.animationBegin, isUpdateAnimationActive = trapezoidProps.isUpdateAnimationActive;
    if (x2 !== +x2 || y2 !== +y2 || upperWidth !== +upperWidth || lowerWidth !== +lowerWidth || height !== +height || upperWidth === 0 && lowerWidth === 0 || height === 0) {
      return null;
    }
    var layerClass = clsx("recharts-trapezoid", className);
    if (!isUpdateAnimationActive) {
      return /* @__PURE__ */ React.createElement("g", null, /* @__PURE__ */ React.createElement("path", _extends$d({}, filterProps(trapezoidProps, true), {
        className: layerClass,
        d: getTrapezoidPath(x2, y2, upperWidth, lowerWidth, height)
      })));
    }
    return /* @__PURE__ */ React.createElement(Animate, {
      canBegin: totalLength > 0,
      from: {
        upperWidth: 0,
        lowerWidth: 0,
        height,
        x: x2,
        y: y2
      },
      to: {
        upperWidth,
        lowerWidth,
        height,
        x: x2,
        y: y2
      },
      duration: animationDuration,
      animationEasing,
      isActive: isUpdateAnimationActive
    }, function(_ref) {
      var currUpperWidth = _ref.upperWidth, currLowerWidth = _ref.lowerWidth, currHeight = _ref.height, currX = _ref.x, currY = _ref.y;
      return /* @__PURE__ */ React.createElement(Animate, {
        canBegin: totalLength > 0,
        from: "0px ".concat(totalLength === -1 ? 1 : totalLength, "px"),
        to: "".concat(totalLength, "px 0px"),
        attributeName: "strokeDasharray",
        begin: animationBegin,
        duration: animationDuration,
        easing: animationEasing
      }, /* @__PURE__ */ React.createElement("path", _extends$d({}, filterProps(trapezoidProps, true), {
        className: layerClass,
        d: getTrapezoidPath(currX, currY, currUpperWidth, currLowerWidth, currHeight),
        ref: pathRef
      })));
    });
  }, "Trapezoid");
  var _excluded$6 = ["option", "shapeType", "propTransformer", "activeClassName", "isActive"];
  function _typeof$i(o2) {
    "@babel/helpers - typeof";
    return _typeof$i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$i(o2);
  }
  __name(_typeof$i, "_typeof$i");
  function _objectWithoutProperties$6(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$6(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$6, "_objectWithoutProperties$6");
  function _objectWithoutPropertiesLoose$6(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$6, "_objectWithoutPropertiesLoose$6");
  function ownKeys$f(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$f, "ownKeys$f");
  function _objectSpread$f(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$f(Object(t2), true).forEach(function(r3) {
        _defineProperty$i(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$f(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$f, "_objectSpread$f");
  function _defineProperty$i(obj, key, value) {
    key = _toPropertyKey$i(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$i, "_defineProperty$i");
  function _toPropertyKey$i(t2) {
    var i2 = _toPrimitive$i(t2, "string");
    return "symbol" == _typeof$i(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$i, "_toPropertyKey$i");
  function _toPrimitive$i(t2, r2) {
    if ("object" != _typeof$i(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$i(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$i, "_toPrimitive$i");
  function defaultPropTransformer(option, props) {
    return _objectSpread$f(_objectSpread$f({}, props), option);
  }
  __name(defaultPropTransformer, "defaultPropTransformer");
  function isSymbolsProps(shapeType, _elementProps) {
    return shapeType === "symbols";
  }
  __name(isSymbolsProps, "isSymbolsProps");
  function ShapeSelector(_ref) {
    var shapeType = _ref.shapeType, elementProps = _ref.elementProps;
    switch (shapeType) {
      case "rectangle":
        return /* @__PURE__ */ React.createElement(Rectangle, elementProps);
      case "trapezoid":
        return /* @__PURE__ */ React.createElement(Trapezoid, elementProps);
      case "sector":
        return /* @__PURE__ */ React.createElement(Sector, elementProps);
      case "symbols":
        if (isSymbolsProps(shapeType)) {
          return /* @__PURE__ */ React.createElement(Symbols, elementProps);
        }
        break;
      default:
        return null;
    }
  }
  __name(ShapeSelector, "ShapeSelector");
  function getPropsFromShapeOption(option) {
    if (/* @__PURE__ */ reactExports.isValidElement(option)) {
      return option.props;
    }
    return option;
  }
  __name(getPropsFromShapeOption, "getPropsFromShapeOption");
  function Shape(_ref2) {
    var option = _ref2.option, shapeType = _ref2.shapeType, _ref2$propTransformer = _ref2.propTransformer, propTransformer = _ref2$propTransformer === void 0 ? defaultPropTransformer : _ref2$propTransformer, _ref2$activeClassName = _ref2.activeClassName, activeClassName = _ref2$activeClassName === void 0 ? "recharts-active-shape" : _ref2$activeClassName, isActive = _ref2.isActive, props = _objectWithoutProperties$6(_ref2, _excluded$6);
    var shape;
    if (/* @__PURE__ */ reactExports.isValidElement(option)) {
      shape = /* @__PURE__ */ reactExports.cloneElement(option, _objectSpread$f(_objectSpread$f({}, props), getPropsFromShapeOption(option)));
    } else if (isFunction$2(option)) {
      shape = option(props);
    } else if (isPlainObject$1(option) && !isBoolean$1(option)) {
      var nextProps = propTransformer(option, props);
      shape = /* @__PURE__ */ React.createElement(ShapeSelector, {
        shapeType,
        elementProps: nextProps
      });
    } else {
      var elementProps = props;
      shape = /* @__PURE__ */ React.createElement(ShapeSelector, {
        shapeType,
        elementProps
      });
    }
    if (isActive) {
      return /* @__PURE__ */ React.createElement(Layer, {
        className: activeClassName
      }, shape);
    }
    return shape;
  }
  __name(Shape, "Shape");
  function isFunnel(graphicalItem, _item) {
    return _item != null && "trapezoids" in graphicalItem.props;
  }
  __name(isFunnel, "isFunnel");
  function isPie(graphicalItem, _item) {
    return _item != null && "sectors" in graphicalItem.props;
  }
  __name(isPie, "isPie");
  function isScatter(graphicalItem, _item) {
    return _item != null && "points" in graphicalItem.props;
  }
  __name(isScatter, "isScatter");
  function compareFunnel(shapeData, activeTooltipItem) {
    var _activeTooltipItem$la, _activeTooltipItem$la2;
    var xMatches = shapeData.x === (activeTooltipItem === null || activeTooltipItem === void 0 || (_activeTooltipItem$la = activeTooltipItem.labelViewBox) === null || _activeTooltipItem$la === void 0 ? void 0 : _activeTooltipItem$la.x) || shapeData.x === activeTooltipItem.x;
    var yMatches = shapeData.y === (activeTooltipItem === null || activeTooltipItem === void 0 || (_activeTooltipItem$la2 = activeTooltipItem.labelViewBox) === null || _activeTooltipItem$la2 === void 0 ? void 0 : _activeTooltipItem$la2.y) || shapeData.y === activeTooltipItem.y;
    return xMatches && yMatches;
  }
  __name(compareFunnel, "compareFunnel");
  function comparePie(shapeData, activeTooltipItem) {
    var startAngleMatches = shapeData.endAngle === activeTooltipItem.endAngle;
    var endAngleMatches = shapeData.startAngle === activeTooltipItem.startAngle;
    return startAngleMatches && endAngleMatches;
  }
  __name(comparePie, "comparePie");
  function compareScatter(shapeData, activeTooltipItem) {
    var xMatches = shapeData.x === activeTooltipItem.x;
    var yMatches = shapeData.y === activeTooltipItem.y;
    var zMatches = shapeData.z === activeTooltipItem.z;
    return xMatches && yMatches && zMatches;
  }
  __name(compareScatter, "compareScatter");
  function getComparisonFn(graphicalItem, activeItem) {
    var comparison;
    if (isFunnel(graphicalItem, activeItem)) {
      comparison = compareFunnel;
    } else if (isPie(graphicalItem, activeItem)) {
      comparison = comparePie;
    } else if (isScatter(graphicalItem, activeItem)) {
      comparison = compareScatter;
    }
    return comparison;
  }
  __name(getComparisonFn, "getComparisonFn");
  function getShapeDataKey(graphicalItem, activeItem) {
    var shapeKey;
    if (isFunnel(graphicalItem, activeItem)) {
      shapeKey = "trapezoids";
    } else if (isPie(graphicalItem, activeItem)) {
      shapeKey = "sectors";
    } else if (isScatter(graphicalItem, activeItem)) {
      shapeKey = "points";
    }
    return shapeKey;
  }
  __name(getShapeDataKey, "getShapeDataKey");
  function getActiveShapeTooltipPayload(graphicalItem, activeItem) {
    if (isFunnel(graphicalItem, activeItem)) {
      var _activeItem$tooltipPa;
      return (_activeItem$tooltipPa = activeItem.tooltipPayload) === null || _activeItem$tooltipPa === void 0 || (_activeItem$tooltipPa = _activeItem$tooltipPa[0]) === null || _activeItem$tooltipPa === void 0 || (_activeItem$tooltipPa = _activeItem$tooltipPa.payload) === null || _activeItem$tooltipPa === void 0 ? void 0 : _activeItem$tooltipPa.payload;
    }
    if (isPie(graphicalItem, activeItem)) {
      var _activeItem$tooltipPa2;
      return (_activeItem$tooltipPa2 = activeItem.tooltipPayload) === null || _activeItem$tooltipPa2 === void 0 || (_activeItem$tooltipPa2 = _activeItem$tooltipPa2[0]) === null || _activeItem$tooltipPa2 === void 0 || (_activeItem$tooltipPa2 = _activeItem$tooltipPa2.payload) === null || _activeItem$tooltipPa2 === void 0 ? void 0 : _activeItem$tooltipPa2.payload;
    }
    if (isScatter(graphicalItem, activeItem)) {
      return activeItem.payload;
    }
    return {};
  }
  __name(getActiveShapeTooltipPayload, "getActiveShapeTooltipPayload");
  function getActiveShapeIndexForTooltip(_ref3) {
    var activeTooltipItem = _ref3.activeTooltipItem, graphicalItem = _ref3.graphicalItem, itemData = _ref3.itemData;
    var shapeKey = getShapeDataKey(graphicalItem, activeTooltipItem);
    var tooltipPayload = getActiveShapeTooltipPayload(graphicalItem, activeTooltipItem);
    var activeItemMatches = itemData.filter(function(datum, dataIndex) {
      var valuesMatch = isEqual$1(tooltipPayload, datum);
      var mouseCoordinateMatches = graphicalItem.props[shapeKey].filter(function(shapeData) {
        var comparison = getComparisonFn(graphicalItem, activeTooltipItem);
        return comparison(shapeData, activeTooltipItem);
      });
      var indexOfMouseCoordinates = graphicalItem.props[shapeKey].indexOf(mouseCoordinateMatches[mouseCoordinateMatches.length - 1]);
      var coordinatesMatch = dataIndex === indexOfMouseCoordinates;
      return valuesMatch && coordinatesMatch;
    });
    var activeIndex = itemData.indexOf(activeItemMatches[activeItemMatches.length - 1]);
    return activeIndex;
  }
  __name(getActiveShapeIndexForTooltip, "getActiveShapeIndexForTooltip");
  var _Pie;
  function _typeof$h(o2) {
    "@babel/helpers - typeof";
    return _typeof$h = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$h(o2);
  }
  __name(_typeof$h, "_typeof$h");
  function _extends$c() {
    _extends$c = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$c.apply(this, arguments);
  }
  __name(_extends$c, "_extends$c");
  function ownKeys$e(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$e, "ownKeys$e");
  function _objectSpread$e(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$e(Object(t2), true).forEach(function(r3) {
        _defineProperty$h(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$e(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$e, "_objectSpread$e");
  function _classCallCheck$c(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$c, "_classCallCheck$c");
  function _defineProperties$c(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$h(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$c, "_defineProperties$c");
  function _createClass$c(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$c(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties$c(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$c, "_createClass$c");
  function _callSuper$a(t2, o2, e) {
    return o2 = _getPrototypeOf$a(o2), _possibleConstructorReturn$a(t2, _isNativeReflectConstruct$a() ? Reflect.construct(o2, e || [], _getPrototypeOf$a(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$a, "_callSuper$a");
  function _possibleConstructorReturn$a(self2, call) {
    if (call && (_typeof$h(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$a(self2);
  }
  __name(_possibleConstructorReturn$a, "_possibleConstructorReturn$a");
  function _assertThisInitialized$a(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$a, "_assertThisInitialized$a");
  function _isNativeReflectConstruct$a() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$a = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$a, "_isNativeReflectConstruct$a");
  function _getPrototypeOf$a(o2) {
    _getPrototypeOf$a = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$a(o2);
  }
  __name(_getPrototypeOf$a, "_getPrototypeOf$a");
  function _inherits$a(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$a(subClass, superClass);
  }
  __name(_inherits$a, "_inherits$a");
  function _setPrototypeOf$a(o2, p2) {
    _setPrototypeOf$a = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$a(o2, p2);
  }
  __name(_setPrototypeOf$a, "_setPrototypeOf$a");
  function _defineProperty$h(obj, key, value) {
    key = _toPropertyKey$h(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$h, "_defineProperty$h");
  function _toPropertyKey$h(t2) {
    var i2 = _toPrimitive$h(t2, "string");
    return "symbol" == _typeof$h(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$h, "_toPropertyKey$h");
  function _toPrimitive$h(t2, r2) {
    if ("object" != _typeof$h(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$h(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$h, "_toPrimitive$h");
  var Pie = /* @__PURE__ */ (function(_PureComponent) {
    function Pie2(props) {
      var _this;
      _classCallCheck$c(this, Pie2);
      _this = _callSuper$a(this, Pie2, [props]);
      _defineProperty$h(_this, "pieRef", null);
      _defineProperty$h(_this, "sectorRefs", []);
      _defineProperty$h(_this, "id", uniqueId("recharts-pie-"));
      _defineProperty$h(_this, "handleAnimationEnd", function() {
        var onAnimationEnd = _this.props.onAnimationEnd;
        _this.setState({
          isAnimationFinished: true
        });
        if (isFunction$2(onAnimationEnd)) {
          onAnimationEnd();
        }
      });
      _defineProperty$h(_this, "handleAnimationStart", function() {
        var onAnimationStart = _this.props.onAnimationStart;
        _this.setState({
          isAnimationFinished: false
        });
        if (isFunction$2(onAnimationStart)) {
          onAnimationStart();
        }
      });
      _this.state = {
        isAnimationFinished: !props.isAnimationActive,
        prevIsAnimationActive: props.isAnimationActive,
        prevAnimationId: props.animationId,
        sectorToFocus: 0
      };
      return _this;
    }
    __name(Pie2, "Pie");
    _inherits$a(Pie2, _PureComponent);
    return _createClass$c(Pie2, [{
      key: "isActiveIndex",
      value: /* @__PURE__ */ __name(function isActiveIndex(i2) {
        var activeIndex = this.props.activeIndex;
        if (Array.isArray(activeIndex)) {
          return activeIndex.indexOf(i2) !== -1;
        }
        return i2 === activeIndex;
      }, "isActiveIndex")
    }, {
      key: "hasActiveIndex",
      value: /* @__PURE__ */ __name(function hasActiveIndex() {
        var activeIndex = this.props.activeIndex;
        return Array.isArray(activeIndex) ? activeIndex.length !== 0 : activeIndex || activeIndex === 0;
      }, "hasActiveIndex")
    }, {
      key: "renderLabels",
      value: /* @__PURE__ */ __name(function renderLabels(sectors) {
        var isAnimationActive = this.props.isAnimationActive;
        if (isAnimationActive && !this.state.isAnimationFinished) {
          return null;
        }
        var _this$props = this.props, label = _this$props.label, labelLine = _this$props.labelLine, dataKey = _this$props.dataKey, valueKey = _this$props.valueKey;
        var pieProps = filterProps(this.props, false);
        var customLabelProps = filterProps(label, false);
        var customLabelLineProps = filterProps(labelLine, false);
        var offsetRadius = label && label.offsetRadius || 20;
        var labels = sectors.map(function(entry, i2) {
          var midAngle = (entry.startAngle + entry.endAngle) / 2;
          var endPoint = polarToCartesian(entry.cx, entry.cy, entry.outerRadius + offsetRadius, midAngle);
          var labelProps = _objectSpread$e(_objectSpread$e(_objectSpread$e(_objectSpread$e({}, pieProps), entry), {}, {
            stroke: "none"
          }, customLabelProps), {}, {
            index: i2,
            textAnchor: Pie2.getTextAnchor(endPoint.x, entry.cx)
          }, endPoint);
          var lineProps = _objectSpread$e(_objectSpread$e(_objectSpread$e(_objectSpread$e({}, pieProps), entry), {}, {
            fill: "none",
            stroke: entry.fill
          }, customLabelLineProps), {}, {
            index: i2,
            points: [polarToCartesian(entry.cx, entry.cy, entry.outerRadius, midAngle), endPoint]
          });
          var realDataKey = dataKey;
          if (isNil(dataKey) && isNil(valueKey)) {
            realDataKey = "value";
          } else if (isNil(dataKey)) {
            realDataKey = valueKey;
          }
          return (
            // eslint-disable-next-line react/no-array-index-key
            /* @__PURE__ */ React.createElement(Layer, {
              key: "label-".concat(entry.startAngle, "-").concat(entry.endAngle, "-").concat(entry.midAngle, "-").concat(i2)
            }, labelLine && Pie2.renderLabelLineItem(labelLine, lineProps, "line"), Pie2.renderLabelItem(label, labelProps, getValueByDataKey(entry, realDataKey)))
          );
        });
        return /* @__PURE__ */ React.createElement(Layer, {
          className: "recharts-pie-labels"
        }, labels);
      }, "renderLabels")
    }, {
      key: "renderSectorsStatically",
      value: /* @__PURE__ */ __name(function renderSectorsStatically(sectors) {
        var _this2 = this;
        var _this$props2 = this.props, activeShape = _this$props2.activeShape, blendStroke = _this$props2.blendStroke, inactiveShapeProp = _this$props2.inactiveShape;
        return sectors.map(function(entry, i2) {
          if ((entry === null || entry === void 0 ? void 0 : entry.startAngle) === 0 && (entry === null || entry === void 0 ? void 0 : entry.endAngle) === 0 && sectors.length !== 1) return null;
          var isActive = _this2.isActiveIndex(i2);
          var inactiveShape = inactiveShapeProp && _this2.hasActiveIndex() ? inactiveShapeProp : null;
          var sectorOptions = isActive ? activeShape : inactiveShape;
          var sectorProps = _objectSpread$e(_objectSpread$e({}, entry), {}, {
            stroke: blendStroke ? entry.fill : entry.stroke,
            tabIndex: -1
          });
          return /* @__PURE__ */ React.createElement(Layer, _extends$c({
            ref: /* @__PURE__ */ __name(function ref(_ref) {
              if (_ref && !_this2.sectorRefs.includes(_ref)) {
                _this2.sectorRefs.push(_ref);
              }
            }, "ref"),
            tabIndex: -1,
            className: "recharts-pie-sector"
          }, adaptEventsOfChild(_this2.props, entry, i2), {
            // eslint-disable-next-line react/no-array-index-key
            key: "sector-".concat(entry === null || entry === void 0 ? void 0 : entry.startAngle, "-").concat(entry === null || entry === void 0 ? void 0 : entry.endAngle, "-").concat(entry.midAngle, "-").concat(i2)
          }), /* @__PURE__ */ React.createElement(Shape, _extends$c({
            option: sectorOptions,
            isActive,
            shapeType: "sector"
          }, sectorProps)));
        });
      }, "renderSectorsStatically")
    }, {
      key: "renderSectorsWithAnimation",
      value: /* @__PURE__ */ __name(function renderSectorsWithAnimation() {
        var _this3 = this;
        var _this$props3 = this.props, sectors = _this$props3.sectors, isAnimationActive = _this$props3.isAnimationActive, animationBegin = _this$props3.animationBegin, animationDuration = _this$props3.animationDuration, animationEasing = _this$props3.animationEasing, animationId = _this$props3.animationId;
        var _this$state = this.state, prevSectors = _this$state.prevSectors, prevIsAnimationActive = _this$state.prevIsAnimationActive;
        return /* @__PURE__ */ React.createElement(Animate, {
          begin: animationBegin,
          duration: animationDuration,
          isActive: isAnimationActive,
          easing: animationEasing,
          from: {
            t: 0
          },
          to: {
            t: 1
          },
          key: "pie-".concat(animationId, "-").concat(prevIsAnimationActive),
          onAnimationStart: this.handleAnimationStart,
          onAnimationEnd: this.handleAnimationEnd
        }, function(_ref2) {
          var t2 = _ref2.t;
          var stepData = [];
          var first = sectors && sectors[0];
          var curAngle = first.startAngle;
          sectors.forEach(function(entry, index2) {
            var prev = prevSectors && prevSectors[index2];
            var paddingAngle = index2 > 0 ? get$1(entry, "paddingAngle", 0) : 0;
            if (prev) {
              var angleIp = interpolateNumber$2(prev.endAngle - prev.startAngle, entry.endAngle - entry.startAngle);
              var latest = _objectSpread$e(_objectSpread$e({}, entry), {}, {
                startAngle: curAngle + paddingAngle,
                endAngle: curAngle + angleIp(t2) + paddingAngle
              });
              stepData.push(latest);
              curAngle = latest.endAngle;
            } else {
              var endAngle = entry.endAngle, startAngle = entry.startAngle;
              var interpolatorAngle = interpolateNumber$2(0, endAngle - startAngle);
              var deltaAngle = interpolatorAngle(t2);
              var _latest = _objectSpread$e(_objectSpread$e({}, entry), {}, {
                startAngle: curAngle + paddingAngle,
                endAngle: curAngle + deltaAngle + paddingAngle
              });
              stepData.push(_latest);
              curAngle = _latest.endAngle;
            }
          });
          return /* @__PURE__ */ React.createElement(Layer, null, _this3.renderSectorsStatically(stepData));
        });
      }, "renderSectorsWithAnimation")
    }, {
      key: "attachKeyboardHandlers",
      value: /* @__PURE__ */ __name(function attachKeyboardHandlers(pieRef) {
        var _this4 = this;
        pieRef.onkeydown = function(e) {
          if (!e.altKey) {
            switch (e.key) {
              case "ArrowLeft": {
                var next = ++_this4.state.sectorToFocus % _this4.sectorRefs.length;
                _this4.sectorRefs[next].focus();
                _this4.setState({
                  sectorToFocus: next
                });
                break;
              }
              case "ArrowRight": {
                var _next = --_this4.state.sectorToFocus < 0 ? _this4.sectorRefs.length - 1 : _this4.state.sectorToFocus % _this4.sectorRefs.length;
                _this4.sectorRefs[_next].focus();
                _this4.setState({
                  sectorToFocus: _next
                });
                break;
              }
              case "Escape": {
                _this4.sectorRefs[_this4.state.sectorToFocus].blur();
                _this4.setState({
                  sectorToFocus: 0
                });
                break;
              }
            }
          }
        };
      }, "attachKeyboardHandlers")
    }, {
      key: "renderSectors",
      value: /* @__PURE__ */ __name(function renderSectors() {
        var _this$props4 = this.props, sectors = _this$props4.sectors, isAnimationActive = _this$props4.isAnimationActive;
        var prevSectors = this.state.prevSectors;
        if (isAnimationActive && sectors && sectors.length && (!prevSectors || !isEqual$1(prevSectors, sectors))) {
          return this.renderSectorsWithAnimation();
        }
        return this.renderSectorsStatically(sectors);
      }, "renderSectors")
    }, {
      key: "componentDidMount",
      value: /* @__PURE__ */ __name(function componentDidMount() {
        if (this.pieRef) {
          this.attachKeyboardHandlers(this.pieRef);
        }
      }, "componentDidMount")
    }, {
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _this5 = this;
        var _this$props5 = this.props, hide2 = _this$props5.hide, sectors = _this$props5.sectors, className = _this$props5.className, label = _this$props5.label, cx2 = _this$props5.cx, cy = _this$props5.cy, innerRadius = _this$props5.innerRadius, outerRadius = _this$props5.outerRadius, isAnimationActive = _this$props5.isAnimationActive;
        var isAnimationFinished = this.state.isAnimationFinished;
        if (hide2 || !sectors || !sectors.length || !isNumber(cx2) || !isNumber(cy) || !isNumber(innerRadius) || !isNumber(outerRadius)) {
          return null;
        }
        var layerClass = clsx("recharts-pie", className);
        return /* @__PURE__ */ React.createElement(Layer, {
          tabIndex: this.props.rootTabIndex,
          className: layerClass,
          ref: /* @__PURE__ */ __name(function ref(_ref3) {
            _this5.pieRef = _ref3;
          }, "ref")
        }, this.renderSectors(), label && this.renderLabels(sectors), Label.renderCallByParent(this.props, null, false), (!isAnimationActive || isAnimationFinished) && LabelList.renderCallByParent(this.props, sectors, false));
      }, "render")
    }], [{
      key: "getDerivedStateFromProps",
      value: /* @__PURE__ */ __name(function getDerivedStateFromProps(nextProps, prevState) {
        if (prevState.prevIsAnimationActive !== nextProps.isAnimationActive) {
          return {
            prevIsAnimationActive: nextProps.isAnimationActive,
            prevAnimationId: nextProps.animationId,
            curSectors: nextProps.sectors,
            prevSectors: [],
            isAnimationFinished: true
          };
        }
        if (nextProps.isAnimationActive && nextProps.animationId !== prevState.prevAnimationId) {
          return {
            prevAnimationId: nextProps.animationId,
            curSectors: nextProps.sectors,
            prevSectors: prevState.curSectors,
            isAnimationFinished: true
          };
        }
        if (nextProps.sectors !== prevState.curSectors) {
          return {
            curSectors: nextProps.sectors,
            isAnimationFinished: true
          };
        }
        return null;
      }, "getDerivedStateFromProps")
    }, {
      key: "getTextAnchor",
      value: /* @__PURE__ */ __name(function getTextAnchor(x2, cx2) {
        if (x2 > cx2) {
          return "start";
        }
        if (x2 < cx2) {
          return "end";
        }
        return "middle";
      }, "getTextAnchor")
    }, {
      key: "renderLabelLineItem",
      value: /* @__PURE__ */ __name(function renderLabelLineItem(option, props, key) {
        if (/* @__PURE__ */ React.isValidElement(option)) {
          return /* @__PURE__ */ React.cloneElement(option, props);
        }
        if (isFunction$2(option)) {
          return option(props);
        }
        var className = clsx("recharts-pie-label-line", typeof option !== "boolean" ? option.className : "");
        return /* @__PURE__ */ React.createElement(Curve, _extends$c({}, props, {
          key,
          type: "linear",
          className
        }));
      }, "renderLabelLineItem")
    }, {
      key: "renderLabelItem",
      value: /* @__PURE__ */ __name(function renderLabelItem(option, props, value) {
        if (/* @__PURE__ */ React.isValidElement(option)) {
          return /* @__PURE__ */ React.cloneElement(option, props);
        }
        var label = value;
        if (isFunction$2(option)) {
          label = option(props);
          if (/* @__PURE__ */ React.isValidElement(label)) {
            return label;
          }
        }
        var className = clsx("recharts-pie-label-text", typeof option !== "boolean" && !isFunction$2(option) ? option.className : "");
        return /* @__PURE__ */ React.createElement(Text, _extends$c({}, props, {
          alignmentBaseline: "middle",
          className
        }), label);
      }, "renderLabelItem")
    }]);
  })(reactExports.PureComponent);
  _Pie = Pie;
  _defineProperty$h(Pie, "displayName", "Pie");
  _defineProperty$h(Pie, "defaultProps", {
    stroke: "#fff",
    fill: "#808080",
    legendType: "rect",
    cx: "50%",
    cy: "50%",
    startAngle: 0,
    endAngle: 360,
    innerRadius: 0,
    outerRadius: "80%",
    paddingAngle: 0,
    labelLine: true,
    hide: false,
    minAngle: 0,
    isAnimationActive: !Global.isSsr,
    animationBegin: 400,
    animationDuration: 1500,
    animationEasing: "ease",
    nameKey: "name",
    blendStroke: false,
    rootTabIndex: 0
  });
  _defineProperty$h(Pie, "parseDeltaAngle", function(startAngle, endAngle) {
    var sign2 = mathSign(endAngle - startAngle);
    var deltaAngle = Math.min(Math.abs(endAngle - startAngle), 360);
    return sign2 * deltaAngle;
  });
  _defineProperty$h(Pie, "getRealPieData", function(itemProps) {
    var data = itemProps.data, children = itemProps.children;
    var presentationProps = filterProps(itemProps, false);
    var cells = findAllByType(children, Cell);
    if (data && data.length) {
      return data.map(function(entry, index2) {
        return _objectSpread$e(_objectSpread$e(_objectSpread$e({
          payload: entry
        }, presentationProps), entry), cells && cells[index2] && cells[index2].props);
      });
    }
    if (cells && cells.length) {
      return cells.map(function(cell) {
        return _objectSpread$e(_objectSpread$e({}, presentationProps), cell.props);
      });
    }
    return [];
  });
  _defineProperty$h(Pie, "parseCoordinateOfPie", function(itemProps, offset2) {
    var top = offset2.top, left = offset2.left, width = offset2.width, height = offset2.height;
    var maxPieRadius = getMaxRadius(width, height);
    var cx2 = left + getPercentValue(itemProps.cx, width, width / 2);
    var cy = top + getPercentValue(itemProps.cy, height, height / 2);
    var innerRadius = getPercentValue(itemProps.innerRadius, maxPieRadius, 0);
    var outerRadius = getPercentValue(itemProps.outerRadius, maxPieRadius, maxPieRadius * 0.8);
    var maxRadius = itemProps.maxRadius || Math.sqrt(width * width + height * height) / 2;
    return {
      cx: cx2,
      cy,
      innerRadius,
      outerRadius,
      maxRadius
    };
  });
  _defineProperty$h(Pie, "getComposedData", function(_ref4) {
    var item = _ref4.item, offset2 = _ref4.offset;
    var itemProps = item.type.defaultProps !== void 0 ? _objectSpread$e(_objectSpread$e({}, item.type.defaultProps), item.props) : item.props;
    var pieData = _Pie.getRealPieData(itemProps);
    if (!pieData || !pieData.length) {
      return null;
    }
    var cornerRadius = itemProps.cornerRadius, startAngle = itemProps.startAngle, endAngle = itemProps.endAngle, paddingAngle = itemProps.paddingAngle, dataKey = itemProps.dataKey, nameKey = itemProps.nameKey, valueKey = itemProps.valueKey, tooltipType = itemProps.tooltipType;
    var minAngle = Math.abs(itemProps.minAngle);
    var coordinate = _Pie.parseCoordinateOfPie(itemProps, offset2);
    var deltaAngle = _Pie.parseDeltaAngle(startAngle, endAngle);
    var absDeltaAngle = Math.abs(deltaAngle);
    var realDataKey = dataKey;
    if (isNil(dataKey) && isNil(valueKey)) {
      warn(false, 'Use "dataKey" to specify the value of pie,\n      the props "valueKey" will be deprecated in 1.1.0');
      realDataKey = "value";
    } else if (isNil(dataKey)) {
      warn(false, 'Use "dataKey" to specify the value of pie,\n      the props "valueKey" will be deprecated in 1.1.0');
      realDataKey = valueKey;
    }
    var notZeroItemCount = pieData.filter(function(entry) {
      return getValueByDataKey(entry, realDataKey, 0) !== 0;
    }).length;
    var totalPadingAngle = (absDeltaAngle >= 360 ? notZeroItemCount : notZeroItemCount - 1) * paddingAngle;
    var realTotalAngle = absDeltaAngle - notZeroItemCount * minAngle - totalPadingAngle;
    var sum = pieData.reduce(function(result, entry) {
      var val = getValueByDataKey(entry, realDataKey, 0);
      return result + (isNumber(val) ? val : 0);
    }, 0);
    var sectors;
    if (sum > 0) {
      var prev;
      sectors = pieData.map(function(entry, i2) {
        var val = getValueByDataKey(entry, realDataKey, 0);
        var name = getValueByDataKey(entry, nameKey, i2);
        var percent = (isNumber(val) ? val : 0) / sum;
        var tempStartAngle;
        if (i2) {
          tempStartAngle = prev.endAngle + mathSign(deltaAngle) * paddingAngle * (val !== 0 ? 1 : 0);
        } else {
          tempStartAngle = startAngle;
        }
        var tempEndAngle = tempStartAngle + mathSign(deltaAngle) * ((val !== 0 ? minAngle : 0) + percent * realTotalAngle);
        var midAngle = (tempStartAngle + tempEndAngle) / 2;
        var middleRadius = (coordinate.innerRadius + coordinate.outerRadius) / 2;
        var tooltipPayload = [{
          name,
          value: val,
          payload: entry,
          dataKey: realDataKey,
          type: tooltipType
        }];
        var tooltipPosition = polarToCartesian(coordinate.cx, coordinate.cy, middleRadius, midAngle);
        prev = _objectSpread$e(_objectSpread$e(_objectSpread$e({
          percent,
          cornerRadius,
          name,
          tooltipPayload,
          midAngle,
          middleRadius,
          tooltipPosition
        }, entry), coordinate), {}, {
          value: getValueByDataKey(entry, realDataKey),
          startAngle: tempStartAngle,
          endAngle: tempEndAngle,
          payload: entry,
          paddingAngle: mathSign(deltaAngle) * paddingAngle
        });
        return prev;
      });
    }
    return _objectSpread$e(_objectSpread$e({}, coordinate), {}, {
      sectors,
      data: pieData
    });
  });
  var _baseRange;
  var hasRequired_baseRange;
  function require_baseRange() {
    if (hasRequired_baseRange) return _baseRange;
    hasRequired_baseRange = 1;
    var nativeCeil = Math.ceil, nativeMax = Math.max;
    function baseRange(start, end, step, fromRight) {
      var index2 = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length);
      while (length--) {
        result[fromRight ? length : ++index2] = start;
        start += step;
      }
      return result;
    }
    __name(baseRange, "baseRange");
    _baseRange = baseRange;
    return _baseRange;
  }
  __name(require_baseRange, "require_baseRange");
  var toFinite_1;
  var hasRequiredToFinite;
  function requireToFinite() {
    if (hasRequiredToFinite) return toFinite_1;
    hasRequiredToFinite = 1;
    var toNumber = requireToNumber();
    var INFINITY = 1 / 0, MAX_INTEGER = 17976931348623157e292;
    function toFinite(value) {
      if (!value) {
        return value === 0 ? value : 0;
      }
      value = toNumber(value);
      if (value === INFINITY || value === -INFINITY) {
        var sign2 = value < 0 ? -1 : 1;
        return sign2 * MAX_INTEGER;
      }
      return value === value ? value : 0;
    }
    __name(toFinite, "toFinite");
    toFinite_1 = toFinite;
    return toFinite_1;
  }
  __name(requireToFinite, "requireToFinite");
  var _createRange;
  var hasRequired_createRange;
  function require_createRange() {
    if (hasRequired_createRange) return _createRange;
    hasRequired_createRange = 1;
    var baseRange = require_baseRange(), isIterateeCall = require_isIterateeCall(), toFinite = requireToFinite();
    function createRange(fromRight) {
      return function(start, end, step) {
        if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
          end = step = void 0;
        }
        start = toFinite(start);
        if (end === void 0) {
          end = start;
          start = 0;
        } else {
          end = toFinite(end);
        }
        step = step === void 0 ? start < end ? 1 : -1 : toFinite(step);
        return baseRange(start, end, step, fromRight);
      };
    }
    __name(createRange, "createRange");
    _createRange = createRange;
    return _createRange;
  }
  __name(require_createRange, "require_createRange");
  var range_1;
  var hasRequiredRange;
  function requireRange() {
    if (hasRequiredRange) return range_1;
    hasRequiredRange = 1;
    var createRange = require_createRange();
    var range2 = createRange();
    range_1 = range2;
    return range_1;
  }
  __name(requireRange, "requireRange");
  var rangeExports = requireRange();
  const range = /* @__PURE__ */ getDefaultExportFromCjs(rangeExports);
  function _typeof$g(o2) {
    "@babel/helpers - typeof";
    return _typeof$g = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$g(o2);
  }
  __name(_typeof$g, "_typeof$g");
  function ownKeys$d(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$d, "ownKeys$d");
  function _objectSpread$d(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$d(Object(t2), true).forEach(function(r3) {
        _defineProperty$g(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$d(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$d, "_objectSpread$d");
  function _defineProperty$g(obj, key, value) {
    key = _toPropertyKey$g(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$g, "_defineProperty$g");
  function _toPropertyKey$g(t2) {
    var i2 = _toPrimitive$g(t2, "string");
    return "symbol" == _typeof$g(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$g, "_toPropertyKey$g");
  function _toPrimitive$g(t2, r2) {
    if ("object" != _typeof$g(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$g(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$g, "_toPrimitive$g");
  var PREFIX_LIST = ["Webkit", "Moz", "O", "ms"];
  var generatePrefixStyle = /* @__PURE__ */ __name(function generatePrefixStyle2(name, value) {
    var camelName = name.replace(/(\w)/, function(v) {
      return v.toUpperCase();
    });
    var result = PREFIX_LIST.reduce(function(res, entry) {
      return _objectSpread$d(_objectSpread$d({}, res), {}, _defineProperty$g({}, entry + camelName, value));
    }, {});
    result[name] = value;
    return result;
  }, "generatePrefixStyle");
  function _typeof$f(o2) {
    "@babel/helpers - typeof";
    return _typeof$f = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$f(o2);
  }
  __name(_typeof$f, "_typeof$f");
  function _extends$b() {
    _extends$b = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$b.apply(this, arguments);
  }
  __name(_extends$b, "_extends$b");
  function ownKeys$c(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$c, "ownKeys$c");
  function _objectSpread$c(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$c(Object(t2), true).forEach(function(r3) {
        _defineProperty$f(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$c(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$c, "_objectSpread$c");
  function _classCallCheck$b(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$b, "_classCallCheck$b");
  function _defineProperties$b(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$f(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$b, "_defineProperties$b");
  function _createClass$b(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$b(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties$b(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$b, "_createClass$b");
  function _callSuper$9(t2, o2, e) {
    return o2 = _getPrototypeOf$9(o2), _possibleConstructorReturn$9(t2, _isNativeReflectConstruct$9() ? Reflect.construct(o2, e || [], _getPrototypeOf$9(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$9, "_callSuper$9");
  function _possibleConstructorReturn$9(self2, call) {
    if (call && (_typeof$f(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$9(self2);
  }
  __name(_possibleConstructorReturn$9, "_possibleConstructorReturn$9");
  function _assertThisInitialized$9(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$9, "_assertThisInitialized$9");
  function _isNativeReflectConstruct$9() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$9 = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$9, "_isNativeReflectConstruct$9");
  function _getPrototypeOf$9(o2) {
    _getPrototypeOf$9 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$9(o2);
  }
  __name(_getPrototypeOf$9, "_getPrototypeOf$9");
  function _inherits$9(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$9(subClass, superClass);
  }
  __name(_inherits$9, "_inherits$9");
  function _setPrototypeOf$9(o2, p2) {
    _setPrototypeOf$9 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$9(o2, p2);
  }
  __name(_setPrototypeOf$9, "_setPrototypeOf$9");
  function _defineProperty$f(obj, key, value) {
    key = _toPropertyKey$f(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$f, "_defineProperty$f");
  function _toPropertyKey$f(t2) {
    var i2 = _toPrimitive$f(t2, "string");
    return "symbol" == _typeof$f(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$f, "_toPropertyKey$f");
  function _toPrimitive$f(t2, r2) {
    if ("object" != _typeof$f(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$f(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$f, "_toPrimitive$f");
  var createScale = /* @__PURE__ */ __name(function createScale2(_ref) {
    var data = _ref.data, startIndex = _ref.startIndex, endIndex = _ref.endIndex, x2 = _ref.x, width = _ref.width, travellerWidth = _ref.travellerWidth;
    if (!data || !data.length) {
      return {};
    }
    var len = data.length;
    var scale = point().domain(range(0, len)).range([x2, x2 + width - travellerWidth]);
    var scaleValues = scale.domain().map(function(entry) {
      return scale(entry);
    });
    return {
      isTextActive: false,
      isSlideMoving: false,
      isTravellerMoving: false,
      isTravellerFocused: false,
      startX: scale(startIndex),
      endX: scale(endIndex),
      scale,
      scaleValues
    };
  }, "createScale");
  var isTouch = /* @__PURE__ */ __name(function isTouch2(e) {
    return e.changedTouches && !!e.changedTouches.length;
  }, "isTouch");
  var Brush = /* @__PURE__ */ (function(_PureComponent) {
    function Brush2(props) {
      var _this;
      _classCallCheck$b(this, Brush2);
      _this = _callSuper$9(this, Brush2, [props]);
      _defineProperty$f(_this, "handleDrag", function(e) {
        if (_this.leaveTimer) {
          clearTimeout(_this.leaveTimer);
          _this.leaveTimer = null;
        }
        if (_this.state.isTravellerMoving) {
          _this.handleTravellerMove(e);
        } else if (_this.state.isSlideMoving) {
          _this.handleSlideDrag(e);
        }
      });
      _defineProperty$f(_this, "handleTouchMove", function(e) {
        if (e.changedTouches != null && e.changedTouches.length > 0) {
          _this.handleDrag(e.changedTouches[0]);
        }
      });
      _defineProperty$f(_this, "handleDragEnd", function() {
        _this.setState({
          isTravellerMoving: false,
          isSlideMoving: false
        }, function() {
          var _this$props = _this.props, endIndex = _this$props.endIndex, onDragEnd = _this$props.onDragEnd, startIndex = _this$props.startIndex;
          onDragEnd === null || onDragEnd === void 0 || onDragEnd({
            endIndex,
            startIndex
          });
        });
        _this.detachDragEndListener();
      });
      _defineProperty$f(_this, "handleLeaveWrapper", function() {
        if (_this.state.isTravellerMoving || _this.state.isSlideMoving) {
          _this.leaveTimer = window.setTimeout(_this.handleDragEnd, _this.props.leaveTimeOut);
        }
      });
      _defineProperty$f(_this, "handleEnterSlideOrTraveller", function() {
        _this.setState({
          isTextActive: true
        });
      });
      _defineProperty$f(_this, "handleLeaveSlideOrTraveller", function() {
        _this.setState({
          isTextActive: false
        });
      });
      _defineProperty$f(_this, "handleSlideDragStart", function(e) {
        var event = isTouch(e) ? e.changedTouches[0] : e;
        _this.setState({
          isTravellerMoving: false,
          isSlideMoving: true,
          slideMoveStartX: event.pageX
        });
        _this.attachDragEndListener();
      });
      _this.travellerDragStartHandlers = {
        startX: _this.handleTravellerDragStart.bind(_this, "startX"),
        endX: _this.handleTravellerDragStart.bind(_this, "endX")
      };
      _this.state = {};
      return _this;
    }
    __name(Brush2, "Brush");
    _inherits$9(Brush2, _PureComponent);
    return _createClass$b(Brush2, [{
      key: "componentWillUnmount",
      value: /* @__PURE__ */ __name(function componentWillUnmount() {
        if (this.leaveTimer) {
          clearTimeout(this.leaveTimer);
          this.leaveTimer = null;
        }
        this.detachDragEndListener();
      }, "componentWillUnmount")
    }, {
      key: "getIndex",
      value: /* @__PURE__ */ __name(function getIndex(_ref2) {
        var startX = _ref2.startX, endX = _ref2.endX;
        var scaleValues = this.state.scaleValues;
        var _this$props2 = this.props, gap = _this$props2.gap, data = _this$props2.data;
        var lastIndex = data.length - 1;
        var min2 = Math.min(startX, endX);
        var max2 = Math.max(startX, endX);
        var minIndex = Brush2.getIndexInRange(scaleValues, min2);
        var maxIndex = Brush2.getIndexInRange(scaleValues, max2);
        return {
          startIndex: minIndex - minIndex % gap,
          endIndex: maxIndex === lastIndex ? lastIndex : maxIndex - maxIndex % gap
        };
      }, "getIndex")
    }, {
      key: "getTextOfTick",
      value: /* @__PURE__ */ __name(function getTextOfTick(index2) {
        var _this$props3 = this.props, data = _this$props3.data, tickFormatter = _this$props3.tickFormatter, dataKey = _this$props3.dataKey;
        var text = getValueByDataKey(data[index2], dataKey, index2);
        return isFunction$2(tickFormatter) ? tickFormatter(text, index2) : text;
      }, "getTextOfTick")
    }, {
      key: "attachDragEndListener",
      value: /* @__PURE__ */ __name(function attachDragEndListener() {
        window.addEventListener("mouseup", this.handleDragEnd, true);
        window.addEventListener("touchend", this.handleDragEnd, true);
        window.addEventListener("mousemove", this.handleDrag, true);
      }, "attachDragEndListener")
    }, {
      key: "detachDragEndListener",
      value: /* @__PURE__ */ __name(function detachDragEndListener() {
        window.removeEventListener("mouseup", this.handleDragEnd, true);
        window.removeEventListener("touchend", this.handleDragEnd, true);
        window.removeEventListener("mousemove", this.handleDrag, true);
      }, "detachDragEndListener")
    }, {
      key: "handleSlideDrag",
      value: /* @__PURE__ */ __name(function handleSlideDrag(e) {
        var _this$state = this.state, slideMoveStartX = _this$state.slideMoveStartX, startX = _this$state.startX, endX = _this$state.endX;
        var _this$props4 = this.props, x2 = _this$props4.x, width = _this$props4.width, travellerWidth = _this$props4.travellerWidth, startIndex = _this$props4.startIndex, endIndex = _this$props4.endIndex, onChange = _this$props4.onChange;
        var delta = e.pageX - slideMoveStartX;
        if (delta > 0) {
          delta = Math.min(delta, x2 + width - travellerWidth - endX, x2 + width - travellerWidth - startX);
        } else if (delta < 0) {
          delta = Math.max(delta, x2 - startX, x2 - endX);
        }
        var newIndex = this.getIndex({
          startX: startX + delta,
          endX: endX + delta
        });
        if ((newIndex.startIndex !== startIndex || newIndex.endIndex !== endIndex) && onChange) {
          onChange(newIndex);
        }
        this.setState({
          startX: startX + delta,
          endX: endX + delta,
          slideMoveStartX: e.pageX
        });
      }, "handleSlideDrag")
    }, {
      key: "handleTravellerDragStart",
      value: /* @__PURE__ */ __name(function handleTravellerDragStart(id, e) {
        var event = isTouch(e) ? e.changedTouches[0] : e;
        this.setState({
          isSlideMoving: false,
          isTravellerMoving: true,
          movingTravellerId: id,
          brushMoveStartX: event.pageX
        });
        this.attachDragEndListener();
      }, "handleTravellerDragStart")
    }, {
      key: "handleTravellerMove",
      value: /* @__PURE__ */ __name(function handleTravellerMove(e) {
        var _this$state2 = this.state, brushMoveStartX = _this$state2.brushMoveStartX, movingTravellerId = _this$state2.movingTravellerId, endX = _this$state2.endX, startX = _this$state2.startX;
        var prevValue = this.state[movingTravellerId];
        var _this$props5 = this.props, x2 = _this$props5.x, width = _this$props5.width, travellerWidth = _this$props5.travellerWidth, onChange = _this$props5.onChange, gap = _this$props5.gap, data = _this$props5.data;
        var params = {
          startX: this.state.startX,
          endX: this.state.endX
        };
        var delta = e.pageX - brushMoveStartX;
        if (delta > 0) {
          delta = Math.min(delta, x2 + width - travellerWidth - prevValue);
        } else if (delta < 0) {
          delta = Math.max(delta, x2 - prevValue);
        }
        params[movingTravellerId] = prevValue + delta;
        var newIndex = this.getIndex(params);
        var startIndex = newIndex.startIndex, endIndex = newIndex.endIndex;
        var isFullGap = /* @__PURE__ */ __name(function isFullGap2() {
          var lastIndex = data.length - 1;
          if (movingTravellerId === "startX" && (endX > startX ? startIndex % gap === 0 : endIndex % gap === 0) || endX < startX && endIndex === lastIndex || movingTravellerId === "endX" && (endX > startX ? endIndex % gap === 0 : startIndex % gap === 0) || endX > startX && endIndex === lastIndex) {
            return true;
          }
          return false;
        }, "isFullGap");
        this.setState(_defineProperty$f(_defineProperty$f({}, movingTravellerId, prevValue + delta), "brushMoveStartX", e.pageX), function() {
          if (onChange) {
            if (isFullGap()) {
              onChange(newIndex);
            }
          }
        });
      }, "handleTravellerMove")
    }, {
      key: "handleTravellerMoveKeyboard",
      value: /* @__PURE__ */ __name(function handleTravellerMoveKeyboard(direction, id) {
        var _this2 = this;
        var _this$state3 = this.state, scaleValues = _this$state3.scaleValues, startX = _this$state3.startX, endX = _this$state3.endX;
        var currentScaleValue = this.state[id];
        var currentIndex = scaleValues.indexOf(currentScaleValue);
        if (currentIndex === -1) {
          return;
        }
        var newIndex = currentIndex + direction;
        if (newIndex === -1 || newIndex >= scaleValues.length) {
          return;
        }
        var newScaleValue = scaleValues[newIndex];
        if (id === "startX" && newScaleValue >= endX || id === "endX" && newScaleValue <= startX) {
          return;
        }
        this.setState(_defineProperty$f({}, id, newScaleValue), function() {
          _this2.props.onChange(_this2.getIndex({
            startX: _this2.state.startX,
            endX: _this2.state.endX
          }));
        });
      }, "handleTravellerMoveKeyboard")
    }, {
      key: "renderBackground",
      value: /* @__PURE__ */ __name(function renderBackground() {
        var _this$props6 = this.props, x2 = _this$props6.x, y2 = _this$props6.y, width = _this$props6.width, height = _this$props6.height, fill = _this$props6.fill, stroke = _this$props6.stroke;
        return /* @__PURE__ */ React.createElement("rect", {
          stroke,
          fill,
          x: x2,
          y: y2,
          width,
          height
        });
      }, "renderBackground")
    }, {
      key: "renderPanorama",
      value: /* @__PURE__ */ __name(function renderPanorama() {
        var _this$props7 = this.props, x2 = _this$props7.x, y2 = _this$props7.y, width = _this$props7.width, height = _this$props7.height, data = _this$props7.data, children = _this$props7.children, padding = _this$props7.padding;
        var chartElement = reactExports.Children.only(children);
        if (!chartElement) {
          return null;
        }
        return /* @__PURE__ */ React.cloneElement(chartElement, {
          x: x2,
          y: y2,
          width,
          height,
          margin: padding,
          compact: true,
          data
        });
      }, "renderPanorama")
    }, {
      key: "renderTravellerLayer",
      value: /* @__PURE__ */ __name(function renderTravellerLayer(travellerX, id) {
        var _data$startIndex, _data$endIndex, _this3 = this;
        var _this$props8 = this.props, y2 = _this$props8.y, travellerWidth = _this$props8.travellerWidth, height = _this$props8.height, traveller = _this$props8.traveller, ariaLabel = _this$props8.ariaLabel, data = _this$props8.data, startIndex = _this$props8.startIndex, endIndex = _this$props8.endIndex;
        var x2 = Math.max(travellerX, this.props.x);
        var travellerProps = _objectSpread$c(_objectSpread$c({}, filterProps(this.props, false)), {}, {
          x: x2,
          y: y2,
          width: travellerWidth,
          height
        });
        var ariaLabelBrush = ariaLabel || "Min value: ".concat((_data$startIndex = data[startIndex]) === null || _data$startIndex === void 0 ? void 0 : _data$startIndex.name, ", Max value: ").concat((_data$endIndex = data[endIndex]) === null || _data$endIndex === void 0 ? void 0 : _data$endIndex.name);
        return /* @__PURE__ */ React.createElement(Layer, {
          tabIndex: 0,
          role: "slider",
          "aria-label": ariaLabelBrush,
          "aria-valuenow": travellerX,
          className: "recharts-brush-traveller",
          onMouseEnter: this.handleEnterSlideOrTraveller,
          onMouseLeave: this.handleLeaveSlideOrTraveller,
          onMouseDown: this.travellerDragStartHandlers[id],
          onTouchStart: this.travellerDragStartHandlers[id],
          onKeyDown: /* @__PURE__ */ __name(function onKeyDown(e) {
            if (!["ArrowLeft", "ArrowRight"].includes(e.key)) {
              return;
            }
            e.preventDefault();
            e.stopPropagation();
            _this3.handleTravellerMoveKeyboard(e.key === "ArrowRight" ? 1 : -1, id);
          }, "onKeyDown"),
          onFocus: /* @__PURE__ */ __name(function onFocus() {
            _this3.setState({
              isTravellerFocused: true
            });
          }, "onFocus"),
          onBlur: /* @__PURE__ */ __name(function onBlur() {
            _this3.setState({
              isTravellerFocused: false
            });
          }, "onBlur"),
          style: {
            cursor: "col-resize"
          }
        }, Brush2.renderTraveller(traveller, travellerProps));
      }, "renderTravellerLayer")
    }, {
      key: "renderSlide",
      value: /* @__PURE__ */ __name(function renderSlide(startX, endX) {
        var _this$props9 = this.props, y2 = _this$props9.y, height = _this$props9.height, stroke = _this$props9.stroke, travellerWidth = _this$props9.travellerWidth;
        var x2 = Math.min(startX, endX) + travellerWidth;
        var width = Math.max(Math.abs(endX - startX) - travellerWidth, 0);
        return /* @__PURE__ */ React.createElement("rect", {
          className: "recharts-brush-slide",
          onMouseEnter: this.handleEnterSlideOrTraveller,
          onMouseLeave: this.handleLeaveSlideOrTraveller,
          onMouseDown: this.handleSlideDragStart,
          onTouchStart: this.handleSlideDragStart,
          style: {
            cursor: "move"
          },
          stroke: "none",
          fill: stroke,
          fillOpacity: 0.2,
          x: x2,
          y: y2,
          width,
          height
        });
      }, "renderSlide")
    }, {
      key: "renderText",
      value: /* @__PURE__ */ __name(function renderText() {
        var _this$props10 = this.props, startIndex = _this$props10.startIndex, endIndex = _this$props10.endIndex, y2 = _this$props10.y, height = _this$props10.height, travellerWidth = _this$props10.travellerWidth, stroke = _this$props10.stroke;
        var _this$state4 = this.state, startX = _this$state4.startX, endX = _this$state4.endX;
        var offset2 = 5;
        var attrs = {
          pointerEvents: "none",
          fill: stroke
        };
        return /* @__PURE__ */ React.createElement(Layer, {
          className: "recharts-brush-texts"
        }, /* @__PURE__ */ React.createElement(Text, _extends$b({
          textAnchor: "end",
          verticalAnchor: "middle",
          x: Math.min(startX, endX) - offset2,
          y: y2 + height / 2
        }, attrs), this.getTextOfTick(startIndex)), /* @__PURE__ */ React.createElement(Text, _extends$b({
          textAnchor: "start",
          verticalAnchor: "middle",
          x: Math.max(startX, endX) + travellerWidth + offset2,
          y: y2 + height / 2
        }, attrs), this.getTextOfTick(endIndex)));
      }, "renderText")
    }, {
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _this$props11 = this.props, data = _this$props11.data, className = _this$props11.className, children = _this$props11.children, x2 = _this$props11.x, y2 = _this$props11.y, width = _this$props11.width, height = _this$props11.height, alwaysShowText = _this$props11.alwaysShowText;
        var _this$state5 = this.state, startX = _this$state5.startX, endX = _this$state5.endX, isTextActive = _this$state5.isTextActive, isSlideMoving = _this$state5.isSlideMoving, isTravellerMoving = _this$state5.isTravellerMoving, isTravellerFocused = _this$state5.isTravellerFocused;
        if (!data || !data.length || !isNumber(x2) || !isNumber(y2) || !isNumber(width) || !isNumber(height) || width <= 0 || height <= 0) {
          return null;
        }
        var layerClass = clsx("recharts-brush", className);
        var isPanoramic = React.Children.count(children) === 1;
        var style = generatePrefixStyle("userSelect", "none");
        return /* @__PURE__ */ React.createElement(Layer, {
          className: layerClass,
          onMouseLeave: this.handleLeaveWrapper,
          onTouchMove: this.handleTouchMove,
          style
        }, this.renderBackground(), isPanoramic && this.renderPanorama(), this.renderSlide(startX, endX), this.renderTravellerLayer(startX, "startX"), this.renderTravellerLayer(endX, "endX"), (isTextActive || isSlideMoving || isTravellerMoving || isTravellerFocused || alwaysShowText) && this.renderText());
      }, "render")
    }], [{
      key: "renderDefaultTraveller",
      value: /* @__PURE__ */ __name(function renderDefaultTraveller(props) {
        var x2 = props.x, y2 = props.y, width = props.width, height = props.height, stroke = props.stroke;
        var lineY = Math.floor(y2 + height / 2) - 1;
        return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("rect", {
          x: x2,
          y: y2,
          width,
          height,
          fill: stroke,
          stroke: "none"
        }), /* @__PURE__ */ React.createElement("line", {
          x1: x2 + 1,
          y1: lineY,
          x2: x2 + width - 1,
          y2: lineY,
          fill: "none",
          stroke: "#fff"
        }), /* @__PURE__ */ React.createElement("line", {
          x1: x2 + 1,
          y1: lineY + 2,
          x2: x2 + width - 1,
          y2: lineY + 2,
          fill: "none",
          stroke: "#fff"
        }));
      }, "renderDefaultTraveller")
    }, {
      key: "renderTraveller",
      value: /* @__PURE__ */ __name(function renderTraveller(option, props) {
        var rectangle;
        if (/* @__PURE__ */ React.isValidElement(option)) {
          rectangle = /* @__PURE__ */ React.cloneElement(option, props);
        } else if (isFunction$2(option)) {
          rectangle = option(props);
        } else {
          rectangle = Brush2.renderDefaultTraveller(props);
        }
        return rectangle;
      }, "renderTraveller")
    }, {
      key: "getDerivedStateFromProps",
      value: /* @__PURE__ */ __name(function getDerivedStateFromProps(nextProps, prevState) {
        var data = nextProps.data, width = nextProps.width, x2 = nextProps.x, travellerWidth = nextProps.travellerWidth, updateId = nextProps.updateId, startIndex = nextProps.startIndex, endIndex = nextProps.endIndex;
        if (data !== prevState.prevData || updateId !== prevState.prevUpdateId) {
          return _objectSpread$c({
            prevData: data,
            prevTravellerWidth: travellerWidth,
            prevUpdateId: updateId,
            prevX: x2,
            prevWidth: width
          }, data && data.length ? createScale({
            data,
            width,
            x: x2,
            travellerWidth,
            startIndex,
            endIndex
          }) : {
            scale: null,
            scaleValues: null
          });
        }
        if (prevState.scale && (width !== prevState.prevWidth || x2 !== prevState.prevX || travellerWidth !== prevState.prevTravellerWidth)) {
          prevState.scale.range([x2, x2 + width - travellerWidth]);
          var scaleValues = prevState.scale.domain().map(function(entry) {
            return prevState.scale(entry);
          });
          return {
            prevData: data,
            prevTravellerWidth: travellerWidth,
            prevUpdateId: updateId,
            prevX: x2,
            prevWidth: width,
            startX: prevState.scale(nextProps.startIndex),
            endX: prevState.scale(nextProps.endIndex),
            scaleValues
          };
        }
        return null;
      }, "getDerivedStateFromProps")
    }, {
      key: "getIndexInRange",
      value: /* @__PURE__ */ __name(function getIndexInRange(valueRange, x2) {
        var len = valueRange.length;
        var start = 0;
        var end = len - 1;
        while (end - start > 1) {
          var middle = Math.floor((start + end) / 2);
          if (valueRange[middle] > x2) {
            end = middle;
          } else {
            start = middle;
          }
        }
        return x2 >= valueRange[end] ? end : start;
      }, "getIndexInRange")
    }]);
  })(reactExports.PureComponent);
  _defineProperty$f(Brush, "displayName", "Brush");
  _defineProperty$f(Brush, "defaultProps", {
    height: 40,
    travellerWidth: 5,
    gap: 1,
    fill: "#fff",
    stroke: "#666",
    padding: {
      top: 1,
      right: 1,
      bottom: 1,
      left: 1
    },
    leaveTimeOut: 1e3,
    alwaysShowText: false
  });
  var _baseSome;
  var hasRequired_baseSome;
  function require_baseSome() {
    if (hasRequired_baseSome) return _baseSome;
    hasRequired_baseSome = 1;
    var baseEach = require_baseEach();
    function baseSome(collection, predicate) {
      var result;
      baseEach(collection, function(value, index2, collection2) {
        result = predicate(value, index2, collection2);
        return !result;
      });
      return !!result;
    }
    __name(baseSome, "baseSome");
    _baseSome = baseSome;
    return _baseSome;
  }
  __name(require_baseSome, "require_baseSome");
  var some_1;
  var hasRequiredSome;
  function requireSome() {
    if (hasRequiredSome) return some_1;
    hasRequiredSome = 1;
    var arraySome2 = require_arraySome(), baseIteratee = require_baseIteratee(), baseSome = require_baseSome(), isArray2 = requireIsArray(), isIterateeCall = require_isIterateeCall();
    function some2(collection, predicate, guard) {
      var func = isArray2(collection) ? arraySome2 : baseSome;
      if (guard && isIterateeCall(collection, predicate, guard)) {
        predicate = void 0;
      }
      return func(collection, baseIteratee(predicate, 3));
    }
    __name(some2, "some");
    some_1 = some2;
    return some_1;
  }
  __name(requireSome, "requireSome");
  var someExports = requireSome();
  const some = /* @__PURE__ */ getDefaultExportFromCjs(someExports);
  var ifOverflowMatches = /* @__PURE__ */ __name(function ifOverflowMatches2(props, value) {
    var alwaysShow = props.alwaysShow;
    var ifOverflow = props.ifOverflow;
    if (alwaysShow) {
      ifOverflow = "extendDomain";
    }
    return ifOverflow === value;
  }, "ifOverflowMatches");
  var _baseAssignValue;
  var hasRequired_baseAssignValue;
  function require_baseAssignValue() {
    if (hasRequired_baseAssignValue) return _baseAssignValue;
    hasRequired_baseAssignValue = 1;
    var defineProperty = require_defineProperty();
    function baseAssignValue(object2, key, value) {
      if (key == "__proto__" && defineProperty) {
        defineProperty(object2, key, {
          "configurable": true,
          "enumerable": true,
          "value": value,
          "writable": true
        });
      } else {
        object2[key] = value;
      }
    }
    __name(baseAssignValue, "baseAssignValue");
    _baseAssignValue = baseAssignValue;
    return _baseAssignValue;
  }
  __name(require_baseAssignValue, "require_baseAssignValue");
  var mapValues_1;
  var hasRequiredMapValues;
  function requireMapValues() {
    if (hasRequiredMapValues) return mapValues_1;
    hasRequiredMapValues = 1;
    var baseAssignValue = require_baseAssignValue(), baseForOwn = require_baseForOwn(), baseIteratee = require_baseIteratee();
    function mapValues2(object2, iteratee) {
      var result = {};
      iteratee = baseIteratee(iteratee, 3);
      baseForOwn(object2, function(value, key, object3) {
        baseAssignValue(result, key, iteratee(value, key, object3));
      });
      return result;
    }
    __name(mapValues2, "mapValues");
    mapValues_1 = mapValues2;
    return mapValues_1;
  }
  __name(requireMapValues, "requireMapValues");
  var mapValuesExports = requireMapValues();
  const mapValues = /* @__PURE__ */ getDefaultExportFromCjs(mapValuesExports);
  var _arrayEvery;
  var hasRequired_arrayEvery;
  function require_arrayEvery() {
    if (hasRequired_arrayEvery) return _arrayEvery;
    hasRequired_arrayEvery = 1;
    function arrayEvery(array2, predicate) {
      var index2 = -1, length = array2 == null ? 0 : array2.length;
      while (++index2 < length) {
        if (!predicate(array2[index2], index2, array2)) {
          return false;
        }
      }
      return true;
    }
    __name(arrayEvery, "arrayEvery");
    _arrayEvery = arrayEvery;
    return _arrayEvery;
  }
  __name(require_arrayEvery, "require_arrayEvery");
  var _baseEvery;
  var hasRequired_baseEvery;
  function require_baseEvery() {
    if (hasRequired_baseEvery) return _baseEvery;
    hasRequired_baseEvery = 1;
    var baseEach = require_baseEach();
    function baseEvery(collection, predicate) {
      var result = true;
      baseEach(collection, function(value, index2, collection2) {
        result = !!predicate(value, index2, collection2);
        return result;
      });
      return result;
    }
    __name(baseEvery, "baseEvery");
    _baseEvery = baseEvery;
    return _baseEvery;
  }
  __name(require_baseEvery, "require_baseEvery");
  var every_1;
  var hasRequiredEvery;
  function requireEvery() {
    if (hasRequiredEvery) return every_1;
    hasRequiredEvery = 1;
    var arrayEvery = require_arrayEvery(), baseEvery = require_baseEvery(), baseIteratee = require_baseIteratee(), isArray2 = requireIsArray(), isIterateeCall = require_isIterateeCall();
    function every2(collection, predicate, guard) {
      var func = isArray2(collection) ? arrayEvery : baseEvery;
      if (guard && isIterateeCall(collection, predicate, guard)) {
        predicate = void 0;
      }
      return func(collection, baseIteratee(predicate, 3));
    }
    __name(every2, "every");
    every_1 = every2;
    return every_1;
  }
  __name(requireEvery, "requireEvery");
  var everyExports = requireEvery();
  const every = /* @__PURE__ */ getDefaultExportFromCjs(everyExports);
  var _excluded$5 = ["x", "y"];
  function _typeof$e(o2) {
    "@babel/helpers - typeof";
    return _typeof$e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o22) {
      return typeof o22;
    } : function(o22) {
      return o22 && "function" == typeof Symbol && o22.constructor === Symbol && o22 !== Symbol.prototype ? "symbol" : typeof o22;
    }, _typeof$e(o2);
  }
  __name(_typeof$e, "_typeof$e");
  function _extends$a() {
    _extends$a = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$a.apply(this, arguments);
  }
  __name(_extends$a, "_extends$a");
  function ownKeys$b(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r22) {
        return Object.getOwnPropertyDescriptor(e, r22).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$b, "ownKeys$b");
  function _objectSpread$b(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$b(Object(t2), true).forEach(function(r22) {
        _defineProperty$e(e, r22, t2[r22]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$b(Object(t2)).forEach(function(r22) {
        Object.defineProperty(e, r22, Object.getOwnPropertyDescriptor(t2, r22));
      });
    }
    return e;
  }
  __name(_objectSpread$b, "_objectSpread$b");
  function _defineProperty$e(obj, key, value) {
    key = _toPropertyKey$e(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$e, "_defineProperty$e");
  function _toPropertyKey$e(t2) {
    var i2 = _toPrimitive$e(t2, "string");
    return "symbol" == _typeof$e(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$e, "_toPropertyKey$e");
  function _toPrimitive$e(t2, r2) {
    if ("object" != _typeof$e(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$e(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$e, "_toPrimitive$e");
  function _objectWithoutProperties$5(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$5(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$5, "_objectWithoutProperties$5");
  function _objectWithoutPropertiesLoose$5(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$5, "_objectWithoutPropertiesLoose$5");
  function typeguardBarRectangleProps(_ref, props) {
    var xProp = _ref.x, yProp = _ref.y, option = _objectWithoutProperties$5(_ref, _excluded$5);
    var xValue = "".concat(xProp);
    var x2 = parseInt(xValue, 10);
    var yValue = "".concat(yProp);
    var y2 = parseInt(yValue, 10);
    var heightValue = "".concat(props.height || option.height);
    var height = parseInt(heightValue, 10);
    var widthValue = "".concat(props.width || option.width);
    var width = parseInt(widthValue, 10);
    return _objectSpread$b(_objectSpread$b(_objectSpread$b(_objectSpread$b(_objectSpread$b({}, props), option), x2 ? {
      x: x2
    } : {}), y2 ? {
      y: y2
    } : {}), {}, {
      height,
      width,
      name: props.name,
      radius: props.radius
    });
  }
  __name(typeguardBarRectangleProps, "typeguardBarRectangleProps");
  function BarRectangle(props) {
    return /* @__PURE__ */ React.createElement(Shape, _extends$a({
      shapeType: "rectangle",
      propTransformer: typeguardBarRectangleProps,
      activeClassName: "recharts-active-bar"
    }, props));
  }
  __name(BarRectangle, "BarRectangle");
  var minPointSizeCallback = /* @__PURE__ */ __name(function minPointSizeCallback2(minPointSize) {
    var defaultValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
    return function(value, index2) {
      if (typeof minPointSize === "number") return minPointSize;
      var isValueNumberOrNil = isNumber(value) || isNullish(value);
      if (isValueNumberOrNil) {
        return minPointSize(value, index2);
      }
      !isValueNumberOrNil ? invariant(false) : void 0;
      return defaultValue;
    };
  }, "minPointSizeCallback2");
  var _excluded$4 = ["value", "background"];
  var _Bar;
  function _typeof$d(o2) {
    "@babel/helpers - typeof";
    return _typeof$d = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$d(o2);
  }
  __name(_typeof$d, "_typeof$d");
  function _objectWithoutProperties$4(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$4(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$4, "_objectWithoutProperties$4");
  function _objectWithoutPropertiesLoose$4(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$4, "_objectWithoutPropertiesLoose$4");
  function _extends$9() {
    _extends$9 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$9.apply(this, arguments);
  }
  __name(_extends$9, "_extends$9");
  function ownKeys$a(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$a, "ownKeys$a");
  function _objectSpread$a(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$a(Object(t2), true).forEach(function(r3) {
        _defineProperty$d(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$a(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$a, "_objectSpread$a");
  function _classCallCheck$a(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$a, "_classCallCheck$a");
  function _defineProperties$a(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$d(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$a, "_defineProperties$a");
  function _createClass$a(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$a(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties$a(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$a, "_createClass$a");
  function _callSuper$8(t2, o2, e) {
    return o2 = _getPrototypeOf$8(o2), _possibleConstructorReturn$8(t2, _isNativeReflectConstruct$8() ? Reflect.construct(o2, e || [], _getPrototypeOf$8(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$8, "_callSuper$8");
  function _possibleConstructorReturn$8(self2, call) {
    if (call && (_typeof$d(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$8(self2);
  }
  __name(_possibleConstructorReturn$8, "_possibleConstructorReturn$8");
  function _assertThisInitialized$8(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$8, "_assertThisInitialized$8");
  function _isNativeReflectConstruct$8() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$8 = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$8, "_isNativeReflectConstruct$8");
  function _getPrototypeOf$8(o2) {
    _getPrototypeOf$8 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$8(o2);
  }
  __name(_getPrototypeOf$8, "_getPrototypeOf$8");
  function _inherits$8(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$8(subClass, superClass);
  }
  __name(_inherits$8, "_inherits$8");
  function _setPrototypeOf$8(o2, p2) {
    _setPrototypeOf$8 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$8(o2, p2);
  }
  __name(_setPrototypeOf$8, "_setPrototypeOf$8");
  function _defineProperty$d(obj, key, value) {
    key = _toPropertyKey$d(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$d, "_defineProperty$d");
  function _toPropertyKey$d(t2) {
    var i2 = _toPrimitive$d(t2, "string");
    return "symbol" == _typeof$d(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$d, "_toPropertyKey$d");
  function _toPrimitive$d(t2, r2) {
    if ("object" != _typeof$d(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$d(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$d, "_toPrimitive$d");
  var Bar = /* @__PURE__ */ (function(_PureComponent) {
    function Bar2() {
      var _this;
      _classCallCheck$a(this, Bar2);
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      _this = _callSuper$8(this, Bar2, [].concat(args));
      _defineProperty$d(_this, "state", {
        isAnimationFinished: false
      });
      _defineProperty$d(_this, "id", uniqueId("recharts-bar-"));
      _defineProperty$d(_this, "handleAnimationEnd", function() {
        var onAnimationEnd = _this.props.onAnimationEnd;
        _this.setState({
          isAnimationFinished: true
        });
        if (onAnimationEnd) {
          onAnimationEnd();
        }
      });
      _defineProperty$d(_this, "handleAnimationStart", function() {
        var onAnimationStart = _this.props.onAnimationStart;
        _this.setState({
          isAnimationFinished: false
        });
        if (onAnimationStart) {
          onAnimationStart();
        }
      });
      return _this;
    }
    __name(Bar2, "Bar");
    _inherits$8(Bar2, _PureComponent);
    return _createClass$a(Bar2, [{
      key: "renderRectanglesStatically",
      value: /* @__PURE__ */ __name(function renderRectanglesStatically(data) {
        var _this2 = this;
        var _this$props = this.props, shape = _this$props.shape, dataKey = _this$props.dataKey, activeIndex = _this$props.activeIndex, activeBar = _this$props.activeBar;
        var baseProps = filterProps(this.props, false);
        return data && data.map(function(entry, i2) {
          var isActive = i2 === activeIndex;
          var option = isActive ? activeBar : shape;
          var props = _objectSpread$a(_objectSpread$a(_objectSpread$a({}, baseProps), entry), {}, {
            isActive,
            option,
            index: i2,
            dataKey,
            onAnimationStart: _this2.handleAnimationStart,
            onAnimationEnd: _this2.handleAnimationEnd
          });
          return /* @__PURE__ */ React.createElement(Layer, _extends$9({
            className: "recharts-bar-rectangle"
          }, adaptEventsOfChild(_this2.props, entry, i2), {
            // https://github.com/recharts/recharts/issues/5415
            // eslint-disable-next-line react/no-array-index-key
            key: "rectangle-".concat(entry === null || entry === void 0 ? void 0 : entry.x, "-").concat(entry === null || entry === void 0 ? void 0 : entry.y, "-").concat(entry === null || entry === void 0 ? void 0 : entry.value, "-").concat(i2)
          }), /* @__PURE__ */ React.createElement(BarRectangle, props));
        });
      }, "renderRectanglesStatically")
    }, {
      key: "renderRectanglesWithAnimation",
      value: /* @__PURE__ */ __name(function renderRectanglesWithAnimation() {
        var _this3 = this;
        var _this$props2 = this.props, data = _this$props2.data, layout = _this$props2.layout, isAnimationActive = _this$props2.isAnimationActive, animationBegin = _this$props2.animationBegin, animationDuration = _this$props2.animationDuration, animationEasing = _this$props2.animationEasing, animationId = _this$props2.animationId;
        var prevData = this.state.prevData;
        return /* @__PURE__ */ React.createElement(Animate, {
          begin: animationBegin,
          duration: animationDuration,
          isActive: isAnimationActive,
          easing: animationEasing,
          from: {
            t: 0
          },
          to: {
            t: 1
          },
          key: "bar-".concat(animationId),
          onAnimationEnd: this.handleAnimationEnd,
          onAnimationStart: this.handleAnimationStart
        }, function(_ref) {
          var t2 = _ref.t;
          var stepData = data.map(function(entry, index2) {
            var prev = prevData && prevData[index2];
            if (prev) {
              var interpolatorX = interpolateNumber$2(prev.x, entry.x);
              var interpolatorY = interpolateNumber$2(prev.y, entry.y);
              var interpolatorWidth = interpolateNumber$2(prev.width, entry.width);
              var interpolatorHeight = interpolateNumber$2(prev.height, entry.height);
              return _objectSpread$a(_objectSpread$a({}, entry), {}, {
                x: interpolatorX(t2),
                y: interpolatorY(t2),
                width: interpolatorWidth(t2),
                height: interpolatorHeight(t2)
              });
            }
            if (layout === "horizontal") {
              var _interpolatorHeight = interpolateNumber$2(0, entry.height);
              var h = _interpolatorHeight(t2);
              return _objectSpread$a(_objectSpread$a({}, entry), {}, {
                y: entry.y + entry.height - h,
                height: h
              });
            }
            var interpolator = interpolateNumber$2(0, entry.width);
            var w = interpolator(t2);
            return _objectSpread$a(_objectSpread$a({}, entry), {}, {
              width: w
            });
          });
          return /* @__PURE__ */ React.createElement(Layer, null, _this3.renderRectanglesStatically(stepData));
        });
      }, "renderRectanglesWithAnimation")
    }, {
      key: "renderRectangles",
      value: /* @__PURE__ */ __name(function renderRectangles() {
        var _this$props3 = this.props, data = _this$props3.data, isAnimationActive = _this$props3.isAnimationActive;
        var prevData = this.state.prevData;
        if (isAnimationActive && data && data.length && (!prevData || !isEqual$1(prevData, data))) {
          return this.renderRectanglesWithAnimation();
        }
        return this.renderRectanglesStatically(data);
      }, "renderRectangles")
    }, {
      key: "renderBackground",
      value: /* @__PURE__ */ __name(function renderBackground() {
        var _this4 = this;
        var _this$props4 = this.props, data = _this$props4.data, dataKey = _this$props4.dataKey, activeIndex = _this$props4.activeIndex;
        var backgroundProps = filterProps(this.props.background, false);
        return data.map(function(entry, i2) {
          entry.value;
          var background = entry.background, rest = _objectWithoutProperties$4(entry, _excluded$4);
          if (!background) {
            return null;
          }
          var props = _objectSpread$a(_objectSpread$a(_objectSpread$a(_objectSpread$a(_objectSpread$a({}, rest), {}, {
            fill: "#eee"
          }, background), backgroundProps), adaptEventsOfChild(_this4.props, entry, i2)), {}, {
            onAnimationStart: _this4.handleAnimationStart,
            onAnimationEnd: _this4.handleAnimationEnd,
            dataKey,
            index: i2,
            className: "recharts-bar-background-rectangle"
          });
          return /* @__PURE__ */ React.createElement(BarRectangle, _extends$9({
            key: "background-bar-".concat(i2),
            option: _this4.props.background,
            isActive: i2 === activeIndex
          }, props));
        });
      }, "renderBackground")
    }, {
      key: "renderErrorBar",
      value: /* @__PURE__ */ __name(function renderErrorBar(needClip, clipPathId) {
        if (this.props.isAnimationActive && !this.state.isAnimationFinished) {
          return null;
        }
        var _this$props5 = this.props, data = _this$props5.data, xAxis = _this$props5.xAxis, yAxis = _this$props5.yAxis, layout = _this$props5.layout, children = _this$props5.children;
        var errorBarItems = findAllByType(children, ErrorBar);
        if (!errorBarItems) {
          return null;
        }
        var offset2 = layout === "vertical" ? data[0].height / 2 : data[0].width / 2;
        var dataPointFormatter = /* @__PURE__ */ __name(function dataPointFormatter2(dataPoint, dataKey) {
          var value = Array.isArray(dataPoint.value) ? dataPoint.value[1] : dataPoint.value;
          return {
            x: dataPoint.x,
            y: dataPoint.y,
            value,
            errorVal: getValueByDataKey(dataPoint, dataKey)
          };
        }, "dataPointFormatter");
        var errorBarProps = {
          clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : null
        };
        return /* @__PURE__ */ React.createElement(Layer, errorBarProps, errorBarItems.map(function(item) {
          return /* @__PURE__ */ React.cloneElement(item, {
            key: "error-bar-".concat(clipPathId, "-").concat(item.props.dataKey),
            data,
            xAxis,
            yAxis,
            layout,
            offset: offset2,
            dataPointFormatter
          });
        }));
      }, "renderErrorBar")
    }, {
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _this$props6 = this.props, hide2 = _this$props6.hide, data = _this$props6.data, className = _this$props6.className, xAxis = _this$props6.xAxis, yAxis = _this$props6.yAxis, left = _this$props6.left, top = _this$props6.top, width = _this$props6.width, height = _this$props6.height, isAnimationActive = _this$props6.isAnimationActive, background = _this$props6.background, id = _this$props6.id;
        if (hide2 || !data || !data.length) {
          return null;
        }
        var isAnimationFinished = this.state.isAnimationFinished;
        var layerClass = clsx("recharts-bar", className);
        var needClipX = xAxis && xAxis.allowDataOverflow;
        var needClipY = yAxis && yAxis.allowDataOverflow;
        var needClip = needClipX || needClipY;
        var clipPathId = isNil(id) ? this.id : id;
        return /* @__PURE__ */ React.createElement(Layer, {
          className: layerClass
        }, needClipX || needClipY ? /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("clipPath", {
          id: "clipPath-".concat(clipPathId)
        }, /* @__PURE__ */ React.createElement("rect", {
          x: needClipX ? left : left - width / 2,
          y: needClipY ? top : top - height / 2,
          width: needClipX ? width : width * 2,
          height: needClipY ? height : height * 2
        }))) : null, /* @__PURE__ */ React.createElement(Layer, {
          className: "recharts-bar-rectangles",
          clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : null
        }, background ? this.renderBackground() : null, this.renderRectangles()), this.renderErrorBar(needClip, clipPathId), (!isAnimationActive || isAnimationFinished) && LabelList.renderCallByParent(this.props, data));
      }, "render")
    }], [{
      key: "getDerivedStateFromProps",
      value: /* @__PURE__ */ __name(function getDerivedStateFromProps(nextProps, prevState) {
        if (nextProps.animationId !== prevState.prevAnimationId) {
          return {
            prevAnimationId: nextProps.animationId,
            curData: nextProps.data,
            prevData: prevState.curData
          };
        }
        if (nextProps.data !== prevState.curData) {
          return {
            curData: nextProps.data
          };
        }
        return null;
      }, "getDerivedStateFromProps")
    }]);
  })(reactExports.PureComponent);
  _Bar = Bar;
  _defineProperty$d(Bar, "displayName", "Bar");
  _defineProperty$d(Bar, "defaultProps", {
    xAxisId: 0,
    yAxisId: 0,
    legendType: "rect",
    minPointSize: 0,
    hide: false,
    data: [],
    layout: "vertical",
    activeBar: false,
    isAnimationActive: !Global.isSsr,
    animationBegin: 0,
    animationDuration: 400,
    animationEasing: "ease"
  });
  _defineProperty$d(Bar, "getComposedData", function(_ref2) {
    var props = _ref2.props, item = _ref2.item, barPosition = _ref2.barPosition, bandSize = _ref2.bandSize, xAxis = _ref2.xAxis, yAxis = _ref2.yAxis, xAxisTicks = _ref2.xAxisTicks, yAxisTicks = _ref2.yAxisTicks, stackedData = _ref2.stackedData, dataStartIndex = _ref2.dataStartIndex, displayedData = _ref2.displayedData, offset2 = _ref2.offset;
    var pos = findPositionOfBar(barPosition, item);
    if (!pos) {
      return null;
    }
    var layout = props.layout;
    var itemDefaultProps = item.type.defaultProps;
    var itemProps = itemDefaultProps !== void 0 ? _objectSpread$a(_objectSpread$a({}, itemDefaultProps), item.props) : item.props;
    var dataKey = itemProps.dataKey, children = itemProps.children, minPointSizeProp = itemProps.minPointSize;
    var numericAxis = layout === "horizontal" ? yAxis : xAxis;
    var stackedDomain = stackedData ? numericAxis.scale.domain() : null;
    var baseValue = getBaseValueOfBar({
      numericAxis
    });
    var cells = findAllByType(children, Cell);
    var rects = displayedData.map(function(entry, index2) {
      var value, x2, y2, width, height, background;
      if (stackedData) {
        value = truncateByDomain(stackedData[dataStartIndex + index2], stackedDomain);
      } else {
        value = getValueByDataKey(entry, dataKey);
        if (!Array.isArray(value)) {
          value = [baseValue, value];
        }
      }
      var minPointSize = minPointSizeCallback(minPointSizeProp, _Bar.defaultProps.minPointSize)(value[1], index2);
      if (layout === "horizontal") {
        var _ref4;
        var _ref3 = [yAxis.scale(value[0]), yAxis.scale(value[1])], baseValueScale = _ref3[0], currentValueScale = _ref3[1];
        x2 = getCateCoordinateOfBar({
          axis: xAxis,
          ticks: xAxisTicks,
          bandSize,
          offset: pos.offset,
          entry,
          index: index2
        });
        y2 = (_ref4 = currentValueScale !== null && currentValueScale !== void 0 ? currentValueScale : baseValueScale) !== null && _ref4 !== void 0 ? _ref4 : void 0;
        width = pos.size;
        var computedHeight = baseValueScale - currentValueScale;
        height = Number.isNaN(computedHeight) ? 0 : computedHeight;
        background = {
          x: x2,
          y: yAxis.y,
          width,
          height: yAxis.height
        };
        if (Math.abs(minPointSize) > 0 && Math.abs(height) < Math.abs(minPointSize)) {
          var delta = mathSign(height || minPointSize) * (Math.abs(minPointSize) - Math.abs(height));
          y2 -= delta;
          height += delta;
        }
      } else {
        var _ref5 = [xAxis.scale(value[0]), xAxis.scale(value[1])], _baseValueScale = _ref5[0], _currentValueScale = _ref5[1];
        x2 = _baseValueScale;
        y2 = getCateCoordinateOfBar({
          axis: yAxis,
          ticks: yAxisTicks,
          bandSize,
          offset: pos.offset,
          entry,
          index: index2
        });
        width = _currentValueScale - _baseValueScale;
        height = pos.size;
        background = {
          x: xAxis.x,
          y: y2,
          width: xAxis.width,
          height
        };
        if (Math.abs(minPointSize) > 0 && Math.abs(width) < Math.abs(minPointSize)) {
          var _delta = mathSign(width || minPointSize) * (Math.abs(minPointSize) - Math.abs(width));
          width += _delta;
        }
      }
      return _objectSpread$a(_objectSpread$a(_objectSpread$a({}, entry), {}, {
        x: x2,
        y: y2,
        width,
        height,
        value: stackedData ? value : value[1],
        payload: entry,
        background
      }, cells && cells[index2] && cells[index2].props), {}, {
        tooltipPayload: [getTooltipItem(item, entry)],
        tooltipPosition: {
          x: x2 + width / 2,
          y: y2 + height / 2
        }
      });
    });
    return _objectSpread$a({
      data: rects,
      layout
    }, offset2);
  });
  function _typeof$c(o2) {
    "@babel/helpers - typeof";
    return _typeof$c = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$c(o2);
  }
  __name(_typeof$c, "_typeof$c");
  function _classCallCheck$9(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$9, "_classCallCheck$9");
  function _defineProperties$9(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$c(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$9, "_defineProperties$9");
  function _createClass$9(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$9(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties$9(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$9, "_createClass$9");
  function ownKeys$9(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$9, "ownKeys$9");
  function _objectSpread$9(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$9(Object(t2), true).forEach(function(r3) {
        _defineProperty$c(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$9(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$9, "_objectSpread$9");
  function _defineProperty$c(obj, key, value) {
    key = _toPropertyKey$c(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$c, "_defineProperty$c");
  function _toPropertyKey$c(t2) {
    var i2 = _toPrimitive$c(t2, "string");
    return "symbol" == _typeof$c(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$c, "_toPropertyKey$c");
  function _toPrimitive$c(t2, r2) {
    if ("object" != _typeof$c(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$c(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$c, "_toPrimitive$c");
  var formatAxisMap = /* @__PURE__ */ __name(function formatAxisMap2(props, axisMap, offset2, axisType, chartName) {
    var width = props.width, height = props.height, layout = props.layout, children = props.children;
    var ids = Object.keys(axisMap);
    var steps = {
      left: offset2.left,
      leftMirror: offset2.left,
      right: width - offset2.right,
      rightMirror: width - offset2.right,
      top: offset2.top,
      topMirror: offset2.top,
      bottom: height - offset2.bottom,
      bottomMirror: height - offset2.bottom
    };
    var hasBar = !!findChildByType(children, Bar);
    return ids.reduce(function(result, id) {
      var axis = axisMap[id];
      var orientation = axis.orientation, domain = axis.domain, _axis$padding = axis.padding, padding = _axis$padding === void 0 ? {} : _axis$padding, mirror = axis.mirror, reversed = axis.reversed;
      var offsetKey = "".concat(orientation).concat(mirror ? "Mirror" : "");
      var calculatedPadding, range2, x2, y2, needSpace;
      if (axis.type === "number" && (axis.padding === "gap" || axis.padding === "no-gap")) {
        var diff = domain[1] - domain[0];
        var smallestDistanceBetweenValues = Infinity;
        var sortedValues = axis.categoricalDomain.sort(compareValues);
        sortedValues.forEach(function(value, index2) {
          if (index2 > 0) {
            smallestDistanceBetweenValues = Math.min((value || 0) - (sortedValues[index2 - 1] || 0), smallestDistanceBetweenValues);
          }
        });
        if (Number.isFinite(smallestDistanceBetweenValues)) {
          var smallestDistanceInPercent = smallestDistanceBetweenValues / diff;
          var rangeWidth = axis.layout === "vertical" ? offset2.height : offset2.width;
          if (axis.padding === "gap") {
            calculatedPadding = smallestDistanceInPercent * rangeWidth / 2;
          }
          if (axis.padding === "no-gap") {
            var gap = getPercentValue(props.barCategoryGap, smallestDistanceInPercent * rangeWidth);
            var halfBand = smallestDistanceInPercent * rangeWidth / 2;
            calculatedPadding = halfBand - gap - (halfBand - gap) / rangeWidth * gap;
          }
        }
      }
      if (axisType === "xAxis") {
        range2 = [offset2.left + (padding.left || 0) + (calculatedPadding || 0), offset2.left + offset2.width - (padding.right || 0) - (calculatedPadding || 0)];
      } else if (axisType === "yAxis") {
        range2 = layout === "horizontal" ? [offset2.top + offset2.height - (padding.bottom || 0), offset2.top + (padding.top || 0)] : [offset2.top + (padding.top || 0) + (calculatedPadding || 0), offset2.top + offset2.height - (padding.bottom || 0) - (calculatedPadding || 0)];
      } else {
        range2 = axis.range;
      }
      if (reversed) {
        range2 = [range2[1], range2[0]];
      }
      var _parseScale = parseScale(axis, chartName, hasBar), scale = _parseScale.scale, realScaleType = _parseScale.realScaleType;
      scale.domain(domain).range(range2);
      checkDomainOfScale(scale);
      var ticks2 = getTicksOfScale(scale, _objectSpread$9(_objectSpread$9({}, axis), {}, {
        realScaleType
      }));
      if (axisType === "xAxis") {
        needSpace = orientation === "top" && !mirror || orientation === "bottom" && mirror;
        x2 = offset2.left;
        y2 = steps[offsetKey] - needSpace * axis.height;
      } else if (axisType === "yAxis") {
        needSpace = orientation === "left" && !mirror || orientation === "right" && mirror;
        x2 = steps[offsetKey] - needSpace * axis.width;
        y2 = offset2.top;
      }
      var finalAxis = _objectSpread$9(_objectSpread$9(_objectSpread$9({}, axis), ticks2), {}, {
        realScaleType,
        x: x2,
        y: y2,
        scale,
        width: axisType === "xAxis" ? offset2.width : axis.width,
        height: axisType === "yAxis" ? offset2.height : axis.height
      });
      finalAxis.bandSize = getBandSizeOfAxis(finalAxis, ticks2);
      if (!axis.hide && axisType === "xAxis") {
        steps[offsetKey] += (needSpace ? -1 : 1) * finalAxis.height;
      } else if (!axis.hide) {
        steps[offsetKey] += (needSpace ? -1 : 1) * finalAxis.width;
      }
      return _objectSpread$9(_objectSpread$9({}, result), {}, _defineProperty$c({}, id, finalAxis));
    }, {});
  }, "formatAxisMap");
  var rectWithPoints = /* @__PURE__ */ __name(function rectWithPoints2(_ref, _ref2) {
    var x1 = _ref.x, y1 = _ref.y;
    var x2 = _ref2.x, y2 = _ref2.y;
    return {
      x: Math.min(x1, x2),
      y: Math.min(y1, y2),
      width: Math.abs(x2 - x1),
      height: Math.abs(y2 - y1)
    };
  }, "rectWithPoints");
  var rectWithCoords = /* @__PURE__ */ __name(function rectWithCoords2(_ref3) {
    var x1 = _ref3.x1, y1 = _ref3.y1, x2 = _ref3.x2, y2 = _ref3.y2;
    return rectWithPoints({
      x: x1,
      y: y1
    }, {
      x: x2,
      y: y2
    });
  }, "rectWithCoords");
  var ScaleHelper = /* @__PURE__ */ (function() {
    function ScaleHelper2(scale) {
      _classCallCheck$9(this, ScaleHelper2);
      this.scale = scale;
    }
    __name(ScaleHelper2, "ScaleHelper");
    return _createClass$9(ScaleHelper2, [{
      key: "domain",
      get: /* @__PURE__ */ __name(function get2() {
        return this.scale.domain;
      }, "get")
    }, {
      key: "range",
      get: /* @__PURE__ */ __name(function get2() {
        return this.scale.range;
      }, "get")
    }, {
      key: "rangeMin",
      get: /* @__PURE__ */ __name(function get2() {
        return this.range()[0];
      }, "get")
    }, {
      key: "rangeMax",
      get: /* @__PURE__ */ __name(function get2() {
        return this.range()[1];
      }, "get")
    }, {
      key: "bandwidth",
      get: /* @__PURE__ */ __name(function get2() {
        return this.scale.bandwidth;
      }, "get")
    }, {
      key: "apply",
      value: /* @__PURE__ */ __name(function apply(value) {
        var _ref4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, bandAware = _ref4.bandAware, position = _ref4.position;
        if (value === void 0) {
          return void 0;
        }
        if (position) {
          switch (position) {
            case "start": {
              return this.scale(value);
            }
            case "middle": {
              var offset2 = this.bandwidth ? this.bandwidth() / 2 : 0;
              return this.scale(value) + offset2;
            }
            case "end": {
              var _offset = this.bandwidth ? this.bandwidth() : 0;
              return this.scale(value) + _offset;
            }
            default: {
              return this.scale(value);
            }
          }
        }
        if (bandAware) {
          var _offset2 = this.bandwidth ? this.bandwidth() / 2 : 0;
          return this.scale(value) + _offset2;
        }
        return this.scale(value);
      }, "apply")
    }, {
      key: "isInRange",
      value: /* @__PURE__ */ __name(function isInRange(value) {
        var range2 = this.range();
        var first = range2[0];
        var last2 = range2[range2.length - 1];
        return first <= last2 ? value >= first && value <= last2 : value >= last2 && value <= first;
      }, "isInRange")
    }], [{
      key: "create",
      value: /* @__PURE__ */ __name(function create2(obj) {
        return new ScaleHelper2(obj);
      }, "create")
    }]);
  })();
  _defineProperty$c(ScaleHelper, "EPS", 1e-4);
  var createLabeledScales = /* @__PURE__ */ __name(function createLabeledScales2(options2) {
    var scales = Object.keys(options2).reduce(function(res, key) {
      return _objectSpread$9(_objectSpread$9({}, res), {}, _defineProperty$c({}, key, ScaleHelper.create(options2[key])));
    }, {});
    return _objectSpread$9(_objectSpread$9({}, scales), {}, {
      apply: /* @__PURE__ */ __name(function apply(coord) {
        var _ref5 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, bandAware = _ref5.bandAware, position = _ref5.position;
        return mapValues(coord, function(value, label) {
          return scales[label].apply(value, {
            bandAware,
            position
          });
        });
      }, "apply"),
      isInRange: /* @__PURE__ */ __name(function isInRange(coord) {
        return every(coord, function(value, label) {
          return scales[label].isInRange(value);
        });
      }, "isInRange")
    });
  }, "createLabeledScales");
  function normalizeAngle(angle) {
    return (angle % 180 + 180) % 180;
  }
  __name(normalizeAngle, "normalizeAngle");
  var getAngledRectangleWidth = /* @__PURE__ */ __name(function getAngledRectangleWidth2(_ref6) {
    var width = _ref6.width, height = _ref6.height;
    var angle = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
    var normalizedAngle = normalizeAngle(angle);
    var angleRadians = normalizedAngle * Math.PI / 180;
    var angleThreshold = Math.atan(height / width);
    var angledWidth = angleRadians > angleThreshold && angleRadians < Math.PI - angleThreshold ? height / Math.sin(angleRadians) : width / Math.cos(angleRadians);
    return Math.abs(angledWidth);
  }, "getAngledRectangleWidth");
  var _createFind;
  var hasRequired_createFind;
  function require_createFind() {
    if (hasRequired_createFind) return _createFind;
    hasRequired_createFind = 1;
    var baseIteratee = require_baseIteratee(), isArrayLike2 = requireIsArrayLike(), keys2 = requireKeys();
    function createFind(findIndexFunc) {
      return function(collection, predicate, fromIndex) {
        var iterable = Object(collection);
        if (!isArrayLike2(collection)) {
          var iteratee = baseIteratee(predicate, 3);
          collection = keys2(collection);
          predicate = /* @__PURE__ */ __name(function(key) {
            return iteratee(iterable[key], key, iterable);
          }, "predicate");
        }
        var index2 = findIndexFunc(collection, predicate, fromIndex);
        return index2 > -1 ? iterable[iteratee ? collection[index2] : index2] : void 0;
      };
    }
    __name(createFind, "createFind");
    _createFind = createFind;
    return _createFind;
  }
  __name(require_createFind, "require_createFind");
  var toInteger_1;
  var hasRequiredToInteger;
  function requireToInteger() {
    if (hasRequiredToInteger) return toInteger_1;
    hasRequiredToInteger = 1;
    var toFinite = requireToFinite();
    function toInteger(value) {
      var result = toFinite(value), remainder = result % 1;
      return result === result ? remainder ? result - remainder : result : 0;
    }
    __name(toInteger, "toInteger");
    toInteger_1 = toInteger;
    return toInteger_1;
  }
  __name(requireToInteger, "requireToInteger");
  var findIndex_1;
  var hasRequiredFindIndex;
  function requireFindIndex() {
    if (hasRequiredFindIndex) return findIndex_1;
    hasRequiredFindIndex = 1;
    var baseFindIndex = require_baseFindIndex(), baseIteratee = require_baseIteratee(), toInteger = requireToInteger();
    var nativeMax = Math.max;
    function findIndex(array2, predicate, fromIndex) {
      var length = array2 == null ? 0 : array2.length;
      if (!length) {
        return -1;
      }
      var index2 = fromIndex == null ? 0 : toInteger(fromIndex);
      if (index2 < 0) {
        index2 = nativeMax(length + index2, 0);
      }
      return baseFindIndex(array2, baseIteratee(predicate, 3), index2);
    }
    __name(findIndex, "findIndex");
    findIndex_1 = findIndex;
    return findIndex_1;
  }
  __name(requireFindIndex, "requireFindIndex");
  var find_1;
  var hasRequiredFind;
  function requireFind() {
    if (hasRequiredFind) return find_1;
    hasRequiredFind = 1;
    var createFind = require_createFind(), findIndex = requireFindIndex();
    var find2 = createFind(findIndex);
    find_1 = find2;
    return find_1;
  }
  __name(requireFind, "requireFind");
  var findExports = requireFind();
  const find = /* @__PURE__ */ getDefaultExportFromCjs(findExports);
  var memoizeExports = requireMemoize();
  const memoize = /* @__PURE__ */ getDefaultExportFromCjs(memoizeExports);
  var calculateViewBox = memoize(function(offset2) {
    return {
      x: offset2.left,
      y: offset2.top,
      width: offset2.width,
      height: offset2.height
    };
  }, function(offset2) {
    return ["l", offset2.left, "t", offset2.top, "w", offset2.width, "h", offset2.height].join("");
  });
  var XAxisContext = /* @__PURE__ */ reactExports.createContext(void 0);
  var YAxisContext = /* @__PURE__ */ reactExports.createContext(void 0);
  var ViewBoxContext = /* @__PURE__ */ reactExports.createContext(void 0);
  var OffsetContext = /* @__PURE__ */ reactExports.createContext({});
  var ClipPathIdContext = /* @__PURE__ */ reactExports.createContext(void 0);
  var ChartHeightContext = /* @__PURE__ */ reactExports.createContext(0);
  var ChartWidthContext = /* @__PURE__ */ reactExports.createContext(0);
  var ChartLayoutContextProvider = /* @__PURE__ */ __name(function ChartLayoutContextProvider2(props) {
    var _props$state = props.state, xAxisMap = _props$state.xAxisMap, yAxisMap = _props$state.yAxisMap, offset2 = _props$state.offset, clipPathId = props.clipPathId, children = props.children, width = props.width, height = props.height;
    var viewBox = calculateViewBox(offset2);
    return /* @__PURE__ */ React.createElement(XAxisContext.Provider, {
      value: xAxisMap
    }, /* @__PURE__ */ React.createElement(YAxisContext.Provider, {
      value: yAxisMap
    }, /* @__PURE__ */ React.createElement(OffsetContext.Provider, {
      value: offset2
    }, /* @__PURE__ */ React.createElement(ViewBoxContext.Provider, {
      value: viewBox
    }, /* @__PURE__ */ React.createElement(ClipPathIdContext.Provider, {
      value: clipPathId
    }, /* @__PURE__ */ React.createElement(ChartHeightContext.Provider, {
      value: height
    }, /* @__PURE__ */ React.createElement(ChartWidthContext.Provider, {
      value: width
    }, children)))))));
  }, "ChartLayoutContextProvider2");
  var useClipPathId = /* @__PURE__ */ __name(function useClipPathId2() {
    return reactExports.useContext(ClipPathIdContext);
  }, "useClipPathId2");
  var useXAxisOrThrow = /* @__PURE__ */ __name(function useXAxisOrThrow2(xAxisId) {
    var xAxisMap = reactExports.useContext(XAxisContext);
    !(xAxisMap != null) ? invariant(false) : void 0;
    var xAxis = xAxisMap[xAxisId];
    !(xAxis != null) ? invariant(false) : void 0;
    return xAxis;
  }, "useXAxisOrThrow2");
  var useArbitraryXAxis = /* @__PURE__ */ __name(function useArbitraryXAxis2() {
    var xAxisMap = reactExports.useContext(XAxisContext);
    return getAnyElementOfObject(xAxisMap);
  }, "useArbitraryXAxis2");
  var useYAxisWithFiniteDomainOrRandom = /* @__PURE__ */ __name(function useYAxisWithFiniteDomainOrRandom2() {
    var yAxisMap = reactExports.useContext(YAxisContext);
    var yAxisWithFiniteDomain = find(yAxisMap, function(axis) {
      return every(axis.domain, Number.isFinite);
    });
    return yAxisWithFiniteDomain || getAnyElementOfObject(yAxisMap);
  }, "useYAxisWithFiniteDomainOrRandom2");
  var useYAxisOrThrow = /* @__PURE__ */ __name(function useYAxisOrThrow2(yAxisId) {
    var yAxisMap = reactExports.useContext(YAxisContext);
    !(yAxisMap != null) ? invariant(false) : void 0;
    var yAxis = yAxisMap[yAxisId];
    !(yAxis != null) ? invariant(false) : void 0;
    return yAxis;
  }, "useYAxisOrThrow2");
  var useViewBox = /* @__PURE__ */ __name(function useViewBox2() {
    var viewBox = reactExports.useContext(ViewBoxContext);
    return viewBox;
  }, "useViewBox2");
  var useOffset = /* @__PURE__ */ __name(function useOffset2() {
    return reactExports.useContext(OffsetContext);
  }, "useOffset2");
  var useChartWidth = /* @__PURE__ */ __name(function useChartWidth2() {
    return reactExports.useContext(ChartWidthContext);
  }, "useChartWidth2");
  var useChartHeight = /* @__PURE__ */ __name(function useChartHeight2() {
    return reactExports.useContext(ChartHeightContext);
  }, "useChartHeight2");
  function _typeof$b(o2) {
    "@babel/helpers - typeof";
    return _typeof$b = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$b(o2);
  }
  __name(_typeof$b, "_typeof$b");
  function _classCallCheck$8(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$8, "_classCallCheck$8");
  function _defineProperties$8(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$b(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$8, "_defineProperties$8");
  function _createClass$8(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$8(Constructor.prototype, protoProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$8, "_createClass$8");
  function _callSuper$7(t2, o2, e) {
    return o2 = _getPrototypeOf$7(o2), _possibleConstructorReturn$7(t2, _isNativeReflectConstruct$7() ? Reflect.construct(o2, e || [], _getPrototypeOf$7(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$7, "_callSuper$7");
  function _possibleConstructorReturn$7(self2, call) {
    if (call && (_typeof$b(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$7(self2);
  }
  __name(_possibleConstructorReturn$7, "_possibleConstructorReturn$7");
  function _assertThisInitialized$7(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$7, "_assertThisInitialized$7");
  function _isNativeReflectConstruct$7() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$7 = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$7, "_isNativeReflectConstruct$7");
  function _getPrototypeOf$7(o2) {
    _getPrototypeOf$7 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$7(o2);
  }
  __name(_getPrototypeOf$7, "_getPrototypeOf$7");
  function _inherits$7(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$7(subClass, superClass);
  }
  __name(_inherits$7, "_inherits$7");
  function _setPrototypeOf$7(o2, p2) {
    _setPrototypeOf$7 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$7(o2, p2);
  }
  __name(_setPrototypeOf$7, "_setPrototypeOf$7");
  function ownKeys$8(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$8, "ownKeys$8");
  function _objectSpread$8(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$8(Object(t2), true).forEach(function(r3) {
        _defineProperty$b(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$8(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$8, "_objectSpread$8");
  function _defineProperty$b(obj, key, value) {
    key = _toPropertyKey$b(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$b, "_defineProperty$b");
  function _toPropertyKey$b(t2) {
    var i2 = _toPrimitive$b(t2, "string");
    return "symbol" == _typeof$b(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$b, "_toPropertyKey$b");
  function _toPrimitive$b(t2, r2) {
    if ("object" != _typeof$b(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$b(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$b, "_toPrimitive$b");
  function _slicedToArray$1(arr, i2) {
    return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i2) || _unsupportedIterableToArray$2(arr, i2) || _nonIterableRest$1();
  }
  __name(_slicedToArray$1, "_slicedToArray$1");
  function _nonIterableRest$1() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableRest$1, "_nonIterableRest$1");
  function _unsupportedIterableToArray$2(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$2(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$2(o2, minLen);
  }
  __name(_unsupportedIterableToArray$2, "_unsupportedIterableToArray$2");
  function _arrayLikeToArray$2(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$2, "_arrayLikeToArray$2");
  function _iterableToArrayLimit$1(r2, l) {
    var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
    if (null != t2) {
      var e, n2, i2, u2, a2 = [], f = true, o2 = false;
      try {
        if (i2 = (t2 = t2.call(r2)).next, 0 === l) ;
        else for (; !(f = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l); f = true) ;
      } catch (r3) {
        o2 = true, n2 = r3;
      } finally {
        try {
          if (!f && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
        } finally {
          if (o2) throw n2;
        }
      }
      return a2;
    }
  }
  __name(_iterableToArrayLimit$1, "_iterableToArrayLimit$1");
  function _arrayWithHoles$1(arr) {
    if (Array.isArray(arr)) return arr;
  }
  __name(_arrayWithHoles$1, "_arrayWithHoles$1");
  function _extends$8() {
    _extends$8 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$8.apply(this, arguments);
  }
  __name(_extends$8, "_extends$8");
  var renderLine = /* @__PURE__ */ __name(function renderLine2(option, props) {
    var line;
    if (/* @__PURE__ */ React.isValidElement(option)) {
      line = /* @__PURE__ */ React.cloneElement(option, props);
    } else if (isFunction$2(option)) {
      line = option(props);
    } else {
      line = /* @__PURE__ */ React.createElement("line", _extends$8({}, props, {
        className: "recharts-reference-line-line"
      }));
    }
    return line;
  }, "renderLine");
  var getEndPoints = /* @__PURE__ */ __name(function getEndPoints2(scales, isFixedX, isFixedY, isSegment, viewBox, position, xAxisOrientation, yAxisOrientation, props) {
    var x2 = viewBox.x, y2 = viewBox.y, width = viewBox.width, height = viewBox.height;
    if (isFixedY) {
      var yCoord = props.y;
      var coord = scales.y.apply(yCoord, {
        position
      });
      if (ifOverflowMatches(props, "discard") && !scales.y.isInRange(coord)) {
        return null;
      }
      var points = [{
        x: x2 + width,
        y: coord
      }, {
        x: x2,
        y: coord
      }];
      return yAxisOrientation === "left" ? points.reverse() : points;
    }
    if (isFixedX) {
      var xCoord = props.x;
      var _coord = scales.x.apply(xCoord, {
        position
      });
      if (ifOverflowMatches(props, "discard") && !scales.x.isInRange(_coord)) {
        return null;
      }
      var _points = [{
        x: _coord,
        y: y2 + height
      }, {
        x: _coord,
        y: y2
      }];
      return xAxisOrientation === "top" ? _points.reverse() : _points;
    }
    if (isSegment) {
      var segment = props.segment;
      var _points2 = segment.map(function(p2) {
        return scales.apply(p2, {
          position
        });
      });
      if (ifOverflowMatches(props, "discard") && some(_points2, function(p2) {
        return !scales.isInRange(p2);
      })) {
        return null;
      }
      return _points2;
    }
    return null;
  }, "getEndPoints");
  function ReferenceLineImpl(props) {
    var fixedX = props.x, fixedY = props.y, segment = props.segment, xAxisId = props.xAxisId, yAxisId = props.yAxisId, shape = props.shape, className = props.className, alwaysShow = props.alwaysShow;
    var clipPathId = useClipPathId();
    var xAxis = useXAxisOrThrow(xAxisId);
    var yAxis = useYAxisOrThrow(yAxisId);
    var viewBox = useViewBox();
    if (!clipPathId || !viewBox) {
      return null;
    }
    warn(alwaysShow === void 0, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
    var scales = createLabeledScales({
      x: xAxis.scale,
      y: yAxis.scale
    });
    var isX = isNumOrStr(fixedX);
    var isY = isNumOrStr(fixedY);
    var isSegment = segment && segment.length === 2;
    var endPoints = getEndPoints(scales, isX, isY, isSegment, viewBox, props.position, xAxis.orientation, yAxis.orientation, props);
    if (!endPoints) {
      return null;
    }
    var _endPoints = _slicedToArray$1(endPoints, 2), _endPoints$ = _endPoints[0], x1 = _endPoints$.x, y1 = _endPoints$.y, _endPoints$2 = _endPoints[1], x2 = _endPoints$2.x, y2 = _endPoints$2.y;
    var clipPath = ifOverflowMatches(props, "hidden") ? "url(#".concat(clipPathId, ")") : void 0;
    var lineProps = _objectSpread$8(_objectSpread$8({
      clipPath
    }, filterProps(props, true)), {}, {
      x1,
      y1,
      x2,
      y2
    });
    return /* @__PURE__ */ React.createElement(Layer, {
      className: clsx("recharts-reference-line", className)
    }, renderLine(shape, lineProps), Label.renderCallByParent(props, rectWithCoords({
      x1,
      y1,
      x2,
      y2
    })));
  }
  __name(ReferenceLineImpl, "ReferenceLineImpl");
  var ReferenceLine = /* @__PURE__ */ (function(_React$Component) {
    function ReferenceLine2() {
      _classCallCheck$8(this, ReferenceLine2);
      return _callSuper$7(this, ReferenceLine2, arguments);
    }
    __name(ReferenceLine2, "ReferenceLine");
    _inherits$7(ReferenceLine2, _React$Component);
    return _createClass$8(ReferenceLine2, [{
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        return /* @__PURE__ */ React.createElement(ReferenceLineImpl, this.props);
      }, "render")
    }]);
  })(React.Component);
  _defineProperty$b(ReferenceLine, "displayName", "ReferenceLine");
  _defineProperty$b(ReferenceLine, "defaultProps", {
    isFront: false,
    ifOverflow: "discard",
    xAxisId: 0,
    yAxisId: 0,
    fill: "none",
    stroke: "#ccc",
    fillOpacity: 1,
    strokeWidth: 1,
    position: "middle"
  });
  function _extends$7() {
    _extends$7 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$7.apply(this, arguments);
  }
  __name(_extends$7, "_extends$7");
  function _typeof$a(o2) {
    "@babel/helpers - typeof";
    return _typeof$a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$a(o2);
  }
  __name(_typeof$a, "_typeof$a");
  function ownKeys$7(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$7, "ownKeys$7");
  function _objectSpread$7(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$7(Object(t2), true).forEach(function(r3) {
        _defineProperty$a(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$7(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$7, "_objectSpread$7");
  function _classCallCheck$7(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$7, "_classCallCheck$7");
  function _defineProperties$7(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$a(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$7, "_defineProperties$7");
  function _createClass$7(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$7(Constructor.prototype, protoProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$7, "_createClass$7");
  function _callSuper$6(t2, o2, e) {
    return o2 = _getPrototypeOf$6(o2), _possibleConstructorReturn$6(t2, _isNativeReflectConstruct$6() ? Reflect.construct(o2, e || [], _getPrototypeOf$6(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$6, "_callSuper$6");
  function _possibleConstructorReturn$6(self2, call) {
    if (call && (_typeof$a(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$6(self2);
  }
  __name(_possibleConstructorReturn$6, "_possibleConstructorReturn$6");
  function _assertThisInitialized$6(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$6, "_assertThisInitialized$6");
  function _isNativeReflectConstruct$6() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$6 = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$6, "_isNativeReflectConstruct$6");
  function _getPrototypeOf$6(o2) {
    _getPrototypeOf$6 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$6(o2);
  }
  __name(_getPrototypeOf$6, "_getPrototypeOf$6");
  function _inherits$6(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$6(subClass, superClass);
  }
  __name(_inherits$6, "_inherits$6");
  function _setPrototypeOf$6(o2, p2) {
    _setPrototypeOf$6 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$6(o2, p2);
  }
  __name(_setPrototypeOf$6, "_setPrototypeOf$6");
  function _defineProperty$a(obj, key, value) {
    key = _toPropertyKey$a(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$a, "_defineProperty$a");
  function _toPropertyKey$a(t2) {
    var i2 = _toPrimitive$a(t2, "string");
    return "symbol" == _typeof$a(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$a, "_toPropertyKey$a");
  function _toPrimitive$a(t2, r2) {
    if ("object" != _typeof$a(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$a(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$a, "_toPrimitive$a");
  var getCoordinate = /* @__PURE__ */ __name(function getCoordinate2(props) {
    var x2 = props.x, y2 = props.y, xAxis = props.xAxis, yAxis = props.yAxis;
    var scales = createLabeledScales({
      x: xAxis.scale,
      y: yAxis.scale
    });
    var result = scales.apply({
      x: x2,
      y: y2
    }, {
      bandAware: true
    });
    if (ifOverflowMatches(props, "discard") && !scales.isInRange(result)) {
      return null;
    }
    return result;
  }, "getCoordinate");
  var ReferenceDot = /* @__PURE__ */ (function(_React$Component) {
    function ReferenceDot2() {
      _classCallCheck$7(this, ReferenceDot2);
      return _callSuper$6(this, ReferenceDot2, arguments);
    }
    __name(ReferenceDot2, "ReferenceDot");
    _inherits$6(ReferenceDot2, _React$Component);
    return _createClass$7(ReferenceDot2, [{
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _this$props = this.props, x2 = _this$props.x, y2 = _this$props.y, r2 = _this$props.r, alwaysShow = _this$props.alwaysShow, clipPathId = _this$props.clipPathId;
        var isX = isNumOrStr(x2);
        var isY = isNumOrStr(y2);
        warn(alwaysShow === void 0, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
        if (!isX || !isY) {
          return null;
        }
        var coordinate = getCoordinate(this.props);
        if (!coordinate) {
          return null;
        }
        var cx2 = coordinate.x, cy = coordinate.y;
        var _this$props2 = this.props, shape = _this$props2.shape, className = _this$props2.className;
        var clipPath = ifOverflowMatches(this.props, "hidden") ? "url(#".concat(clipPathId, ")") : void 0;
        var dotProps = _objectSpread$7(_objectSpread$7({
          clipPath
        }, filterProps(this.props, true)), {}, {
          cx: cx2,
          cy
        });
        return /* @__PURE__ */ React.createElement(Layer, {
          className: clsx("recharts-reference-dot", className)
        }, ReferenceDot2.renderDot(shape, dotProps), Label.renderCallByParent(this.props, {
          x: cx2 - r2,
          y: cy - r2,
          width: 2 * r2,
          height: 2 * r2
        }));
      }, "render")
    }]);
  })(React.Component);
  _defineProperty$a(ReferenceDot, "displayName", "ReferenceDot");
  _defineProperty$a(ReferenceDot, "defaultProps", {
    isFront: false,
    ifOverflow: "discard",
    xAxisId: 0,
    yAxisId: 0,
    r: 10,
    fill: "#fff",
    stroke: "#ccc",
    fillOpacity: 1,
    strokeWidth: 1
  });
  _defineProperty$a(ReferenceDot, "renderDot", function(option, props) {
    var dot;
    if (/* @__PURE__ */ React.isValidElement(option)) {
      dot = /* @__PURE__ */ React.cloneElement(option, props);
    } else if (isFunction$2(option)) {
      dot = option(props);
    } else {
      dot = /* @__PURE__ */ React.createElement(Dot, _extends$7({}, props, {
        cx: props.cx,
        cy: props.cy,
        className: "recharts-reference-dot-dot"
      }));
    }
    return dot;
  });
  function _extends$6() {
    _extends$6 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$6.apply(this, arguments);
  }
  __name(_extends$6, "_extends$6");
  function _typeof$9(o2) {
    "@babel/helpers - typeof";
    return _typeof$9 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$9(o2);
  }
  __name(_typeof$9, "_typeof$9");
  function ownKeys$6(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$6, "ownKeys$6");
  function _objectSpread$6(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$6(Object(t2), true).forEach(function(r3) {
        _defineProperty$9(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$6(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$6, "_objectSpread$6");
  function _classCallCheck$6(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$6, "_classCallCheck$6");
  function _defineProperties$6(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$9(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$6, "_defineProperties$6");
  function _createClass$6(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$6(Constructor.prototype, protoProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$6, "_createClass$6");
  function _callSuper$5(t2, o2, e) {
    return o2 = _getPrototypeOf$5(o2), _possibleConstructorReturn$5(t2, _isNativeReflectConstruct$5() ? Reflect.construct(o2, e || [], _getPrototypeOf$5(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$5, "_callSuper$5");
  function _possibleConstructorReturn$5(self2, call) {
    if (call && (_typeof$9(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$5(self2);
  }
  __name(_possibleConstructorReturn$5, "_possibleConstructorReturn$5");
  function _assertThisInitialized$5(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$5, "_assertThisInitialized$5");
  function _isNativeReflectConstruct$5() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$5 = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$5, "_isNativeReflectConstruct$5");
  function _getPrototypeOf$5(o2) {
    _getPrototypeOf$5 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$5(o2);
  }
  __name(_getPrototypeOf$5, "_getPrototypeOf$5");
  function _inherits$5(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$5(subClass, superClass);
  }
  __name(_inherits$5, "_inherits$5");
  function _setPrototypeOf$5(o2, p2) {
    _setPrototypeOf$5 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$5(o2, p2);
  }
  __name(_setPrototypeOf$5, "_setPrototypeOf$5");
  function _defineProperty$9(obj, key, value) {
    key = _toPropertyKey$9(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$9, "_defineProperty$9");
  function _toPropertyKey$9(t2) {
    var i2 = _toPrimitive$9(t2, "string");
    return "symbol" == _typeof$9(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$9, "_toPropertyKey$9");
  function _toPrimitive$9(t2, r2) {
    if ("object" != _typeof$9(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$9(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$9, "_toPrimitive$9");
  var getRect = /* @__PURE__ */ __name(function getRect2(hasX1, hasX2, hasY1, hasY2, props) {
    var xValue1 = props.x1, xValue2 = props.x2, yValue1 = props.y1, yValue2 = props.y2, xAxis = props.xAxis, yAxis = props.yAxis;
    if (!xAxis || !yAxis) return null;
    var scales = createLabeledScales({
      x: xAxis.scale,
      y: yAxis.scale
    });
    var p1 = {
      x: hasX1 ? scales.x.apply(xValue1, {
        position: "start"
      }) : scales.x.rangeMin,
      y: hasY1 ? scales.y.apply(yValue1, {
        position: "start"
      }) : scales.y.rangeMin
    };
    var p2 = {
      x: hasX2 ? scales.x.apply(xValue2, {
        position: "end"
      }) : scales.x.rangeMax,
      y: hasY2 ? scales.y.apply(yValue2, {
        position: "end"
      }) : scales.y.rangeMax
    };
    if (ifOverflowMatches(props, "discard") && (!scales.isInRange(p1) || !scales.isInRange(p2))) {
      return null;
    }
    return rectWithPoints(p1, p2);
  }, "getRect");
  var ReferenceArea = /* @__PURE__ */ (function(_React$Component) {
    function ReferenceArea2() {
      _classCallCheck$6(this, ReferenceArea2);
      return _callSuper$5(this, ReferenceArea2, arguments);
    }
    __name(ReferenceArea2, "ReferenceArea");
    _inherits$5(ReferenceArea2, _React$Component);
    return _createClass$6(ReferenceArea2, [{
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _this$props = this.props, x1 = _this$props.x1, x2 = _this$props.x2, y1 = _this$props.y1, y2 = _this$props.y2, className = _this$props.className, alwaysShow = _this$props.alwaysShow, clipPathId = _this$props.clipPathId;
        warn(alwaysShow === void 0, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
        var hasX1 = isNumOrStr(x1);
        var hasX2 = isNumOrStr(x2);
        var hasY1 = isNumOrStr(y1);
        var hasY2 = isNumOrStr(y2);
        var shape = this.props.shape;
        if (!hasX1 && !hasX2 && !hasY1 && !hasY2 && !shape) {
          return null;
        }
        var rect = getRect(hasX1, hasX2, hasY1, hasY2, this.props);
        if (!rect && !shape) {
          return null;
        }
        var clipPath = ifOverflowMatches(this.props, "hidden") ? "url(#".concat(clipPathId, ")") : void 0;
        return /* @__PURE__ */ React.createElement(Layer, {
          className: clsx("recharts-reference-area", className)
        }, ReferenceArea2.renderRect(shape, _objectSpread$6(_objectSpread$6({
          clipPath
        }, filterProps(this.props, true)), rect)), Label.renderCallByParent(this.props, rect));
      }, "render")
    }]);
  })(React.Component);
  _defineProperty$9(ReferenceArea, "displayName", "ReferenceArea");
  _defineProperty$9(ReferenceArea, "defaultProps", {
    isFront: false,
    ifOverflow: "discard",
    xAxisId: 0,
    yAxisId: 0,
    r: 10,
    fill: "#ccc",
    fillOpacity: 0.5,
    stroke: "none",
    strokeWidth: 1
  });
  _defineProperty$9(ReferenceArea, "renderRect", function(option, props) {
    var rect;
    if (/* @__PURE__ */ React.isValidElement(option)) {
      rect = /* @__PURE__ */ React.cloneElement(option, props);
    } else if (isFunction$2(option)) {
      rect = option(props);
    } else {
      rect = /* @__PURE__ */ React.createElement(Rectangle, _extends$6({}, props, {
        className: "recharts-reference-area-rect"
      }));
    }
    return rect;
  });
  function getEveryNthWithCondition(array2, n2, isValid2) {
    if (n2 < 1) {
      return [];
    }
    if (n2 === 1 && isValid2 === void 0) {
      return array2;
    }
    var result = [];
    for (var i2 = 0; i2 < array2.length; i2 += n2) {
      {
        result.push(array2[i2]);
      }
    }
    return result;
  }
  __name(getEveryNthWithCondition, "getEveryNthWithCondition");
  function getAngledTickWidth(contentSize, unitSize, angle) {
    var size2 = {
      width: contentSize.width + unitSize.width,
      height: contentSize.height + unitSize.height
    };
    return getAngledRectangleWidth(size2, angle);
  }
  __name(getAngledTickWidth, "getAngledTickWidth");
  function getTickBoundaries(viewBox, sign2, sizeKey) {
    var isWidth = sizeKey === "width";
    var x2 = viewBox.x, y2 = viewBox.y, width = viewBox.width, height = viewBox.height;
    if (sign2 === 1) {
      return {
        start: isWidth ? x2 : y2,
        end: isWidth ? x2 + width : y2 + height
      };
    }
    return {
      start: isWidth ? x2 + width : y2 + height,
      end: isWidth ? x2 : y2
    };
  }
  __name(getTickBoundaries, "getTickBoundaries");
  function isVisible(sign2, tickPosition, getSize, start, end) {
    if (sign2 * tickPosition < sign2 * start || sign2 * tickPosition > sign2 * end) {
      return false;
    }
    var size2 = getSize();
    return sign2 * (tickPosition - sign2 * size2 / 2 - start) >= 0 && sign2 * (tickPosition + sign2 * size2 / 2 - end) <= 0;
  }
  __name(isVisible, "isVisible");
  function getNumberIntervalTicks(ticks2, interval) {
    return getEveryNthWithCondition(ticks2, interval + 1);
  }
  __name(getNumberIntervalTicks, "getNumberIntervalTicks");
  function getEquidistantTicks(sign2, boundaries, getTickSize, ticks2, minTickGap) {
    var result = (ticks2 || []).slice();
    var initialStart = boundaries.start, end = boundaries.end;
    var index2 = 0;
    var stepsize = 1;
    var start = initialStart;
    var _loop = /* @__PURE__ */ __name(function _loop2() {
      var entry = ticks2 === null || ticks2 === void 0 ? void 0 : ticks2[index2];
      if (entry === void 0) {
        return {
          v: getEveryNthWithCondition(ticks2, stepsize)
        };
      }
      var i2 = index2;
      var size2;
      var getSize = /* @__PURE__ */ __name(function getSize2() {
        if (size2 === void 0) {
          size2 = getTickSize(entry, i2);
        }
        return size2;
      }, "getSize");
      var tickCoord = entry.coordinate;
      var isShow = index2 === 0 || isVisible(sign2, tickCoord, getSize, start, end);
      if (!isShow) {
        index2 = 0;
        start = initialStart;
        stepsize += 1;
      }
      if (isShow) {
        start = tickCoord + sign2 * (getSize() / 2 + minTickGap);
        index2 += stepsize;
      }
    }, "_loop"), _ret;
    while (stepsize <= result.length) {
      _ret = _loop();
      if (_ret) return _ret.v;
    }
    return [];
  }
  __name(getEquidistantTicks, "getEquidistantTicks");
  function _typeof$8(o2) {
    "@babel/helpers - typeof";
    return _typeof$8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$8(o2);
  }
  __name(_typeof$8, "_typeof$8");
  function ownKeys$5(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$5, "ownKeys$5");
  function _objectSpread$5(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$5(Object(t2), true).forEach(function(r3) {
        _defineProperty$8(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$5(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$5, "_objectSpread$5");
  function _defineProperty$8(obj, key, value) {
    key = _toPropertyKey$8(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$8, "_defineProperty$8");
  function _toPropertyKey$8(t2) {
    var i2 = _toPrimitive$8(t2, "string");
    return "symbol" == _typeof$8(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$8, "_toPropertyKey$8");
  function _toPrimitive$8(t2, r2) {
    if ("object" != _typeof$8(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$8(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$8, "_toPrimitive$8");
  function getTicksEnd(sign2, boundaries, getTickSize, ticks2, minTickGap) {
    var result = (ticks2 || []).slice();
    var len = result.length;
    var start = boundaries.start;
    var end = boundaries.end;
    var _loop = /* @__PURE__ */ __name(function _loop2(i3) {
      var entry = result[i3];
      var size2;
      var getSize = /* @__PURE__ */ __name(function getSize2() {
        if (size2 === void 0) {
          size2 = getTickSize(entry, i3);
        }
        return size2;
      }, "getSize");
      if (i3 === len - 1) {
        var gap = sign2 * (entry.coordinate + sign2 * getSize() / 2 - end);
        result[i3] = entry = _objectSpread$5(_objectSpread$5({}, entry), {}, {
          tickCoord: gap > 0 ? entry.coordinate - gap * sign2 : entry.coordinate
        });
      } else {
        result[i3] = entry = _objectSpread$5(_objectSpread$5({}, entry), {}, {
          tickCoord: entry.coordinate
        });
      }
      var isShow = isVisible(sign2, entry.tickCoord, getSize, start, end);
      if (isShow) {
        end = entry.tickCoord - sign2 * (getSize() / 2 + minTickGap);
        result[i3] = _objectSpread$5(_objectSpread$5({}, entry), {}, {
          isShow: true
        });
      }
    }, "_loop");
    for (var i2 = len - 1; i2 >= 0; i2--) {
      _loop(i2);
    }
    return result;
  }
  __name(getTicksEnd, "getTicksEnd");
  function getTicksStart(sign2, boundaries, getTickSize, ticks2, minTickGap, preserveEnd) {
    var result = (ticks2 || []).slice();
    var len = result.length;
    var start = boundaries.start, end = boundaries.end;
    if (preserveEnd) {
      var tail = ticks2[len - 1];
      var tailSize = getTickSize(tail, len - 1);
      var tailGap = sign2 * (tail.coordinate + sign2 * tailSize / 2 - end);
      result[len - 1] = tail = _objectSpread$5(_objectSpread$5({}, tail), {}, {
        tickCoord: tailGap > 0 ? tail.coordinate - tailGap * sign2 : tail.coordinate
      });
      var isTailShow = isVisible(sign2, tail.tickCoord, function() {
        return tailSize;
      }, start, end);
      if (isTailShow) {
        end = tail.tickCoord - sign2 * (tailSize / 2 + minTickGap);
        result[len - 1] = _objectSpread$5(_objectSpread$5({}, tail), {}, {
          isShow: true
        });
      }
    }
    var count2 = preserveEnd ? len - 1 : len;
    var _loop2 = /* @__PURE__ */ __name(function _loop22(i3) {
      var entry = result[i3];
      var size2;
      var getSize = /* @__PURE__ */ __name(function getSize2() {
        if (size2 === void 0) {
          size2 = getTickSize(entry, i3);
        }
        return size2;
      }, "getSize");
      if (i3 === 0) {
        var gap = sign2 * (entry.coordinate - sign2 * getSize() / 2 - start);
        result[i3] = entry = _objectSpread$5(_objectSpread$5({}, entry), {}, {
          tickCoord: gap < 0 ? entry.coordinate - gap * sign2 : entry.coordinate
        });
      } else {
        result[i3] = entry = _objectSpread$5(_objectSpread$5({}, entry), {}, {
          tickCoord: entry.coordinate
        });
      }
      var isShow = isVisible(sign2, entry.tickCoord, getSize, start, end);
      if (isShow) {
        start = entry.tickCoord + sign2 * (getSize() / 2 + minTickGap);
        result[i3] = _objectSpread$5(_objectSpread$5({}, entry), {}, {
          isShow: true
        });
      }
    }, "_loop2");
    for (var i2 = 0; i2 < count2; i2++) {
      _loop2(i2);
    }
    return result;
  }
  __name(getTicksStart, "getTicksStart");
  function getTicks(props, fontSize, letterSpacing) {
    var tick = props.tick, ticks2 = props.ticks, viewBox = props.viewBox, minTickGap = props.minTickGap, orientation = props.orientation, interval = props.interval, tickFormatter = props.tickFormatter, unit2 = props.unit, angle = props.angle;
    if (!ticks2 || !ticks2.length || !tick) {
      return [];
    }
    if (isNumber(interval) || Global.isSsr) {
      return getNumberIntervalTicks(ticks2, typeof interval === "number" && isNumber(interval) ? interval : 0);
    }
    var candidates = [];
    var sizeKey = orientation === "top" || orientation === "bottom" ? "width" : "height";
    var unitSize = unit2 && sizeKey === "width" ? getStringSize(unit2, {
      fontSize,
      letterSpacing
    }) : {
      width: 0,
      height: 0
    };
    var getTickSize = /* @__PURE__ */ __name(function getTickSize2(content, index2) {
      var value = isFunction$2(tickFormatter) ? tickFormatter(content.value, index2) : content.value;
      return sizeKey === "width" ? getAngledTickWidth(getStringSize(value, {
        fontSize,
        letterSpacing
      }), unitSize, angle) : getStringSize(value, {
        fontSize,
        letterSpacing
      })[sizeKey];
    }, "getTickSize");
    var sign2 = ticks2.length >= 2 ? mathSign(ticks2[1].coordinate - ticks2[0].coordinate) : 1;
    var boundaries = getTickBoundaries(viewBox, sign2, sizeKey);
    if (interval === "equidistantPreserveStart") {
      return getEquidistantTicks(sign2, boundaries, getTickSize, ticks2, minTickGap);
    }
    if (interval === "preserveStart" || interval === "preserveStartEnd") {
      candidates = getTicksStart(sign2, boundaries, getTickSize, ticks2, minTickGap, interval === "preserveStartEnd");
    } else {
      candidates = getTicksEnd(sign2, boundaries, getTickSize, ticks2, minTickGap);
    }
    return candidates.filter(function(entry) {
      return entry.isShow;
    });
  }
  __name(getTicks, "getTicks");
  var _excluded$3 = ["viewBox"], _excluded2$3 = ["viewBox"], _excluded3 = ["ticks"];
  function _typeof$7(o2) {
    "@babel/helpers - typeof";
    return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$7(o2);
  }
  __name(_typeof$7, "_typeof$7");
  function _extends$5() {
    _extends$5 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$5.apply(this, arguments);
  }
  __name(_extends$5, "_extends$5");
  function ownKeys$4(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$4, "ownKeys$4");
  function _objectSpread$4(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$4(Object(t2), true).forEach(function(r3) {
        _defineProperty$7(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$4(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$4, "_objectSpread$4");
  function _objectWithoutProperties$3(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$3(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$3, "_objectWithoutProperties$3");
  function _objectWithoutPropertiesLoose$3(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$3, "_objectWithoutPropertiesLoose$3");
  function _classCallCheck$5(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$5, "_classCallCheck$5");
  function _defineProperties$5(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$7(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$5, "_defineProperties$5");
  function _createClass$5(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$5(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties$5(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$5, "_createClass$5");
  function _callSuper$4(t2, o2, e) {
    return o2 = _getPrototypeOf$4(o2), _possibleConstructorReturn$4(t2, _isNativeReflectConstruct$4() ? Reflect.construct(o2, e || [], _getPrototypeOf$4(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$4, "_callSuper$4");
  function _possibleConstructorReturn$4(self2, call) {
    if (call && (_typeof$7(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$4(self2);
  }
  __name(_possibleConstructorReturn$4, "_possibleConstructorReturn$4");
  function _assertThisInitialized$4(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$4, "_assertThisInitialized$4");
  function _isNativeReflectConstruct$4() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$4 = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$4, "_isNativeReflectConstruct$4");
  function _getPrototypeOf$4(o2) {
    _getPrototypeOf$4 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$4(o2);
  }
  __name(_getPrototypeOf$4, "_getPrototypeOf$4");
  function _inherits$4(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$4(subClass, superClass);
  }
  __name(_inherits$4, "_inherits$4");
  function _setPrototypeOf$4(o2, p2) {
    _setPrototypeOf$4 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$4(o2, p2);
  }
  __name(_setPrototypeOf$4, "_setPrototypeOf$4");
  function _defineProperty$7(obj, key, value) {
    key = _toPropertyKey$7(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$7, "_defineProperty$7");
  function _toPropertyKey$7(t2) {
    var i2 = _toPrimitive$7(t2, "string");
    return "symbol" == _typeof$7(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$7, "_toPropertyKey$7");
  function _toPrimitive$7(t2, r2) {
    if ("object" != _typeof$7(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$7(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$7, "_toPrimitive$7");
  var CartesianAxis = /* @__PURE__ */ (function(_Component) {
    function CartesianAxis2(props) {
      var _this;
      _classCallCheck$5(this, CartesianAxis2);
      _this = _callSuper$4(this, CartesianAxis2, [props]);
      _this.state = {
        fontSize: "",
        letterSpacing: ""
      };
      return _this;
    }
    __name(CartesianAxis2, "CartesianAxis");
    _inherits$4(CartesianAxis2, _Component);
    return _createClass$5(CartesianAxis2, [{
      key: "shouldComponentUpdate",
      value: /* @__PURE__ */ __name(function shouldComponentUpdate(_ref, nextState) {
        var viewBox = _ref.viewBox, restProps = _objectWithoutProperties$3(_ref, _excluded$3);
        var _this$props = this.props, viewBoxOld = _this$props.viewBox, restPropsOld = _objectWithoutProperties$3(_this$props, _excluded2$3);
        return !shallowEqual(viewBox, viewBoxOld) || !shallowEqual(restProps, restPropsOld) || !shallowEqual(nextState, this.state);
      }, "shouldComponentUpdate")
    }, {
      key: "componentDidMount",
      value: /* @__PURE__ */ __name(function componentDidMount() {
        var htmlLayer = this.layerReference;
        if (!htmlLayer) return;
        var tick = htmlLayer.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];
        if (tick) {
          this.setState({
            fontSize: window.getComputedStyle(tick).fontSize,
            letterSpacing: window.getComputedStyle(tick).letterSpacing
          });
        }
      }, "componentDidMount")
      /**
       * Calculate the coordinates of endpoints in ticks
       * @param  {Object} data The data of a simple tick
       * @return {Object} (x1, y1): The coordinate of endpoint close to tick text
       *  (x2, y2): The coordinate of endpoint close to axis
       */
    }, {
      key: "getTickLineCoord",
      value: /* @__PURE__ */ __name(function getTickLineCoord(data) {
        var _this$props2 = this.props, x2 = _this$props2.x, y2 = _this$props2.y, width = _this$props2.width, height = _this$props2.height, orientation = _this$props2.orientation, tickSize = _this$props2.tickSize, mirror = _this$props2.mirror, tickMargin = _this$props2.tickMargin;
        var x1, x22, y1, y22, tx, ty;
        var sign2 = mirror ? -1 : 1;
        var finalTickSize = data.tickSize || tickSize;
        var tickCoord = isNumber(data.tickCoord) ? data.tickCoord : data.coordinate;
        switch (orientation) {
          case "top":
            x1 = x22 = data.coordinate;
            y22 = y2 + +!mirror * height;
            y1 = y22 - sign2 * finalTickSize;
            ty = y1 - sign2 * tickMargin;
            tx = tickCoord;
            break;
          case "left":
            y1 = y22 = data.coordinate;
            x22 = x2 + +!mirror * width;
            x1 = x22 - sign2 * finalTickSize;
            tx = x1 - sign2 * tickMargin;
            ty = tickCoord;
            break;
          case "right":
            y1 = y22 = data.coordinate;
            x22 = x2 + +mirror * width;
            x1 = x22 + sign2 * finalTickSize;
            tx = x1 + sign2 * tickMargin;
            ty = tickCoord;
            break;
          default:
            x1 = x22 = data.coordinate;
            y22 = y2 + +mirror * height;
            y1 = y22 + sign2 * finalTickSize;
            ty = y1 + sign2 * tickMargin;
            tx = tickCoord;
            break;
        }
        return {
          line: {
            x1,
            y1,
            x2: x22,
            y2: y22
          },
          tick: {
            x: tx,
            y: ty
          }
        };
      }, "getTickLineCoord")
    }, {
      key: "getTickTextAnchor",
      value: /* @__PURE__ */ __name(function getTickTextAnchor() {
        var _this$props3 = this.props, orientation = _this$props3.orientation, mirror = _this$props3.mirror;
        var textAnchor;
        switch (orientation) {
          case "left":
            textAnchor = mirror ? "start" : "end";
            break;
          case "right":
            textAnchor = mirror ? "end" : "start";
            break;
          default:
            textAnchor = "middle";
            break;
        }
        return textAnchor;
      }, "getTickTextAnchor")
    }, {
      key: "getTickVerticalAnchor",
      value: /* @__PURE__ */ __name(function getTickVerticalAnchor() {
        var _this$props4 = this.props, orientation = _this$props4.orientation, mirror = _this$props4.mirror;
        var verticalAnchor = "end";
        switch (orientation) {
          case "left":
          case "right":
            verticalAnchor = "middle";
            break;
          case "top":
            verticalAnchor = mirror ? "start" : "end";
            break;
          default:
            verticalAnchor = mirror ? "end" : "start";
            break;
        }
        return verticalAnchor;
      }, "getTickVerticalAnchor")
    }, {
      key: "renderAxisLine",
      value: /* @__PURE__ */ __name(function renderAxisLine() {
        var _this$props5 = this.props, x2 = _this$props5.x, y2 = _this$props5.y, width = _this$props5.width, height = _this$props5.height, orientation = _this$props5.orientation, mirror = _this$props5.mirror, axisLine = _this$props5.axisLine;
        var props = _objectSpread$4(_objectSpread$4(_objectSpread$4({}, filterProps(this.props, false)), filterProps(axisLine, false)), {}, {
          fill: "none"
        });
        if (orientation === "top" || orientation === "bottom") {
          var needHeight = +(orientation === "top" && !mirror || orientation === "bottom" && mirror);
          props = _objectSpread$4(_objectSpread$4({}, props), {}, {
            x1: x2,
            y1: y2 + needHeight * height,
            x2: x2 + width,
            y2: y2 + needHeight * height
          });
        } else {
          var needWidth = +(orientation === "left" && !mirror || orientation === "right" && mirror);
          props = _objectSpread$4(_objectSpread$4({}, props), {}, {
            x1: x2 + needWidth * width,
            y1: y2,
            x2: x2 + needWidth * width,
            y2: y2 + height
          });
        }
        return /* @__PURE__ */ React.createElement("line", _extends$5({}, props, {
          className: clsx("recharts-cartesian-axis-line", get$1(axisLine, "className"))
        }));
      }, "renderAxisLine")
    }, {
      key: "renderTicks",
      value: (
        /**
         * render the ticks
         * @param {Array} ticks The ticks to actually render (overrides what was passed in props)
         * @param {string} fontSize Fontsize to consider for tick spacing
         * @param {string} letterSpacing Letterspacing to consider for tick spacing
         * @return {ReactComponent} renderedTicks
         */
        /* @__PURE__ */ __name(function renderTicks(ticks2, fontSize, letterSpacing) {
          var _this2 = this;
          var _this$props6 = this.props, tickLine = _this$props6.tickLine, stroke = _this$props6.stroke, tick = _this$props6.tick, tickFormatter = _this$props6.tickFormatter, unit2 = _this$props6.unit;
          var finalTicks = getTicks(_objectSpread$4(_objectSpread$4({}, this.props), {}, {
            ticks: ticks2
          }), fontSize, letterSpacing);
          var textAnchor = this.getTickTextAnchor();
          var verticalAnchor = this.getTickVerticalAnchor();
          var axisProps = filterProps(this.props, false);
          var customTickProps = filterProps(tick, false);
          var tickLineProps = _objectSpread$4(_objectSpread$4({}, axisProps), {}, {
            fill: "none"
          }, filterProps(tickLine, false));
          var items = finalTicks.map(function(entry, i2) {
            var _this2$getTickLineCoo = _this2.getTickLineCoord(entry), lineCoord = _this2$getTickLineCoo.line, tickCoord = _this2$getTickLineCoo.tick;
            var tickProps = _objectSpread$4(_objectSpread$4(_objectSpread$4(_objectSpread$4({
              textAnchor,
              verticalAnchor
            }, axisProps), {}, {
              stroke: "none",
              fill: stroke
            }, customTickProps), tickCoord), {}, {
              index: i2,
              payload: entry,
              visibleTicksCount: finalTicks.length,
              tickFormatter
            });
            return /* @__PURE__ */ React.createElement(Layer, _extends$5({
              className: "recharts-cartesian-axis-tick",
              key: "tick-".concat(entry.value, "-").concat(entry.coordinate, "-").concat(entry.tickCoord)
            }, adaptEventsOfChild(_this2.props, entry, i2)), tickLine && /* @__PURE__ */ React.createElement("line", _extends$5({}, tickLineProps, lineCoord, {
              className: clsx("recharts-cartesian-axis-tick-line", get$1(tickLine, "className"))
            })), tick && CartesianAxis2.renderTickItem(tick, tickProps, "".concat(isFunction$2(tickFormatter) ? tickFormatter(entry.value, i2) : entry.value).concat(unit2 || "")));
          });
          return /* @__PURE__ */ React.createElement("g", {
            className: "recharts-cartesian-axis-ticks"
          }, items);
        }, "renderTicks")
      )
    }, {
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _this3 = this;
        var _this$props7 = this.props, axisLine = _this$props7.axisLine, width = _this$props7.width, height = _this$props7.height, ticksGenerator = _this$props7.ticksGenerator, className = _this$props7.className, hide2 = _this$props7.hide;
        if (hide2) {
          return null;
        }
        var _this$props8 = this.props, ticks2 = _this$props8.ticks, noTicksProps = _objectWithoutProperties$3(_this$props8, _excluded3);
        var finalTicks = ticks2;
        if (isFunction$2(ticksGenerator)) {
          finalTicks = ticks2 && ticks2.length > 0 ? ticksGenerator(this.props) : ticksGenerator(noTicksProps);
        }
        if (width <= 0 || height <= 0 || !finalTicks || !finalTicks.length) {
          return null;
        }
        return /* @__PURE__ */ React.createElement(Layer, {
          className: clsx("recharts-cartesian-axis", className),
          ref: /* @__PURE__ */ __name(function ref(_ref2) {
            _this3.layerReference = _ref2;
          }, "ref")
        }, axisLine && this.renderAxisLine(), this.renderTicks(finalTicks, this.state.fontSize, this.state.letterSpacing), Label.renderCallByParent(this.props));
      }, "render")
    }], [{
      key: "renderTickItem",
      value: /* @__PURE__ */ __name(function renderTickItem(option, props, value) {
        var tickItem;
        var combinedClassName = clsx(props.className, "recharts-cartesian-axis-tick-value");
        if (/* @__PURE__ */ React.isValidElement(option)) {
          tickItem = /* @__PURE__ */ React.cloneElement(option, _objectSpread$4(_objectSpread$4({}, props), {}, {
            className: combinedClassName
          }));
        } else if (isFunction$2(option)) {
          tickItem = option(_objectSpread$4(_objectSpread$4({}, props), {}, {
            className: combinedClassName
          }));
        } else {
          tickItem = /* @__PURE__ */ React.createElement(Text, _extends$5({}, props, {
            className: "recharts-cartesian-axis-tick-value"
          }), value);
        }
        return tickItem;
      }, "renderTickItem")
    }]);
  })(reactExports.Component);
  _defineProperty$7(CartesianAxis, "displayName", "CartesianAxis");
  _defineProperty$7(CartesianAxis, "defaultProps", {
    x: 0,
    y: 0,
    width: 0,
    height: 0,
    viewBox: {
      x: 0,
      y: 0,
      width: 0,
      height: 0
    },
    // The orientation of axis
    orientation: "bottom",
    // The ticks
    ticks: [],
    stroke: "#666",
    tickLine: true,
    axisLine: true,
    tick: true,
    mirror: false,
    minTickGap: 5,
    // The width or height of tick
    tickSize: 6,
    tickMargin: 2,
    interval: "preserveEnd"
  });
  var _excluded$2 = ["x1", "y1", "x2", "y2", "key"], _excluded2$2 = ["offset"];
  function _typeof$6(o2) {
    "@babel/helpers - typeof";
    return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$6(o2);
  }
  __name(_typeof$6, "_typeof$6");
  function ownKeys$3(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$3, "ownKeys$3");
  function _objectSpread$3(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$3(Object(t2), true).forEach(function(r3) {
        _defineProperty$6(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$3(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$3, "_objectSpread$3");
  function _defineProperty$6(obj, key, value) {
    key = _toPropertyKey$6(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$6, "_defineProperty$6");
  function _toPropertyKey$6(t2) {
    var i2 = _toPrimitive$6(t2, "string");
    return "symbol" == _typeof$6(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$6, "_toPropertyKey$6");
  function _toPrimitive$6(t2, r2) {
    if ("object" != _typeof$6(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$6(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$6, "_toPrimitive$6");
  function _extends$4() {
    _extends$4 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$4.apply(this, arguments);
  }
  __name(_extends$4, "_extends$4");
  function _objectWithoutProperties$2(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$2(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$2, "_objectWithoutProperties$2");
  function _objectWithoutPropertiesLoose$2(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$2, "_objectWithoutPropertiesLoose$2");
  var Background = /* @__PURE__ */ __name(function Background2(props) {
    var fill = props.fill;
    if (!fill || fill === "none") {
      return null;
    }
    var fillOpacity = props.fillOpacity, x2 = props.x, y2 = props.y, width = props.width, height = props.height, ry = props.ry;
    return /* @__PURE__ */ React.createElement("rect", {
      x: x2,
      y: y2,
      ry,
      width,
      height,
      stroke: "none",
      fill,
      fillOpacity,
      className: "recharts-cartesian-grid-bg"
    });
  }, "Background");
  function renderLineItem(option, props) {
    var lineItem;
    if (/* @__PURE__ */ React.isValidElement(option)) {
      lineItem = /* @__PURE__ */ React.cloneElement(option, props);
    } else if (isFunction$2(option)) {
      lineItem = option(props);
    } else {
      var x1 = props.x1, y1 = props.y1, x2 = props.x2, y2 = props.y2, key = props.key, others = _objectWithoutProperties$2(props, _excluded$2);
      var _filterProps = filterProps(others, false);
      _filterProps.offset;
      var restOfFilteredProps = _objectWithoutProperties$2(_filterProps, _excluded2$2);
      lineItem = /* @__PURE__ */ React.createElement("line", _extends$4({}, restOfFilteredProps, {
        x1,
        y1,
        x2,
        y2,
        fill: "none",
        key
      }));
    }
    return lineItem;
  }
  __name(renderLineItem, "renderLineItem");
  function HorizontalGridLines(props) {
    var x2 = props.x, width = props.width, _props$horizontal = props.horizontal, horizontal = _props$horizontal === void 0 ? true : _props$horizontal, horizontalPoints = props.horizontalPoints;
    if (!horizontal || !horizontalPoints || !horizontalPoints.length) {
      return null;
    }
    var items = horizontalPoints.map(function(entry, i2) {
      var lineItemProps = _objectSpread$3(_objectSpread$3({}, props), {}, {
        x1: x2,
        y1: entry,
        x2: x2 + width,
        y2: entry,
        key: "line-".concat(i2),
        index: i2
      });
      return renderLineItem(horizontal, lineItemProps);
    });
    return /* @__PURE__ */ React.createElement("g", {
      className: "recharts-cartesian-grid-horizontal"
    }, items);
  }
  __name(HorizontalGridLines, "HorizontalGridLines");
  function VerticalGridLines(props) {
    var y2 = props.y, height = props.height, _props$vertical = props.vertical, vertical = _props$vertical === void 0 ? true : _props$vertical, verticalPoints = props.verticalPoints;
    if (!vertical || !verticalPoints || !verticalPoints.length) {
      return null;
    }
    var items = verticalPoints.map(function(entry, i2) {
      var lineItemProps = _objectSpread$3(_objectSpread$3({}, props), {}, {
        x1: entry,
        y1: y2,
        x2: entry,
        y2: y2 + height,
        key: "line-".concat(i2),
        index: i2
      });
      return renderLineItem(vertical, lineItemProps);
    });
    return /* @__PURE__ */ React.createElement("g", {
      className: "recharts-cartesian-grid-vertical"
    }, items);
  }
  __name(VerticalGridLines, "VerticalGridLines");
  function HorizontalStripes(props) {
    var horizontalFill = props.horizontalFill, fillOpacity = props.fillOpacity, x2 = props.x, y2 = props.y, width = props.width, height = props.height, horizontalPoints = props.horizontalPoints, _props$horizontal2 = props.horizontal, horizontal = _props$horizontal2 === void 0 ? true : _props$horizontal2;
    if (!horizontal || !horizontalFill || !horizontalFill.length) {
      return null;
    }
    var roundedSortedHorizontalPoints = horizontalPoints.map(function(e) {
      return Math.round(e + y2 - y2);
    }).sort(function(a2, b) {
      return a2 - b;
    });
    if (y2 !== roundedSortedHorizontalPoints[0]) {
      roundedSortedHorizontalPoints.unshift(0);
    }
    var items = roundedSortedHorizontalPoints.map(function(entry, i2) {
      var lastStripe = !roundedSortedHorizontalPoints[i2 + 1];
      var lineHeight = lastStripe ? y2 + height - entry : roundedSortedHorizontalPoints[i2 + 1] - entry;
      if (lineHeight <= 0) {
        return null;
      }
      var colorIndex = i2 % horizontalFill.length;
      return /* @__PURE__ */ React.createElement("rect", {
        key: "react-".concat(i2),
        y: entry,
        x: x2,
        height: lineHeight,
        width,
        stroke: "none",
        fill: horizontalFill[colorIndex],
        fillOpacity,
        className: "recharts-cartesian-grid-bg"
      });
    });
    return /* @__PURE__ */ React.createElement("g", {
      className: "recharts-cartesian-gridstripes-horizontal"
    }, items);
  }
  __name(HorizontalStripes, "HorizontalStripes");
  function VerticalStripes(props) {
    var _props$vertical2 = props.vertical, vertical = _props$vertical2 === void 0 ? true : _props$vertical2, verticalFill = props.verticalFill, fillOpacity = props.fillOpacity, x2 = props.x, y2 = props.y, width = props.width, height = props.height, verticalPoints = props.verticalPoints;
    if (!vertical || !verticalFill || !verticalFill.length) {
      return null;
    }
    var roundedSortedVerticalPoints = verticalPoints.map(function(e) {
      return Math.round(e + x2 - x2);
    }).sort(function(a2, b) {
      return a2 - b;
    });
    if (x2 !== roundedSortedVerticalPoints[0]) {
      roundedSortedVerticalPoints.unshift(0);
    }
    var items = roundedSortedVerticalPoints.map(function(entry, i2) {
      var lastStripe = !roundedSortedVerticalPoints[i2 + 1];
      var lineWidth = lastStripe ? x2 + width - entry : roundedSortedVerticalPoints[i2 + 1] - entry;
      if (lineWidth <= 0) {
        return null;
      }
      var colorIndex = i2 % verticalFill.length;
      return /* @__PURE__ */ React.createElement("rect", {
        key: "react-".concat(i2),
        x: entry,
        y: y2,
        width: lineWidth,
        height,
        stroke: "none",
        fill: verticalFill[colorIndex],
        fillOpacity,
        className: "recharts-cartesian-grid-bg"
      });
    });
    return /* @__PURE__ */ React.createElement("g", {
      className: "recharts-cartesian-gridstripes-vertical"
    }, items);
  }
  __name(VerticalStripes, "VerticalStripes");
  var defaultVerticalCoordinatesGenerator = /* @__PURE__ */ __name(function defaultVerticalCoordinatesGenerator2(_ref, syncWithTicks) {
    var xAxis = _ref.xAxis, width = _ref.width, height = _ref.height, offset2 = _ref.offset;
    return getCoordinatesOfGrid(getTicks(_objectSpread$3(_objectSpread$3(_objectSpread$3({}, CartesianAxis.defaultProps), xAxis), {}, {
      ticks: getTicksOfAxis(xAxis, true),
      viewBox: {
        x: 0,
        y: 0,
        width,
        height
      }
    })), offset2.left, offset2.left + offset2.width, syncWithTicks);
  }, "defaultVerticalCoordinatesGenerator");
  var defaultHorizontalCoordinatesGenerator = /* @__PURE__ */ __name(function defaultHorizontalCoordinatesGenerator2(_ref2, syncWithTicks) {
    var yAxis = _ref2.yAxis, width = _ref2.width, height = _ref2.height, offset2 = _ref2.offset;
    return getCoordinatesOfGrid(getTicks(_objectSpread$3(_objectSpread$3(_objectSpread$3({}, CartesianAxis.defaultProps), yAxis), {}, {
      ticks: getTicksOfAxis(yAxis, true),
      viewBox: {
        x: 0,
        y: 0,
        width,
        height
      }
    })), offset2.top, offset2.top + offset2.height, syncWithTicks);
  }, "defaultHorizontalCoordinatesGenerator");
  var defaultProps = {
    horizontal: true,
    vertical: true,
    stroke: "#ccc",
    fill: "none",
    // The fill of colors of grid lines
    verticalFill: [],
    horizontalFill: []
  };
  function CartesianGrid(props) {
    var _props$stroke, _props$fill, _props$horizontal3, _props$horizontalFill, _props$vertical3, _props$verticalFill;
    var chartWidth = useChartWidth();
    var chartHeight = useChartHeight();
    var offset2 = useOffset();
    var propsIncludingDefaults = _objectSpread$3(_objectSpread$3({}, props), {}, {
      stroke: (_props$stroke = props.stroke) !== null && _props$stroke !== void 0 ? _props$stroke : defaultProps.stroke,
      fill: (_props$fill = props.fill) !== null && _props$fill !== void 0 ? _props$fill : defaultProps.fill,
      horizontal: (_props$horizontal3 = props.horizontal) !== null && _props$horizontal3 !== void 0 ? _props$horizontal3 : defaultProps.horizontal,
      horizontalFill: (_props$horizontalFill = props.horizontalFill) !== null && _props$horizontalFill !== void 0 ? _props$horizontalFill : defaultProps.horizontalFill,
      vertical: (_props$vertical3 = props.vertical) !== null && _props$vertical3 !== void 0 ? _props$vertical3 : defaultProps.vertical,
      verticalFill: (_props$verticalFill = props.verticalFill) !== null && _props$verticalFill !== void 0 ? _props$verticalFill : defaultProps.verticalFill,
      x: isNumber(props.x) ? props.x : offset2.left,
      y: isNumber(props.y) ? props.y : offset2.top,
      width: isNumber(props.width) ? props.width : offset2.width,
      height: isNumber(props.height) ? props.height : offset2.height
    });
    var x2 = propsIncludingDefaults.x, y2 = propsIncludingDefaults.y, width = propsIncludingDefaults.width, height = propsIncludingDefaults.height, syncWithTicks = propsIncludingDefaults.syncWithTicks, horizontalValues = propsIncludingDefaults.horizontalValues, verticalValues = propsIncludingDefaults.verticalValues;
    var xAxis = useArbitraryXAxis();
    var yAxis = useYAxisWithFiniteDomainOrRandom();
    if (!isNumber(width) || width <= 0 || !isNumber(height) || height <= 0 || !isNumber(x2) || x2 !== +x2 || !isNumber(y2) || y2 !== +y2) {
      return null;
    }
    var verticalCoordinatesGenerator = propsIncludingDefaults.verticalCoordinatesGenerator || defaultVerticalCoordinatesGenerator;
    var horizontalCoordinatesGenerator = propsIncludingDefaults.horizontalCoordinatesGenerator || defaultHorizontalCoordinatesGenerator;
    var horizontalPoints = propsIncludingDefaults.horizontalPoints, verticalPoints = propsIncludingDefaults.verticalPoints;
    if ((!horizontalPoints || !horizontalPoints.length) && isFunction$2(horizontalCoordinatesGenerator)) {
      var isHorizontalValues = horizontalValues && horizontalValues.length;
      var generatorResult = horizontalCoordinatesGenerator({
        yAxis: yAxis ? _objectSpread$3(_objectSpread$3({}, yAxis), {}, {
          ticks: isHorizontalValues ? horizontalValues : yAxis.ticks
        }) : void 0,
        width: chartWidth,
        height: chartHeight,
        offset: offset2
      }, isHorizontalValues ? true : syncWithTicks);
      warn(Array.isArray(generatorResult), "horizontalCoordinatesGenerator should return Array but instead it returned [".concat(_typeof$6(generatorResult), "]"));
      if (Array.isArray(generatorResult)) {
        horizontalPoints = generatorResult;
      }
    }
    if ((!verticalPoints || !verticalPoints.length) && isFunction$2(verticalCoordinatesGenerator)) {
      var isVerticalValues = verticalValues && verticalValues.length;
      var _generatorResult = verticalCoordinatesGenerator({
        xAxis: xAxis ? _objectSpread$3(_objectSpread$3({}, xAxis), {}, {
          ticks: isVerticalValues ? verticalValues : xAxis.ticks
        }) : void 0,
        width: chartWidth,
        height: chartHeight,
        offset: offset2
      }, isVerticalValues ? true : syncWithTicks);
      warn(Array.isArray(_generatorResult), "verticalCoordinatesGenerator should return Array but instead it returned [".concat(_typeof$6(_generatorResult), "]"));
      if (Array.isArray(_generatorResult)) {
        verticalPoints = _generatorResult;
      }
    }
    return /* @__PURE__ */ React.createElement("g", {
      className: "recharts-cartesian-grid"
    }, /* @__PURE__ */ React.createElement(Background, {
      fill: propsIncludingDefaults.fill,
      fillOpacity: propsIncludingDefaults.fillOpacity,
      x: propsIncludingDefaults.x,
      y: propsIncludingDefaults.y,
      width: propsIncludingDefaults.width,
      height: propsIncludingDefaults.height,
      ry: propsIncludingDefaults.ry
    }), /* @__PURE__ */ React.createElement(HorizontalGridLines, _extends$4({}, propsIncludingDefaults, {
      offset: offset2,
      horizontalPoints,
      xAxis,
      yAxis
    })), /* @__PURE__ */ React.createElement(VerticalGridLines, _extends$4({}, propsIncludingDefaults, {
      offset: offset2,
      verticalPoints,
      xAxis,
      yAxis
    })), /* @__PURE__ */ React.createElement(HorizontalStripes, _extends$4({}, propsIncludingDefaults, {
      horizontalPoints
    })), /* @__PURE__ */ React.createElement(VerticalStripes, _extends$4({}, propsIncludingDefaults, {
      verticalPoints
    })));
  }
  __name(CartesianGrid, "CartesianGrid");
  CartesianGrid.displayName = "CartesianGrid";
  var _excluded$1 = ["layout", "type", "stroke", "connectNulls", "isRange", "ref"], _excluded2$1 = ["key"];
  var _Area;
  function _typeof$5(o2) {
    "@babel/helpers - typeof";
    return _typeof$5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$5(o2);
  }
  __name(_typeof$5, "_typeof$5");
  function _objectWithoutProperties$1(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose$1(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties$1, "_objectWithoutProperties$1");
  function _objectWithoutPropertiesLoose$1(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose$1, "_objectWithoutPropertiesLoose$1");
  function _extends$3() {
    _extends$3 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$3.apply(this, arguments);
  }
  __name(_extends$3, "_extends$3");
  function ownKeys$2(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$2, "ownKeys$2");
  function _objectSpread$2(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$2(Object(t2), true).forEach(function(r3) {
        _defineProperty$5(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$2(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$2, "_objectSpread$2");
  function _classCallCheck$4(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$4, "_classCallCheck$4");
  function _defineProperties$4(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$5(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$4, "_defineProperties$4");
  function _createClass$4(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$4(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties$4(Constructor, staticProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$4, "_createClass$4");
  function _callSuper$3(t2, o2, e) {
    return o2 = _getPrototypeOf$3(o2), _possibleConstructorReturn$3(t2, _isNativeReflectConstruct$3() ? Reflect.construct(o2, e || [], _getPrototypeOf$3(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$3, "_callSuper$3");
  function _possibleConstructorReturn$3(self2, call) {
    if (call && (_typeof$5(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$3(self2);
  }
  __name(_possibleConstructorReturn$3, "_possibleConstructorReturn$3");
  function _assertThisInitialized$3(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$3, "_assertThisInitialized$3");
  function _isNativeReflectConstruct$3() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$3 = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$3, "_isNativeReflectConstruct$3");
  function _getPrototypeOf$3(o2) {
    _getPrototypeOf$3 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$3(o2);
  }
  __name(_getPrototypeOf$3, "_getPrototypeOf$3");
  function _inherits$3(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$3(subClass, superClass);
  }
  __name(_inherits$3, "_inherits$3");
  function _setPrototypeOf$3(o2, p2) {
    _setPrototypeOf$3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$3(o2, p2);
  }
  __name(_setPrototypeOf$3, "_setPrototypeOf$3");
  function _defineProperty$5(obj, key, value) {
    key = _toPropertyKey$5(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$5, "_defineProperty$5");
  function _toPropertyKey$5(t2) {
    var i2 = _toPrimitive$5(t2, "string");
    return "symbol" == _typeof$5(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$5, "_toPropertyKey$5");
  function _toPrimitive$5(t2, r2) {
    if ("object" != _typeof$5(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$5(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$5, "_toPrimitive$5");
  var Area = /* @__PURE__ */ (function(_PureComponent) {
    function Area2() {
      var _this;
      _classCallCheck$4(this, Area2);
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      _this = _callSuper$3(this, Area2, [].concat(args));
      _defineProperty$5(_this, "state", {
        isAnimationFinished: true
      });
      _defineProperty$5(_this, "id", uniqueId("recharts-area-"));
      _defineProperty$5(_this, "handleAnimationEnd", function() {
        var onAnimationEnd = _this.props.onAnimationEnd;
        _this.setState({
          isAnimationFinished: true
        });
        if (isFunction$2(onAnimationEnd)) {
          onAnimationEnd();
        }
      });
      _defineProperty$5(_this, "handleAnimationStart", function() {
        var onAnimationStart = _this.props.onAnimationStart;
        _this.setState({
          isAnimationFinished: false
        });
        if (isFunction$2(onAnimationStart)) {
          onAnimationStart();
        }
      });
      return _this;
    }
    __name(Area2, "Area");
    _inherits$3(Area2, _PureComponent);
    return _createClass$4(Area2, [{
      key: "renderDots",
      value: /* @__PURE__ */ __name(function renderDots(needClip, clipDot, clipPathId) {
        var isAnimationActive = this.props.isAnimationActive;
        var isAnimationFinished = this.state.isAnimationFinished;
        if (isAnimationActive && !isAnimationFinished) {
          return null;
        }
        var _this$props = this.props, dot = _this$props.dot, points = _this$props.points, dataKey = _this$props.dataKey;
        var areaProps = filterProps(this.props, false);
        var customDotProps = filterProps(dot, true);
        var dots = points.map(function(entry, i2) {
          var dotProps = _objectSpread$2(_objectSpread$2(_objectSpread$2({
            key: "dot-".concat(i2),
            r: 3
          }, areaProps), customDotProps), {}, {
            index: i2,
            cx: entry.x,
            cy: entry.y,
            dataKey,
            value: entry.value,
            payload: entry.payload,
            points
          });
          return Area2.renderDotItem(dot, dotProps);
        });
        var dotsProps = {
          clipPath: needClip ? "url(#clipPath-".concat(clipDot ? "" : "dots-").concat(clipPathId, ")") : null
        };
        return /* @__PURE__ */ React.createElement(Layer, _extends$3({
          className: "recharts-area-dots"
        }, dotsProps), dots);
      }, "renderDots")
    }, {
      key: "renderHorizontalRect",
      value: /* @__PURE__ */ __name(function renderHorizontalRect(alpha2) {
        var _this$props2 = this.props, baseLine = _this$props2.baseLine, points = _this$props2.points, strokeWidth = _this$props2.strokeWidth;
        var startX = points[0].x;
        var endX = points[points.length - 1].x;
        var width = alpha2 * Math.abs(startX - endX);
        var maxY = max(points.map(function(entry) {
          return entry.y || 0;
        }));
        if (isNumber(baseLine) && typeof baseLine === "number") {
          maxY = Math.max(baseLine, maxY);
        } else if (baseLine && Array.isArray(baseLine) && baseLine.length) {
          maxY = Math.max(max(baseLine.map(function(entry) {
            return entry.y || 0;
          })), maxY);
        }
        if (isNumber(maxY)) {
          return /* @__PURE__ */ React.createElement("rect", {
            x: startX < endX ? startX : startX - width,
            y: 0,
            width,
            height: Math.floor(maxY + (strokeWidth ? parseInt("".concat(strokeWidth), 10) : 1))
          });
        }
        return null;
      }, "renderHorizontalRect")
    }, {
      key: "renderVerticalRect",
      value: /* @__PURE__ */ __name(function renderVerticalRect(alpha2) {
        var _this$props3 = this.props, baseLine = _this$props3.baseLine, points = _this$props3.points, strokeWidth = _this$props3.strokeWidth;
        var startY = points[0].y;
        var endY = points[points.length - 1].y;
        var height = alpha2 * Math.abs(startY - endY);
        var maxX = max(points.map(function(entry) {
          return entry.x || 0;
        }));
        if (isNumber(baseLine) && typeof baseLine === "number") {
          maxX = Math.max(baseLine, maxX);
        } else if (baseLine && Array.isArray(baseLine) && baseLine.length) {
          maxX = Math.max(max(baseLine.map(function(entry) {
            return entry.x || 0;
          })), maxX);
        }
        if (isNumber(maxX)) {
          return /* @__PURE__ */ React.createElement("rect", {
            x: 0,
            y: startY < endY ? startY : startY - height,
            width: maxX + (strokeWidth ? parseInt("".concat(strokeWidth), 10) : 1),
            height: Math.floor(height)
          });
        }
        return null;
      }, "renderVerticalRect")
    }, {
      key: "renderClipRect",
      value: /* @__PURE__ */ __name(function renderClipRect(alpha2) {
        var layout = this.props.layout;
        if (layout === "vertical") {
          return this.renderVerticalRect(alpha2);
        }
        return this.renderHorizontalRect(alpha2);
      }, "renderClipRect")
    }, {
      key: "renderAreaStatically",
      value: /* @__PURE__ */ __name(function renderAreaStatically(points, baseLine, needClip, clipPathId) {
        var _this$props4 = this.props, layout = _this$props4.layout, type = _this$props4.type, stroke = _this$props4.stroke, connectNulls = _this$props4.connectNulls, isRange = _this$props4.isRange;
        _this$props4.ref;
        var others = _objectWithoutProperties$1(_this$props4, _excluded$1);
        return /* @__PURE__ */ React.createElement(Layer, {
          clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : null
        }, /* @__PURE__ */ React.createElement(Curve, _extends$3({}, filterProps(others, true), {
          points,
          connectNulls,
          type,
          baseLine,
          layout,
          stroke: "none",
          className: "recharts-area-area"
        })), stroke !== "none" && /* @__PURE__ */ React.createElement(Curve, _extends$3({}, filterProps(this.props, false), {
          className: "recharts-area-curve",
          layout,
          type,
          connectNulls,
          fill: "none",
          points
        })), stroke !== "none" && isRange && /* @__PURE__ */ React.createElement(Curve, _extends$3({}, filterProps(this.props, false), {
          className: "recharts-area-curve",
          layout,
          type,
          connectNulls,
          fill: "none",
          points: baseLine
        })));
      }, "renderAreaStatically")
    }, {
      key: "renderAreaWithAnimation",
      value: /* @__PURE__ */ __name(function renderAreaWithAnimation(needClip, clipPathId) {
        var _this2 = this;
        var _this$props5 = this.props, points = _this$props5.points, baseLine = _this$props5.baseLine, isAnimationActive = _this$props5.isAnimationActive, animationBegin = _this$props5.animationBegin, animationDuration = _this$props5.animationDuration, animationEasing = _this$props5.animationEasing, animationId = _this$props5.animationId;
        var _this$state = this.state, prevPoints = _this$state.prevPoints, prevBaseLine = _this$state.prevBaseLine;
        return /* @__PURE__ */ React.createElement(Animate, {
          begin: animationBegin,
          duration: animationDuration,
          isActive: isAnimationActive,
          easing: animationEasing,
          from: {
            t: 0
          },
          to: {
            t: 1
          },
          key: "area-".concat(animationId),
          onAnimationEnd: this.handleAnimationEnd,
          onAnimationStart: this.handleAnimationStart
        }, function(_ref) {
          var t2 = _ref.t;
          if (prevPoints) {
            var prevPointsDiffFactor = prevPoints.length / points.length;
            var stepPoints = points.map(function(entry, index2) {
              var prevPointIndex = Math.floor(index2 * prevPointsDiffFactor);
              if (prevPoints[prevPointIndex]) {
                var prev = prevPoints[prevPointIndex];
                var interpolatorX = interpolateNumber$2(prev.x, entry.x);
                var interpolatorY = interpolateNumber$2(prev.y, entry.y);
                return _objectSpread$2(_objectSpread$2({}, entry), {}, {
                  x: interpolatorX(t2),
                  y: interpolatorY(t2)
                });
              }
              return entry;
            });
            var stepBaseLine;
            if (isNumber(baseLine) && typeof baseLine === "number") {
              var interpolator = interpolateNumber$2(prevBaseLine, baseLine);
              stepBaseLine = interpolator(t2);
            } else if (isNil(baseLine) || isNan(baseLine)) {
              var _interpolator = interpolateNumber$2(prevBaseLine, 0);
              stepBaseLine = _interpolator(t2);
            } else {
              stepBaseLine = baseLine.map(function(entry, index2) {
                var prevPointIndex = Math.floor(index2 * prevPointsDiffFactor);
                if (prevBaseLine[prevPointIndex]) {
                  var prev = prevBaseLine[prevPointIndex];
                  var interpolatorX = interpolateNumber$2(prev.x, entry.x);
                  var interpolatorY = interpolateNumber$2(prev.y, entry.y);
                  return _objectSpread$2(_objectSpread$2({}, entry), {}, {
                    x: interpolatorX(t2),
                    y: interpolatorY(t2)
                  });
                }
                return entry;
              });
            }
            return _this2.renderAreaStatically(stepPoints, stepBaseLine, needClip, clipPathId);
          }
          return /* @__PURE__ */ React.createElement(Layer, null, /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("clipPath", {
            id: "animationClipPath-".concat(clipPathId)
          }, _this2.renderClipRect(t2))), /* @__PURE__ */ React.createElement(Layer, {
            clipPath: "url(#animationClipPath-".concat(clipPathId, ")")
          }, _this2.renderAreaStatically(points, baseLine, needClip, clipPathId)));
        });
      }, "renderAreaWithAnimation")
    }, {
      key: "renderArea",
      value: /* @__PURE__ */ __name(function renderArea(needClip, clipPathId) {
        var _this$props6 = this.props, points = _this$props6.points, baseLine = _this$props6.baseLine, isAnimationActive = _this$props6.isAnimationActive;
        var _this$state2 = this.state, prevPoints = _this$state2.prevPoints, prevBaseLine = _this$state2.prevBaseLine, totalLength = _this$state2.totalLength;
        if (isAnimationActive && points && points.length && (!prevPoints && totalLength > 0 || !isEqual$1(prevPoints, points) || !isEqual$1(prevBaseLine, baseLine))) {
          return this.renderAreaWithAnimation(needClip, clipPathId);
        }
        return this.renderAreaStatically(points, baseLine, needClip, clipPathId);
      }, "renderArea")
    }, {
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        var _filterProps;
        var _this$props7 = this.props, hide2 = _this$props7.hide, dot = _this$props7.dot, points = _this$props7.points, className = _this$props7.className, top = _this$props7.top, left = _this$props7.left, xAxis = _this$props7.xAxis, yAxis = _this$props7.yAxis, width = _this$props7.width, height = _this$props7.height, isAnimationActive = _this$props7.isAnimationActive, id = _this$props7.id;
        if (hide2 || !points || !points.length) {
          return null;
        }
        var isAnimationFinished = this.state.isAnimationFinished;
        var hasSinglePoint = points.length === 1;
        var layerClass = clsx("recharts-area", className);
        var needClipX = xAxis && xAxis.allowDataOverflow;
        var needClipY = yAxis && yAxis.allowDataOverflow;
        var needClip = needClipX || needClipY;
        var clipPathId = isNil(id) ? this.id : id;
        var _ref2 = (_filterProps = filterProps(dot, false)) !== null && _filterProps !== void 0 ? _filterProps : {
          r: 3,
          strokeWidth: 2
        }, _ref2$r = _ref2.r, r2 = _ref2$r === void 0 ? 3 : _ref2$r, _ref2$strokeWidth = _ref2.strokeWidth, strokeWidth = _ref2$strokeWidth === void 0 ? 2 : _ref2$strokeWidth;
        var _ref3 = hasClipDot(dot) ? dot : {}, _ref3$clipDot = _ref3.clipDot, clipDot = _ref3$clipDot === void 0 ? true : _ref3$clipDot;
        var dotSize = r2 * 2 + strokeWidth;
        return /* @__PURE__ */ React.createElement(Layer, {
          className: layerClass
        }, needClipX || needClipY ? /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("clipPath", {
          id: "clipPath-".concat(clipPathId)
        }, /* @__PURE__ */ React.createElement("rect", {
          x: needClipX ? left : left - width / 2,
          y: needClipY ? top : top - height / 2,
          width: needClipX ? width : width * 2,
          height: needClipY ? height : height * 2
        })), !clipDot && /* @__PURE__ */ React.createElement("clipPath", {
          id: "clipPath-dots-".concat(clipPathId)
        }, /* @__PURE__ */ React.createElement("rect", {
          x: left - dotSize / 2,
          y: top - dotSize / 2,
          width: width + dotSize,
          height: height + dotSize
        }))) : null, !hasSinglePoint ? this.renderArea(needClip, clipPathId) : null, (dot || hasSinglePoint) && this.renderDots(needClip, clipDot, clipPathId), (!isAnimationActive || isAnimationFinished) && LabelList.renderCallByParent(this.props, points));
      }, "render")
    }], [{
      key: "getDerivedStateFromProps",
      value: /* @__PURE__ */ __name(function getDerivedStateFromProps(nextProps, prevState) {
        if (nextProps.animationId !== prevState.prevAnimationId) {
          return {
            prevAnimationId: nextProps.animationId,
            curPoints: nextProps.points,
            curBaseLine: nextProps.baseLine,
            prevPoints: prevState.curPoints,
            prevBaseLine: prevState.curBaseLine
          };
        }
        if (nextProps.points !== prevState.curPoints || nextProps.baseLine !== prevState.curBaseLine) {
          return {
            curPoints: nextProps.points,
            curBaseLine: nextProps.baseLine
          };
        }
        return null;
      }, "getDerivedStateFromProps")
    }]);
  })(reactExports.PureComponent);
  _Area = Area;
  _defineProperty$5(Area, "displayName", "Area");
  _defineProperty$5(Area, "defaultProps", {
    stroke: "#3182bd",
    fill: "#3182bd",
    fillOpacity: 0.6,
    xAxisId: 0,
    yAxisId: 0,
    legendType: "line",
    connectNulls: false,
    // points of area
    points: [],
    dot: false,
    activeDot: true,
    hide: false,
    isAnimationActive: !Global.isSsr,
    animationBegin: 0,
    animationDuration: 1500,
    animationEasing: "ease"
  });
  _defineProperty$5(Area, "getBaseValue", function(props, item, xAxis, yAxis) {
    var layout = props.layout, chartBaseValue = props.baseValue;
    var itemBaseValue = item.props.baseValue;
    var baseValue = itemBaseValue !== null && itemBaseValue !== void 0 ? itemBaseValue : chartBaseValue;
    if (isNumber(baseValue) && typeof baseValue === "number") {
      return baseValue;
    }
    var numericAxis = layout === "horizontal" ? yAxis : xAxis;
    var domain = numericAxis.scale.domain();
    if (numericAxis.type === "number") {
      var domainMax = Math.max(domain[0], domain[1]);
      var domainMin = Math.min(domain[0], domain[1]);
      if (baseValue === "dataMin") {
        return domainMin;
      }
      if (baseValue === "dataMax") {
        return domainMax;
      }
      return domainMax < 0 ? domainMax : Math.max(Math.min(domain[0], domain[1]), 0);
    }
    if (baseValue === "dataMin") {
      return domain[0];
    }
    if (baseValue === "dataMax") {
      return domain[1];
    }
    return domain[0];
  });
  _defineProperty$5(Area, "getComposedData", function(_ref4) {
    var props = _ref4.props, item = _ref4.item, xAxis = _ref4.xAxis, yAxis = _ref4.yAxis, xAxisTicks = _ref4.xAxisTicks, yAxisTicks = _ref4.yAxisTicks, bandSize = _ref4.bandSize, dataKey = _ref4.dataKey, stackedData = _ref4.stackedData, dataStartIndex = _ref4.dataStartIndex, displayedData = _ref4.displayedData, offset2 = _ref4.offset;
    var layout = props.layout;
    var hasStack = stackedData && stackedData.length;
    var baseValue = _Area.getBaseValue(props, item, xAxis, yAxis);
    var isHorizontalLayout = layout === "horizontal";
    var isRange = false;
    var points = displayedData.map(function(entry, index2) {
      var value;
      if (hasStack) {
        value = stackedData[dataStartIndex + index2];
      } else {
        value = getValueByDataKey(entry, dataKey);
        if (!Array.isArray(value)) {
          value = [baseValue, value];
        } else {
          isRange = true;
        }
      }
      var isBreakPoint = value[1] == null || hasStack && getValueByDataKey(entry, dataKey) == null;
      if (isHorizontalLayout) {
        return {
          x: getCateCoordinateOfLine({
            axis: xAxis,
            ticks: xAxisTicks,
            bandSize,
            entry,
            index: index2
          }),
          y: isBreakPoint ? null : yAxis.scale(value[1]),
          value,
          payload: entry
        };
      }
      return {
        x: isBreakPoint ? null : xAxis.scale(value[1]),
        y: getCateCoordinateOfLine({
          axis: yAxis,
          ticks: yAxisTicks,
          bandSize,
          entry,
          index: index2
        }),
        value,
        payload: entry
      };
    });
    var baseLine;
    if (hasStack || isRange) {
      baseLine = points.map(function(entry) {
        var x2 = Array.isArray(entry.value) ? entry.value[0] : null;
        if (isHorizontalLayout) {
          return {
            x: entry.x,
            y: x2 != null && entry.y != null ? yAxis.scale(x2) : null
          };
        }
        return {
          x: x2 != null ? xAxis.scale(x2) : null,
          y: entry.y
        };
      });
    } else {
      baseLine = isHorizontalLayout ? yAxis.scale(baseValue) : xAxis.scale(baseValue);
    }
    return _objectSpread$2({
      points,
      baseLine,
      layout,
      isRange
    }, offset2);
  });
  _defineProperty$5(Area, "renderDotItem", function(option, props) {
    var dotItem;
    if (/* @__PURE__ */ React.isValidElement(option)) {
      dotItem = /* @__PURE__ */ React.cloneElement(option, props);
    } else if (isFunction$2(option)) {
      dotItem = option(props);
    } else {
      var className = clsx("recharts-area-dot", typeof option !== "boolean" ? option.className : "");
      var key = props.key, rest = _objectWithoutProperties$1(props, _excluded2$1);
      dotItem = /* @__PURE__ */ React.createElement(Dot, _extends$3({}, rest, {
        key,
        className
      }));
    }
    return dotItem;
  });
  function _typeof$4(o2) {
    "@babel/helpers - typeof";
    return _typeof$4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$4(o2);
  }
  __name(_typeof$4, "_typeof$4");
  function _classCallCheck$3(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$3, "_classCallCheck$3");
  function _defineProperties$3(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$4(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$3, "_defineProperties$3");
  function _createClass$3(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$3(Constructor.prototype, protoProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$3, "_createClass$3");
  function _callSuper$2(t2, o2, e) {
    return o2 = _getPrototypeOf$2(o2), _possibleConstructorReturn$2(t2, _isNativeReflectConstruct$2() ? Reflect.construct(o2, e || [], _getPrototypeOf$2(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$2, "_callSuper$2");
  function _possibleConstructorReturn$2(self2, call) {
    if (call && (_typeof$4(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$2(self2);
  }
  __name(_possibleConstructorReturn$2, "_possibleConstructorReturn$2");
  function _assertThisInitialized$2(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$2, "_assertThisInitialized$2");
  function _isNativeReflectConstruct$2() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$2 = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct$2");
  function _getPrototypeOf$2(o2) {
    _getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$2(o2);
  }
  __name(_getPrototypeOf$2, "_getPrototypeOf$2");
  function _inherits$2(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$2(subClass, superClass);
  }
  __name(_inherits$2, "_inherits$2");
  function _setPrototypeOf$2(o2, p2) {
    _setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$2(o2, p2);
  }
  __name(_setPrototypeOf$2, "_setPrototypeOf$2");
  function _defineProperty$4(obj, key, value) {
    key = _toPropertyKey$4(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$4, "_defineProperty$4");
  function _toPropertyKey$4(t2) {
    var i2 = _toPrimitive$4(t2, "string");
    return "symbol" == _typeof$4(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$4, "_toPropertyKey$4");
  function _toPrimitive$4(t2, r2) {
    if ("object" != _typeof$4(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$4(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$4, "_toPrimitive$4");
  function _extends$2() {
    _extends$2 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$2.apply(this, arguments);
  }
  __name(_extends$2, "_extends$2");
  function XAxisImpl(_ref) {
    var xAxisId = _ref.xAxisId;
    var width = useChartWidth();
    var height = useChartHeight();
    var axisOptions = useXAxisOrThrow(xAxisId);
    if (axisOptions == null) {
      return null;
    }
    return (
      // @ts-expect-error the axisOptions type is not exactly what CartesianAxis is expecting.
      /* @__PURE__ */ reactExports.createElement(CartesianAxis, _extends$2({}, axisOptions, {
        className: clsx("recharts-".concat(axisOptions.axisType, " ").concat(axisOptions.axisType), axisOptions.className),
        viewBox: {
          x: 0,
          y: 0,
          width,
          height
        },
        ticksGenerator: /* @__PURE__ */ __name(function ticksGenerator(axis) {
          return getTicksOfAxis(axis, true);
        }, "ticksGenerator")
      }))
    );
  }
  __name(XAxisImpl, "XAxisImpl");
  var XAxis = /* @__PURE__ */ (function(_React$Component) {
    function XAxis2() {
      _classCallCheck$3(this, XAxis2);
      return _callSuper$2(this, XAxis2, arguments);
    }
    __name(XAxis2, "XAxis");
    _inherits$2(XAxis2, _React$Component);
    return _createClass$3(XAxis2, [{
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        return /* @__PURE__ */ reactExports.createElement(XAxisImpl, this.props);
      }, "render")
    }]);
  })(reactExports.Component);
  _defineProperty$4(XAxis, "displayName", "XAxis");
  _defineProperty$4(XAxis, "defaultProps", {
    allowDecimals: true,
    hide: false,
    orientation: "bottom",
    width: 0,
    height: 30,
    mirror: false,
    xAxisId: 0,
    tickCount: 5,
    type: "category",
    padding: {
      left: 0,
      right: 0
    },
    allowDataOverflow: false,
    scale: "auto",
    reversed: false,
    allowDuplicatedCategory: true
  });
  function _typeof$3(o2) {
    "@babel/helpers - typeof";
    return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$3(o2);
  }
  __name(_typeof$3, "_typeof$3");
  function _classCallCheck$2(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$2, "_classCallCheck$2");
  function _defineProperties$2(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$3(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$2, "_defineProperties$2");
  function _createClass$2(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$2(Constructor.prototype, protoProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$2, "_createClass$2");
  function _callSuper$1(t2, o2, e) {
    return o2 = _getPrototypeOf$1(o2), _possibleConstructorReturn$1(t2, _isNativeReflectConstruct$1() ? Reflect.construct(o2, e || [], _getPrototypeOf$1(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper$1, "_callSuper$1");
  function _possibleConstructorReturn$1(self2, call) {
    if (call && (_typeof$3(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized$1(self2);
  }
  __name(_possibleConstructorReturn$1, "_possibleConstructorReturn$1");
  function _assertThisInitialized$1(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized$1, "_assertThisInitialized$1");
  function _isNativeReflectConstruct$1() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t3) {
    }
    return (_isNativeReflectConstruct$1 = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct"))();
  }
  __name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct$1");
  function _getPrototypeOf$1(o2) {
    _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o3) {
      return o3.__proto__ || Object.getPrototypeOf(o3);
    }, "_getPrototypeOf");
    return _getPrototypeOf$1(o2);
  }
  __name(_getPrototypeOf$1, "_getPrototypeOf$1");
  function _inherits$1(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf$1(subClass, superClass);
  }
  __name(_inherits$1, "_inherits$1");
  function _setPrototypeOf$1(o2, p2) {
    _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o3, p3) {
      o3.__proto__ = p3;
      return o3;
    }, "_setPrototypeOf");
    return _setPrototypeOf$1(o2, p2);
  }
  __name(_setPrototypeOf$1, "_setPrototypeOf$1");
  function _defineProperty$3(obj, key, value) {
    key = _toPropertyKey$3(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$3, "_defineProperty$3");
  function _toPropertyKey$3(t2) {
    var i2 = _toPrimitive$3(t2, "string");
    return "symbol" == _typeof$3(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$3, "_toPropertyKey$3");
  function _toPrimitive$3(t2, r2) {
    if ("object" != _typeof$3(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$3(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$3, "_toPrimitive$3");
  function _extends$1() {
    _extends$1 = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends$1.apply(this, arguments);
  }
  __name(_extends$1, "_extends$1");
  var YAxisImpl = /* @__PURE__ */ __name(function YAxisImpl2(_ref) {
    var yAxisId = _ref.yAxisId;
    var width = useChartWidth();
    var height = useChartHeight();
    var axisOptions = useYAxisOrThrow(yAxisId);
    if (axisOptions == null) {
      return null;
    }
    return (
      // @ts-expect-error the axisOptions type is not exactly what CartesianAxis is expecting.
      /* @__PURE__ */ reactExports.createElement(CartesianAxis, _extends$1({}, axisOptions, {
        className: clsx("recharts-".concat(axisOptions.axisType, " ").concat(axisOptions.axisType), axisOptions.className),
        viewBox: {
          x: 0,
          y: 0,
          width,
          height
        },
        ticksGenerator: /* @__PURE__ */ __name(function ticksGenerator(axis) {
          return getTicksOfAxis(axis, true);
        }, "ticksGenerator")
      }))
    );
  }, "YAxisImpl");
  var YAxis = /* @__PURE__ */ (function(_React$Component) {
    function YAxis2() {
      _classCallCheck$2(this, YAxis2);
      return _callSuper$1(this, YAxis2, arguments);
    }
    __name(YAxis2, "YAxis");
    _inherits$1(YAxis2, _React$Component);
    return _createClass$2(YAxis2, [{
      key: "render",
      value: /* @__PURE__ */ __name(function render() {
        return /* @__PURE__ */ reactExports.createElement(YAxisImpl, this.props);
      }, "render")
    }]);
  })(reactExports.Component);
  _defineProperty$3(YAxis, "displayName", "YAxis");
  _defineProperty$3(YAxis, "defaultProps", {
    allowDuplicatedCategory: true,
    allowDecimals: true,
    hide: false,
    orientation: "left",
    width: 60,
    height: 0,
    mirror: false,
    yAxisId: 0,
    tickCount: 5,
    type: "number",
    padding: {
      top: 0,
      bottom: 0
    },
    allowDataOverflow: false,
    scale: "auto",
    reversed: false
  });
  function _toConsumableArray$1(arr) {
    return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1();
  }
  __name(_toConsumableArray$1, "_toConsumableArray$1");
  function _nonIterableSpread$1() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableSpread$1, "_nonIterableSpread$1");
  function _unsupportedIterableToArray$1(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray$1(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray$1(o2, minLen);
  }
  __name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray$1");
  function _iterableToArray$1(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  }
  __name(_iterableToArray$1, "_iterableToArray$1");
  function _arrayWithoutHoles$1(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
  }
  __name(_arrayWithoutHoles$1, "_arrayWithoutHoles$1");
  function _arrayLikeToArray$1(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray$1, "_arrayLikeToArray$1");
  var detectReferenceElementsDomain = /* @__PURE__ */ __name(function detectReferenceElementsDomain2(children, domain, axisId, axisType, specifiedTicks) {
    var lines = findAllByType(children, ReferenceLine);
    var dots = findAllByType(children, ReferenceDot);
    var elements = [].concat(_toConsumableArray$1(lines), _toConsumableArray$1(dots));
    var areas = findAllByType(children, ReferenceArea);
    var idKey = "".concat(axisType, "Id");
    var valueKey = axisType[0];
    var finalDomain = domain;
    if (elements.length) {
      finalDomain = elements.reduce(function(result, el) {
        if (el.props[idKey] === axisId && ifOverflowMatches(el.props, "extendDomain") && isNumber(el.props[valueKey])) {
          var value = el.props[valueKey];
          return [Math.min(result[0], value), Math.max(result[1], value)];
        }
        return result;
      }, finalDomain);
    }
    if (areas.length) {
      var key1 = "".concat(valueKey, "1");
      var key2 = "".concat(valueKey, "2");
      finalDomain = areas.reduce(function(result, el) {
        if (el.props[idKey] === axisId && ifOverflowMatches(el.props, "extendDomain") && isNumber(el.props[key1]) && isNumber(el.props[key2])) {
          var value1 = el.props[key1];
          var value2 = el.props[key2];
          return [Math.min(result[0], value1, value2), Math.max(result[1], value1, value2)];
        }
        return result;
      }, finalDomain);
    }
    if (specifiedTicks && specifiedTicks.length) {
      finalDomain = specifiedTicks.reduce(function(result, tick) {
        if (isNumber(tick)) {
          return [Math.min(result[0], tick), Math.max(result[1], tick)];
        }
        return result;
      }, finalDomain);
    }
    return finalDomain;
  }, "detectReferenceElementsDomain");
  var eventemitter3 = { exports: {} };
  var hasRequiredEventemitter3;
  function requireEventemitter3() {
    if (hasRequiredEventemitter3) return eventemitter3.exports;
    hasRequiredEventemitter3 = 1;
    (function(module2) {
      var has = Object.prototype.hasOwnProperty, prefix2 = "~";
      function Events() {
      }
      __name(Events, "Events");
      if (Object.create) {
        Events.prototype = /* @__PURE__ */ Object.create(null);
        if (!new Events().__proto__) prefix2 = false;
      }
      function EE(fn, context, once) {
        this.fn = fn;
        this.context = context;
        this.once = once || false;
      }
      __name(EE, "EE");
      function addListener(emitter, event, fn, context, once) {
        if (typeof fn !== "function") {
          throw new TypeError("The listener must be a function");
        }
        var listener = new EE(fn, context || emitter, once), evt = prefix2 ? prefix2 + event : event;
        if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
        else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
        else emitter._events[evt] = [emitter._events[evt], listener];
        return emitter;
      }
      __name(addListener, "addListener");
      function clearEvent(emitter, evt) {
        if (--emitter._eventsCount === 0) emitter._events = new Events();
        else delete emitter._events[evt];
      }
      __name(clearEvent, "clearEvent");
      function EventEmitter2() {
        this._events = new Events();
        this._eventsCount = 0;
      }
      __name(EventEmitter2, "EventEmitter");
      EventEmitter2.prototype.eventNames = /* @__PURE__ */ __name(function eventNames() {
        var names = [], events, name;
        if (this._eventsCount === 0) return names;
        for (name in events = this._events) {
          if (has.call(events, name)) names.push(prefix2 ? name.slice(1) : name);
        }
        if (Object.getOwnPropertySymbols) {
          return names.concat(Object.getOwnPropertySymbols(events));
        }
        return names;
      }, "eventNames");
      EventEmitter2.prototype.listeners = /* @__PURE__ */ __name(function listeners(event) {
        var evt = prefix2 ? prefix2 + event : event, handlers = this._events[evt];
        if (!handlers) return [];
        if (handlers.fn) return [handlers.fn];
        for (var i2 = 0, l = handlers.length, ee2 = new Array(l); i2 < l; i2++) {
          ee2[i2] = handlers[i2].fn;
        }
        return ee2;
      }, "listeners");
      EventEmitter2.prototype.listenerCount = /* @__PURE__ */ __name(function listenerCount(event) {
        var evt = prefix2 ? prefix2 + event : event, listeners = this._events[evt];
        if (!listeners) return 0;
        if (listeners.fn) return 1;
        return listeners.length;
      }, "listenerCount");
      EventEmitter2.prototype.emit = /* @__PURE__ */ __name(function emit(event, a1, a2, a3, a4, a5) {
        var evt = prefix2 ? prefix2 + event : event;
        if (!this._events[evt]) return false;
        var listeners = this._events[evt], len = arguments.length, args, i2;
        if (listeners.fn) {
          if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
          switch (len) {
            case 1:
              return listeners.fn.call(listeners.context), true;
            case 2:
              return listeners.fn.call(listeners.context, a1), true;
            case 3:
              return listeners.fn.call(listeners.context, a1, a2), true;
            case 4:
              return listeners.fn.call(listeners.context, a1, a2, a3), true;
            case 5:
              return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
            case 6:
              return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
          }
          for (i2 = 1, args = new Array(len - 1); i2 < len; i2++) {
            args[i2 - 1] = arguments[i2];
          }
          listeners.fn.apply(listeners.context, args);
        } else {
          var length = listeners.length, j;
          for (i2 = 0; i2 < length; i2++) {
            if (listeners[i2].once) this.removeListener(event, listeners[i2].fn, void 0, true);
            switch (len) {
              case 1:
                listeners[i2].fn.call(listeners[i2].context);
                break;
              case 2:
                listeners[i2].fn.call(listeners[i2].context, a1);
                break;
              case 3:
                listeners[i2].fn.call(listeners[i2].context, a1, a2);
                break;
              case 4:
                listeners[i2].fn.call(listeners[i2].context, a1, a2, a3);
                break;
              default:
                if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
                  args[j - 1] = arguments[j];
                }
                listeners[i2].fn.apply(listeners[i2].context, args);
            }
          }
        }
        return true;
      }, "emit");
      EventEmitter2.prototype.on = /* @__PURE__ */ __name(function on(event, fn, context) {
        return addListener(this, event, fn, context, false);
      }, "on");
      EventEmitter2.prototype.once = /* @__PURE__ */ __name(function once(event, fn, context) {
        return addListener(this, event, fn, context, true);
      }, "once");
      EventEmitter2.prototype.removeListener = /* @__PURE__ */ __name(function removeListener(event, fn, context, once) {
        var evt = prefix2 ? prefix2 + event : event;
        if (!this._events[evt]) return this;
        if (!fn) {
          clearEvent(this, evt);
          return this;
        }
        var listeners = this._events[evt];
        if (listeners.fn) {
          if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
            clearEvent(this, evt);
          }
        } else {
          for (var i2 = 0, events = [], length = listeners.length; i2 < length; i2++) {
            if (listeners[i2].fn !== fn || once && !listeners[i2].once || context && listeners[i2].context !== context) {
              events.push(listeners[i2]);
            }
          }
          if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
          else clearEvent(this, evt);
        }
        return this;
      }, "removeListener");
      EventEmitter2.prototype.removeAllListeners = /* @__PURE__ */ __name(function removeAllListeners(event) {
        var evt;
        if (event) {
          evt = prefix2 ? prefix2 + event : event;
          if (this._events[evt]) clearEvent(this, evt);
        } else {
          this._events = new Events();
          this._eventsCount = 0;
        }
        return this;
      }, "removeAllListeners");
      EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener;
      EventEmitter2.prototype.addListener = EventEmitter2.prototype.on;
      EventEmitter2.prefixed = prefix2;
      EventEmitter2.EventEmitter = EventEmitter2;
      {
        module2.exports = EventEmitter2;
      }
    })(eventemitter3);
    return eventemitter3.exports;
  }
  __name(requireEventemitter3, "requireEventemitter3");
  var eventemitter3Exports = requireEventemitter3();
  const EventEmitter = /* @__PURE__ */ getDefaultExportFromCjs(eventemitter3Exports);
  var eventCenter = new EventEmitter();
  var SYNC_EVENT = "recharts.syncMouseEvents";
  function _typeof$2(o2) {
    "@babel/helpers - typeof";
    return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$2(o2);
  }
  __name(_typeof$2, "_typeof$2");
  function _classCallCheck$1(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck$1, "_classCallCheck$1");
  function _defineProperties$1(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey$2(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties$1, "_defineProperties$1");
  function _createClass$1(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass$1, "_createClass$1");
  function _defineProperty$2(obj, key, value) {
    key = _toPropertyKey$2(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$2, "_defineProperty$2");
  function _toPropertyKey$2(t2) {
    var i2 = _toPrimitive$2(t2, "string");
    return "symbol" == _typeof$2(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$2, "_toPropertyKey$2");
  function _toPrimitive$2(t2, r2) {
    if ("object" != _typeof$2(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$2(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return String(t2);
  }
  __name(_toPrimitive$2, "_toPrimitive$2");
  var AccessibilityManager = /* @__PURE__ */ (function() {
    function AccessibilityManager2() {
      _classCallCheck$1(this, AccessibilityManager2);
      _defineProperty$2(this, "activeIndex", 0);
      _defineProperty$2(this, "coordinateList", []);
      _defineProperty$2(this, "layout", "horizontal");
    }
    __name(AccessibilityManager2, "AccessibilityManager");
    return _createClass$1(AccessibilityManager2, [{
      key: "setDetails",
      value: /* @__PURE__ */ __name(function setDetails(_ref) {
        var _ref2;
        var _ref$coordinateList = _ref.coordinateList, coordinateList = _ref$coordinateList === void 0 ? null : _ref$coordinateList, _ref$container = _ref.container, container = _ref$container === void 0 ? null : _ref$container, _ref$layout = _ref.layout, layout = _ref$layout === void 0 ? null : _ref$layout, _ref$offset = _ref.offset, offset2 = _ref$offset === void 0 ? null : _ref$offset, _ref$mouseHandlerCall = _ref.mouseHandlerCallback, mouseHandlerCallback = _ref$mouseHandlerCall === void 0 ? null : _ref$mouseHandlerCall;
        this.coordinateList = (_ref2 = coordinateList !== null && coordinateList !== void 0 ? coordinateList : this.coordinateList) !== null && _ref2 !== void 0 ? _ref2 : [];
        this.container = container !== null && container !== void 0 ? container : this.container;
        this.layout = layout !== null && layout !== void 0 ? layout : this.layout;
        this.offset = offset2 !== null && offset2 !== void 0 ? offset2 : this.offset;
        this.mouseHandlerCallback = mouseHandlerCallback !== null && mouseHandlerCallback !== void 0 ? mouseHandlerCallback : this.mouseHandlerCallback;
        this.activeIndex = Math.min(Math.max(this.activeIndex, 0), this.coordinateList.length - 1);
      }, "setDetails")
    }, {
      key: "focus",
      value: /* @__PURE__ */ __name(function focus2() {
        this.spoofMouse();
      }, "focus")
    }, {
      key: "keyboardEvent",
      value: /* @__PURE__ */ __name(function keyboardEvent(e) {
        if (this.coordinateList.length === 0) {
          return;
        }
        switch (e.key) {
          case "ArrowRight": {
            if (this.layout !== "horizontal") {
              return;
            }
            this.activeIndex = Math.min(this.activeIndex + 1, this.coordinateList.length - 1);
            this.spoofMouse();
            break;
          }
          case "ArrowLeft": {
            if (this.layout !== "horizontal") {
              return;
            }
            this.activeIndex = Math.max(this.activeIndex - 1, 0);
            this.spoofMouse();
            break;
          }
        }
      }, "keyboardEvent")
    }, {
      key: "setIndex",
      value: /* @__PURE__ */ __name(function setIndex(newIndex) {
        this.activeIndex = newIndex;
      }, "setIndex")
    }, {
      key: "spoofMouse",
      value: /* @__PURE__ */ __name(function spoofMouse() {
        var _window, _window2;
        if (this.layout !== "horizontal") {
          return;
        }
        if (this.coordinateList.length === 0) {
          return;
        }
        var _this$container$getBo = this.container.getBoundingClientRect(), x2 = _this$container$getBo.x, y2 = _this$container$getBo.y, height = _this$container$getBo.height;
        var coordinate = this.coordinateList[this.activeIndex].coordinate;
        var scrollOffsetX = ((_window = window) === null || _window === void 0 ? void 0 : _window.scrollX) || 0;
        var scrollOffsetY = ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.scrollY) || 0;
        var pageX = x2 + coordinate + scrollOffsetX;
        var pageY = y2 + this.offset.top + height / 2 + scrollOffsetY;
        this.mouseHandlerCallback({
          pageX,
          pageY
        });
      }, "spoofMouse")
    }]);
  })();
  function isDomainSpecifiedByUser(domain, allowDataOverflow, axisType) {
    if (axisType === "number" && allowDataOverflow === true && Array.isArray(domain)) {
      var domainStart = domain === null || domain === void 0 ? void 0 : domain[0];
      var domainEnd = domain === null || domain === void 0 ? void 0 : domain[1];
      if (!!domainStart && !!domainEnd && isNumber(domainStart) && isNumber(domainEnd)) {
        return true;
      }
    }
    return false;
  }
  __name(isDomainSpecifiedByUser, "isDomainSpecifiedByUser");
  function getCursorRectangle(layout, activeCoordinate, offset2, tooltipAxisBandSize) {
    var halfSize = tooltipAxisBandSize / 2;
    return {
      stroke: "none",
      fill: "#ccc",
      x: layout === "horizontal" ? activeCoordinate.x - halfSize : offset2.left + 0.5,
      y: layout === "horizontal" ? offset2.top + 0.5 : activeCoordinate.y - halfSize,
      width: layout === "horizontal" ? tooltipAxisBandSize : offset2.width - 1,
      height: layout === "horizontal" ? offset2.height - 1 : tooltipAxisBandSize
    };
  }
  __name(getCursorRectangle, "getCursorRectangle");
  function getRadialCursorPoints(activeCoordinate) {
    var cx2 = activeCoordinate.cx, cy = activeCoordinate.cy, radius = activeCoordinate.radius, startAngle = activeCoordinate.startAngle, endAngle = activeCoordinate.endAngle;
    var startPoint = polarToCartesian(cx2, cy, radius, startAngle);
    var endPoint = polarToCartesian(cx2, cy, radius, endAngle);
    return {
      points: [startPoint, endPoint],
      cx: cx2,
      cy,
      radius,
      startAngle,
      endAngle
    };
  }
  __name(getRadialCursorPoints, "getRadialCursorPoints");
  function getCursorPoints(layout, activeCoordinate, offset2) {
    var x1, y1, x2, y2;
    if (layout === "horizontal") {
      x1 = activeCoordinate.x;
      x2 = x1;
      y1 = offset2.top;
      y2 = offset2.top + offset2.height;
    } else if (layout === "vertical") {
      y1 = activeCoordinate.y;
      y2 = y1;
      x1 = offset2.left;
      x2 = offset2.left + offset2.width;
    } else if (activeCoordinate.cx != null && activeCoordinate.cy != null) {
      if (layout === "centric") {
        var cx2 = activeCoordinate.cx, cy = activeCoordinate.cy, innerRadius = activeCoordinate.innerRadius, outerRadius = activeCoordinate.outerRadius, angle = activeCoordinate.angle;
        var innerPoint = polarToCartesian(cx2, cy, innerRadius, angle);
        var outerPoint = polarToCartesian(cx2, cy, outerRadius, angle);
        x1 = innerPoint.x;
        y1 = innerPoint.y;
        x2 = outerPoint.x;
        y2 = outerPoint.y;
      } else {
        return getRadialCursorPoints(activeCoordinate);
      }
    }
    return [{
      x: x1,
      y: y1
    }, {
      x: x2,
      y: y2
    }];
  }
  __name(getCursorPoints, "getCursorPoints");
  function _typeof$1(o2) {
    "@babel/helpers - typeof";
    return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
      return typeof o3;
    } : function(o3) {
      return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
    }, _typeof$1(o2);
  }
  __name(_typeof$1, "_typeof$1");
  function ownKeys$1(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r3) {
        return Object.getOwnPropertyDescriptor(e, r3).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys$1, "ownKeys$1");
  function _objectSpread$1(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys$1(Object(t2), true).forEach(function(r3) {
        _defineProperty$1(e, r3, t2[r3]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys$1(Object(t2)).forEach(function(r3) {
        Object.defineProperty(e, r3, Object.getOwnPropertyDescriptor(t2, r3));
      });
    }
    return e;
  }
  __name(_objectSpread$1, "_objectSpread$1");
  function _defineProperty$1(obj, key, value) {
    key = _toPropertyKey$1(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty$1, "_defineProperty$1");
  function _toPropertyKey$1(t2) {
    var i2 = _toPrimitive$1(t2, "string");
    return "symbol" == _typeof$1(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey$1, "_toPropertyKey$1");
  function _toPrimitive$1(t2, r2) {
    if ("object" != _typeof$1(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof$1(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive$1, "_toPrimitive$1");
  function Cursor(props) {
    var _element$props$cursor, _defaultProps;
    var element = props.element, tooltipEventType = props.tooltipEventType, isActive = props.isActive, activeCoordinate = props.activeCoordinate, activePayload = props.activePayload, offset2 = props.offset, activeTooltipIndex = props.activeTooltipIndex, tooltipAxisBandSize = props.tooltipAxisBandSize, layout = props.layout, chartName = props.chartName;
    var elementPropsCursor = (_element$props$cursor = element.props.cursor) !== null && _element$props$cursor !== void 0 ? _element$props$cursor : (_defaultProps = element.type.defaultProps) === null || _defaultProps === void 0 ? void 0 : _defaultProps.cursor;
    if (!element || !elementPropsCursor || !isActive || !activeCoordinate || chartName !== "ScatterChart" && tooltipEventType !== "axis") {
      return null;
    }
    var restProps;
    var cursorComp = Curve;
    if (chartName === "ScatterChart") {
      restProps = activeCoordinate;
      cursorComp = Cross;
    } else if (chartName === "BarChart") {
      restProps = getCursorRectangle(layout, activeCoordinate, offset2, tooltipAxisBandSize);
      cursorComp = Rectangle;
    } else if (layout === "radial") {
      var _getRadialCursorPoint = getRadialCursorPoints(activeCoordinate), cx2 = _getRadialCursorPoint.cx, cy = _getRadialCursorPoint.cy, radius = _getRadialCursorPoint.radius, startAngle = _getRadialCursorPoint.startAngle, endAngle = _getRadialCursorPoint.endAngle;
      restProps = {
        cx: cx2,
        cy,
        startAngle,
        endAngle,
        innerRadius: radius,
        outerRadius: radius
      };
      cursorComp = Sector;
    } else {
      restProps = {
        points: getCursorPoints(layout, activeCoordinate, offset2)
      };
      cursorComp = Curve;
    }
    var cursorProps = _objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({
      stroke: "#ccc",
      pointerEvents: "none"
    }, offset2), restProps), filterProps(elementPropsCursor, false)), {}, {
      payload: activePayload,
      payloadIndex: activeTooltipIndex,
      className: clsx("recharts-tooltip-cursor", elementPropsCursor.className)
    });
    return /* @__PURE__ */ reactExports.isValidElement(elementPropsCursor) ? /* @__PURE__ */ reactExports.cloneElement(elementPropsCursor, cursorProps) : /* @__PURE__ */ reactExports.createElement(cursorComp, cursorProps);
  }
  __name(Cursor, "Cursor");
  var _excluded = ["item"], _excluded2 = ["children", "className", "width", "height", "style", "compact", "title", "desc"];
  function _typeof(o2) {
    "@babel/helpers - typeof";
    return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o22) {
      return typeof o22;
    } : function(o22) {
      return o22 && "function" == typeof Symbol && o22.constructor === Symbol && o22 !== Symbol.prototype ? "symbol" : typeof o22;
    }, _typeof(o2);
  }
  __name(_typeof, "_typeof");
  function _extends() {
    _extends = Object.assign ? Object.assign.bind() : function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends.apply(this, arguments);
  }
  __name(_extends, "_extends");
  function _slicedToArray(arr, i2) {
    return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
  }
  __name(_slicedToArray, "_slicedToArray");
  function _nonIterableRest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableRest, "_nonIterableRest");
  function _iterableToArrayLimit(r2, l) {
    var t2 = null == r2 ? null : "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
    if (null != t2) {
      var e, n2, i2, u2, a2 = [], f = true, o2 = false;
      try {
        if (i2 = (t2 = t2.call(r2)).next, 0 === l) ;
        else for (; !(f = (e = i2.call(t2)).done) && (a2.push(e.value), a2.length !== l); f = true) ;
      } catch (r22) {
        o2 = true, n2 = r22;
      } finally {
        try {
          if (!f && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
        } finally {
          if (o2) throw n2;
        }
      }
      return a2;
    }
  }
  __name(_iterableToArrayLimit, "_iterableToArrayLimit");
  function _arrayWithHoles(arr) {
    if (Array.isArray(arr)) return arr;
  }
  __name(_arrayWithHoles, "_arrayWithHoles");
  function _objectWithoutProperties(source, excluded) {
    if (source == null) return {};
    var target = _objectWithoutPropertiesLoose(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutProperties, "_objectWithoutProperties");
  function _objectWithoutPropertiesLoose(source, excluded) {
    if (source == null) return {};
    var target = {};
    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  __name(_objectWithoutPropertiesLoose, "_objectWithoutPropertiesLoose");
  function _classCallCheck(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  __name(_classCallCheck, "_classCallCheck");
  function _defineProperties(target, props) {
    for (var i2 = 0; i2 < props.length; i2++) {
      var descriptor = props[i2];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
    }
  }
  __name(_defineProperties, "_defineProperties");
  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
    Object.defineProperty(Constructor, "prototype", { writable: false });
    return Constructor;
  }
  __name(_createClass, "_createClass");
  function _callSuper(t2, o2, e) {
    return o2 = _getPrototypeOf(o2), _possibleConstructorReturn(t2, _isNativeReflectConstruct() ? Reflect.construct(o2, e || [], _getPrototypeOf(t2).constructor) : o2.apply(t2, e));
  }
  __name(_callSuper, "_callSuper");
  function _possibleConstructorReturn(self2, call) {
    if (call && (_typeof(call) === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }
    return _assertThisInitialized(self2);
  }
  __name(_possibleConstructorReturn, "_possibleConstructorReturn");
  function _assertThisInitialized(self2) {
    if (self2 === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self2;
  }
  __name(_assertThisInitialized, "_assertThisInitialized");
  function _isNativeReflectConstruct() {
    try {
      var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
      }));
    } catch (t22) {
    }
    return (_isNativeReflectConstruct = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
      return !!t2;
    }, "_isNativeReflectConstruct2"))();
  }
  __name(_isNativeReflectConstruct, "_isNativeReflectConstruct");
  function _getPrototypeOf(o2) {
    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : /* @__PURE__ */ __name(function _getPrototypeOf2(o22) {
      return o22.__proto__ || Object.getPrototypeOf(o22);
    }, "_getPrototypeOf2");
    return _getPrototypeOf(o2);
  }
  __name(_getPrototypeOf, "_getPrototypeOf");
  function _inherits(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
    Object.defineProperty(subClass, "prototype", { writable: false });
    if (superClass) _setPrototypeOf(subClass, superClass);
  }
  __name(_inherits, "_inherits");
  function _setPrototypeOf(o2, p2) {
    _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : /* @__PURE__ */ __name(function _setPrototypeOf2(o22, p22) {
      o22.__proto__ = p22;
      return o22;
    }, "_setPrototypeOf2");
    return _setPrototypeOf(o2, p2);
  }
  __name(_setPrototypeOf, "_setPrototypeOf");
  function _toConsumableArray(arr) {
    return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  }
  __name(_toConsumableArray, "_toConsumableArray");
  function _nonIterableSpread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  __name(_nonIterableSpread, "_nonIterableSpread");
  function _unsupportedIterableToArray(o2, minLen) {
    if (!o2) return;
    if (typeof o2 === "string") return _arrayLikeToArray(o2, minLen);
    var n2 = Object.prototype.toString.call(o2).slice(8, -1);
    if (n2 === "Object" && o2.constructor) n2 = o2.constructor.name;
    if (n2 === "Map" || n2 === "Set") return Array.from(o2);
    if (n2 === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2)) return _arrayLikeToArray(o2, minLen);
  }
  __name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
  function _iterableToArray(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
  }
  __name(_iterableToArray, "_iterableToArray");
  function _arrayWithoutHoles(arr) {
    if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  }
  __name(_arrayWithoutHoles, "_arrayWithoutHoles");
  function _arrayLikeToArray(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) arr2[i2] = arr[i2];
    return arr2;
  }
  __name(_arrayLikeToArray, "_arrayLikeToArray");
  function ownKeys(e, r2) {
    var t2 = Object.keys(e);
    if (Object.getOwnPropertySymbols) {
      var o2 = Object.getOwnPropertySymbols(e);
      r2 && (o2 = o2.filter(function(r22) {
        return Object.getOwnPropertyDescriptor(e, r22).enumerable;
      })), t2.push.apply(t2, o2);
    }
    return t2;
  }
  __name(ownKeys, "ownKeys");
  function _objectSpread(e) {
    for (var r2 = 1; r2 < arguments.length; r2++) {
      var t2 = null != arguments[r2] ? arguments[r2] : {};
      r2 % 2 ? ownKeys(Object(t2), true).forEach(function(r22) {
        _defineProperty(e, r22, t2[r22]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r22) {
        Object.defineProperty(e, r22, Object.getOwnPropertyDescriptor(t2, r22));
      });
    }
    return e;
  }
  __name(_objectSpread, "_objectSpread");
  function _defineProperty(obj, key, value) {
    key = _toPropertyKey(key);
    if (key in obj) {
      Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
    } else {
      obj[key] = value;
    }
    return obj;
  }
  __name(_defineProperty, "_defineProperty");
  function _toPropertyKey(t2) {
    var i2 = _toPrimitive(t2, "string");
    return "symbol" == _typeof(i2) ? i2 : i2 + "";
  }
  __name(_toPropertyKey, "_toPropertyKey");
  function _toPrimitive(t2, r2) {
    if ("object" != _typeof(t2) || !t2) return t2;
    var e = t2[Symbol.toPrimitive];
    if (void 0 !== e) {
      var i2 = e.call(t2, r2);
      if ("object" != _typeof(i2)) return i2;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return ("string" === r2 ? String : Number)(t2);
  }
  __name(_toPrimitive, "_toPrimitive");
  var ORIENT_MAP = {
    xAxis: ["bottom", "top"],
    yAxis: ["left", "right"]
  };
  var FULL_WIDTH_AND_HEIGHT = {
    width: "100%",
    height: "100%"
  };
  var originCoordinate = {
    x: 0,
    y: 0
  };
  function renderAsIs(element) {
    return element;
  }
  __name(renderAsIs, "renderAsIs");
  var calculateTooltipPos = /* @__PURE__ */ __name(function calculateTooltipPos2(rangeObj, layout) {
    if (layout === "horizontal") {
      return rangeObj.x;
    }
    if (layout === "vertical") {
      return rangeObj.y;
    }
    if (layout === "centric") {
      return rangeObj.angle;
    }
    return rangeObj.radius;
  }, "calculateTooltipPos2");
  var getActiveCoordinate = /* @__PURE__ */ __name(function getActiveCoordinate2(layout, tooltipTicks, activeIndex, rangeObj) {
    var entry = tooltipTicks.find(function(tick) {
      return tick && tick.index === activeIndex;
    });
    if (entry) {
      if (layout === "horizontal") {
        return {
          x: entry.coordinate,
          y: rangeObj.y
        };
      }
      if (layout === "vertical") {
        return {
          x: rangeObj.x,
          y: entry.coordinate
        };
      }
      if (layout === "centric") {
        var _angle = entry.coordinate;
        var _radius = rangeObj.radius;
        return _objectSpread(_objectSpread(_objectSpread({}, rangeObj), polarToCartesian(rangeObj.cx, rangeObj.cy, _radius, _angle)), {}, {
          angle: _angle,
          radius: _radius
        });
      }
      var radius = entry.coordinate;
      var angle = rangeObj.angle;
      return _objectSpread(_objectSpread(_objectSpread({}, rangeObj), polarToCartesian(rangeObj.cx, rangeObj.cy, radius, angle)), {}, {
        angle,
        radius
      });
    }
    return originCoordinate;
  }, "getActiveCoordinate2");
  var getDisplayedData = /* @__PURE__ */ __name(function getDisplayedData2(data, _ref) {
    var graphicalItems = _ref.graphicalItems, dataStartIndex = _ref.dataStartIndex, dataEndIndex = _ref.dataEndIndex;
    var itemsData = (graphicalItems !== null && graphicalItems !== void 0 ? graphicalItems : []).reduce(function(result, child) {
      var itemData = child.props.data;
      if (itemData && itemData.length) {
        return [].concat(_toConsumableArray(result), _toConsumableArray(itemData));
      }
      return result;
    }, []);
    if (itemsData.length > 0) {
      return itemsData;
    }
    if (data && data.length && isNumber(dataStartIndex) && isNumber(dataEndIndex)) {
      return data.slice(dataStartIndex, dataEndIndex + 1);
    }
    return [];
  }, "getDisplayedData2");
  function getDefaultDomainByAxisType(axisType) {
    return axisType === "number" ? [0, "auto"] : void 0;
  }
  __name(getDefaultDomainByAxisType, "getDefaultDomainByAxisType");
  var getTooltipContent = /* @__PURE__ */ __name(function getTooltipContent2(state, chartData, activeIndex, activeLabel) {
    var graphicalItems = state.graphicalItems, tooltipAxis = state.tooltipAxis;
    var displayedData = getDisplayedData(chartData, state);
    if (activeIndex < 0 || !graphicalItems || !graphicalItems.length || activeIndex >= displayedData.length) {
      return null;
    }
    return graphicalItems.reduce(function(result, child) {
      var _child$props$data;
      var data = (_child$props$data = child.props.data) !== null && _child$props$data !== void 0 ? _child$props$data : chartData;
      if (data && state.dataStartIndex + state.dataEndIndex !== 0 && // https://github.com/recharts/recharts/issues/4717
      // The data is sliced only when the active index is within the start/end index range.
      state.dataEndIndex - state.dataStartIndex >= activeIndex) {
        data = data.slice(state.dataStartIndex, state.dataEndIndex + 1);
      }
      var payload;
      if (tooltipAxis.dataKey && !tooltipAxis.allowDuplicatedCategory) {
        var entries = data === void 0 ? displayedData : data;
        payload = findEntryInArray(entries, tooltipAxis.dataKey, activeLabel);
      } else {
        payload = data && data[activeIndex] || displayedData[activeIndex];
      }
      if (!payload) {
        return result;
      }
      return [].concat(_toConsumableArray(result), [getTooltipItem(child, payload)]);
    }, []);
  }, "getTooltipContent2");
  var getTooltipData = /* @__PURE__ */ __name(function getTooltipData2(state, chartData, layout, rangeObj) {
    var rangeData = rangeObj || {
      x: state.chartX,
      y: state.chartY
    };
    var pos = calculateTooltipPos(rangeData, layout);
    var ticks2 = state.orderedTooltipTicks, axis = state.tooltipAxis, tooltipTicks = state.tooltipTicks;
    var activeIndex = calculateActiveTickIndex(pos, ticks2, tooltipTicks, axis);
    if (activeIndex >= 0 && tooltipTicks) {
      var activeLabel = tooltipTicks[activeIndex] && tooltipTicks[activeIndex].value;
      var activePayload = getTooltipContent(state, chartData, activeIndex, activeLabel);
      var activeCoordinate = getActiveCoordinate(layout, ticks2, activeIndex, rangeData);
      return {
        activeTooltipIndex: activeIndex,
        activeLabel,
        activePayload,
        activeCoordinate
      };
    }
    return null;
  }, "getTooltipData2");
  var getAxisMapByAxes = /* @__PURE__ */ __name(function getAxisMapByAxes2(props, _ref2) {
    var axes = _ref2.axes, graphicalItems = _ref2.graphicalItems, axisType = _ref2.axisType, axisIdKey = _ref2.axisIdKey, stackGroups = _ref2.stackGroups, dataStartIndex = _ref2.dataStartIndex, dataEndIndex = _ref2.dataEndIndex;
    var layout = props.layout, children = props.children, stackOffset = props.stackOffset;
    var isCategorical = isCategoricalAxis(layout, axisType);
    return axes.reduce(function(result, child) {
      var _childProps$domain2;
      var childProps = child.type.defaultProps !== void 0 ? _objectSpread(_objectSpread({}, child.type.defaultProps), child.props) : child.props;
      var type = childProps.type, dataKey = childProps.dataKey, allowDataOverflow = childProps.allowDataOverflow, allowDuplicatedCategory = childProps.allowDuplicatedCategory, scale = childProps.scale, ticks2 = childProps.ticks, includeHidden = childProps.includeHidden;
      var axisId = childProps[axisIdKey];
      if (result[axisId]) {
        return result;
      }
      var displayedData = getDisplayedData(props.data, {
        graphicalItems: graphicalItems.filter(function(item) {
          var _defaultProps;
          var itemAxisId = axisIdKey in item.props ? item.props[axisIdKey] : (_defaultProps = item.type.defaultProps) === null || _defaultProps === void 0 ? void 0 : _defaultProps[axisIdKey];
          return itemAxisId === axisId;
        }),
        dataStartIndex,
        dataEndIndex
      });
      var len = displayedData.length;
      var domain, duplicateDomain, categoricalDomain;
      if (isDomainSpecifiedByUser(childProps.domain, allowDataOverflow, type)) {
        domain = parseSpecifiedDomain(childProps.domain, null, allowDataOverflow);
        if (isCategorical && (type === "number" || scale !== "auto")) {
          categoricalDomain = getDomainOfDataByKey(displayedData, dataKey, "category");
        }
      }
      var defaultDomain = getDefaultDomainByAxisType(type);
      if (!domain || domain.length === 0) {
        var _childProps$domain;
        var childDomain = (_childProps$domain = childProps.domain) !== null && _childProps$domain !== void 0 ? _childProps$domain : defaultDomain;
        if (dataKey) {
          domain = getDomainOfDataByKey(displayedData, dataKey, type);
          if (type === "category" && isCategorical) {
            var duplicate = hasDuplicate(domain);
            if (allowDuplicatedCategory && duplicate) {
              duplicateDomain = domain;
              domain = range(0, len);
            } else if (!allowDuplicatedCategory) {
              domain = parseDomainOfCategoryAxis(childDomain, domain, child).reduce(function(finalDomain, entry) {
                return finalDomain.indexOf(entry) >= 0 ? finalDomain : [].concat(_toConsumableArray(finalDomain), [entry]);
              }, []);
            }
          } else if (type === "category") {
            if (!allowDuplicatedCategory) {
              domain = parseDomainOfCategoryAxis(childDomain, domain, child).reduce(function(finalDomain, entry) {
                return finalDomain.indexOf(entry) >= 0 || entry === "" || isNil(entry) ? finalDomain : [].concat(_toConsumableArray(finalDomain), [entry]);
              }, []);
            } else {
              domain = domain.filter(function(entry) {
                return entry !== "" && !isNil(entry);
              });
            }
          } else if (type === "number") {
            var errorBarsDomain = parseErrorBarsOfAxis(displayedData, graphicalItems.filter(function(item) {
              var _defaultProps2, _defaultProps3;
              var itemAxisId = axisIdKey in item.props ? item.props[axisIdKey] : (_defaultProps2 = item.type.defaultProps) === null || _defaultProps2 === void 0 ? void 0 : _defaultProps2[axisIdKey];
              var itemHide = "hide" in item.props ? item.props.hide : (_defaultProps3 = item.type.defaultProps) === null || _defaultProps3 === void 0 ? void 0 : _defaultProps3.hide;
              return itemAxisId === axisId && (includeHidden || !itemHide);
            }), dataKey, axisType, layout);
            if (errorBarsDomain) {
              domain = errorBarsDomain;
            }
          }
          if (isCategorical && (type === "number" || scale !== "auto")) {
            categoricalDomain = getDomainOfDataByKey(displayedData, dataKey, "category");
          }
        } else if (isCategorical) {
          domain = range(0, len);
        } else if (stackGroups && stackGroups[axisId] && stackGroups[axisId].hasStack && type === "number") {
          domain = stackOffset === "expand" ? [0, 1] : getDomainOfStackGroups(stackGroups[axisId].stackGroups, dataStartIndex, dataEndIndex);
        } else {
          domain = getDomainOfItemsWithSameAxis(displayedData, graphicalItems.filter(function(item) {
            var itemAxisId = axisIdKey in item.props ? item.props[axisIdKey] : item.type.defaultProps[axisIdKey];
            var itemHide = "hide" in item.props ? item.props.hide : item.type.defaultProps.hide;
            return itemAxisId === axisId && (includeHidden || !itemHide);
          }), type, layout, true);
        }
        if (type === "number") {
          domain = detectReferenceElementsDomain(children, domain, axisId, axisType, ticks2);
          if (childDomain) {
            domain = parseSpecifiedDomain(childDomain, domain, allowDataOverflow);
          }
        } else if (type === "category" && childDomain) {
          var axisDomain = childDomain;
          var isDomainValid = domain.every(function(entry) {
            return axisDomain.indexOf(entry) >= 0;
          });
          if (isDomainValid) {
            domain = axisDomain;
          }
        }
      }
      return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, axisId, _objectSpread(_objectSpread({}, childProps), {}, {
        axisType,
        domain,
        categoricalDomain,
        duplicateDomain,
        originalDomain: (_childProps$domain2 = childProps.domain) !== null && _childProps$domain2 !== void 0 ? _childProps$domain2 : defaultDomain,
        isCategorical,
        layout
      })));
    }, {});
  }, "getAxisMapByAxes2");
  var getAxisMapByItems = /* @__PURE__ */ __name(function getAxisMapByItems2(props, _ref3) {
    var graphicalItems = _ref3.graphicalItems, Axis = _ref3.Axis, axisType = _ref3.axisType, axisIdKey = _ref3.axisIdKey, stackGroups = _ref3.stackGroups, dataStartIndex = _ref3.dataStartIndex, dataEndIndex = _ref3.dataEndIndex;
    var layout = props.layout, children = props.children;
    var displayedData = getDisplayedData(props.data, {
      graphicalItems,
      dataStartIndex,
      dataEndIndex
    });
    var len = displayedData.length;
    var isCategorical = isCategoricalAxis(layout, axisType);
    var index2 = -1;
    return graphicalItems.reduce(function(result, child) {
      var childProps = child.type.defaultProps !== void 0 ? _objectSpread(_objectSpread({}, child.type.defaultProps), child.props) : child.props;
      var axisId = childProps[axisIdKey];
      var originalDomain = getDefaultDomainByAxisType("number");
      if (!result[axisId]) {
        index2++;
        var domain;
        if (isCategorical) {
          domain = range(0, len);
        } else if (stackGroups && stackGroups[axisId] && stackGroups[axisId].hasStack) {
          domain = getDomainOfStackGroups(stackGroups[axisId].stackGroups, dataStartIndex, dataEndIndex);
          domain = detectReferenceElementsDomain(children, domain, axisId, axisType);
        } else {
          domain = parseSpecifiedDomain(originalDomain, getDomainOfItemsWithSameAxis(displayedData, graphicalItems.filter(function(item) {
            var _defaultProps4, _defaultProps5;
            var itemAxisId = axisIdKey in item.props ? item.props[axisIdKey] : (_defaultProps4 = item.type.defaultProps) === null || _defaultProps4 === void 0 ? void 0 : _defaultProps4[axisIdKey];
            var itemHide = "hide" in item.props ? item.props.hide : (_defaultProps5 = item.type.defaultProps) === null || _defaultProps5 === void 0 ? void 0 : _defaultProps5.hide;
            return itemAxisId === axisId && !itemHide;
          }), "number", layout), Axis.defaultProps.allowDataOverflow);
          domain = detectReferenceElementsDomain(children, domain, axisId, axisType);
        }
        return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, axisId, _objectSpread(_objectSpread({
          axisType
        }, Axis.defaultProps), {}, {
          hide: true,
          orientation: get$1(ORIENT_MAP, "".concat(axisType, ".").concat(index2 % 2), null),
          domain,
          originalDomain,
          isCategorical,
          layout
          // specify scale when no Axis
          // scale: isCategorical ? 'band' : 'linear',
        })));
      }
      return result;
    }, {});
  }, "getAxisMapByItems2");
  var getAxisMap = /* @__PURE__ */ __name(function getAxisMap2(props, _ref4) {
    var _ref4$axisType = _ref4.axisType, axisType = _ref4$axisType === void 0 ? "xAxis" : _ref4$axisType, AxisComp = _ref4.AxisComp, graphicalItems = _ref4.graphicalItems, stackGroups = _ref4.stackGroups, dataStartIndex = _ref4.dataStartIndex, dataEndIndex = _ref4.dataEndIndex;
    var children = props.children;
    var axisIdKey = "".concat(axisType, "Id");
    var axes = findAllByType(children, AxisComp);
    var axisMap = {};
    if (axes && axes.length) {
      axisMap = getAxisMapByAxes(props, {
        axes,
        graphicalItems,
        axisType,
        axisIdKey,
        stackGroups,
        dataStartIndex,
        dataEndIndex
      });
    } else if (graphicalItems && graphicalItems.length) {
      axisMap = getAxisMapByItems(props, {
        Axis: AxisComp,
        graphicalItems,
        axisType,
        axisIdKey,
        stackGroups,
        dataStartIndex,
        dataEndIndex
      });
    }
    return axisMap;
  }, "getAxisMap2");
  var tooltipTicksGenerator = /* @__PURE__ */ __name(function tooltipTicksGenerator2(axisMap) {
    var axis = getAnyElementOfObject(axisMap);
    var tooltipTicks = getTicksOfAxis(axis, false, true);
    return {
      tooltipTicks,
      orderedTooltipTicks: sortBy(tooltipTicks, function(o2) {
        return o2.coordinate;
      }),
      tooltipAxis: axis,
      tooltipAxisBandSize: getBandSizeOfAxis(axis, tooltipTicks)
    };
  }, "tooltipTicksGenerator2");
  var createDefaultState = /* @__PURE__ */ __name(function createDefaultState2(props) {
    var children = props.children, defaultShowTooltip = props.defaultShowTooltip;
    var brushItem = findChildByType(children, Brush);
    var startIndex = 0;
    var endIndex = 0;
    if (props.data && props.data.length !== 0) {
      endIndex = props.data.length - 1;
    }
    if (brushItem && brushItem.props) {
      if (brushItem.props.startIndex >= 0) {
        startIndex = brushItem.props.startIndex;
      }
      if (brushItem.props.endIndex >= 0) {
        endIndex = brushItem.props.endIndex;
      }
    }
    return {
      chartX: 0,
      chartY: 0,
      dataStartIndex: startIndex,
      dataEndIndex: endIndex,
      activeTooltipIndex: -1,
      isTooltipActive: Boolean(defaultShowTooltip)
    };
  }, "createDefaultState2");
  var hasGraphicalBarItem = /* @__PURE__ */ __name(function hasGraphicalBarItem2(graphicalItems) {
    if (!graphicalItems || !graphicalItems.length) {
      return false;
    }
    return graphicalItems.some(function(item) {
      var name = getDisplayName(item && item.type);
      return name && name.indexOf("Bar") >= 0;
    });
  }, "hasGraphicalBarItem2");
  var getAxisNameByLayout = /* @__PURE__ */ __name(function getAxisNameByLayout2(layout) {
    if (layout === "horizontal") {
      return {
        numericAxisName: "yAxis",
        cateAxisName: "xAxis"
      };
    }
    if (layout === "vertical") {
      return {
        numericAxisName: "xAxis",
        cateAxisName: "yAxis"
      };
    }
    if (layout === "centric") {
      return {
        numericAxisName: "radiusAxis",
        cateAxisName: "angleAxis"
      };
    }
    return {
      numericAxisName: "angleAxis",
      cateAxisName: "radiusAxis"
    };
  }, "getAxisNameByLayout2");
  var calculateOffset = /* @__PURE__ */ __name(function calculateOffset2(_ref5, prevLegendBBox) {
    var props = _ref5.props, graphicalItems = _ref5.graphicalItems, _ref5$xAxisMap = _ref5.xAxisMap, xAxisMap = _ref5$xAxisMap === void 0 ? {} : _ref5$xAxisMap, _ref5$yAxisMap = _ref5.yAxisMap, yAxisMap = _ref5$yAxisMap === void 0 ? {} : _ref5$yAxisMap;
    var width = props.width, height = props.height, children = props.children;
    var margin = props.margin || {};
    var brushItem = findChildByType(children, Brush);
    var legendItem = findChildByType(children, Legend);
    var offsetH = Object.keys(yAxisMap).reduce(function(result, id) {
      var entry = yAxisMap[id];
      var orientation = entry.orientation;
      if (!entry.mirror && !entry.hide) {
        return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, orientation, result[orientation] + entry.width));
      }
      return result;
    }, {
      left: margin.left || 0,
      right: margin.right || 0
    });
    var offsetV = Object.keys(xAxisMap).reduce(function(result, id) {
      var entry = xAxisMap[id];
      var orientation = entry.orientation;
      if (!entry.mirror && !entry.hide) {
        return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, orientation, get$1(result, "".concat(orientation)) + entry.height));
      }
      return result;
    }, {
      top: margin.top || 0,
      bottom: margin.bottom || 0
    });
    var offset2 = _objectSpread(_objectSpread({}, offsetV), offsetH);
    var brushBottom = offset2.bottom;
    if (brushItem) {
      offset2.bottom += brushItem.props.height || Brush.defaultProps.height;
    }
    if (legendItem && prevLegendBBox) {
      offset2 = appendOffsetOfLegend(offset2, graphicalItems, props, prevLegendBBox);
    }
    var offsetWidth = width - offset2.left - offset2.right;
    var offsetHeight = height - offset2.top - offset2.bottom;
    return _objectSpread(_objectSpread({
      brushBottom
    }, offset2), {}, {
      // never return negative values for height and width
      width: Math.max(offsetWidth, 0),
      height: Math.max(offsetHeight, 0)
    });
  }, "calculateOffset2");
  var getCartesianAxisSize = /* @__PURE__ */ __name(function getCartesianAxisSize2(axisObj, axisName) {
    if (axisName === "xAxis") {
      return axisObj[axisName].width;
    }
    if (axisName === "yAxis") {
      return axisObj[axisName].height;
    }
    return void 0;
  }, "getCartesianAxisSize2");
  var generateCategoricalChart = /* @__PURE__ */ __name(function generateCategoricalChart2(_ref6) {
    var chartName = _ref6.chartName, GraphicalChild = _ref6.GraphicalChild, _ref6$defaultTooltipE = _ref6.defaultTooltipEventType, defaultTooltipEventType = _ref6$defaultTooltipE === void 0 ? "axis" : _ref6$defaultTooltipE, _ref6$validateTooltip = _ref6.validateTooltipEventTypes, validateTooltipEventTypes = _ref6$validateTooltip === void 0 ? ["axis"] : _ref6$validateTooltip, axisComponents = _ref6.axisComponents, legendContent = _ref6.legendContent, formatAxisMap2 = _ref6.formatAxisMap, defaultProps2 = _ref6.defaultProps;
    var getFormatItems = /* @__PURE__ */ __name(function getFormatItems2(props, currentState) {
      var graphicalItems = currentState.graphicalItems, stackGroups = currentState.stackGroups, offset2 = currentState.offset, updateId = currentState.updateId, dataStartIndex = currentState.dataStartIndex, dataEndIndex = currentState.dataEndIndex;
      var barSize = props.barSize, layout = props.layout, barGap = props.barGap, barCategoryGap = props.barCategoryGap, globalMaxBarSize = props.maxBarSize;
      var _getAxisNameByLayout = getAxisNameByLayout(layout), numericAxisName = _getAxisNameByLayout.numericAxisName, cateAxisName = _getAxisNameByLayout.cateAxisName;
      var hasBar = hasGraphicalBarItem(graphicalItems);
      var formattedItems = [];
      graphicalItems.forEach(function(item, index2) {
        var displayedData = getDisplayedData(props.data, {
          graphicalItems: [item],
          dataStartIndex,
          dataEndIndex
        });
        var itemProps = item.type.defaultProps !== void 0 ? _objectSpread(_objectSpread({}, item.type.defaultProps), item.props) : item.props;
        var dataKey = itemProps.dataKey, childMaxBarSize = itemProps.maxBarSize;
        var numericAxisId = itemProps["".concat(numericAxisName, "Id")];
        var cateAxisId = itemProps["".concat(cateAxisName, "Id")];
        var axisObjInitialValue = {};
        var axisObj = axisComponents.reduce(function(result, entry) {
          var axisMap = currentState["".concat(entry.axisType, "Map")];
          var id = itemProps["".concat(entry.axisType, "Id")];
          !(axisMap && axisMap[id] || entry.axisType === "zAxis") ? invariant(false) : void 0;
          var axis = axisMap[id];
          return _objectSpread(_objectSpread({}, result), {}, _defineProperty(_defineProperty({}, entry.axisType, axis), "".concat(entry.axisType, "Ticks"), getTicksOfAxis(axis)));
        }, axisObjInitialValue);
        var cateAxis = axisObj[cateAxisName];
        var cateTicks = axisObj["".concat(cateAxisName, "Ticks")];
        var stackedData = stackGroups && stackGroups[numericAxisId] && stackGroups[numericAxisId].hasStack && getStackedDataOfItem(item, stackGroups[numericAxisId].stackGroups);
        var itemIsBar = getDisplayName(item.type).indexOf("Bar") >= 0;
        var bandSize = getBandSizeOfAxis(cateAxis, cateTicks);
        var barPosition = [];
        var sizeList = hasBar && getBarSizeList({
          barSize,
          stackGroups,
          totalSize: getCartesianAxisSize(axisObj, cateAxisName)
        });
        if (itemIsBar) {
          var _ref7, _getBandSizeOfAxis;
          var maxBarSize = isNil(childMaxBarSize) ? globalMaxBarSize : childMaxBarSize;
          var barBandSize = (_ref7 = (_getBandSizeOfAxis = getBandSizeOfAxis(cateAxis, cateTicks, true)) !== null && _getBandSizeOfAxis !== void 0 ? _getBandSizeOfAxis : maxBarSize) !== null && _ref7 !== void 0 ? _ref7 : 0;
          barPosition = getBarPosition({
            barGap,
            barCategoryGap,
            bandSize: barBandSize !== bandSize ? barBandSize : bandSize,
            sizeList: sizeList[cateAxisId],
            maxBarSize
          });
          if (barBandSize !== bandSize) {
            barPosition = barPosition.map(function(pos) {
              return _objectSpread(_objectSpread({}, pos), {}, {
                position: _objectSpread(_objectSpread({}, pos.position), {}, {
                  offset: pos.position.offset - barBandSize / 2
                })
              });
            });
          }
        }
        var composedFn = item && item.type && item.type.getComposedData;
        if (composedFn) {
          formattedItems.push({
            props: _objectSpread(_objectSpread({}, composedFn(_objectSpread(_objectSpread({}, axisObj), {}, {
              displayedData,
              props,
              dataKey,
              item,
              bandSize,
              barPosition,
              offset: offset2,
              stackedData,
              layout,
              dataStartIndex,
              dataEndIndex
            }))), {}, _defineProperty(_defineProperty(_defineProperty({
              key: item.key || "item-".concat(index2)
            }, numericAxisName, axisObj[numericAxisName]), cateAxisName, axisObj[cateAxisName]), "animationId", updateId)),
            childIndex: parseChildIndex(item, props.children),
            item
          });
        }
      });
      return formattedItems;
    }, "getFormatItems2");
    var updateStateOfAxisMapsOffsetAndStackGroups = /* @__PURE__ */ __name(function updateStateOfAxisMapsOffsetAndStackGroups2(_ref8, prevState) {
      var props = _ref8.props, dataStartIndex = _ref8.dataStartIndex, dataEndIndex = _ref8.dataEndIndex, updateId = _ref8.updateId;
      if (!validateWidthHeight({
        props
      })) {
        return null;
      }
      var children = props.children, layout = props.layout, stackOffset = props.stackOffset, data = props.data, reverseStackOrder = props.reverseStackOrder;
      var _getAxisNameByLayout2 = getAxisNameByLayout(layout), numericAxisName = _getAxisNameByLayout2.numericAxisName, cateAxisName = _getAxisNameByLayout2.cateAxisName;
      var graphicalItems = findAllByType(children, GraphicalChild);
      var stackGroups = getStackGroupsByAxisId(data, graphicalItems, "".concat(numericAxisName, "Id"), "".concat(cateAxisName, "Id"), stackOffset, reverseStackOrder);
      var axisObj = axisComponents.reduce(function(result, entry) {
        var name = "".concat(entry.axisType, "Map");
        return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, name, getAxisMap(props, _objectSpread(_objectSpread({}, entry), {}, {
          graphicalItems,
          stackGroups: entry.axisType === numericAxisName && stackGroups,
          dataStartIndex,
          dataEndIndex
        }))));
      }, {});
      var offset2 = calculateOffset(_objectSpread(_objectSpread({}, axisObj), {}, {
        props,
        graphicalItems
      }), prevState === null || prevState === void 0 ? void 0 : prevState.legendBBox);
      Object.keys(axisObj).forEach(function(key) {
        axisObj[key] = formatAxisMap2(props, axisObj[key], offset2, key.replace("Map", ""), chartName);
      });
      var cateAxisMap = axisObj["".concat(cateAxisName, "Map")];
      var ticksObj = tooltipTicksGenerator(cateAxisMap);
      var formattedGraphicalItems = getFormatItems(props, _objectSpread(_objectSpread({}, axisObj), {}, {
        dataStartIndex,
        dataEndIndex,
        updateId,
        graphicalItems,
        stackGroups,
        offset: offset2
      }));
      return _objectSpread(_objectSpread({
        formattedGraphicalItems,
        graphicalItems,
        offset: offset2,
        stackGroups
      }, ticksObj), axisObj);
    }, "updateStateOfAxisMapsOffsetAndStackGroups2");
    var CategoricalChartWrapper = /* @__PURE__ */ (function(_Component) {
      function CategoricalChartWrapper2(_props) {
        var _props$id, _props$throttleDelay;
        var _this;
        _classCallCheck(this, CategoricalChartWrapper2);
        _this = _callSuper(this, CategoricalChartWrapper2, [_props]);
        _defineProperty(_this, "eventEmitterSymbol", Symbol("rechartsEventEmitter"));
        _defineProperty(_this, "accessibilityManager", new AccessibilityManager());
        _defineProperty(_this, "handleLegendBBoxUpdate", function(box) {
          if (box) {
            var _this$state = _this.state, dataStartIndex = _this$state.dataStartIndex, dataEndIndex = _this$state.dataEndIndex, updateId = _this$state.updateId;
            _this.setState(_objectSpread({
              legendBBox: box
            }, updateStateOfAxisMapsOffsetAndStackGroups({
              props: _this.props,
              dataStartIndex,
              dataEndIndex,
              updateId
            }, _objectSpread(_objectSpread({}, _this.state), {}, {
              legendBBox: box
            }))));
          }
        });
        _defineProperty(_this, "handleReceiveSyncEvent", function(cId, data, emitter) {
          if (_this.props.syncId === cId) {
            if (emitter === _this.eventEmitterSymbol && typeof _this.props.syncMethod !== "function") {
              return;
            }
            _this.applySyncEvent(data);
          }
        });
        _defineProperty(_this, "handleBrushChange", function(_ref9) {
          var startIndex = _ref9.startIndex, endIndex = _ref9.endIndex;
          if (startIndex !== _this.state.dataStartIndex || endIndex !== _this.state.dataEndIndex) {
            var updateId = _this.state.updateId;
            _this.setState(function() {
              return _objectSpread({
                dataStartIndex: startIndex,
                dataEndIndex: endIndex
              }, updateStateOfAxisMapsOffsetAndStackGroups({
                props: _this.props,
                dataStartIndex: startIndex,
                dataEndIndex: endIndex,
                updateId
              }, _this.state));
            });
            _this.triggerSyncEvent({
              dataStartIndex: startIndex,
              dataEndIndex: endIndex
            });
          }
        });
        _defineProperty(_this, "handleMouseEnter", function(e) {
          var mouse = _this.getMouseInfo(e);
          if (mouse) {
            var _nextState = _objectSpread(_objectSpread({}, mouse), {}, {
              isTooltipActive: true
            });
            _this.setState(_nextState);
            _this.triggerSyncEvent(_nextState);
            var onMouseEnter = _this.props.onMouseEnter;
            if (isFunction$2(onMouseEnter)) {
              onMouseEnter(_nextState, e);
            }
          }
        });
        _defineProperty(_this, "triggeredAfterMouseMove", function(e) {
          var mouse = _this.getMouseInfo(e);
          var nextState = mouse ? _objectSpread(_objectSpread({}, mouse), {}, {
            isTooltipActive: true
          }) : {
            isTooltipActive: false
          };
          _this.setState(nextState);
          _this.triggerSyncEvent(nextState);
          var onMouseMove = _this.props.onMouseMove;
          if (isFunction$2(onMouseMove)) {
            onMouseMove(nextState, e);
          }
        });
        _defineProperty(_this, "handleItemMouseEnter", function(el) {
          _this.setState(function() {
            return {
              isTooltipActive: true,
              activeItem: el,
              activePayload: el.tooltipPayload,
              activeCoordinate: el.tooltipPosition || {
                x: el.cx,
                y: el.cy
              }
            };
          });
        });
        _defineProperty(_this, "handleItemMouseLeave", function() {
          _this.setState(function() {
            return {
              isTooltipActive: false
            };
          });
        });
        _defineProperty(_this, "handleMouseMove", function(e) {
          e.persist();
          _this.throttleTriggeredAfterMouseMove(e);
        });
        _defineProperty(_this, "handleMouseLeave", function(e) {
          _this.throttleTriggeredAfterMouseMove.cancel();
          var nextState = {
            isTooltipActive: false
          };
          _this.setState(nextState);
          _this.triggerSyncEvent(nextState);
          var onMouseLeave = _this.props.onMouseLeave;
          if (isFunction$2(onMouseLeave)) {
            onMouseLeave(nextState, e);
          }
        });
        _defineProperty(_this, "handleOuterEvent", function(e) {
          var eventName = getReactEventByType(e);
          var event = get$1(_this.props, "".concat(eventName));
          if (eventName && isFunction$2(event)) {
            var _mouse;
            var mouse;
            if (/.*touch.*/i.test(eventName)) {
              mouse = _this.getMouseInfo(e.changedTouches[0]);
            } else {
              mouse = _this.getMouseInfo(e);
            }
            event((_mouse = mouse) !== null && _mouse !== void 0 ? _mouse : {}, e);
          }
        });
        _defineProperty(_this, "handleClick", function(e) {
          var mouse = _this.getMouseInfo(e);
          if (mouse) {
            var _nextState2 = _objectSpread(_objectSpread({}, mouse), {}, {
              isTooltipActive: true
            });
            _this.setState(_nextState2);
            _this.triggerSyncEvent(_nextState2);
            var onClick = _this.props.onClick;
            if (isFunction$2(onClick)) {
              onClick(_nextState2, e);
            }
          }
        });
        _defineProperty(_this, "handleMouseDown", function(e) {
          var onMouseDown = _this.props.onMouseDown;
          if (isFunction$2(onMouseDown)) {
            var _nextState3 = _this.getMouseInfo(e);
            onMouseDown(_nextState3, e);
          }
        });
        _defineProperty(_this, "handleMouseUp", function(e) {
          var onMouseUp = _this.props.onMouseUp;
          if (isFunction$2(onMouseUp)) {
            var _nextState4 = _this.getMouseInfo(e);
            onMouseUp(_nextState4, e);
          }
        });
        _defineProperty(_this, "handleTouchMove", function(e) {
          if (e.changedTouches != null && e.changedTouches.length > 0) {
            _this.throttleTriggeredAfterMouseMove(e.changedTouches[0]);
          }
        });
        _defineProperty(_this, "handleTouchStart", function(e) {
          if (e.changedTouches != null && e.changedTouches.length > 0) {
            _this.handleMouseDown(e.changedTouches[0]);
          }
        });
        _defineProperty(_this, "handleTouchEnd", function(e) {
          if (e.changedTouches != null && e.changedTouches.length > 0) {
            _this.handleMouseUp(e.changedTouches[0]);
          }
        });
        _defineProperty(_this, "handleDoubleClick", function(e) {
          var onDoubleClick = _this.props.onDoubleClick;
          if (isFunction$2(onDoubleClick)) {
            var _nextState5 = _this.getMouseInfo(e);
            onDoubleClick(_nextState5, e);
          }
        });
        _defineProperty(_this, "handleContextMenu", function(e) {
          var onContextMenu = _this.props.onContextMenu;
          if (isFunction$2(onContextMenu)) {
            var _nextState6 = _this.getMouseInfo(e);
            onContextMenu(_nextState6, e);
          }
        });
        _defineProperty(_this, "triggerSyncEvent", function(data) {
          if (_this.props.syncId !== void 0) {
            eventCenter.emit(SYNC_EVENT, _this.props.syncId, data, _this.eventEmitterSymbol);
          }
        });
        _defineProperty(_this, "applySyncEvent", function(data) {
          var _this$props = _this.props, layout = _this$props.layout, syncMethod = _this$props.syncMethod;
          var updateId = _this.state.updateId;
          var dataStartIndex = data.dataStartIndex, dataEndIndex = data.dataEndIndex;
          if (data.dataStartIndex !== void 0 || data.dataEndIndex !== void 0) {
            _this.setState(_objectSpread({
              dataStartIndex,
              dataEndIndex
            }, updateStateOfAxisMapsOffsetAndStackGroups({
              props: _this.props,
              dataStartIndex,
              dataEndIndex,
              updateId
            }, _this.state)));
          } else if (data.activeTooltipIndex !== void 0) {
            var chartX = data.chartX, chartY = data.chartY;
            var activeTooltipIndex = data.activeTooltipIndex;
            var _this$state2 = _this.state, offset2 = _this$state2.offset, tooltipTicks = _this$state2.tooltipTicks;
            if (!offset2) {
              return;
            }
            if (typeof syncMethod === "function") {
              activeTooltipIndex = syncMethod(tooltipTicks, data);
            } else if (syncMethod === "value") {
              activeTooltipIndex = -1;
              for (var i2 = 0; i2 < tooltipTicks.length; i2++) {
                if (tooltipTicks[i2].value === data.activeLabel) {
                  activeTooltipIndex = i2;
                  break;
                }
              }
            }
            var viewBox = _objectSpread(_objectSpread({}, offset2), {}, {
              x: offset2.left,
              y: offset2.top
            });
            var validateChartX = Math.min(chartX, viewBox.x + viewBox.width);
            var validateChartY = Math.min(chartY, viewBox.y + viewBox.height);
            var activeLabel = tooltipTicks[activeTooltipIndex] && tooltipTicks[activeTooltipIndex].value;
            var activePayload = getTooltipContent(_this.state, _this.props.data, activeTooltipIndex);
            var activeCoordinate = tooltipTicks[activeTooltipIndex] ? {
              x: layout === "horizontal" ? tooltipTicks[activeTooltipIndex].coordinate : validateChartX,
              y: layout === "horizontal" ? validateChartY : tooltipTicks[activeTooltipIndex].coordinate
            } : originCoordinate;
            _this.setState(_objectSpread(_objectSpread({}, data), {}, {
              activeLabel,
              activeCoordinate,
              activePayload,
              activeTooltipIndex
            }));
          } else {
            _this.setState(data);
          }
        });
        _defineProperty(_this, "renderCursor", function(element) {
          var _element$props$active;
          var _this$state3 = _this.state, isTooltipActive = _this$state3.isTooltipActive, activeCoordinate = _this$state3.activeCoordinate, activePayload = _this$state3.activePayload, offset2 = _this$state3.offset, activeTooltipIndex = _this$state3.activeTooltipIndex, tooltipAxisBandSize = _this$state3.tooltipAxisBandSize;
          var tooltipEventType = _this.getTooltipEventType();
          var isActive = (_element$props$active = element.props.active) !== null && _element$props$active !== void 0 ? _element$props$active : isTooltipActive;
          var layout = _this.props.layout;
          var key = element.key || "_recharts-cursor";
          return /* @__PURE__ */ React.createElement(Cursor, {
            key,
            activeCoordinate,
            activePayload,
            activeTooltipIndex,
            chartName,
            element,
            isActive,
            layout,
            offset: offset2,
            tooltipAxisBandSize,
            tooltipEventType
          });
        });
        _defineProperty(_this, "renderPolarAxis", function(element, displayName2, index2) {
          var axisType = get$1(element, "type.axisType");
          var axisMap = get$1(_this.state, "".concat(axisType, "Map"));
          var elementDefaultProps = element.type.defaultProps;
          var elementProps = elementDefaultProps !== void 0 ? _objectSpread(_objectSpread({}, elementDefaultProps), element.props) : element.props;
          var axisOption = axisMap && axisMap[elementProps["".concat(axisType, "Id")]];
          return /* @__PURE__ */ reactExports.cloneElement(element, _objectSpread(_objectSpread({}, axisOption), {}, {
            className: clsx(axisType, axisOption.className),
            key: element.key || "".concat(displayName2, "-").concat(index2),
            ticks: getTicksOfAxis(axisOption, true)
          }));
        });
        _defineProperty(_this, "renderPolarGrid", function(element) {
          var _element$props = element.props, radialLines = _element$props.radialLines, polarAngles = _element$props.polarAngles, polarRadius = _element$props.polarRadius;
          var _this$state4 = _this.state, radiusAxisMap = _this$state4.radiusAxisMap, angleAxisMap = _this$state4.angleAxisMap;
          var radiusAxis = getAnyElementOfObject(radiusAxisMap);
          var angleAxis = getAnyElementOfObject(angleAxisMap);
          var cx2 = angleAxis.cx, cy = angleAxis.cy, innerRadius = angleAxis.innerRadius, outerRadius = angleAxis.outerRadius;
          return /* @__PURE__ */ reactExports.cloneElement(element, {
            polarAngles: Array.isArray(polarAngles) ? polarAngles : getTicksOfAxis(angleAxis, true).map(function(entry) {
              return entry.coordinate;
            }),
            polarRadius: Array.isArray(polarRadius) ? polarRadius : getTicksOfAxis(radiusAxis, true).map(function(entry) {
              return entry.coordinate;
            }),
            cx: cx2,
            cy,
            innerRadius,
            outerRadius,
            key: element.key || "polar-grid",
            radialLines
          });
        });
        _defineProperty(_this, "renderLegend", function() {
          var formattedGraphicalItems = _this.state.formattedGraphicalItems;
          var _this$props2 = _this.props, children = _this$props2.children, width = _this$props2.width, height = _this$props2.height;
          var margin = _this.props.margin || {};
          var legendWidth = width - (margin.left || 0) - (margin.right || 0);
          var props = getLegendProps({
            children,
            formattedGraphicalItems,
            legendWidth,
            legendContent
          });
          if (!props) {
            return null;
          }
          var item = props.item, otherProps = _objectWithoutProperties(props, _excluded);
          return /* @__PURE__ */ reactExports.cloneElement(item, _objectSpread(_objectSpread({}, otherProps), {}, {
            chartWidth: width,
            chartHeight: height,
            margin,
            onBBoxUpdate: _this.handleLegendBBoxUpdate
          }));
        });
        _defineProperty(_this, "renderTooltip", function() {
          var _tooltipItem$props$ac;
          var _this$props3 = _this.props, children = _this$props3.children, accessibilityLayer = _this$props3.accessibilityLayer;
          var tooltipItem = findChildByType(children, Tooltip);
          if (!tooltipItem) {
            return null;
          }
          var _this$state5 = _this.state, isTooltipActive = _this$state5.isTooltipActive, activeCoordinate = _this$state5.activeCoordinate, activePayload = _this$state5.activePayload, activeLabel = _this$state5.activeLabel, offset2 = _this$state5.offset;
          var isActive = (_tooltipItem$props$ac = tooltipItem.props.active) !== null && _tooltipItem$props$ac !== void 0 ? _tooltipItem$props$ac : isTooltipActive;
          return /* @__PURE__ */ reactExports.cloneElement(tooltipItem, {
            viewBox: _objectSpread(_objectSpread({}, offset2), {}, {
              x: offset2.left,
              y: offset2.top
            }),
            active: isActive,
            label: activeLabel,
            payload: isActive ? activePayload : [],
            coordinate: activeCoordinate,
            accessibilityLayer
          });
        });
        _defineProperty(_this, "renderBrush", function(element) {
          var _this$props4 = _this.props, margin = _this$props4.margin, data = _this$props4.data;
          var _this$state6 = _this.state, offset2 = _this$state6.offset, dataStartIndex = _this$state6.dataStartIndex, dataEndIndex = _this$state6.dataEndIndex, updateId = _this$state6.updateId;
          return /* @__PURE__ */ reactExports.cloneElement(element, {
            key: element.key || "_recharts-brush",
            onChange: combineEventHandlers(_this.handleBrushChange, element.props.onChange),
            data,
            x: isNumber(element.props.x) ? element.props.x : offset2.left,
            y: isNumber(element.props.y) ? element.props.y : offset2.top + offset2.height + offset2.brushBottom - (margin.bottom || 0),
            width: isNumber(element.props.width) ? element.props.width : offset2.width,
            startIndex: dataStartIndex,
            endIndex: dataEndIndex,
            updateId: "brush-".concat(updateId)
          });
        });
        _defineProperty(_this, "renderReferenceElement", function(element, displayName2, index2) {
          if (!element) {
            return null;
          }
          var _this2 = _this, clipPathId = _this2.clipPathId;
          var _this$state7 = _this.state, xAxisMap = _this$state7.xAxisMap, yAxisMap = _this$state7.yAxisMap, offset2 = _this$state7.offset;
          var elementDefaultProps = element.type.defaultProps || {};
          var _element$props2 = element.props, _element$props2$xAxis = _element$props2.xAxisId, xAxisId = _element$props2$xAxis === void 0 ? elementDefaultProps.xAxisId : _element$props2$xAxis, _element$props2$yAxis = _element$props2.yAxisId, yAxisId = _element$props2$yAxis === void 0 ? elementDefaultProps.yAxisId : _element$props2$yAxis;
          return /* @__PURE__ */ reactExports.cloneElement(element, {
            key: element.key || "".concat(displayName2, "-").concat(index2),
            xAxis: xAxisMap[xAxisId],
            yAxis: yAxisMap[yAxisId],
            viewBox: {
              x: offset2.left,
              y: offset2.top,
              width: offset2.width,
              height: offset2.height
            },
            clipPathId
          });
        });
        _defineProperty(_this, "renderActivePoints", function(_ref10) {
          var item = _ref10.item, activePoint = _ref10.activePoint, basePoint = _ref10.basePoint, childIndex = _ref10.childIndex, isRange = _ref10.isRange;
          var result = [];
          var key = item.props.key;
          var itemItemProps = item.item.type.defaultProps !== void 0 ? _objectSpread(_objectSpread({}, item.item.type.defaultProps), item.item.props) : item.item.props;
          var activeDot = itemItemProps.activeDot, dataKey = itemItemProps.dataKey;
          var dotProps = _objectSpread(_objectSpread({
            index: childIndex,
            dataKey,
            cx: activePoint.x,
            cy: activePoint.y,
            r: 4,
            fill: getMainColorOfGraphicItem(item.item),
            strokeWidth: 2,
            stroke: "#fff",
            payload: activePoint.payload,
            value: activePoint.value
          }, filterProps(activeDot, false)), adaptEventHandlers(activeDot));
          result.push(CategoricalChartWrapper2.renderActiveDot(activeDot, dotProps, "".concat(key, "-activePoint-").concat(childIndex)));
          if (basePoint) {
            result.push(CategoricalChartWrapper2.renderActiveDot(activeDot, _objectSpread(_objectSpread({}, dotProps), {}, {
              cx: basePoint.x,
              cy: basePoint.y
            }), "".concat(key, "-basePoint-").concat(childIndex)));
          } else if (isRange) {
            result.push(null);
          }
          return result;
        });
        _defineProperty(_this, "renderGraphicChild", function(element, displayName2, index2) {
          var item = _this.filterFormatItem(element, displayName2, index2);
          if (!item) {
            return null;
          }
          var tooltipEventType = _this.getTooltipEventType();
          var _this$state8 = _this.state, isTooltipActive = _this$state8.isTooltipActive, tooltipAxis = _this$state8.tooltipAxis, activeTooltipIndex = _this$state8.activeTooltipIndex, activeLabel = _this$state8.activeLabel;
          var children = _this.props.children;
          var tooltipItem = findChildByType(children, Tooltip);
          var _item$props = item.props, points = _item$props.points, isRange = _item$props.isRange, baseLine = _item$props.baseLine;
          var itemItemProps = item.item.type.defaultProps !== void 0 ? _objectSpread(_objectSpread({}, item.item.type.defaultProps), item.item.props) : item.item.props;
          var activeDot = itemItemProps.activeDot, hide2 = itemItemProps.hide, activeBar = itemItemProps.activeBar, activeShape = itemItemProps.activeShape;
          var hasActive = Boolean(!hide2 && isTooltipActive && tooltipItem && (activeDot || activeBar || activeShape));
          var itemEvents = {};
          if (tooltipEventType !== "axis" && tooltipItem && tooltipItem.props.trigger === "click") {
            itemEvents = {
              onClick: combineEventHandlers(_this.handleItemMouseEnter, element.props.onClick)
            };
          } else if (tooltipEventType !== "axis") {
            itemEvents = {
              onMouseLeave: combineEventHandlers(_this.handleItemMouseLeave, element.props.onMouseLeave),
              onMouseEnter: combineEventHandlers(_this.handleItemMouseEnter, element.props.onMouseEnter)
            };
          }
          var graphicalItem = /* @__PURE__ */ reactExports.cloneElement(element, _objectSpread(_objectSpread({}, item.props), itemEvents));
          function findWithPayload(entry) {
            return typeof tooltipAxis.dataKey === "function" ? tooltipAxis.dataKey(entry.payload) : null;
          }
          __name(findWithPayload, "findWithPayload");
          if (hasActive) {
            if (activeTooltipIndex >= 0) {
              var activePoint, basePoint;
              if (tooltipAxis.dataKey && !tooltipAxis.allowDuplicatedCategory) {
                var specifiedKey = typeof tooltipAxis.dataKey === "function" ? findWithPayload : "payload.".concat(tooltipAxis.dataKey.toString());
                activePoint = findEntryInArray(points, specifiedKey, activeLabel);
                basePoint = isRange && baseLine && findEntryInArray(baseLine, specifiedKey, activeLabel);
              } else {
                activePoint = points === null || points === void 0 ? void 0 : points[activeTooltipIndex];
                basePoint = isRange && baseLine && baseLine[activeTooltipIndex];
              }
              if (activeShape || activeBar) {
                var activeIndex = element.props.activeIndex !== void 0 ? element.props.activeIndex : activeTooltipIndex;
                return [/* @__PURE__ */ reactExports.cloneElement(element, _objectSpread(_objectSpread(_objectSpread({}, item.props), itemEvents), {}, {
                  activeIndex
                })), null, null];
              }
              if (!isNil(activePoint)) {
                return [graphicalItem].concat(_toConsumableArray(_this.renderActivePoints({
                  item,
                  activePoint,
                  basePoint,
                  childIndex: activeTooltipIndex,
                  isRange
                })));
              }
            } else {
              var _this$getItemByXY;
              var _ref11 = (_this$getItemByXY = _this.getItemByXY(_this.state.activeCoordinate)) !== null && _this$getItemByXY !== void 0 ? _this$getItemByXY : {
                graphicalItem
              }, _ref11$graphicalItem = _ref11.graphicalItem, _ref11$graphicalItem$ = _ref11$graphicalItem.item, xyItem = _ref11$graphicalItem$ === void 0 ? element : _ref11$graphicalItem$, childIndex = _ref11$graphicalItem.childIndex;
              var elementProps = _objectSpread(_objectSpread(_objectSpread({}, item.props), itemEvents), {}, {
                activeIndex: childIndex
              });
              return [/* @__PURE__ */ reactExports.cloneElement(xyItem, elementProps), null, null];
            }
          }
          if (isRange) {
            return [graphicalItem, null, null];
          }
          return [graphicalItem, null];
        });
        _defineProperty(_this, "renderCustomized", function(element, displayName2, index2) {
          return /* @__PURE__ */ reactExports.cloneElement(element, _objectSpread(_objectSpread({
            key: "recharts-customized-".concat(index2)
          }, _this.props), _this.state));
        });
        _defineProperty(_this, "renderMap", {
          CartesianGrid: {
            handler: renderAsIs,
            once: true
          },
          ReferenceArea: {
            handler: _this.renderReferenceElement
          },
          ReferenceLine: {
            handler: renderAsIs
          },
          ReferenceDot: {
            handler: _this.renderReferenceElement
          },
          XAxis: {
            handler: renderAsIs
          },
          YAxis: {
            handler: renderAsIs
          },
          Brush: {
            handler: _this.renderBrush,
            once: true
          },
          Bar: {
            handler: _this.renderGraphicChild
          },
          Line: {
            handler: _this.renderGraphicChild
          },
          Area: {
            handler: _this.renderGraphicChild
          },
          Radar: {
            handler: _this.renderGraphicChild
          },
          RadialBar: {
            handler: _this.renderGraphicChild
          },
          Scatter: {
            handler: _this.renderGraphicChild
          },
          Pie: {
            handler: _this.renderGraphicChild
          },
          Funnel: {
            handler: _this.renderGraphicChild
          },
          Tooltip: {
            handler: _this.renderCursor,
            once: true
          },
          PolarGrid: {
            handler: _this.renderPolarGrid,
            once: true
          },
          PolarAngleAxis: {
            handler: _this.renderPolarAxis
          },
          PolarRadiusAxis: {
            handler: _this.renderPolarAxis
          },
          Customized: {
            handler: _this.renderCustomized
          }
        });
        _this.clipPathId = "".concat((_props$id = _props.id) !== null && _props$id !== void 0 ? _props$id : uniqueId("recharts"), "-clip");
        _this.throttleTriggeredAfterMouseMove = throttle(_this.triggeredAfterMouseMove, (_props$throttleDelay = _props.throttleDelay) !== null && _props$throttleDelay !== void 0 ? _props$throttleDelay : 1e3 / 60);
        _this.state = {};
        return _this;
      }
      __name(CategoricalChartWrapper2, "CategoricalChartWrapper2");
      _inherits(CategoricalChartWrapper2, _Component);
      return _createClass(CategoricalChartWrapper2, [{
        key: "componentDidMount",
        value: /* @__PURE__ */ __name(function componentDidMount() {
          var _this$props$margin$le, _this$props$margin$to;
          this.addListener();
          this.accessibilityManager.setDetails({
            container: this.container,
            offset: {
              left: (_this$props$margin$le = this.props.margin.left) !== null && _this$props$margin$le !== void 0 ? _this$props$margin$le : 0,
              top: (_this$props$margin$to = this.props.margin.top) !== null && _this$props$margin$to !== void 0 ? _this$props$margin$to : 0
            },
            coordinateList: this.state.tooltipTicks,
            mouseHandlerCallback: this.triggeredAfterMouseMove,
            layout: this.props.layout
          });
          this.displayDefaultTooltip();
        }, "componentDidMount")
      }, {
        key: "displayDefaultTooltip",
        value: /* @__PURE__ */ __name(function displayDefaultTooltip() {
          var _this$props5 = this.props, children = _this$props5.children, data = _this$props5.data, height = _this$props5.height, layout = _this$props5.layout;
          var tooltipElem = findChildByType(children, Tooltip);
          if (!tooltipElem) {
            return;
          }
          var defaultIndex = tooltipElem.props.defaultIndex;
          if (typeof defaultIndex !== "number" || defaultIndex < 0 || defaultIndex > this.state.tooltipTicks.length - 1) {
            return;
          }
          var activeLabel = this.state.tooltipTicks[defaultIndex] && this.state.tooltipTicks[defaultIndex].value;
          var activePayload = getTooltipContent(this.state, data, defaultIndex, activeLabel);
          var independentAxisCoord = this.state.tooltipTicks[defaultIndex].coordinate;
          var dependentAxisCoord = (this.state.offset.top + height) / 2;
          var isHorizontal = layout === "horizontal";
          var activeCoordinate = isHorizontal ? {
            x: independentAxisCoord,
            y: dependentAxisCoord
          } : {
            y: independentAxisCoord,
            x: dependentAxisCoord
          };
          var scatterPlotElement = this.state.formattedGraphicalItems.find(function(_ref12) {
            var item = _ref12.item;
            return item.type.name === "Scatter";
          });
          if (scatterPlotElement) {
            activeCoordinate = _objectSpread(_objectSpread({}, activeCoordinate), scatterPlotElement.props.points[defaultIndex].tooltipPosition);
            activePayload = scatterPlotElement.props.points[defaultIndex].tooltipPayload;
          }
          var nextState = {
            activeTooltipIndex: defaultIndex,
            isTooltipActive: true,
            activeLabel,
            activePayload,
            activeCoordinate
          };
          this.setState(nextState);
          this.renderCursor(tooltipElem);
          this.accessibilityManager.setIndex(defaultIndex);
        }, "displayDefaultTooltip")
      }, {
        key: "getSnapshotBeforeUpdate",
        value: /* @__PURE__ */ __name(function getSnapshotBeforeUpdate(prevProps, prevState) {
          if (!this.props.accessibilityLayer) {
            return null;
          }
          if (this.state.tooltipTicks !== prevState.tooltipTicks) {
            this.accessibilityManager.setDetails({
              coordinateList: this.state.tooltipTicks
            });
          }
          if (this.props.layout !== prevProps.layout) {
            this.accessibilityManager.setDetails({
              layout: this.props.layout
            });
          }
          if (this.props.margin !== prevProps.margin) {
            var _this$props$margin$le2, _this$props$margin$to2;
            this.accessibilityManager.setDetails({
              offset: {
                left: (_this$props$margin$le2 = this.props.margin.left) !== null && _this$props$margin$le2 !== void 0 ? _this$props$margin$le2 : 0,
                top: (_this$props$margin$to2 = this.props.margin.top) !== null && _this$props$margin$to2 !== void 0 ? _this$props$margin$to2 : 0
              }
            });
          }
          return null;
        }, "getSnapshotBeforeUpdate")
      }, {
        key: "componentDidUpdate",
        value: /* @__PURE__ */ __name(function componentDidUpdate(prevProps) {
          if (!isChildrenEqual([findChildByType(prevProps.children, Tooltip)], [findChildByType(this.props.children, Tooltip)])) {
            this.displayDefaultTooltip();
          }
        }, "componentDidUpdate")
      }, {
        key: "componentWillUnmount",
        value: /* @__PURE__ */ __name(function componentWillUnmount() {
          this.removeListener();
          this.throttleTriggeredAfterMouseMove.cancel();
        }, "componentWillUnmount")
      }, {
        key: "getTooltipEventType",
        value: /* @__PURE__ */ __name(function getTooltipEventType() {
          var tooltipItem = findChildByType(this.props.children, Tooltip);
          if (tooltipItem && typeof tooltipItem.props.shared === "boolean") {
            var eventType = tooltipItem.props.shared ? "axis" : "item";
            return validateTooltipEventTypes.indexOf(eventType) >= 0 ? eventType : defaultTooltipEventType;
          }
          return defaultTooltipEventType;
        }, "getTooltipEventType")
        /**
         * Get the information of mouse in chart, return null when the mouse is not in the chart
         * @param  {MousePointer} event    The event object
         * @return {Object}          Mouse data
         */
      }, {
        key: "getMouseInfo",
        value: /* @__PURE__ */ __name(function getMouseInfo(event) {
          if (!this.container) {
            return null;
          }
          var element = this.container;
          var boundingRect = element.getBoundingClientRect();
          var containerOffset = getOffset(boundingRect);
          var e = {
            chartX: Math.round(event.pageX - containerOffset.left),
            chartY: Math.round(event.pageY - containerOffset.top)
          };
          var scale = boundingRect.width / element.offsetWidth || 1;
          var rangeObj = this.inRange(e.chartX, e.chartY, scale);
          if (!rangeObj) {
            return null;
          }
          var _this$state9 = this.state, xAxisMap = _this$state9.xAxisMap, yAxisMap = _this$state9.yAxisMap;
          var tooltipEventType = this.getTooltipEventType();
          var toolTipData = getTooltipData(this.state, this.props.data, this.props.layout, rangeObj);
          if (tooltipEventType !== "axis" && xAxisMap && yAxisMap) {
            var xScale = getAnyElementOfObject(xAxisMap).scale;
            var yScale = getAnyElementOfObject(yAxisMap).scale;
            var xValue = xScale && xScale.invert ? xScale.invert(e.chartX) : null;
            var yValue = yScale && yScale.invert ? yScale.invert(e.chartY) : null;
            return _objectSpread(_objectSpread({}, e), {}, {
              xValue,
              yValue
            }, toolTipData);
          }
          if (toolTipData) {
            return _objectSpread(_objectSpread({}, e), toolTipData);
          }
          return null;
        }, "getMouseInfo")
      }, {
        key: "inRange",
        value: /* @__PURE__ */ __name(function inRange(x2, y2) {
          var scale = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1;
          var layout = this.props.layout;
          var scaledX = x2 / scale, scaledY = y2 / scale;
          if (layout === "horizontal" || layout === "vertical") {
            var offset2 = this.state.offset;
            var isInRange = scaledX >= offset2.left && scaledX <= offset2.left + offset2.width && scaledY >= offset2.top && scaledY <= offset2.top + offset2.height;
            return isInRange ? {
              x: scaledX,
              y: scaledY
            } : null;
          }
          var _this$state10 = this.state, angleAxisMap = _this$state10.angleAxisMap, radiusAxisMap = _this$state10.radiusAxisMap;
          if (angleAxisMap && radiusAxisMap) {
            var angleAxis = getAnyElementOfObject(angleAxisMap);
            return inRangeOfSector({
              x: scaledX,
              y: scaledY
            }, angleAxis);
          }
          return null;
        }, "inRange")
      }, {
        key: "parseEventsOfWrapper",
        value: /* @__PURE__ */ __name(function parseEventsOfWrapper() {
          var children = this.props.children;
          var tooltipEventType = this.getTooltipEventType();
          var tooltipItem = findChildByType(children, Tooltip);
          var tooltipEvents = {};
          if (tooltipItem && tooltipEventType === "axis") {
            if (tooltipItem.props.trigger === "click") {
              tooltipEvents = {
                onClick: this.handleClick
              };
            } else {
              tooltipEvents = {
                onMouseEnter: this.handleMouseEnter,
                onDoubleClick: this.handleDoubleClick,
                onMouseMove: this.handleMouseMove,
                onMouseLeave: this.handleMouseLeave,
                onTouchMove: this.handleTouchMove,
                onTouchStart: this.handleTouchStart,
                onTouchEnd: this.handleTouchEnd,
                onContextMenu: this.handleContextMenu
              };
            }
          }
          var outerEvents = adaptEventHandlers(this.props, this.handleOuterEvent);
          return _objectSpread(_objectSpread({}, outerEvents), tooltipEvents);
        }, "parseEventsOfWrapper")
      }, {
        key: "addListener",
        value: /* @__PURE__ */ __name(function addListener() {
          eventCenter.on(SYNC_EVENT, this.handleReceiveSyncEvent);
        }, "addListener")
      }, {
        key: "removeListener",
        value: /* @__PURE__ */ __name(function removeListener() {
          eventCenter.removeListener(SYNC_EVENT, this.handleReceiveSyncEvent);
        }, "removeListener")
      }, {
        key: "filterFormatItem",
        value: /* @__PURE__ */ __name(function filterFormatItem(item, displayName2, childIndex) {
          var formattedGraphicalItems = this.state.formattedGraphicalItems;
          for (var i2 = 0, len = formattedGraphicalItems.length; i2 < len; i2++) {
            var entry = formattedGraphicalItems[i2];
            if (entry.item === item || entry.props.key === item.key || displayName2 === getDisplayName(entry.item.type) && childIndex === entry.childIndex) {
              return entry;
            }
          }
          return null;
        }, "filterFormatItem")
      }, {
        key: "renderClipPath",
        value: /* @__PURE__ */ __name(function renderClipPath() {
          var clipPathId = this.clipPathId;
          var _this$state$offset = this.state.offset, left = _this$state$offset.left, top = _this$state$offset.top, height = _this$state$offset.height, width = _this$state$offset.width;
          return /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("clipPath", {
            id: clipPathId
          }, /* @__PURE__ */ React.createElement("rect", {
            x: left,
            y: top,
            height,
            width
          })));
        }, "renderClipPath")
      }, {
        key: "getXScales",
        value: /* @__PURE__ */ __name(function getXScales() {
          var xAxisMap = this.state.xAxisMap;
          return xAxisMap ? Object.entries(xAxisMap).reduce(function(res, _ref13) {
            var _ref14 = _slicedToArray(_ref13, 2), axisId = _ref14[0], axisProps = _ref14[1];
            return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, axisId, axisProps.scale));
          }, {}) : null;
        }, "getXScales")
      }, {
        key: "getYScales",
        value: /* @__PURE__ */ __name(function getYScales() {
          var yAxisMap = this.state.yAxisMap;
          return yAxisMap ? Object.entries(yAxisMap).reduce(function(res, _ref15) {
            var _ref16 = _slicedToArray(_ref15, 2), axisId = _ref16[0], axisProps = _ref16[1];
            return _objectSpread(_objectSpread({}, res), {}, _defineProperty({}, axisId, axisProps.scale));
          }, {}) : null;
        }, "getYScales")
      }, {
        key: "getXScaleByAxisId",
        value: /* @__PURE__ */ __name(function getXScaleByAxisId(axisId) {
          var _this$state$xAxisMap;
          return (_this$state$xAxisMap = this.state.xAxisMap) === null || _this$state$xAxisMap === void 0 || (_this$state$xAxisMap = _this$state$xAxisMap[axisId]) === null || _this$state$xAxisMap === void 0 ? void 0 : _this$state$xAxisMap.scale;
        }, "getXScaleByAxisId")
      }, {
        key: "getYScaleByAxisId",
        value: /* @__PURE__ */ __name(function getYScaleByAxisId(axisId) {
          var _this$state$yAxisMap;
          return (_this$state$yAxisMap = this.state.yAxisMap) === null || _this$state$yAxisMap === void 0 || (_this$state$yAxisMap = _this$state$yAxisMap[axisId]) === null || _this$state$yAxisMap === void 0 ? void 0 : _this$state$yAxisMap.scale;
        }, "getYScaleByAxisId")
      }, {
        key: "getItemByXY",
        value: /* @__PURE__ */ __name(function getItemByXY(chartXY) {
          var _this$state11 = this.state, formattedGraphicalItems = _this$state11.formattedGraphicalItems, activeItem = _this$state11.activeItem;
          if (formattedGraphicalItems && formattedGraphicalItems.length) {
            for (var i2 = 0, len = formattedGraphicalItems.length; i2 < len; i2++) {
              var graphicalItem = formattedGraphicalItems[i2];
              var props = graphicalItem.props, item = graphicalItem.item;
              var itemProps = item.type.defaultProps !== void 0 ? _objectSpread(_objectSpread({}, item.type.defaultProps), item.props) : item.props;
              var itemDisplayName = getDisplayName(item.type);
              if (itemDisplayName === "Bar") {
                var activeBarItem = (props.data || []).find(function(entry) {
                  return isInRectangle(chartXY, entry);
                });
                if (activeBarItem) {
                  return {
                    graphicalItem,
                    payload: activeBarItem
                  };
                }
              } else if (itemDisplayName === "RadialBar") {
                var _activeBarItem = (props.data || []).find(function(entry) {
                  return inRangeOfSector(chartXY, entry);
                });
                if (_activeBarItem) {
                  return {
                    graphicalItem,
                    payload: _activeBarItem
                  };
                }
              } else if (isFunnel(graphicalItem, activeItem) || isPie(graphicalItem, activeItem) || isScatter(graphicalItem, activeItem)) {
                var activeIndex = getActiveShapeIndexForTooltip({
                  graphicalItem,
                  activeTooltipItem: activeItem,
                  itemData: itemProps.data
                });
                var childIndex = itemProps.activeIndex === void 0 ? activeIndex : itemProps.activeIndex;
                return {
                  graphicalItem: _objectSpread(_objectSpread({}, graphicalItem), {}, {
                    childIndex
                  }),
                  payload: isScatter(graphicalItem, activeItem) ? itemProps.data[activeIndex] : graphicalItem.props.data[activeIndex]
                };
              }
            }
          }
          return null;
        }, "getItemByXY")
      }, {
        key: "render",
        value: /* @__PURE__ */ __name(function render() {
          var _this3 = this;
          if (!validateWidthHeight(this)) {
            return null;
          }
          var _this$props6 = this.props, children = _this$props6.children, className = _this$props6.className, width = _this$props6.width, height = _this$props6.height, style = _this$props6.style, compact2 = _this$props6.compact, title = _this$props6.title, desc = _this$props6.desc, others = _objectWithoutProperties(_this$props6, _excluded2);
          var attrs = filterProps(others, false);
          if (compact2) {
            return /* @__PURE__ */ React.createElement(ChartLayoutContextProvider, {
              state: this.state,
              width: this.props.width,
              height: this.props.height,
              clipPathId: this.clipPathId
            }, /* @__PURE__ */ React.createElement(Surface, _extends({}, attrs, {
              width,
              height,
              title,
              desc
            }), this.renderClipPath(), renderByOrder(children, this.renderMap)));
          }
          if (this.props.accessibilityLayer) {
            var _this$props$tabIndex, _this$props$role;
            attrs.tabIndex = (_this$props$tabIndex = this.props.tabIndex) !== null && _this$props$tabIndex !== void 0 ? _this$props$tabIndex : 0;
            attrs.role = (_this$props$role = this.props.role) !== null && _this$props$role !== void 0 ? _this$props$role : "application";
            attrs.onKeyDown = function(e) {
              _this3.accessibilityManager.keyboardEvent(e);
            };
            attrs.onFocus = function() {
              _this3.accessibilityManager.focus();
            };
          }
          var events = this.parseEventsOfWrapper();
          return /* @__PURE__ */ React.createElement(ChartLayoutContextProvider, {
            state: this.state,
            width: this.props.width,
            height: this.props.height,
            clipPathId: this.clipPathId
          }, /* @__PURE__ */ React.createElement("div", _extends({
            className: clsx("recharts-wrapper", className),
            style: _objectSpread({
              position: "relative",
              cursor: "default",
              width,
              height
            }, style)
          }, events, {
            ref: /* @__PURE__ */ __name(function ref(node) {
              _this3.container = node;
            }, "ref")
          }), /* @__PURE__ */ React.createElement(Surface, _extends({}, attrs, {
            width,
            height,
            title,
            desc,
            style: FULL_WIDTH_AND_HEIGHT
          }), this.renderClipPath(), renderByOrder(children, this.renderMap)), this.renderLegend(), this.renderTooltip()));
        }, "render")
      }]);
    })(reactExports.Component);
    _defineProperty(CategoricalChartWrapper, "displayName", chartName);
    _defineProperty(CategoricalChartWrapper, "defaultProps", _objectSpread({
      layout: "horizontal",
      stackOffset: "none",
      barCategoryGap: "10%",
      barGap: 4,
      margin: {
        top: 5,
        right: 5,
        bottom: 5,
        left: 5
      },
      reverseStackOrder: false,
      syncMethod: "index"
    }, defaultProps2));
    _defineProperty(CategoricalChartWrapper, "getDerivedStateFromProps", function(nextProps, prevState) {
      var dataKey = nextProps.dataKey, data = nextProps.data, children = nextProps.children, width = nextProps.width, height = nextProps.height, layout = nextProps.layout, stackOffset = nextProps.stackOffset, margin = nextProps.margin;
      var dataStartIndex = prevState.dataStartIndex, dataEndIndex = prevState.dataEndIndex;
      if (prevState.updateId === void 0) {
        var defaultState = createDefaultState(nextProps);
        return _objectSpread(_objectSpread(_objectSpread({}, defaultState), {}, {
          updateId: 0
        }, updateStateOfAxisMapsOffsetAndStackGroups(_objectSpread(_objectSpread({
          props: nextProps
        }, defaultState), {}, {
          updateId: 0
        }), prevState)), {}, {
          prevDataKey: dataKey,
          prevData: data,
          prevWidth: width,
          prevHeight: height,
          prevLayout: layout,
          prevStackOffset: stackOffset,
          prevMargin: margin,
          prevChildren: children
        });
      }
      if (dataKey !== prevState.prevDataKey || data !== prevState.prevData || width !== prevState.prevWidth || height !== prevState.prevHeight || layout !== prevState.prevLayout || stackOffset !== prevState.prevStackOffset || !shallowEqual(margin, prevState.prevMargin)) {
        var _defaultState = createDefaultState(nextProps);
        var keepFromPrevState = {
          // (chartX, chartY) are (0,0) in default state, but we want to keep the last mouse position to avoid
          // any flickering
          chartX: prevState.chartX,
          chartY: prevState.chartY,
          // The tooltip should stay active when it was active in the previous render. If this is not
          // the case, the tooltip disappears and immediately re-appears, causing a flickering effect
          isTooltipActive: prevState.isTooltipActive
        };
        var updatesToState = _objectSpread(_objectSpread({}, getTooltipData(prevState, data, layout)), {}, {
          updateId: prevState.updateId + 1
        });
        var newState = _objectSpread(_objectSpread(_objectSpread({}, _defaultState), keepFromPrevState), updatesToState);
        return _objectSpread(_objectSpread(_objectSpread({}, newState), updateStateOfAxisMapsOffsetAndStackGroups(_objectSpread({
          props: nextProps
        }, newState), prevState)), {}, {
          prevDataKey: dataKey,
          prevData: data,
          prevWidth: width,
          prevHeight: height,
          prevLayout: layout,
          prevStackOffset: stackOffset,
          prevMargin: margin,
          prevChildren: children
        });
      }
      if (!isChildrenEqual(children, prevState.prevChildren)) {
        var _brush$props$startInd, _brush$props, _brush$props$endIndex, _brush$props2;
        var brush = findChildByType(children, Brush);
        var startIndex = brush ? (_brush$props$startInd = (_brush$props = brush.props) === null || _brush$props === void 0 ? void 0 : _brush$props.startIndex) !== null && _brush$props$startInd !== void 0 ? _brush$props$startInd : dataStartIndex : dataStartIndex;
        var endIndex = brush ? (_brush$props$endIndex = (_brush$props2 = brush.props) === null || _brush$props2 === void 0 ? void 0 : _brush$props2.endIndex) !== null && _brush$props$endIndex !== void 0 ? _brush$props$endIndex : dataEndIndex : dataEndIndex;
        var hasDifferentStartOrEndIndex = startIndex !== dataStartIndex || endIndex !== dataEndIndex;
        var hasGlobalData = !isNil(data);
        var newUpdateId = hasGlobalData && !hasDifferentStartOrEndIndex ? prevState.updateId : prevState.updateId + 1;
        return _objectSpread(_objectSpread({
          updateId: newUpdateId
        }, updateStateOfAxisMapsOffsetAndStackGroups(_objectSpread(_objectSpread({
          props: nextProps
        }, prevState), {}, {
          updateId: newUpdateId,
          dataStartIndex: startIndex,
          dataEndIndex: endIndex
        }), prevState)), {}, {
          prevChildren: children,
          dataStartIndex: startIndex,
          dataEndIndex: endIndex
        });
      }
      return null;
    });
    _defineProperty(CategoricalChartWrapper, "renderActiveDot", function(option, props, key) {
      var dot;
      if (/* @__PURE__ */ reactExports.isValidElement(option)) {
        dot = /* @__PURE__ */ reactExports.cloneElement(option, props);
      } else if (isFunction$2(option)) {
        dot = option(props);
      } else {
        dot = /* @__PURE__ */ React.createElement(Dot, props);
      }
      return /* @__PURE__ */ React.createElement(Layer, {
        className: "recharts-active-dot",
        key
      }, dot);
    });
    var CategoricalChart = /* @__PURE__ */ reactExports.forwardRef(/* @__PURE__ */ __name(function CategoricalChart2(props, ref) {
      return /* @__PURE__ */ React.createElement(CategoricalChartWrapper, _extends({}, props, {
        ref
      }));
    }, "CategoricalChart2"));
    CategoricalChart.displayName = CategoricalChartWrapper.displayName;
    return CategoricalChart;
  }, "generateCategoricalChart2");
  var PieChart = generateCategoricalChart({
    chartName: "PieChart",
    GraphicalChild: Pie,
    validateTooltipEventTypes: ["item"],
    defaultTooltipEventType: "item",
    legendContent: "children",
    axisComponents: [{
      axisType: "angleAxis",
      AxisComp: PolarAngleAxis
    }, {
      axisType: "radiusAxis",
      AxisComp: PolarRadiusAxis
    }],
    formatAxisMap: formatAxisMap$1,
    defaultProps: {
      layout: "centric",
      startAngle: 0,
      endAngle: 360,
      cx: "50%",
      cy: "50%",
      innerRadius: 0,
      outerRadius: "80%"
    }
  });
  var AreaChart = generateCategoricalChart({
    chartName: "AreaChart",
    GraphicalChild: Area,
    axisComponents: [{
      axisType: "xAxis",
      AxisComp: XAxis
    }, {
      axisType: "yAxis",
      AxisComp: YAxis
    }],
    formatAxisMap
  });
  const THEMES = { light: "", dark: ".dark" };
  const ChartContext = reactExports.createContext(null);
  function useChart() {
    const context = reactExports.useContext(ChartContext);
    if (!context) {
      throw new Error("useChart must be used within a <ChartContainer />");
    }
    return context;
  }
  __name(useChart, "useChart");
  const ChartContainer = reactExports.forwardRef((_nc, ref) => {
    var _oc = _nc, { id, className, children, config: config2 } = _oc, props = __objRest(_oc, ["id", "className", "children", "config"]);
    const uniqueId2 = reactExports.useId();
    const chartId = `chart-${id || uniqueId2.replace(/:/g, "")}`;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(ChartContext.Provider, { value: { config: config2 }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      __spreadProps(__spreadValues({
        "data-chart": chartId,
        ref,
        className: cn$1(
          "cky:flex cky:aspect-video cky:justify-center cky:text-xs cky:[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground cky:[&_.recharts-cartesian-grid_line[stroke=#ccc]]:stroke-border/50 cky:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border cky:[&_.recharts-dot[stroke=#fff]]:stroke-transparent cky:[&_.recharts-layer]:outline-none cky:[&_.recharts-polar-grid_[stroke=#ccc]]:stroke-border cky:[&_.recharts-radial-bar-background-sector]:fill-muted cky:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted cky:[&_.recharts-reference-line_[stroke=#ccc]]:stroke-border cky:[&_.recharts-sector[stroke=#fff]]:stroke-transparent cky:[&_.recharts-sector]:outline-none cky:[&_.recharts-surface]:outline-none",
          className
        )
      }, props), {
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(ChartStyle, { id: chartId, config: config2 }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(ResponsiveContainer, { children })
        ]
      })
    ) });
  });
  ChartContainer.displayName = "Chart";
  const ChartStyle = /* @__PURE__ */ __name(({ id, config: config2 }) => {
    const colorConfig = Object.entries(config2).filter(
      ([, config22]) => config22.theme || config22.color
    );
    if (!colorConfig.length) {
      return null;
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "style",
      {
        dangerouslySetInnerHTML: {
          __html: Object.entries(THEMES).map(
            ([theme, prefix2]) => `
${prefix2} [data-chart=${id}] {
${colorConfig.map(([key, itemConfig]) => {
              var _a2;
              const color2 = ((_a2 = itemConfig.theme) == null ? void 0 : _a2[theme]) || itemConfig.color;
              return color2 ? `  --color-${key}: ${color2};` : null;
            }).join("\n")}
}
`
          ).join("\n")
        }
      }
    );
  }, "ChartStyle");
  const ChartTooltipContent = reactExports.forwardRef(
    ({
      active,
      payload,
      className,
      indicator = "dot",
      hideLabel = false,
      hideIndicator = false,
      label,
      labelFormatter,
      labelClassName,
      formatter,
      color: color2,
      nameKey,
      labelKey
    }, ref) => {
      const { config: config2 } = useChart();
      const tooltipLabel = reactExports.useMemo(() => {
        var _a2;
        if (hideLabel || !(payload == null ? void 0 : payload.length)) {
          return null;
        }
        const [item] = payload;
        const key = `${labelKey || (item == null ? void 0 : item.dataKey) || (item == null ? void 0 : item.name) || "value"}`;
        const itemConfig = getPayloadConfigFromPayload(config2, item, key);
        const value = !labelKey && typeof label === "string" ? ((_a2 = config2[label]) == null ? void 0 : _a2.label) || label : itemConfig == null ? void 0 : itemConfig.label;
        if (labelFormatter) {
          return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn$1("cky:font-medium", labelClassName), children: labelFormatter(value, payload) });
        }
        if (!value) {
          return null;
        }
        return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn$1("cky:font-medium", labelClassName), children: value });
      }, [
        label,
        labelFormatter,
        payload,
        hideLabel,
        labelClassName,
        config2,
        labelKey
      ]);
      if (!active || !(payload == null ? void 0 : payload.length)) {
        return null;
      }
      const nestLabel = payload.length === 1 && indicator !== "dot";
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          ref,
          className: cn$1(
            "cky:grid cky:min-w-[8rem] cky:items-start cky:gap-1.5 cky:rounded-lg cky:border cky:border-border/50 cky:bg-background cky:px-2.5 cky:py-1.5 cky:text-xs cky:shadow-xl",
            className
          ),
          children: [
            !nestLabel ? tooltipLabel : null,
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:grid cky:gap-1.5", children: payload.filter((item) => item.type !== "none").map((item, index2) => {
              const key = `${nameKey || item.name || item.dataKey || "value"}`;
              const itemConfig = getPayloadConfigFromPayload(config2, item, key);
              const indicatorColor = color2 || item.payload.fill || item.color;
              return /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: cn$1(
                    "cky:flex cky:w-full cky:flex-wrap cky:items-stretch cky:gap-2 cky:[&>svg]:h-2.5 cky:[&>svg]:w-2.5 cky:[&>svg]:text-muted-foreground",
                    indicator === "dot" && "cky:items-center"
                  ),
                  children: formatter && (item == null ? void 0 : item.value) !== void 0 && item.name ? formatter(item.value, item.name, item, index2, item.payload) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
                    (itemConfig == null ? void 0 : itemConfig.icon) ? /* @__PURE__ */ jsxRuntimeExports.jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "div",
                      {
                        className: cn$1(
                          "cky:shrink-0 cky:rounded-[2px] cky:border-[--color-border] cky:bg-[--color-bg]",
                          {
                            "h-2.5 w-2.5": indicator === "dot",
                            "w-1": indicator === "line",
                            "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
                            "my-0.5": nestLabel && indicator === "dashed"
                          }
                        ),
                        style: {
                          "--color-bg": indicatorColor,
                          "--color-border": indicatorColor
                        }
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs(
                      "div",
                      {
                        className: cn$1(
                          "cky:flex cky:flex-1 cky:justify-between cky:leading-none",
                          nestLabel ? "cky:items-end" : "cky:items-center"
                        ),
                        children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:grid cky:gap-1.5", children: [
                            nestLabel ? tooltipLabel : null,
                            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-muted-foreground", children: (itemConfig == null ? void 0 : itemConfig.label) || item.name })
                          ] }),
                          item.value && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:font-mono cky:font-medium cky:tabular-nums cky:text-foreground", children: item.value.toLocaleString() })
                        ]
                      }
                    )
                  ] })
                },
                item.dataKey
              );
            }) })
          ]
        }
      );
    }
  );
  ChartTooltipContent.displayName = "ChartTooltip";
  const ChartLegendContent = reactExports.forwardRef(
    ({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }, ref) => {
      const { config: config2 } = useChart();
      if (!(payload == null ? void 0 : payload.length)) {
        return null;
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          ref,
          className: cn$1(
            "cky:flex cky:items-center cky:justify-center cky:gap-4",
            verticalAlign === "top" ? "cky:pb-3" : "cky:pt-3",
            className
          ),
          children: payload.filter((item) => item.type !== "none").map((item) => {
            const key = `${nameKey || item.dataKey || "value"}`;
            const itemConfig = getPayloadConfigFromPayload(config2, item, key);
            return /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "div",
              {
                className: cn$1(
                  "cky:flex cky:items-center cky:gap-1.5 cky:[&>svg]:h-3 cky:[&>svg]:w-3 cky:[&>svg]:text-muted-foreground"
                ),
                children: [
                  (itemConfig == null ? void 0 : itemConfig.icon) && !hideIcon ? /* @__PURE__ */ jsxRuntimeExports.jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "div",
                    {
                      className: "cky:h-2 cky:w-2 cky:shrink-0 cky:rounded-[2px]",
                      style: {
                        backgroundColor: item.color
                      }
                    }
                  ),
                  itemConfig == null ? void 0 : itemConfig.label
                ]
              },
              item.value
            );
          })
        }
      );
    }
  );
  ChartLegendContent.displayName = "ChartLegend";
  function getPayloadConfigFromPayload(config2, payload, key) {
    if (typeof payload !== "object" || payload === null) {
      return void 0;
    }
    const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
    let configLabelKey = key;
    if (key in payload && typeof payload[key] === "string") {
      configLabelKey = payload[key];
    } else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
      configLabelKey = payloadPayload[key];
    }
    return configLabelKey in config2 ? config2[configLabelKey] : config2[key];
  }
  __name(getPayloadConfigFromPayload, "getPayloadConfigFromPayload");
  var U = 1, Y$1 = 0.9, H = 0.8, J = 0.17, p = 0.1, u = 0.999, $ = 0.9999;
  var k$1 = 0.99, m = /[\\\/_+.#"@\[\(\{&]/, B$1 = /[\\\/_+.#"@\[\(\{&]/g, K$1 = /[\s-]/, X = /[\s-]/g;
  function G(_, C, h, P2, A, f, O) {
    if (f === C.length) return A === _.length ? U : k$1;
    var T2 = `${A},${f}`;
    if (O[T2] !== void 0) return O[T2];
    for (var L2 = P2.charAt(f), c2 = h.indexOf(L2, A), S = 0, E, N2, R, M2; c2 >= 0; ) E = G(_, C, h, P2, c2 + 1, f + 1, O), E > S && (c2 === A ? E *= U : m.test(_.charAt(c2 - 1)) ? (E *= H, R = _.slice(A, c2 - 1).match(B$1), R && A > 0 && (E *= Math.pow(u, R.length))) : K$1.test(_.charAt(c2 - 1)) ? (E *= Y$1, M2 = _.slice(A, c2 - 1).match(X), M2 && A > 0 && (E *= Math.pow(u, M2.length))) : (E *= J, A > 0 && (E *= Math.pow(u, c2 - A))), _.charAt(c2) !== C.charAt(f) && (E *= $)), (E < p && h.charAt(c2 - 1) === P2.charAt(f + 1) || P2.charAt(f + 1) === P2.charAt(f) && h.charAt(c2 - 1) !== P2.charAt(f)) && (N2 = G(_, C, h, P2, c2 + 1, f + 2, O), N2 * p > E && (E = N2 * p)), E > S && (S = E), c2 = h.indexOf(L2, c2 + 1);
    return O[T2] = S, S;
  }
  __name(G, "G");
  function D(_) {
    return _.toLowerCase().replace(X, " ");
  }
  __name(D, "D");
  function W(_, C, h) {
    return _ = h && h.length > 0 ? `${_ + " " + h.join(" ")}` : _, G(_, C, D(_), D(C), 0, 0, {});
  }
  __name(W, "W");
  var N = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', be = '[cmdk-group-heading=""]', le = '[cmdk-item=""]', ce = `${le}:not([aria-disabled="true"])`, Z = "cmdk-item-select", T = "data-value", Re = /* @__PURE__ */ __name((r2, o2, n2) => W(r2, o2, n2), "Re"), ue = reactExports.createContext(void 0), K = /* @__PURE__ */ __name(() => reactExports.useContext(ue), "K"), de = reactExports.createContext(void 0), ee = /* @__PURE__ */ __name(() => reactExports.useContext(de), "ee"), fe = reactExports.createContext(void 0), me = reactExports.forwardRef((r2, o2) => {
    let n2 = L(() => {
      var e, a2;
      return { search: "", value: (a2 = (e = r2.value) != null ? e : r2.defaultValue) != null ? a2 : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
    }), u2 = L(() => /* @__PURE__ */ new Set()), c2 = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p2 = pe(r2), _a2 = r2, { label: b, children: m2, value: R, onValueChange: x2, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = false, vimBindings: j = true } = _a2, O = __objRest(_a2, ["label", "children", "value", "onValueChange", "filter", "shouldFilter", "loop", "disablePointerSelection", "vimBindings"]), $2 = useId(), q = useId(), _ = useId(), I = reactExports.useRef(null), v = ke();
    k(() => {
      if (R !== void 0) {
        let e = R.trim();
        n2.current.value = e, E.emit();
      }
    }, [R]), k(() => {
      v(6, ne);
    }, []);
    let E = reactExports.useMemo(() => ({ subscribe: /* @__PURE__ */ __name((e) => (f.current.add(e), () => f.current.delete(e)), "subscribe"), snapshot: /* @__PURE__ */ __name(() => n2.current, "snapshot"), setState: /* @__PURE__ */ __name((e, a2, s2) => {
      var i2, l, g, y2;
      if (!Object.is(n2.current[e], a2)) {
        if (n2.current[e] = a2, e === "search") J2(), z(), v(1, W2);
        else if (e === "value") {
          if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
            let h = document.getElementById(_);
            h ? h.focus() : (i2 = document.getElementById($2)) == null || i2.focus();
          }
          if (v(7, () => {
            var h;
            n2.current.selectedItemId = (h = M2()) == null ? void 0 : h.id, E.emit();
          }), s2 || v(5, ne), ((l = p2.current) == null ? void 0 : l.value) !== void 0) {
            let h = a2 != null ? a2 : "";
            (y2 = (g = p2.current).onValueChange) == null || y2.call(g, h);
            return;
          }
        }
        E.emit();
      }
    }, "setState"), emit: /* @__PURE__ */ __name(() => {
      f.current.forEach((e) => e());
    }, "emit") }), []), U2 = reactExports.useMemo(() => ({ value: /* @__PURE__ */ __name((e, a2, s2) => {
      var i2;
      a2 !== ((i2 = d.current.get(e)) == null ? void 0 : i2.value) && (d.current.set(e, { value: a2, keywords: s2 }), n2.current.filtered.items.set(e, te(a2, s2)), v(2, () => {
        z(), E.emit();
      }));
    }, "value"), item: /* @__PURE__ */ __name((e, a2) => (u2.current.add(e), a2 && (c2.current.has(a2) ? c2.current.get(a2).add(e) : c2.current.set(a2, /* @__PURE__ */ new Set([e]))), v(3, () => {
      J2(), z(), n2.current.value || W2(), E.emit();
    }), () => {
      d.current.delete(e), u2.current.delete(e), n2.current.filtered.items.delete(e);
      let s2 = M2();
      v(4, () => {
        J2(), (s2 == null ? void 0 : s2.getAttribute("id")) === e && W2(), E.emit();
      });
    }), "item"), group: /* @__PURE__ */ __name((e) => (c2.current.has(e) || c2.current.set(e, /* @__PURE__ */ new Set()), () => {
      d.current.delete(e), c2.current.delete(e);
    }), "group"), filter: /* @__PURE__ */ __name(() => p2.current.shouldFilter, "filter"), label: b || r2["aria-label"], getDisablePointerSelection: /* @__PURE__ */ __name(() => p2.current.disablePointerSelection, "getDisablePointerSelection"), listId: $2, inputId: _, labelId: q, listInnerRef: I }), []);
    function te(e, a2) {
      var i2, l;
      let s2 = (l = (i2 = p2.current) == null ? void 0 : i2.filter) != null ? l : Re;
      return e ? s2(e, n2.current.search, a2) : 0;
    }
    __name(te, "te");
    function z() {
      if (!n2.current.search || p2.current.shouldFilter === false) return;
      let e = n2.current.filtered.items, a2 = [];
      n2.current.filtered.groups.forEach((i2) => {
        let l = c2.current.get(i2), g = 0;
        l.forEach((y2) => {
          let h = e.get(y2);
          g = Math.max(h, g);
        }), a2.push([i2, g]);
      });
      let s2 = I.current;
      V().sort((i2, l) => {
        var h, F;
        let g = i2.getAttribute("id"), y2 = l.getAttribute("id");
        return ((h = e.get(y2)) != null ? h : 0) - ((F = e.get(g)) != null ? F : 0);
      }).forEach((i2) => {
        let l = i2.closest(Y);
        l ? l.appendChild(i2.parentElement === l ? i2 : i2.closest(`${Y} > *`)) : s2.appendChild(i2.parentElement === s2 ? i2 : i2.closest(`${Y} > *`));
      }), a2.sort((i2, l) => l[1] - i2[1]).forEach((i2) => {
        var g;
        let l = (g = I.current) == null ? void 0 : g.querySelector(`${N}[${T}="${encodeURIComponent(i2[0])}"]`);
        l == null || l.parentElement.appendChild(l);
      });
    }
    __name(z, "z");
    function W2() {
      let e = V().find((s2) => s2.getAttribute("aria-disabled") !== "true"), a2 = e == null ? void 0 : e.getAttribute(T);
      E.setState("value", a2 || void 0);
    }
    __name(W2, "W");
    function J2() {
      var a2, s2, i2, l;
      if (!n2.current.search || p2.current.shouldFilter === false) {
        n2.current.filtered.count = u2.current.size;
        return;
      }
      n2.current.filtered.groups = /* @__PURE__ */ new Set();
      let e = 0;
      for (let g of u2.current) {
        let y2 = (s2 = (a2 = d.current.get(g)) == null ? void 0 : a2.value) != null ? s2 : "", h = (l = (i2 = d.current.get(g)) == null ? void 0 : i2.keywords) != null ? l : [], F = te(y2, h);
        n2.current.filtered.items.set(g, F), F > 0 && e++;
      }
      for (let [g, y2] of c2.current) for (let h of y2) if (n2.current.filtered.items.get(h) > 0) {
        n2.current.filtered.groups.add(g);
        break;
      }
      n2.current.filtered.count = e;
    }
    __name(J2, "J");
    function ne() {
      var a2, s2, i2;
      let e = M2();
      e && (((a2 = e.parentElement) == null ? void 0 : a2.firstChild) === e && ((i2 = (s2 = e.closest(N)) == null ? void 0 : s2.querySelector(be)) == null || i2.scrollIntoView({ block: "nearest" })), e.scrollIntoView({ block: "nearest" }));
    }
    __name(ne, "ne");
    function M2() {
      var e;
      return (e = I.current) == null ? void 0 : e.querySelector(`${le}[aria-selected="true"]`);
    }
    __name(M2, "M");
    function V() {
      var e;
      return Array.from(((e = I.current) == null ? void 0 : e.querySelectorAll(ce)) || []);
    }
    __name(V, "V");
    function X2(e) {
      let s2 = V()[e];
      s2 && E.setState("value", s2.getAttribute(T));
    }
    __name(X2, "X");
    function Q(e) {
      var g;
      let a2 = M2(), s2 = V(), i2 = s2.findIndex((y2) => y2 === a2), l = s2[i2 + e];
      (g = p2.current) != null && g.loop && (l = i2 + e < 0 ? s2[s2.length - 1] : i2 + e === s2.length ? s2[0] : s2[i2 + e]), l && E.setState("value", l.getAttribute(T));
    }
    __name(Q, "Q");
    function re2(e) {
      let a2 = M2(), s2 = a2 == null ? void 0 : a2.closest(N), i2;
      for (; s2 && !i2; ) s2 = e > 0 ? we(s2, N) : De(s2, N), i2 = s2 == null ? void 0 : s2.querySelector(ce);
      i2 ? E.setState("value", i2.getAttribute(T)) : Q(e);
    }
    __name(re2, "re");
    let oe = /* @__PURE__ */ __name(() => X2(V().length - 1), "oe"), ie = /* @__PURE__ */ __name((e) => {
      e.preventDefault(), e.metaKey ? oe() : e.altKey ? re2(1) : Q(1);
    }, "ie"), se = /* @__PURE__ */ __name((e) => {
      e.preventDefault(), e.metaKey ? X2(0) : e.altKey ? re2(-1) : Q(-1);
    }, "se");
    return reactExports.createElement(Primitive$1.div, __spreadProps(__spreadValues({ ref: o2, tabIndex: -1 }, O), { "cmdk-root": "", onKeyDown: /* @__PURE__ */ __name((e) => {
      var s2;
      (s2 = O.onKeyDown) == null || s2.call(O, e);
      let a2 = e.nativeEvent.isComposing || e.keyCode === 229;
      if (!(e.defaultPrevented || a2)) switch (e.key) {
        case "n":
        case "j": {
          j && e.ctrlKey && ie(e);
          break;
        }
        case "ArrowDown": {
          ie(e);
          break;
        }
        case "p":
        case "k": {
          j && e.ctrlKey && se(e);
          break;
        }
        case "ArrowUp": {
          se(e);
          break;
        }
        case "Home": {
          e.preventDefault(), X2(0);
          break;
        }
        case "End": {
          e.preventDefault(), oe();
          break;
        }
        case "Enter": {
          e.preventDefault();
          let i2 = M2();
          if (i2) {
            let l = new Event(Z);
            i2.dispatchEvent(l);
          }
        }
      }
    }, "onKeyDown") }), reactExports.createElement("label", { "cmdk-label": "", htmlFor: U2.inputId, id: U2.labelId, style: Te }, b), B(r2, (e) => reactExports.createElement(de.Provider, { value: E }, reactExports.createElement(ue.Provider, { value: U2 }, e))));
  }), he = reactExports.forwardRef((r2, o2) => {
    var _, I;
    let n2 = useId(), u2 = reactExports.useRef(null), c2 = reactExports.useContext(fe), d = K(), f = pe(r2), p2 = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c2 == null ? void 0 : c2.forceMount;
    k(() => {
      if (!p2) return d.item(n2, c2 == null ? void 0 : c2.id);
    }, [p2]);
    let b = ve(n2, u2, [r2.value, r2.children, u2], r2.keywords), m2 = ee(), R = P((v) => v.value && v.value === b.current), x2 = P((v) => p2 || d.filter() === false ? true : v.search ? v.filtered.items.get(n2) > 0 : true);
    reactExports.useEffect(() => {
      let v = u2.current;
      if (!(!v || r2.disabled)) return v.addEventListener(Z, C), () => v.removeEventListener(Z, C);
    }, [x2, r2.onSelect, r2.disabled]);
    function C() {
      var v, E;
      S(), (E = (v = f.current).onSelect) == null || E.call(v, b.current);
    }
    __name(C, "C");
    function S() {
      m2.setState("value", b.current, true);
    }
    __name(S, "S");
    if (!x2) return null;
    let _a2 = r2, { disabled: A, value: ge, onSelect: j, forceMount: O, keywords: $2 } = _a2, q = __objRest(_a2, ["disabled", "value", "onSelect", "forceMount", "keywords"]);
    return reactExports.createElement(Primitive$1.div, __spreadProps(__spreadValues({ ref: composeRefs(u2, o2) }, q), { id: n2, "cmdk-item": "", role: "option", "aria-disabled": !!A, "aria-selected": !!R, "data-disabled": !!A, "data-selected": !!R, onPointerMove: A || d.getDisablePointerSelection() ? void 0 : S, onClick: A ? void 0 : C }), r2.children);
  }), Ee = reactExports.forwardRef((r2, o2) => {
    let _a2 = r2, { heading: n2, children: u2, forceMount: c2 } = _a2, d = __objRest(_a2, ["heading", "children", "forceMount"]), f = useId(), p2 = reactExports.useRef(null), b = reactExports.useRef(null), m2 = useId(), R = K(), x2 = P((S) => c2 || R.filter() === false ? true : S.search ? S.filtered.groups.has(f) : true);
    k(() => R.group(f), []), ve(f, p2, [r2.value, r2.heading, b]);
    let C = reactExports.useMemo(() => ({ id: f, forceMount: c2 }), [c2]);
    return reactExports.createElement(Primitive$1.div, __spreadProps(__spreadValues({ ref: composeRefs(p2, o2) }, d), { "cmdk-group": "", role: "presentation", hidden: x2 ? void 0 : true }), n2 && reactExports.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n2), B(r2, (S) => reactExports.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n2 ? m2 : void 0 }, reactExports.createElement(fe.Provider, { value: C }, S))));
  }), ye = reactExports.forwardRef((r2, o2) => {
    let _a2 = r2, { alwaysRender: n2 } = _a2, u2 = __objRest(_a2, ["alwaysRender"]), c2 = reactExports.useRef(null), d = P((f) => !f.search);
    return !n2 && !d ? null : reactExports.createElement(Primitive$1.div, __spreadProps(__spreadValues({ ref: composeRefs(c2, o2) }, u2), { "cmdk-separator": "", role: "separator" }));
  }), Se = reactExports.forwardRef((r2, o2) => {
    let _a2 = r2, { onValueChange: n2 } = _a2, u2 = __objRest(_a2, ["onValueChange"]), c2 = r2.value != null, d = ee(), f = P((m2) => m2.search), p2 = P((m2) => m2.selectedItemId), b = K();
    return reactExports.useEffect(() => {
      r2.value != null && d.setState("search", r2.value);
    }, [r2.value]), reactExports.createElement(Primitive$1.input, __spreadProps(__spreadValues({ ref: o2 }, u2), { "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: false, "aria-autocomplete": "list", role: "combobox", "aria-expanded": true, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": p2, id: b.inputId, type: "text", value: c2 ? r2.value : f, onChange: /* @__PURE__ */ __name((m2) => {
      c2 || d.setState("search", m2.target.value), n2 == null || n2(m2.target.value);
    }, "onChange") }));
  }), Ce = reactExports.forwardRef((r2, o2) => {
    let _a2 = r2, { children: n2, label: u2 = "Suggestions" } = _a2, c2 = __objRest(_a2, ["children", "label"]), d = reactExports.useRef(null), f = reactExports.useRef(null), p2 = P((m2) => m2.selectedItemId), b = K();
    return reactExports.useEffect(() => {
      if (f.current && d.current) {
        let m2 = f.current, R = d.current, x2, C = new ResizeObserver(() => {
          x2 = requestAnimationFrame(() => {
            let S = m2.offsetHeight;
            R.style.setProperty("--cmdk-list-height", S.toFixed(1) + "px");
          });
        });
        return C.observe(m2), () => {
          cancelAnimationFrame(x2), C.unobserve(m2);
        };
      }
    }, []), reactExports.createElement(Primitive$1.div, __spreadProps(__spreadValues({ ref: composeRefs(d, o2) }, c2), { "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }), B(r2, (m2) => reactExports.createElement("div", { ref: composeRefs(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
  }), xe = reactExports.forwardRef((r2, o2) => {
    let _a2 = r2, { open: n2, onOpenChange: u2, overlayClassName: c2, contentClassName: d, container: f } = _a2, p2 = __objRest(_a2, ["open", "onOpenChange", "overlayClassName", "contentClassName", "container"]);
    return reactExports.createElement(Root$3, { open: n2, onOpenChange: u2 }, reactExports.createElement(Portal$1, { container: f }, reactExports.createElement(Overlay, { "cmdk-overlay": "", className: c2 }), reactExports.createElement(Content$1, { "aria-label": r2.label, "cmdk-dialog": "", className: d }, reactExports.createElement(me, __spreadValues({ ref: o2 }, p2)))));
  }), Ie = reactExports.forwardRef((r2, o2) => P((u2) => u2.filtered.count === 0) ? reactExports.createElement(Primitive$1.div, __spreadProps(__spreadValues({ ref: o2 }, r2), { "cmdk-empty": "", role: "presentation" })) : null), Pe = reactExports.forwardRef((r2, o2) => {
    let _a2 = r2, { progress: n2, children: u2, label: c2 = "Loading..." } = _a2, d = __objRest(_a2, ["progress", "children", "label"]);
    return reactExports.createElement(Primitive$1.div, __spreadProps(__spreadValues({ ref: o2 }, d), { "cmdk-loading": "", role: "progressbar", "aria-valuenow": n2, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c2 }), B(r2, (f) => reactExports.createElement("div", { "aria-hidden": true }, f)));
  }), _e = Object.assign(me, { List: Ce, Item: he, Input: Se, Group: Ee, Separator: ye, Dialog: xe, Empty: Ie, Loading: Pe });
  function we(r2, o2) {
    let n2 = r2.nextElementSibling;
    for (; n2; ) {
      if (n2.matches(o2)) return n2;
      n2 = n2.nextElementSibling;
    }
  }
  __name(we, "we");
  function De(r2, o2) {
    let n2 = r2.previousElementSibling;
    for (; n2; ) {
      if (n2.matches(o2)) return n2;
      n2 = n2.previousElementSibling;
    }
  }
  __name(De, "De");
  function pe(r2) {
    let o2 = reactExports.useRef(r2);
    return k(() => {
      o2.current = r2;
    }), o2;
  }
  __name(pe, "pe");
  var k = typeof window == "undefined" ? reactExports.useEffect : reactExports.useLayoutEffect;
  function L(r2) {
    let o2 = reactExports.useRef();
    return o2.current === void 0 && (o2.current = r2()), o2;
  }
  __name(L, "L");
  function P(r2) {
    let o2 = ee(), n2 = /* @__PURE__ */ __name(() => r2(o2.snapshot()), "n");
    return reactExports.useSyncExternalStore(o2.subscribe, n2, n2);
  }
  __name(P, "P");
  function ve(r2, o2, n2, u2 = []) {
    let c2 = reactExports.useRef(), d = K();
    return k(() => {
      var b;
      let f = (() => {
        var m2;
        for (let R of n2) {
          if (typeof R == "string") return R.trim();
          if (typeof R == "object" && "current" in R) return R.current ? (m2 = R.current.textContent) == null ? void 0 : m2.trim() : c2.current;
        }
      })(), p2 = u2.map((m2) => m2.trim());
      d.value(r2, f, p2), (b = o2.current) == null || b.setAttribute(T, f), c2.current = f;
    }), c2;
  }
  __name(ve, "ve");
  var ke = /* @__PURE__ */ __name(() => {
    let [r2, o2] = reactExports.useState(), n2 = L(() => /* @__PURE__ */ new Map());
    return k(() => {
      n2.current.forEach((u2) => u2()), n2.current = /* @__PURE__ */ new Map();
    }, [r2]), (u2, c2) => {
      n2.current.set(u2, c2), o2({});
    };
  }, "ke");
  function Me(r2) {
    let o2 = r2.type;
    return typeof o2 == "function" ? o2(r2.props) : "render" in o2 ? o2.render(r2.props) : r2;
  }
  __name(Me, "Me");
  function B({ asChild: r2, children: o2 }, n2) {
    return r2 && reactExports.isValidElement(o2) ? reactExports.cloneElement(Me(o2), { ref: o2.ref }, n2(o2.props.children)) : n2(o2);
  }
  __name(B, "B");
  var Te = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
  const Command = reactExports.forwardRef((_pc, ref) => {
    var _qc = _pc, { className } = _qc, props = __objRest(_qc, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      _e,
      __spreadValues({
        ref,
        className: cn$1(
          "cky:flex cky:h-full cky:w-full cky:flex-col cky:overflow-hidden cky:rounded-md cky:bg-popover cky:text-popover-foreground",
          className
        )
      }, props)
    );
  });
  Command.displayName = _e.displayName;
  const CommandInput = reactExports.forwardRef((_rc, ref) => {
    var _sc = _rc, { className } = _sc, props = __objRest(_sc, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:border-b cky:px-3", "cmdk-input-wrapper": "", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Search, { className: "cky:mr-2 cky:h-4 cky:w-4 cky:shrink-0 cky:opacity-50" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        _e.Input,
        __spreadValues({
          ref,
          className: cn$1(
            "cky:flex cky:h-11 cky:w-full cky:rounded-md cky:bg-transparent cky:py-3 cky:text-sm cky:outline-none cky:placeholder:text-muted-foreground cky:disabled:cursor-not-allowed cky:disabled:opacity-50",
            className
          )
        }, props)
      )
    ] });
  });
  CommandInput.displayName = _e.Input.displayName;
  const CommandList = reactExports.forwardRef((_tc, ref) => {
    var _uc = _tc, { className } = _uc, props = __objRest(_uc, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      _e.List,
      __spreadValues({
        ref,
        className: cn$1("cky:max-h-[300px] cky:overflow-y-auto cky:overflow-x-hidden", className)
      }, props)
    );
  });
  CommandList.displayName = _e.List.displayName;
  const CommandEmpty = reactExports.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
    _e.Empty,
    __spreadValues({
      ref,
      className: "cky:py-6 cky:text-center cky:text-sm"
    }, props)
  ));
  CommandEmpty.displayName = _e.Empty.displayName;
  const CommandGroup = reactExports.forwardRef((_vc, ref) => {
    var _wc = _vc, { className } = _wc, props = __objRest(_wc, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      _e.Group,
      __spreadValues({
        ref,
        className: cn$1(
          "cky:overflow-hidden cky:p-1 cky:text-foreground cky:[&_[cmdk-group-heading]]:px-2 cky:[&_[cmdk-group-heading]]:py-1.5 cky:[&_[cmdk-group-heading]]:text-xs cky:[&_[cmdk-group-heading]]:font-medium cky:[&_[cmdk-group-heading]]:text-muted-foreground",
          className
        )
      }, props)
    );
  });
  CommandGroup.displayName = _e.Group.displayName;
  const CommandSeparator = reactExports.forwardRef((_xc, ref) => {
    var _yc = _xc, { className } = _yc, props = __objRest(_yc, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      _e.Separator,
      __spreadValues({
        ref,
        className: cn$1("cky:-mx-1 cky:h-px cky:bg-border", className)
      }, props)
    );
  });
  CommandSeparator.displayName = _e.Separator.displayName;
  const CommandItem = reactExports.forwardRef((_zc, ref) => {
    var _Ac = _zc, { className } = _Ac, props = __objRest(_Ac, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      _e.Item,
      __spreadValues({
        ref,
        className: cn$1(
          "cky:relative cky:flex cky:cursor-default cky:gap-2 cky:select-none cky:items-center cky:rounded-sm cky:px-2 cky:py-1.5 cky:text-sm cky:outline-none cky:data-[disabled=true]:pointer-events-none cky:data-[selected=true]:bg-accent cky:data-[selected=true]:text-accent-foreground cky:data-[disabled=true]:opacity-50 cky:[&_svg]:pointer-events-none cky:[&_svg]:size-4 cky:[&_svg]:shrink-0",
          className
        )
      }, props)
    );
  });
  CommandItem.displayName = _e.Item.displayName;
  var M = /* @__PURE__ */ __name((e, i2, s2, u2, m2, a2, l, h) => {
    let d = document.documentElement, w = ["light", "dark"];
    function p2(n2) {
      (Array.isArray(e) ? e : [e]).forEach((y2) => {
        let k2 = y2 === "class", S = k2 && a2 ? m2.map((f) => a2[f] || f) : m2;
        k2 ? (d.classList.remove(...S), d.classList.add(a2 && a2[n2] ? a2[n2] : n2)) : d.setAttribute(y2, n2);
      }), R(n2);
    }
    __name(p2, "p");
    function R(n2) {
      h && w.includes(n2) && (d.style.colorScheme = n2);
    }
    __name(R, "R");
    function c2() {
      return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
    }
    __name(c2, "c");
    if (u2) p2(u2);
    else try {
      let n2 = localStorage.getItem(i2) || s2, y2 = l && n2 === "system" ? c2() : n2;
      p2(y2);
    } catch (n2) {
    }
  }, "M");
  reactExports.createContext(void 0);
  reactExports.memo(({ forcedTheme: e, storageKey: i2, attribute: s2, enableSystem: u2, enableColorScheme: m2, defaultTheme: a2, value: l, themes: h, nonce: d, scriptProps: w }) => {
    let p2 = JSON.stringify([s2, i2, a2, e, h, l, u2, m2]).slice(1, -1);
    return reactExports.createElement("script", __spreadProps(__spreadValues({}, w), { suppressHydrationWarning: true, nonce: typeof window == "undefined" ? d : "", dangerouslySetInnerHTML: { __html: `(${M.toString()})(${p2})` } }));
  });
  var RADIO_NAME = "Radio";
  var [createRadioContext, createRadioScope] = createContextScope(RADIO_NAME);
  var [RadioProvider, useRadioContext] = createRadioContext(RADIO_NAME);
  var Radio = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, {
        __scopeRadio,
        name,
        checked = false,
        required,
        disabled,
        value = "on",
        onCheck,
        form
      } = _a2, radioProps = __objRest(_a2, [
        "__scopeRadio",
        "name",
        "checked",
        "required",
        "disabled",
        "value",
        "onCheck",
        "form"
      ]);
      const [button, setButton] = reactExports.useState(null);
      const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
      const hasConsumerStoppedPropagationRef = reactExports.useRef(false);
      const isFormControl = button ? form || !!button.closest("form") : true;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(RadioProvider, { scope: __scopeRadio, checked, disabled, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Primitive$1.button,
          __spreadProps(__spreadValues({
            type: "button",
            role: "radio",
            "aria-checked": checked,
            "data-state": getState(checked),
            "data-disabled": disabled ? "" : void 0,
            disabled,
            value
          }, radioProps), {
            ref: composedRefs,
            onClick: composeEventHandlers(props.onClick, (event) => {
              if (!checked) onCheck == null ? void 0 : onCheck();
              if (isFormControl) {
                hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
                if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
              }
            })
          })
        ),
        isFormControl && /* @__PURE__ */ jsxRuntimeExports.jsx(
          RadioBubbleInput,
          {
            control: button,
            bubbles: !hasConsumerStoppedPropagationRef.current,
            name,
            value,
            checked,
            required,
            disabled,
            form,
            style: { transform: "translateX(-100%)" }
          }
        )
      ] });
    }
  );
  Radio.displayName = RADIO_NAME;
  var INDICATOR_NAME = "RadioIndicator";
  var RadioIndicator = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeRadio, forceMount } = _a2, indicatorProps = __objRest(_a2, ["__scopeRadio", "forceMount"]);
      const context = useRadioContext(INDICATOR_NAME, __scopeRadio);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.checked, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.span,
        __spreadProps(__spreadValues({
          "data-state": getState(context.checked),
          "data-disabled": context.disabled ? "" : void 0
        }, indicatorProps), {
          ref: forwardedRef
        })
      ) });
    }
  );
  RadioIndicator.displayName = INDICATOR_NAME;
  var BUBBLE_INPUT_NAME = "RadioBubbleInput";
  var RadioBubbleInput = reactExports.forwardRef(
    (_Bc, forwardedRef) => {
      var _Cc = _Bc, {
        __scopeRadio,
        control,
        checked,
        bubbles = true
      } = _Cc, props = __objRest(_Cc, [
        "__scopeRadio",
        "control",
        "checked",
        "bubbles"
      ]);
      const ref = reactExports.useRef(null);
      const composedRefs = useComposedRefs(ref, forwardedRef);
      const prevChecked = usePrevious(checked);
      const controlSize = useSize(control);
      reactExports.useEffect(() => {
        const input = ref.current;
        if (!input) return;
        const inputProto = window.HTMLInputElement.prototype;
        const descriptor = Object.getOwnPropertyDescriptor(
          inputProto,
          "checked"
        );
        const setChecked = descriptor.set;
        if (prevChecked !== checked && setChecked) {
          const event = new Event("click", { bubbles });
          setChecked.call(input, checked);
          input.dispatchEvent(event);
        }
      }, [prevChecked, checked, bubbles]);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Primitive$1.input,
        __spreadProps(__spreadValues({
          type: "radio",
          "aria-hidden": true,
          defaultChecked: checked
        }, props), {
          tabIndex: -1,
          ref: composedRefs,
          style: __spreadProps(__spreadValues(__spreadValues({}, props.style), controlSize), {
            position: "absolute",
            pointerEvents: "none",
            opacity: 0,
            margin: 0
          })
        })
      );
    }
  );
  RadioBubbleInput.displayName = BUBBLE_INPUT_NAME;
  function getState(checked) {
    return checked ? "checked" : "unchecked";
  }
  __name(getState, "getState");
  var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
  var RADIO_GROUP_NAME = "RadioGroup";
  var [createRadioGroupContext, createRadioGroupScope] = createContextScope(RADIO_GROUP_NAME, [
    createRovingFocusGroupScope,
    createRadioScope
  ]);
  var useRovingFocusGroupScope = createRovingFocusGroupScope();
  var useRadioScope = createRadioScope();
  var [RadioGroupProvider, useRadioGroupContext] = createRadioGroupContext(RADIO_GROUP_NAME);
  var RadioGroup$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, {
        __scopeRadioGroup,
        name,
        defaultValue,
        value: valueProp,
        required = false,
        disabled = false,
        orientation,
        dir,
        loop = true,
        onValueChange
      } = _a2, groupProps = __objRest(_a2, [
        "__scopeRadioGroup",
        "name",
        "defaultValue",
        "value",
        "required",
        "disabled",
        "orientation",
        "dir",
        "loop",
        "onValueChange"
      ]);
      const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
      const direction = useDirection(dir);
      const [value, setValue] = useControllableState({
        prop: valueProp,
        defaultProp: defaultValue != null ? defaultValue : null,
        onChange: onValueChange,
        caller: RADIO_GROUP_NAME
      });
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        RadioGroupProvider,
        {
          scope: __scopeRadioGroup,
          name,
          required,
          disabled,
          value,
          onValueChange: setValue,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Root$5,
            __spreadProps(__spreadValues({
              asChild: true
            }, rovingFocusGroupScope), {
              orientation,
              dir: direction,
              loop,
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                Primitive$1.div,
                __spreadProps(__spreadValues({
                  role: "radiogroup",
                  "aria-required": required,
                  "aria-orientation": orientation,
                  "data-disabled": disabled ? "" : void 0,
                  dir: direction
                }, groupProps), {
                  ref: forwardedRef
                })
              )
            })
          )
        }
      );
    }
  );
  RadioGroup$1.displayName = RADIO_GROUP_NAME;
  var ITEM_NAME = "RadioGroupItem";
  var RadioGroupItem$1 = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeRadioGroup, disabled } = _a2, itemProps = __objRest(_a2, ["__scopeRadioGroup", "disabled"]);
      const context = useRadioGroupContext(ITEM_NAME, __scopeRadioGroup);
      const isDisabled = context.disabled || disabled;
      const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
      const radioScope = useRadioScope(__scopeRadioGroup);
      const ref = reactExports.useRef(null);
      const composedRefs = useComposedRefs(forwardedRef, ref);
      const checked = context.value === itemProps.value;
      const isArrowKeyPressedRef = reactExports.useRef(false);
      reactExports.useEffect(() => {
        const handleKeyDown = /* @__PURE__ */ __name((event) => {
          if (ARROW_KEYS.includes(event.key)) {
            isArrowKeyPressedRef.current = true;
          }
        }, "handleKeyDown");
        const handleKeyUp = /* @__PURE__ */ __name(() => isArrowKeyPressedRef.current = false, "handleKeyUp");
        document.addEventListener("keydown", handleKeyDown);
        document.addEventListener("keyup", handleKeyUp);
        return () => {
          document.removeEventListener("keydown", handleKeyDown);
          document.removeEventListener("keyup", handleKeyUp);
        };
      }, []);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        Item$2,
        __spreadProps(__spreadValues({
          asChild: true
        }, rovingFocusGroupScope), {
          focusable: !isDisabled,
          active: checked,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Radio,
            __spreadProps(__spreadValues(__spreadValues({
              disabled: isDisabled,
              required: context.required,
              checked
            }, radioScope), itemProps), {
              name: context.name,
              ref: composedRefs,
              onCheck: /* @__PURE__ */ __name(() => context.onValueChange(itemProps.value), "onCheck"),
              onKeyDown: composeEventHandlers((event) => {
                if (event.key === "Enter") event.preventDefault();
              }),
              onFocus: composeEventHandlers(itemProps.onFocus, () => {
                var _a3;
                if (isArrowKeyPressedRef.current) (_a3 = ref.current) == null ? void 0 : _a3.click();
              })
            })
          )
        })
      );
    }
  );
  RadioGroupItem$1.displayName = ITEM_NAME;
  var INDICATOR_NAME2 = "RadioGroupIndicator";
  var RadioGroupIndicator = reactExports.forwardRef(
    (props, forwardedRef) => {
      const _a2 = props, { __scopeRadioGroup } = _a2, indicatorProps = __objRest(_a2, ["__scopeRadioGroup"]);
      const radioScope = useRadioScope(__scopeRadioGroup);
      return /* @__PURE__ */ jsxRuntimeExports.jsx(RadioIndicator, __spreadProps(__spreadValues(__spreadValues({}, radioScope), indicatorProps), { ref: forwardedRef }));
    }
  );
  RadioGroupIndicator.displayName = INDICATOR_NAME2;
  var Root2 = RadioGroup$1;
  var Item2 = RadioGroupItem$1;
  var Indicator = RadioGroupIndicator;
  const RadioGroup = reactExports.forwardRef((_Dc, ref) => {
    var _Ec = _Dc, { className } = _Ec, props = __objRest(_Ec, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Root2,
      __spreadValues({
        ref,
        className: cn$1("cky:grid cky:gap-2", className)
      }, props)
    );
  });
  RadioGroup.displayName = Root2.displayName;
  const RadioGroupItem = reactExports.forwardRef((_Fc, ref) => {
    var _Gc = _Fc, { className } = _Gc, props = __objRest(_Gc, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Item2,
      __spreadProps(__spreadValues({
        ref,
        className: cn$1(
          "cky:aspect-square cky:h-4 cky:w-4 cky:rounded-full cky:border cky:border-[#8c8f94] cky:bg-white cky:text-[var(--cky-primary)] cky:shadow-sm cky:outline-none cky:transition-colors",
          "focus-visible:cky:ring-2 focus-visible:cky:ring-[var(--cky-primary)] focus-visible:cky:ring-offset-1",
          "disabled:cky:cursor-not-allowed disabled:cky:opacity-50",
          "data-[state=checked]:cky:border-[var(--cky-primary)]",
          className
        )
      }, props), {
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(Indicator, { className: "cky:flex cky:items-center cky:justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:h-2 cky:w-2 cky:rounded-full cky:bg-[var(--cky-primary)]" }) })
      })
    );
  });
  RadioGroupItem.displayName = Item2.displayName;
  const fieldVariants = cva("cky:group/field cky:flex cky:w-full cky:gap-3", {
    variants: {
      orientation: {
        vertical: "cky:flex-col cky:gap-1.5",
        horizontal: "cky:flex-row cky:items-center cky:gap-2"
      }
    },
    defaultVariants: {
      orientation: "vertical"
    }
  });
  const Field = reactExports.forwardRef((_Hc, ref) => {
    var _Ic = _Hc, { className, orientation, "data-invalid": dataInvalid } = _Ic, props = __objRest(_Ic, ["className", "orientation", "data-invalid"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "fieldset",
      __spreadValues({
        ref,
        "data-slot": "field",
        "data-invalid": dataInvalid ? true : void 0,
        className: cn$1(
          fieldVariants({ orientation }),
          "data-[invalid=true]:cky:[&_[data-slot=field-label]]:text-[#d63638]",
          className
        )
      }, props)
    );
  });
  Field.displayName = "Field";
  const FieldGroup = reactExports.forwardRef((_Jc, ref) => {
    var _Kc = _Jc, { className } = _Kc, props = __objRest(_Kc, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      __spreadValues({
        ref,
        "data-slot": "field-group",
        className: cn$1("cky:flex cky:w-full cky:flex-col cky:gap-6", className)
      }, props)
    );
  });
  FieldGroup.displayName = "FieldGroup";
  const FieldLabel = reactExports.forwardRef((_Lc, ref) => {
    var _Mc = _Lc, { className } = _Mc, props = __objRest(_Mc, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Label$2,
      __spreadValues({
        ref,
        "data-slot": "field-label",
        className: cn$1(
          "cky:peer-disabled:cursor-not-allowed cky:peer-disabled:opacity-70",
          className
        )
      }, props)
    );
  });
  FieldLabel.displayName = "FieldLabel";
  const FieldDescription = reactExports.forwardRef((_Nc, ref) => {
    var _Oc = _Nc, { className } = _Oc, props = __objRest(_Oc, ["className"]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "p",
      __spreadValues({
        ref,
        "data-slot": "field-description",
        className: cn$1(
          "cky:text-[13px] cky:leading-snug cky:text-[#646970]",
          className
        )
      }, props)
    );
  });
  FieldDescription.displayName = "FieldDescription";
  function FieldError(_Pc) {
    var _Qc = _Pc, {
      className,
      children,
      errors
    } = _Qc, props = __objRest(_Qc, [
      "className",
      "children",
      "errors"
    ]);
    const list = Array.isArray(errors) ? errors : errors == null ? [] : [errors];
    const fromErrors = list.map((e) => e == null ? void 0 : e.message).find(Boolean);
    const body = fromErrors != null ? fromErrors : children;
    if (!body) return null;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "p",
      __spreadProps(__spreadValues({
        role: "alert",
        "data-slot": "field-error",
        className: cn$1(
          "cky:text-sm cky:font-medium cky:text-[#d63638]",
          className
        )
      }, props), {
        children: String(body)
      })
    );
  }
  __name(FieldError, "FieldError");
  FieldError.displayName = "FieldError";
  const scriptRel = "modulepreload";
  const assetsURL = /* @__PURE__ */ __name(function(dep, importerUrl) {
    return new URL(dep, importerUrl).href;
  }, "assetsURL");
  const seen = {};
  const __vitePreload = /* @__PURE__ */ __name(function preload(baseModule, deps, importerUrl) {
    let promise = Promise.resolve();
    if (false) {
      let allSettled = function(promises$2) {
        return Promise.all(promises$2.map((p2) => Promise.resolve(p2).then((value$1) => ({
          status: "fulfilled",
          value: value$1
        }), (reason) => ({
          status: "rejected",
          reason
        }))));
      };
      __name(allSettled, "allSettled");
      const links = document.getElementsByTagName("link");
      const cspNonceMeta = document.querySelector("meta[property=csp-nonce]");
      const cspNonce = (cspNonceMeta == null ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta == null ? void 0 : cspNonceMeta.getAttribute("nonce"));
      promise = allSettled(deps.map((dep) => {
        dep = assetsURL(dep, importerUrl);
        if (dep in seen) return;
        seen[dep] = true;
        const isCss = dep.endsWith(".css");
        const cssSelector = isCss ? '[rel="stylesheet"]' : "";
        if (!!importerUrl) for (let i$1 = links.length - 1; i$1 >= 0; i$1--) {
          const link$1 = links[i$1];
          if (link$1.href === dep && (!isCss || link$1.rel === "stylesheet")) return;
        }
        else if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) return;
        const link = document.createElement("link");
        link.rel = isCss ? "stylesheet" : scriptRel;
        if (!isCss) link.as = "script";
        link.crossOrigin = "";
        link.href = dep;
        if (cspNonce) link.setAttribute("nonce", cspNonce);
        document.head.appendChild(link);
        if (isCss) return new Promise((res, rej) => {
          link.addEventListener("load", res);
          link.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`)));
        });
      }));
    }
    function handlePreloadError(err$2) {
      const e$1 = new Event("vite:preloadError", { cancelable: true });
      e$1.payload = err$2;
      window.dispatchEvent(e$1);
      if (!e$1.defaultPrevented) throw err$2;
    }
    __name(handlePreloadError, "handlePreloadError");
    return promise.then((res) => {
      for (const item of res || []) {
        if (item.status !== "rejected") continue;
        handlePreloadError(item.reason);
      }
      return baseModule().catch(handlePreloadError);
    });
  }, "preload");
  function createNonceMiddleware(nonce) {
    const middleware = /* @__PURE__ */ __name((options2, next) => {
      const { headers = {} } = options2;
      for (const headerName in headers) {
        if (headerName.toLowerCase() === "x-wp-nonce" && headers[headerName] === middleware.nonce) {
          return next(options2);
        }
      }
      return next(__spreadProps(__spreadValues({}, options2), {
        headers: __spreadProps(__spreadValues({}, headers), {
          "X-WP-Nonce": middleware.nonce
        })
      }));
    }, "middleware");
    middleware.nonce = nonce;
    return middleware;
  }
  __name(createNonceMiddleware, "createNonceMiddleware");
  var nonce_default = createNonceMiddleware;
  var namespaceAndEndpointMiddleware = /* @__PURE__ */ __name((options2, next) => {
    let path = options2.path;
    let namespaceTrimmed, endpointTrimmed;
    if (typeof options2.namespace === "string" && typeof options2.endpoint === "string") {
      namespaceTrimmed = options2.namespace.replace(/^\/|\/$/g, "");
      endpointTrimmed = options2.endpoint.replace(/^\//, "");
      if (endpointTrimmed) {
        path = namespaceTrimmed + "/" + endpointTrimmed;
      } else {
        path = namespaceTrimmed;
      }
    }
    delete options2.namespace;
    delete options2.endpoint;
    return next(__spreadProps(__spreadValues({}, options2), {
      path
    }));
  }, "namespaceAndEndpointMiddleware");
  var namespace_endpoint_default = namespaceAndEndpointMiddleware;
  var createRootURLMiddleware = /* @__PURE__ */ __name((rootURL) => (options2, next) => {
    return namespace_endpoint_default(options2, (optionsWithPath) => {
      let url = optionsWithPath.url;
      let path = optionsWithPath.path;
      let apiRoot;
      if (typeof path === "string") {
        apiRoot = rootURL;
        if (-1 !== rootURL.indexOf("?")) {
          path = path.replace("?", "&");
        }
        path = path.replace(/^\//, "");
        if ("string" === typeof apiRoot && -1 !== apiRoot.indexOf("?")) {
          path = path.replace("?", "&");
        }
        url = apiRoot + path;
      }
      return next(__spreadProps(__spreadValues({}, optionsWithPath), {
        url
      }));
    });
  }, "createRootURLMiddleware");
  var root_url_default = createRootURLMiddleware;
  function getQueryString(url) {
    let query;
    try {
      query = new URL(url, "http://example.com").search.substring(1);
    } catch (e) {
    }
    if (query) {
      return query;
    }
  }
  __name(getQueryString, "getQueryString");
  function buildQueryString(data) {
    let string2 = "";
    const stack = Object.entries(data);
    let pair;
    while (pair = stack.shift()) {
      let [key, value] = pair;
      const hasNestedData = Array.isArray(value) || value && value.constructor === Object;
      if (hasNestedData) {
        const valuePairs = Object.entries(value).reverse();
        for (const [member, memberValue] of valuePairs) {
          stack.unshift([`${key}[${member}]`, memberValue]);
        }
      } else if (value !== void 0) {
        if (value === null) {
          value = "";
        }
        string2 += "&" + [key, String(value)].map(encodeURIComponent).join("=");
      }
    }
    return string2.substr(1);
  }
  __name(buildQueryString, "buildQueryString");
  function getFragment(url) {
    const matches = /^\S+?(#[^\s\?]*)/.exec(url);
    if (matches) {
      return matches[1];
    }
  }
  __name(getFragment, "getFragment");
  function safeDecodeURIComponent(uriComponent) {
    try {
      return decodeURIComponent(uriComponent);
    } catch (e) {
      return uriComponent;
    }
  }
  __name(safeDecodeURIComponent, "safeDecodeURIComponent");
  function setPath(object2, path, value) {
    const length = path.length;
    const lastIndex = length - 1;
    for (let i2 = 0; i2 < length; i2++) {
      let key = path[i2];
      if (!key && Array.isArray(object2)) {
        key = object2.length.toString();
      }
      key = ["__proto__", "constructor", "prototype"].includes(key) ? key.toUpperCase() : key;
      const isNextKeyArrayIndex = !isNaN(Number(path[i2 + 1]));
      object2[key] = i2 === lastIndex ? (
        // If at end of path, assign the intended value.
        value
      ) : (
        // Otherwise, advance to the next object in the path, creating
        // it if it does not yet exist.
        object2[key] || (isNextKeyArrayIndex ? [] : {})
      );
      if (Array.isArray(object2[key]) && !isNextKeyArrayIndex) {
        object2[key] = __spreadValues({}, object2[key]);
      }
      object2 = object2[key];
    }
  }
  __name(setPath, "setPath");
  function getQueryArgs(url) {
    return (getQueryString(url) || "").replace(/\+/g, "%20").split("&").reduce((accumulator, keyValue) => {
      const [key, value = ""] = keyValue.split("=").filter(Boolean).map(safeDecodeURIComponent);
      if (key) {
        const segments = key.replace(/\]/g, "").split("[");
        setPath(accumulator, segments, value);
      }
      return accumulator;
    }, /* @__PURE__ */ Object.create(null));
  }
  __name(getQueryArgs, "getQueryArgs");
  function addQueryArgs(url = "", args) {
    if (!args || !Object.keys(args).length) {
      return url;
    }
    const fragment = getFragment(url) || "";
    let baseUrl = url.replace(fragment, "");
    const queryStringIndex = url.indexOf("?");
    if (queryStringIndex !== -1) {
      args = Object.assign(getQueryArgs(url), args);
      baseUrl = baseUrl.substr(0, queryStringIndex);
    }
    return baseUrl + "?" + buildQueryString(args) + fragment;
  }
  __name(addQueryArgs, "addQueryArgs");
  function getQueryArg(url, arg) {
    return getQueryArgs(url)[arg];
  }
  __name(getQueryArg, "getQueryArg");
  function hasQueryArg(url, arg) {
    return getQueryArg(url, arg) !== void 0;
  }
  __name(hasQueryArg, "hasQueryArg");
  function removeQueryArgs(url, ...args) {
    const fragment = url.replace(/^[^#]*/, "");
    url = url.replace(/#.*/, "");
    const queryStringIndex = url.indexOf("?");
    if (queryStringIndex === -1) {
      return url + fragment;
    }
    const query = getQueryArgs(url);
    const baseURL = url.substr(0, queryStringIndex);
    args.forEach((arg) => delete query[arg]);
    const queryString = buildQueryString(query);
    const updatedUrl = queryString ? baseURL + "?" + queryString : baseURL;
    return updatedUrl + fragment;
  }
  __name(removeQueryArgs, "removeQueryArgs");
  function normalizePath(path) {
    const split = path.split("?");
    const query = split[1];
    const base = split[0];
    if (!query) {
      return base;
    }
    return base + "?" + query.split("&").map((entry) => entry.split("=")).map((pair) => pair.map(decodeURIComponent)).sort((a2, b) => a2[0].localeCompare(b[0])).map((pair) => pair.map(encodeURIComponent)).map((pair) => pair.join("=")).join("&");
  }
  __name(normalizePath, "normalizePath");
  function createPreloadingMiddleware(preloadedData) {
    const cache = Object.fromEntries(
      Object.entries(preloadedData).map(([path, data]) => [
        normalizePath(path),
        data
      ])
    );
    return (options2, next) => {
      const { parse: parse2 = true } = options2;
      let rawPath = options2.path;
      if (!rawPath && options2.url) {
        const _a2 = getQueryArgs(
          options2.url
        ), { rest_route: pathFromQuery } = _a2, queryArgs = __objRest(_a2, ["rest_route"]);
        if (typeof pathFromQuery === "string") {
          rawPath = addQueryArgs(pathFromQuery, queryArgs);
        }
      }
      if (typeof rawPath !== "string") {
        return next(options2);
      }
      const method = options2.method || "GET";
      const path = normalizePath(rawPath);
      if ("GET" === method && cache[path]) {
        const cacheData = cache[path];
        delete cache[path];
        return prepareResponse(cacheData, !!parse2);
      } else if ("OPTIONS" === method && cache[method] && cache[method][path]) {
        const cacheData = cache[method][path];
        delete cache[method][path];
        return prepareResponse(cacheData, !!parse2);
      }
      return next(options2);
    };
  }
  __name(createPreloadingMiddleware, "createPreloadingMiddleware");
  function prepareResponse(responseData, parse2) {
    if (parse2) {
      return Promise.resolve(responseData.body);
    }
    try {
      return Promise.resolve(
        new window.Response(JSON.stringify(responseData.body), {
          status: 200,
          statusText: "OK",
          headers: responseData.headers
        })
      );
    } catch (e) {
      Object.entries(
        responseData.headers
      ).forEach(([key, value]) => {
        if (key.toLowerCase() === "link") {
          responseData.headers[key] = value.replace(
            /<([^>]+)>/,
            (_, url) => `<${encodeURI(url)}>`
          );
        }
      });
      return Promise.resolve(
        parse2 ? responseData.body : new window.Response(JSON.stringify(responseData.body), {
          status: 200,
          statusText: "OK",
          headers: responseData.headers
        })
      );
    }
  }
  __name(prepareResponse, "prepareResponse");
  var preloading_default = createPreloadingMiddleware;
  var modifyQuery = /* @__PURE__ */ __name((_Rc, queryArgs) => {
    var _Sc = _Rc, { path, url } = _Sc, options2 = __objRest(_Sc, ["path", "url"]);
    return __spreadProps(__spreadValues({}, options2), {
      url: url && addQueryArgs(url, queryArgs),
      path: path && addQueryArgs(path, queryArgs)
    });
  }, "modifyQuery");
  var parseResponse = /* @__PURE__ */ __name((response) => response.json ? response.json() : Promise.reject(response), "parseResponse");
  var parseLinkHeader = /* @__PURE__ */ __name((linkHeader) => {
    if (!linkHeader) {
      return {};
    }
    const match = linkHeader.match(/<([^>]+)>; rel="next"/);
    return match ? {
      next: match[1]
    } : {};
  }, "parseLinkHeader");
  var getNextPageUrl = /* @__PURE__ */ __name((response) => {
    const { next } = parseLinkHeader(response.headers.get("link"));
    return next;
  }, "getNextPageUrl");
  var requestContainsUnboundedQuery = /* @__PURE__ */ __name((options2) => {
    const pathIsUnbounded = !!options2.path && options2.path.indexOf("per_page=-1") !== -1;
    const urlIsUnbounded = !!options2.url && options2.url.indexOf("per_page=-1") !== -1;
    return pathIsUnbounded || urlIsUnbounded;
  }, "requestContainsUnboundedQuery");
  var fetchAllMiddleware = /* @__PURE__ */ __name((options2, next) => __async(null, null, function* () {
    if (options2.parse === false) {
      return next(options2);
    }
    if (!requestContainsUnboundedQuery(options2)) {
      return next(options2);
    }
    const response = yield index_default(__spreadProps(__spreadValues({}, modifyQuery(options2, {
      per_page: 100
    })), {
      // Ensure headers are returned for page 1.
      parse: false
    }));
    const results = yield parseResponse(response);
    if (!Array.isArray(results)) {
      return results;
    }
    let nextPage = getNextPageUrl(response);
    if (!nextPage) {
      return results;
    }
    let mergedResults = [].concat(results);
    while (nextPage) {
      const nextResponse = yield index_default(__spreadProps(__spreadValues({}, options2), {
        // Ensure the URL for the next page is used instead of any provided path.
        path: void 0,
        url: nextPage,
        // Ensure we still get headers so we can identify the next page.
        parse: false
      }));
      const nextResults = yield parseResponse(nextResponse);
      mergedResults = mergedResults.concat(nextResults);
      nextPage = getNextPageUrl(nextResponse);
    }
    return mergedResults;
  }), "fetchAllMiddleware");
  var fetch_all_middleware_default = fetchAllMiddleware;
  var OVERRIDE_METHODS = /* @__PURE__ */ new Set(["PATCH", "PUT", "DELETE"]);
  var DEFAULT_METHOD = "GET";
  var httpV1Middleware = /* @__PURE__ */ __name((options2, next) => {
    const { method = DEFAULT_METHOD } = options2;
    if (OVERRIDE_METHODS.has(method.toUpperCase())) {
      options2 = __spreadProps(__spreadValues({}, options2), {
        headers: __spreadProps(__spreadValues({
          "Content-Type": "application/json"
        }, options2.headers), {
          "X-HTTP-Method-Override": method
        }),
        method: "POST"
      });
    }
    return next(options2);
  }, "httpV1Middleware");
  var http_v1_default = httpV1Middleware;
  var userLocaleMiddleware = /* @__PURE__ */ __name((options2, next) => {
    if (typeof options2.url === "string" && !hasQueryArg(options2.url, "_locale")) {
      options2.url = addQueryArgs(options2.url, { _locale: "user" });
    }
    if (typeof options2.path === "string" && !hasQueryArg(options2.path, "_locale")) {
      options2.path = addQueryArgs(options2.path, { _locale: "user" });
    }
    return next(options2);
  }, "userLocaleMiddleware");
  var user_locale_default = userLocaleMiddleware;
  function parseJsonAndNormalizeError(response) {
    return __async(this, null, function* () {
      try {
        return yield response.json();
      } catch (e) {
        throw {
          code: "invalid_json",
          message: __$3("The response is not a valid JSON response.")
        };
      }
    });
  }
  __name(parseJsonAndNormalizeError, "parseJsonAndNormalizeError");
  function parseResponseAndNormalizeError(response, shouldParseResponse = true) {
    return __async(this, null, function* () {
      if (!shouldParseResponse) {
        return response;
      }
      if (response.status === 204) {
        return null;
      }
      return yield parseJsonAndNormalizeError(response);
    });
  }
  __name(parseResponseAndNormalizeError, "parseResponseAndNormalizeError");
  function parseAndThrowError(response, shouldParseResponse = true) {
    return __async(this, null, function* () {
      if (!shouldParseResponse) {
        throw response;
      }
      throw yield parseJsonAndNormalizeError(response);
    });
  }
  __name(parseAndThrowError, "parseAndThrowError");
  function isMediaUploadRequest(options2) {
    const isCreateMethod = !!options2.method && options2.method === "POST";
    const isMediaEndpoint = !!options2.path && options2.path.indexOf("/wp/v2/media") !== -1 || !!options2.url && options2.url.indexOf("/wp/v2/media") !== -1;
    return isMediaEndpoint && isCreateMethod;
  }
  __name(isMediaUploadRequest, "isMediaUploadRequest");
  var mediaUploadMiddleware = /* @__PURE__ */ __name((options2, next) => {
    if (!isMediaUploadRequest(options2)) {
      return next(options2);
    }
    let retries = 0;
    const maxRetries = 5;
    const postProcess = /* @__PURE__ */ __name((attachmentId) => {
      retries++;
      return next({
        path: `/wp/v2/media/${attachmentId}/post-process`,
        method: "POST",
        data: { action: "create-image-subsizes" },
        parse: false
      }).catch(() => {
        if (retries < maxRetries) {
          return postProcess(attachmentId);
        }
        next({
          path: `/wp/v2/media/${attachmentId}?force=true`,
          method: "DELETE"
        });
        return Promise.reject();
      });
    }, "postProcess");
    return next(__spreadProps(__spreadValues({}, options2), { parse: false })).catch((response) => {
      if (!(response instanceof globalThis.Response)) {
        return Promise.reject(response);
      }
      const attachmentId = response.headers.get(
        "x-wp-upload-attachment-id"
      );
      if (response.status >= 500 && response.status < 600 && attachmentId) {
        return postProcess(attachmentId).catch(() => {
          if (options2.parse !== false) {
            return Promise.reject({
              code: "post_process",
              message: __$3(
                "Media upload failed. If this is a photo or a large image, please scale it down and try again."
              )
            });
          }
          return Promise.reject(response);
        });
      }
      return parseAndThrowError(response, options2.parse);
    }).then(
      (response) => parseResponseAndNormalizeError(response, options2.parse)
    );
  }, "mediaUploadMiddleware");
  var media_upload_default = mediaUploadMiddleware;
  var createThemePreviewMiddleware = /* @__PURE__ */ __name((themePath) => (options2, next) => {
    if (typeof options2.url === "string") {
      const wpThemePreview = getQueryArg(
        options2.url,
        "wp_theme_preview"
      );
      if (wpThemePreview === void 0) {
        options2.url = addQueryArgs(options2.url, {
          wp_theme_preview: themePath
        });
      } else if (wpThemePreview === "") {
        options2.url = removeQueryArgs(
          options2.url,
          "wp_theme_preview"
        );
      }
    }
    if (typeof options2.path === "string") {
      const wpThemePreview = getQueryArg(
        options2.path,
        "wp_theme_preview"
      );
      if (wpThemePreview === void 0) {
        options2.path = addQueryArgs(options2.path, {
          wp_theme_preview: themePath
        });
      } else if (wpThemePreview === "") {
        options2.path = removeQueryArgs(
          options2.path,
          "wp_theme_preview"
        );
      }
    }
    return next(options2);
  }, "createThemePreviewMiddleware");
  var theme_preview_default = createThemePreviewMiddleware;
  var DEFAULT_HEADERS = {
    // The backend uses the Accept header as a condition for considering an
    // incoming request as a REST request.
    //
    // See: https://core.trac.wordpress.org/ticket/44534
    Accept: "application/json, */*;q=0.1"
  };
  var DEFAULT_OPTIONS = {
    credentials: "include"
  };
  var middlewares = [
    user_locale_default,
    namespace_endpoint_default,
    http_v1_default,
    fetch_all_middleware_default
  ];
  function registerMiddleware(middleware) {
    middlewares.unshift(middleware);
  }
  __name(registerMiddleware, "registerMiddleware");
  var defaultFetchHandler = /* @__PURE__ */ __name((nextOptions) => {
    const _a2 = nextOptions, { url, path, data, parse: parse2 = true } = _a2, remainingOptions = __objRest(_a2, ["url", "path", "data", "parse"]);
    let { body, headers } = nextOptions;
    headers = __spreadValues(__spreadValues({}, DEFAULT_HEADERS), headers);
    if (data) {
      body = JSON.stringify(data);
      headers["Content-Type"] = "application/json";
    }
    const responsePromise = globalThis.fetch(
      // Fall back to explicitly passing `window.location` which is the behavior if `undefined` is passed.
      url || path || window.location.href,
      __spreadProps(__spreadValues(__spreadValues({}, DEFAULT_OPTIONS), remainingOptions), {
        body,
        headers
      })
    );
    return responsePromise.then(
      (response) => {
        if (!response.ok) {
          return parseAndThrowError(response, parse2);
        }
        return parseResponseAndNormalizeError(response, parse2);
      },
      (err) => {
        if (err && err.name === "AbortError") {
          throw err;
        }
        if (!globalThis.navigator.onLine) {
          throw {
            code: "offline_error",
            message: __$3(
              "Unable to connect. Please check your Internet connection."
            )
          };
        }
        throw {
          code: "fetch_error",
          message: __$3(
            "Could not get a valid response from the server."
          )
        };
      }
    );
  }, "defaultFetchHandler");
  var fetchHandler = defaultFetchHandler;
  function setFetchHandler(newFetchHandler) {
    fetchHandler = newFetchHandler;
  }
  __name(setFetchHandler, "setFetchHandler");
  var apiFetch = /* @__PURE__ */ __name((options2) => {
    const enhancedHandler = middlewares.reduceRight(
      (next, middleware) => {
        return (workingOptions) => middleware(workingOptions, next);
      },
      fetchHandler
    );
    return enhancedHandler(options2).catch((error) => {
      if (error.code !== "rest_cookie_invalid_nonce") {
        return Promise.reject(error);
      }
      return globalThis.fetch(apiFetch.nonceEndpoint).then((response) => {
        if (!response.ok) {
          return Promise.reject(error);
        }
        return response.text();
      }).then((text) => {
        apiFetch.nonceMiddleware.nonce = text;
        return apiFetch(options2);
      });
    });
  }, "apiFetch");
  apiFetch.use = registerMiddleware;
  apiFetch.setFetchHandler = setFetchHandler;
  apiFetch.createNonceMiddleware = nonce_default;
  apiFetch.createPreloadingMiddleware = preloading_default;
  apiFetch.createRootURLMiddleware = root_url_default;
  apiFetch.fetchAllMiddleware = fetch_all_middleware_default;
  apiFetch.mediaUploadMiddleware = media_upload_default;
  apiFetch.createThemePreviewMiddleware = theme_preview_default;
  var index_default = apiFetch;
  function getApiBase() {
    var _a2, _b2;
    return ((_b2 = (_a2 = window.ckyGlobals) == null ? void 0 : _a2.api) == null ? void 0 : _b2.base) || "/wp-json/cky/v1/";
  }
  __name(getApiBase, "getApiBase");
  function getNonce() {
    var _a2, _b2;
    return ((_b2 = (_a2 = window.ckyGlobals) == null ? void 0 : _a2.api) == null ? void 0 : _b2.nonce) || "";
  }
  __name(getNonce, "getNonce");
  index_default.use(index_default.createNonceMiddleware(getNonce()));
  index_default.use(index_default.createRootURLMiddleware(getApiBase()));
  const activeRequests = /* @__PURE__ */ new Map();
  const cancelResolvers = /* @__PURE__ */ new Set();
  function mergeQueryParams(options2) {
    if (!options2.params) return;
    const urlParams = new URLSearchParams(Object.entries(options2.params));
    options2.path = options2.path + "?" + urlParams;
  }
  __name(mergeQueryParams, "mergeQueryParams");
  function createCancellableRequest(apiRequest) {
    let cancelResolve = /* @__PURE__ */ __name(() => {
    }, "cancelResolve");
    const cancelPromise = new Promise((resolve) => {
      cancelResolve = /* @__PURE__ */ __name(() => resolve(null), "cancelResolve");
    });
    cancelResolvers.add(cancelResolve);
    return Promise.race([apiRequest, cancelPromise]).finally(() => {
      cancelResolvers.delete(cancelResolve);
    });
  }
  __name(createCancellableRequest, "createCancellableRequest");
  function request(options2, fallbackId) {
    const requestId = options2.path || `${fallbackId}_${Date.now()}`;
    if (options2.method === "GET" && activeRequests.has(requestId)) {
      return activeRequests.get(requestId);
    }
    const cancellableRequest = createCancellableRequest(index_default(options2));
    activeRequests.set(requestId, cancellableRequest);
    return cancellableRequest.finally(() => {
      activeRequests.delete(requestId);
    });
  }
  __name(request, "request");
  const ckyRest = {
    post(options2) {
      options2 = options2 || {};
      options2.method = "POST";
      mergeQueryParams(options2);
      try {
        return request(options2, "post");
      } catch (error) {
        return error;
      }
    },
    get(options2) {
      options2 = options2 || {};
      options2.method = "GET";
      mergeQueryParams(options2);
      try {
        return request(options2, "get");
      } catch (error) {
        return error;
      }
    },
    put(options2) {
      options2 = options2 || {};
      options2.method = "PUT";
      mergeQueryParams(options2);
      try {
        return request(options2, "put");
      } catch (error) {
        return error;
      }
    },
    delete(options2) {
      options2 = options2 || {};
      options2.method = "DELETE";
      try {
        return request(options2, "delete");
      } catch (error) {
        return error;
      }
    },
    cancelAll() {
      cancelResolvers.forEach((resolve) => resolve());
      cancelResolvers.clear();
      activeRequests.clear();
    }
  };
  function getSettings() {
    return __async(this, null, function* () {
      try {
        const response = yield ckyRest.get({
          path: "settings"
        });
        return response;
      } catch (error) {
        console.error("Error fetching settings:", error);
        throw error;
      }
    });
  }
  __name(getSettings, "getSettings");
  function saveSettings(settings2, clear = true) {
    return __async(this, null, function* () {
      try {
        const response = yield ckyRest.post({
          path: "settings",
          data: settings2,
          params: { clear }
        });
        return response;
      } catch (error) {
        console.error("Error saving settings:", error);
        throw error;
      }
    });
  }
  __name(saveSettings, "saveSettings");
  function getSettingsInfo(force = false) {
    return __async(this, null, function* () {
      try {
        const response = yield ckyRest.get({
          path: "settings/info",
          params: { force }
        });
        return response;
      } catch (error) {
        console.error("Error fetching settings info:", error);
        throw error;
      }
    });
  }
  __name(getSettingsInfo, "getSettingsInfo");
  function updateConnectNotice(status) {
    return __async(this, null, function* () {
      try {
        yield ckyRest.post({
          path: "/settings/connect_notice",
          data: {
            connect_notice: status
          }
        });
      } catch (error) {
        console.error("Error updating connect notice:", error);
        throw error;
      }
    });
  }
  __name(updateConnectNotice, "updateConnectNotice");
  function updateExpand(expand) {
    return __async(this, null, function* () {
      try {
        yield ckyRest.post({
          path: "/settings/expand",
          data: {
            expand
          }
        });
      } catch (error) {
        console.error("Error updating connect card expand status:", error);
        throw error;
      }
    });
  }
  __name(updateExpand, "updateExpand");
  function purgeCache$1() {
    return __async(this, null, function* () {
      try {
        yield ckyRest.post({
          path: "/settings/cache/purge",
          data: {}
        });
      } catch (error) {
        console.warn("Cache purge failed (non-critical):", error);
      }
    });
  }
  __name(purgeCache$1, "purgeCache$1");
  const settingsService = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    getSettings,
    getSettingsInfo,
    purgeCache: purgeCache$1,
    saveSettings,
    updateConnectNotice,
    updateExpand
  }, Symbol.toStringTag, { value: "Module" }));
  function win() {
    return window;
  }
  __name(win, "win");
  function getAppStoreState() {
    return __async(this, null, function* () {
      try {
        const { useAppStore: useAppStore2 } = yield __vitePreload(() => __async(null, null, function* () {
          const { useAppStore: useAppStore3 } = yield Promise.resolve().then(() => store);
          return { useAppStore: useAppStore3 };
        }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href);
        return useAppStore2.getState();
      } catch (e) {
        return null;
      }
    });
  }
  __name(getAppStoreState, "getAppStoreState");
  function syncStoreWithSettingsResponse(response) {
    return __async(this, null, function* () {
      try {
        const store2 = yield getAppStoreState();
        if (store2 == null ? void 0 : store2.updateSettings) {
          store2.updateSettings(response);
        }
      } catch (e) {
      }
    });
  }
  __name(syncStoreWithSettingsResponse, "syncStoreWithSettingsResponse");
  function getOption(key, value = false) {
    var _a2;
    let current = value;
    const settings2 = ((_a2 = win().ckyConfig) == null ? void 0 : _a2.settings) || {};
    if (settings2[key]) {
      current = settings2[key];
    }
    return current;
  }
  __name(getOption, "getOption");
  function getInfo(key = false, value = false) {
    var _a2;
    let current = value;
    const settings2 = ((_a2 = win().ckyConfig) == null ? void 0 : _a2.info) || {};
    if (key === false) return settings2;
    if (settings2[key]) {
      current = settings2[key];
    }
    return current;
  }
  __name(getInfo, "getInfo");
  function setOption(key, value) {
    const w = win();
    if (!w.ckyConfig) {
      w.ckyConfig = {};
    }
    if (!w.ckyConfig.settings) {
      w.ckyConfig.settings = {};
    }
    w.ckyConfig.settings[key] = value;
  }
  __name(setOption, "setOption");
  function saveOptions(clear = true) {
    return __async(this, null, function* () {
      var _a2;
      try {
        let settings2 = ((_a2 = win().ckyConfig) == null ? void 0 : _a2.settings) || {};
        if (!settings2 || Object.keys(settings2).length === 0) {
          const store2 = yield getAppStoreState();
          if (store2 == null ? void 0 : store2.options) {
            settings2 = store2.options;
          }
        }
        const response = yield saveSettings(settings2, clear);
        if (response && typeof response === "object") {
          win().ckyConfig.settings = response;
          yield syncStoreWithSettingsResponse(response);
        }
        return !!response;
      } catch (error) {
        console.error("Error saving options:", error);
        return false;
      }
    });
  }
  __name(saveOptions, "saveOptions");
  function reloadSettings() {
    return __async(this, null, function* () {
      try {
        const response = yield getSettings();
        if (response && typeof response === "object") {
          win().ckyConfig.settings = response;
        }
      } catch (error) {
        console.error("Error reloading settings:", error);
      }
    });
  }
  __name(reloadSettings, "reloadSettings");
  function getDefaultLanguage() {
    var _a2, _b2, _c2;
    const fromSettings = (_b2 = (_a2 = win().ckyConfig) == null ? void 0 : _a2.settings) == null ? void 0 : _b2.languages;
    if (fromSettings && typeof fromSettings.default === "string") {
      return fromSettings.default;
    }
    const legacy = (_c2 = win().ckyConfig) == null ? void 0 : _c2.languages;
    return (legacy == null ? void 0 : legacy.default) || "en";
  }
  __name(getDefaultLanguage, "getDefaultLanguage");
  function setDefaultLanguage(lang = "en") {
    return __async(this, null, function* () {
      const w = win();
      if (!w.ckyConfig) {
        w.ckyConfig = {};
      }
      if (!w.ckyConfig.settings) {
        w.ckyConfig.settings = {};
      }
      if (!w.ckyConfig.settings.languages) {
        w.ckyConfig.settings.languages = {};
      }
      w.ckyConfig.settings.languages.default = lang;
      if (!w.ckyConfig.languages) {
        w.ckyConfig.languages = {};
      }
      w.ckyConfig.languages.default = lang;
    });
  }
  __name(setDefaultLanguage, "setDefaultLanguage");
  function getAssetsURL() {
    var _a2, _b2;
    return ((_b2 = (_a2 = win().ckyGlobals) == null ? void 0 : _a2.app) == null ? void 0 : _b2.url) || "";
  }
  __name(getAssetsURL, "getAssetsURL");
  function purgeCache() {
    return __async(this, null, function* () {
      yield purgeCache$1();
    });
  }
  __name(purgeCache, "purgeCache");
  function isRTLLanguage(language = false) {
    var _a2, _b2;
    const code = language === false ? ((_b2 = (_a2 = win().ckyConfig) == null ? void 0 : _a2.languages) == null ? void 0 : _b2.current) || "" : language;
    return ["ar", "az", "dv", "he", "ku", "fa", "ur"].includes(code);
  }
  __name(isRTLLanguage, "isRTLLanguage");
  function checkDomain() {
    var _a2, _b2, _c2;
    try {
      const siteUrl2 = (_b2 = (_a2 = win().ckyGlobals) == null ? void 0 : _a2.site) == null ? void 0 : _b2.url;
      if (!siteUrl2) return true;
      const { hostname: actual } = new URL(siteUrl2);
      const info = ((_c2 = win().ckyConfig) == null ? void 0 : _c2.info) || {};
      if (!info.url) return true;
      const registered = new URL(info.url);
      const registeredDomain = registered.hostname;
      const domains = actual.split(".");
      let isValidDomain = false;
      for (let index2 = 0; index2 < domains.length; index2++) {
        const domain = domains.slice(index2).join(".");
        isValidDomain = isValidDomain || domain === registeredDomain || domain.replace(/^www./, "") === registeredDomain.replace(/^www./, "");
        if (isValidDomain) break;
      }
      return isValidDomain;
    } catch (e) {
      return false;
    }
  }
  __name(checkDomain, "checkDomain");
  const common = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    checkDomain,
    getAssetsURL,
    getDefaultLanguage,
    getInfo,
    getOption,
    isRTLLanguage,
    purgeCache,
    reloadSettings,
    saveOptions,
    setDefaultLanguage,
    setOption
  }, Symbol.toStringTag, { value: "Module" }));
  const sprintf$1 = /* @__PURE__ */ __name((format2, ...args) => {
    const rest = [...args];
    return format2.replace(/%[sdj%]/g, (match) => {
      if (match === "%%") return "%";
      const arg = rest.shift();
      if (match === "%d") return String(Number(arg));
      if (match === "%s") return String(arg);
      if (match === "%j") return JSON.stringify(arg);
      return match;
    });
  }, "sprintf$1");
  let globalTriggerNotification = null;
  const setGlobalTriggerNotification = /* @__PURE__ */ __name((fn) => {
    globalTriggerNotification = fn;
  }, "setGlobalTriggerNotification");
  function dispatchGlobalNotification(data) {
    globalTriggerNotification == null ? void 0 : globalTriggerNotification(data);
  }
  __name(dispatchGlobalNotification, "dispatchGlobalNotification");
  const GLOBAL_UTILITIES = {
    sprintf: sprintf$1,
    getOption,
    setOption,
    saveOptions,
    getInfo,
    getDefaultLanguage,
    setDefaultLanguage,
    getAssetsURL,
    purgeCache,
    triggerNotification: dispatchGlobalNotification
  };
  const GlobalContext = reactExports.createContext(null);
  const GlobalProvider = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalContext.Provider, { value: GLOBAL_UTILITIES, children }), "GlobalProvider");
  const useGlobalUtilities = /* @__PURE__ */ __name(() => {
    const context = reactExports.useContext(GlobalContext);
    if (!context) {
      throw new Error("useGlobalUtilities must be used within a GlobalProvider");
    }
    return context;
  }, "useGlobalUtilities");
  const NotificationContext = reactExports.createContext(null);
  const DEFAULT_TOAST_DURATION = 5e3;
  const NotificationProvider = /* @__PURE__ */ __name(({ children }) => {
    const triggerNotification = reactExports.useCallback((data) => {
      var _a2;
      const duration = (_a2 = data.duration) != null ? _a2 : DEFAULT_TOAST_DURATION;
      const options2 = { duration };
      switch (data.type) {
        case "success":
          toast.success(data.message, options2);
          break;
        case "error":
          toast.error(data.message, options2);
          break;
        case "warning":
          toast.warning(data.message, options2);
          break;
        case "info":
          toast.info(data.message, options2);
          break;
        default:
          toast(data.message, options2);
      }
    }, []);
    reactExports.useEffect(() => {
      setGlobalTriggerNotification(triggerNotification);
    }, [triggerNotification]);
    const notificationValue = reactExports.useMemo(
      () => ({ triggerNotification }),
      [triggerNotification]
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsx(NotificationContext.Provider, { value: notificationValue, children });
  }, "NotificationProvider");
  const useNotifications = /* @__PURE__ */ __name(() => {
    const context = reactExports.useContext(NotificationContext);
    if (!context) {
      throw new Error("useNotifications must be used within a NotificationProvider");
    }
    return context;
  }, "useNotifications");
  const createStoreImpl = /* @__PURE__ */ __name((createState) => {
    let state;
    const listeners = /* @__PURE__ */ new Set();
    const setState = /* @__PURE__ */ __name((partial, replace) => {
      const nextState = typeof partial === "function" ? partial(state) : partial;
      if (!Object.is(nextState, state)) {
        const previousState = state;
        state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
        listeners.forEach((listener) => listener(state, previousState));
      }
    }, "setState");
    const getState2 = /* @__PURE__ */ __name(() => state, "getState");
    const getInitialState = /* @__PURE__ */ __name(() => initialState, "getInitialState");
    const subscribe2 = /* @__PURE__ */ __name((listener) => {
      listeners.add(listener);
      return () => listeners.delete(listener);
    }, "subscribe");
    const api = { setState, getState: getState2, getInitialState, subscribe: subscribe2 };
    const initialState = state = createState(setState, getState2, api);
    return api;
  }, "createStoreImpl");
  const createStore = /* @__PURE__ */ __name(((createState) => createState ? createStoreImpl(createState) : createStoreImpl), "createStore");
  const identity = /* @__PURE__ */ __name((arg) => arg, "identity");
  function useStore(api, selector = identity) {
    const slice = React.useSyncExternalStore(
      api.subscribe,
      React.useCallback(() => selector(api.getState()), [api, selector]),
      React.useCallback(() => selector(api.getInitialState()), [api, selector])
    );
    React.useDebugValue(slice);
    return slice;
  }
  __name(useStore, "useStore");
  const createImpl = /* @__PURE__ */ __name((createState) => {
    const api = createStore(createState);
    const useBoundStore = /* @__PURE__ */ __name((selector) => useStore(api, selector), "useBoundStore");
    Object.assign(useBoundStore, api);
    return useBoundStore;
  }, "createImpl");
  const create = /* @__PURE__ */ __name(((createState) => createImpl), "create");
  const __vite_import_meta_env__ = { "BASE_URL": "./", "DEV": false, "MODE": "production", "PROD": true, "SSR": false };
  const trackedConnections = /* @__PURE__ */ new Map();
  const getTrackedConnectionState = /* @__PURE__ */ __name((name) => {
    const api = trackedConnections.get(name);
    if (!api) return {};
    return Object.fromEntries(
      Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])
    );
  }, "getTrackedConnectionState");
  const extractConnectionInformation = /* @__PURE__ */ __name((store2, extensionConnector, options2) => {
    if (store2 === void 0) {
      return {
        type: "untracked",
        connection: extensionConnector.connect(options2)
      };
    }
    const existingConnection = trackedConnections.get(options2.name);
    if (existingConnection) {
      return __spreadValues({ type: "tracked", store: store2 }, existingConnection);
    }
    const newConnection = {
      connection: extensionConnector.connect(options2),
      stores: {}
    };
    trackedConnections.set(options2.name, newConnection);
    return __spreadValues({ type: "tracked", store: store2 }, newConnection);
  }, "extractConnectionInformation");
  const removeStoreFromTrackedConnections = /* @__PURE__ */ __name((name, store2) => {
    if (store2 === void 0) return;
    const connectionInfo = trackedConnections.get(name);
    if (!connectionInfo) return;
    delete connectionInfo.stores[store2];
    if (Object.keys(connectionInfo.stores).length === 0) {
      trackedConnections.delete(name);
    }
  }, "removeStoreFromTrackedConnections");
  const findCallerName = /* @__PURE__ */ __name((stack) => {
    var _a2, _b2;
    if (!stack) return void 0;
    const traceLines = stack.split("\n");
    const apiSetStateLineIndex = traceLines.findIndex(
      (traceLine) => traceLine.includes("api.setState")
    );
    if (apiSetStateLineIndex < 0) return void 0;
    const callerLine = ((_a2 = traceLines[apiSetStateLineIndex + 1]) == null ? void 0 : _a2.trim()) || "";
    return (_b2 = /.+ (.+) .+/.exec(callerLine)) == null ? void 0 : _b2[1];
  }, "findCallerName");
  const devtoolsImpl = /* @__PURE__ */ __name((fn, devtoolsOptions = {}) => (set2, get2, api) => {
    const _a2 = devtoolsOptions, { enabled, anonymousActionType, store: store2 } = _a2, options2 = __objRest(_a2, ["enabled", "anonymousActionType", "store"]);
    let extensionConnector;
    try {
      extensionConnector = (enabled != null ? enabled : (__vite_import_meta_env__ ? "production" : void 0) !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__;
    } catch (e) {
    }
    if (!extensionConnector) {
      return fn(set2, get2, api);
    }
    const _b2 = extractConnectionInformation(store2, extensionConnector, options2), { connection } = _b2, connectionInformation = __objRest(_b2, ["connection"]);
    let isRecording = true;
    api.setState = ((state, replace, nameOrAction) => {
      const r2 = set2(state, replace);
      if (!isRecording) return r2;
      const action = nameOrAction === void 0 ? {
        type: anonymousActionType || findCallerName(new Error().stack) || "anonymous"
      } : typeof nameOrAction === "string" ? { type: nameOrAction } : nameOrAction;
      if (store2 === void 0) {
        connection == null ? void 0 : connection.send(action, get2());
        return r2;
      }
      connection == null ? void 0 : connection.send(
        __spreadProps(__spreadValues({}, action), {
          type: `${store2}/${action.type}`
        }),
        __spreadProps(__spreadValues({}, getTrackedConnectionState(options2.name)), {
          [store2]: api.getState()
        })
      );
      return r2;
    });
    api.devtools = {
      cleanup: /* @__PURE__ */ __name(() => {
        if (connection && typeof connection.unsubscribe === "function") {
          connection.unsubscribe();
        }
        removeStoreFromTrackedConnections(options2.name, store2);
      }, "cleanup")
    };
    const setStateFromDevtools = /* @__PURE__ */ __name((...a2) => {
      const originalIsRecording = isRecording;
      isRecording = false;
      set2(...a2);
      isRecording = originalIsRecording;
    }, "setStateFromDevtools");
    const initialState = fn(api.setState, get2, api);
    if (connectionInformation.type === "untracked") {
      connection == null ? void 0 : connection.init(initialState);
    } else {
      connectionInformation.stores[connectionInformation.store] = api;
      connection == null ? void 0 : connection.init(
        Object.fromEntries(
          Object.entries(connectionInformation.stores).map(([key, store22]) => [
            key,
            key === connectionInformation.store ? initialState : store22.getState()
          ])
        )
      );
    }
    if (api.dispatchFromDevtools && typeof api.dispatch === "function") {
      let didWarnAboutReservedActionType = false;
      const originalDispatch = api.dispatch;
      api.dispatch = (...args) => {
        if ((__vite_import_meta_env__ ? "production" : void 0) !== "production" && args[0].type === "__setState" && !didWarnAboutReservedActionType) {
          console.warn(
            '[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'
          );
          didWarnAboutReservedActionType = true;
        }
        originalDispatch(...args);
      };
    }
    connection.subscribe((message) => {
      var _a3;
      switch (message.type) {
        case "ACTION":
          if (typeof message.payload !== "string") {
            console.error(
              "[zustand devtools middleware] Unsupported action format"
            );
            return;
          }
          return parseJsonThen(
            message.payload,
            (action) => {
              if (action.type === "__setState") {
                if (store2 === void 0) {
                  setStateFromDevtools(action.state);
                  return;
                }
                if (Object.keys(action.state).length !== 1) {
                  console.error(
                    `
                    [zustand devtools middleware] Unsupported __setState action format.
                    When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
                    and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
                    `
                  );
                }
                const stateFromDevtools = action.state[store2];
                if (stateFromDevtools === void 0 || stateFromDevtools === null) {
                  return;
                }
                if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {
                  setStateFromDevtools(stateFromDevtools);
                }
                return;
              }
              if (!api.dispatchFromDevtools) return;
              if (typeof api.dispatch !== "function") return;
              api.dispatch(action);
            }
          );
        case "DISPATCH":
          switch (message.payload.type) {
            case "RESET":
              setStateFromDevtools(initialState);
              if (store2 === void 0) {
                return connection == null ? void 0 : connection.init(api.getState());
              }
              return connection == null ? void 0 : connection.init(getTrackedConnectionState(options2.name));
            case "COMMIT":
              if (store2 === void 0) {
                connection == null ? void 0 : connection.init(api.getState());
                return;
              }
              return connection == null ? void 0 : connection.init(getTrackedConnectionState(options2.name));
            case "ROLLBACK":
              return parseJsonThen(message.state, (state) => {
                if (store2 === void 0) {
                  setStateFromDevtools(state);
                  connection == null ? void 0 : connection.init(api.getState());
                  return;
                }
                setStateFromDevtools(state[store2]);
                connection == null ? void 0 : connection.init(getTrackedConnectionState(options2.name));
              });
            case "JUMP_TO_STATE":
            case "JUMP_TO_ACTION":
              return parseJsonThen(message.state, (state) => {
                if (store2 === void 0) {
                  setStateFromDevtools(state);
                  return;
                }
                if (JSON.stringify(api.getState()) !== JSON.stringify(state[store2])) {
                  setStateFromDevtools(state[store2]);
                }
              });
            case "IMPORT_STATE": {
              const { nextLiftedState } = message.payload;
              const lastComputedState = (_a3 = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a3.state;
              if (!lastComputedState) return;
              if (store2 === void 0) {
                setStateFromDevtools(lastComputedState);
              } else {
                setStateFromDevtools(lastComputedState[store2]);
              }
              connection == null ? void 0 : connection.send(
                null,
                // FIXME no-any
                nextLiftedState
              );
              return;
            }
            case "PAUSE_RECORDING":
              return isRecording = !isRecording;
          }
          return;
      }
    });
    return initialState;
  }, "devtoolsImpl");
  const devtools = devtoolsImpl;
  const parseJsonThen = /* @__PURE__ */ __name((stringified, fn) => {
    let parsed;
    try {
      parsed = JSON.parse(stringified);
    } catch (e) {
      console.error(
        "[zustand devtools middleware] Could not parse the received json",
        e
      );
    }
    if (parsed !== void 0) fn(parsed);
  }, "parseJsonThen");
  const isIterable = /* @__PURE__ */ __name((obj) => Symbol.iterator in obj, "isIterable");
  const hasIterableEntries = /* @__PURE__ */ __name((value) => (
    // HACK: avoid checking entries type
    "entries" in value
  ), "hasIterableEntries");
  const compareEntries = /* @__PURE__ */ __name((valueA, valueB) => {
    const mapA = valueA instanceof Map ? valueA : new Map(valueA.entries());
    const mapB = valueB instanceof Map ? valueB : new Map(valueB.entries());
    if (mapA.size !== mapB.size) {
      return false;
    }
    for (const [key, value] of mapA) {
      if (!mapB.has(key) || !Object.is(value, mapB.get(key))) {
        return false;
      }
    }
    return true;
  }, "compareEntries");
  const compareIterables = /* @__PURE__ */ __name((valueA, valueB) => {
    const iteratorA = valueA[Symbol.iterator]();
    const iteratorB = valueB[Symbol.iterator]();
    let nextA = iteratorA.next();
    let nextB = iteratorB.next();
    while (!nextA.done && !nextB.done) {
      if (!Object.is(nextA.value, nextB.value)) {
        return false;
      }
      nextA = iteratorA.next();
      nextB = iteratorB.next();
    }
    return !!nextA.done && !!nextB.done;
  }, "compareIterables");
  function shallow(valueA, valueB) {
    if (Object.is(valueA, valueB)) {
      return true;
    }
    if (typeof valueA !== "object" || valueA === null || typeof valueB !== "object" || valueB === null) {
      return false;
    }
    if (Object.getPrototypeOf(valueA) !== Object.getPrototypeOf(valueB)) {
      return false;
    }
    if (isIterable(valueA) && isIterable(valueB)) {
      if (hasIterableEntries(valueA) && hasIterableEntries(valueB)) {
        return compareEntries(valueA, valueB);
      }
      return compareIterables(valueA, valueB);
    }
    return compareEntries(
      { entries: /* @__PURE__ */ __name(() => Object.entries(valueA), "entries") },
      { entries: /* @__PURE__ */ __name(() => Object.entries(valueB), "entries") }
    );
  }
  __name(shallow, "shallow");
  function useShallow(selector) {
    const prev = React.useRef(void 0);
    return (state) => {
      const next = selector(state);
      return shallow(prev.current, next) ? prev.current : prev.current = next;
    };
  }
  __name(useShallow, "useShallow");
  const createAppState = /* @__PURE__ */ __name((set2, get2) => {
    var _a2, _b2, _c2, _d;
    return {
      options: ((_a2 = window.ckyConfig) == null ? void 0 : _a2.settings) || {},
      info: false,
      status: true,
      session_status: true,
      errors: {},
      expand: ((_b2 = window.ckyNoticeExpand) == null ? void 0 : _b2.status) || false,
      gcm: ((_c2 = window.ckyGcmConfig) == null ? void 0 : _c2.settings) || {},
      connect_notice: ((_d = window.ckyConnectNotice) == null ? void 0 : _d.status) || false,
      disconnect_success_overlay: false,
      affiliate_banner_visible: false,
      info_loaded: false,
      setOption: /* @__PURE__ */ __name((key, value) => set2((state) => __spreadProps(__spreadValues({}, state), {
        options: __spreadProps(__spreadValues({}, state.options), { [key]: value })
      })), "setOption"),
      setInfo: /* @__PURE__ */ __name((data) => {
        if (data && typeof data === "object") {
          const w = window;
          if (!w.ckyConfig) w.ckyConfig = {};
          w.ckyConfig.info = data;
        }
        set2((state) => __spreadProps(__spreadValues({}, state), {
          info: data
        }));
      }, "setInfo"),
      setGcmInfo: /* @__PURE__ */ __name((data) => set2((state) => __spreadProps(__spreadValues({}, state), {
        gcm: data
      })), "setGcmInfo"),
      updateSettings: /* @__PURE__ */ __name((data) => set2((state) => {
        window.ckyConfig.settings = data;
        if ((data == null ? void 0 : data.languages) && typeof data.languages === "object") {
          const l = data.languages;
          __vitePreload(() => __async(null, null, function* () {
            const { useLanguageStore: useLanguageStore2 } = yield Promise.resolve().then(() => languageStore);
            return { useLanguageStore: useLanguageStore2 };
          }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href).then(({ useLanguageStore: useLanguageStore2 }) => {
            useLanguageStore2.setState({
              selected: Array.isArray(l.selected) ? l.selected : ["en"],
              default: typeof l.default === "string" ? l.default : "en",
              current: typeof l.current === "string" ? l.current : typeof l.default === "string" ? l.default : "en"
            });
            __vitePreload(() => __async(null, null, function* () {
              const { syncLanguageMirrorFromSettings: syncLanguageMirrorFromSettings2 } = yield Promise.resolve().then(() => languageBootstrap);
              return { syncLanguageMirrorFromSettings: syncLanguageMirrorFromSettings2 };
            }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href).then(
              ({ syncLanguageMirrorFromSettings: syncLanguageMirrorFromSettings2 }) => {
                syncLanguageMirrorFromSettings2();
              }
            );
          });
        }
        return __spreadProps(__spreadValues({}, state), {
          options: data
        });
      }), "updateSettings"),
      updateGcm: /* @__PURE__ */ __name((data) => set2((state) => {
        window.ckyGcmConfig.settings = data;
        return __spreadProps(__spreadValues({}, state), {
          gcm: data
        });
      }), "updateGcm"),
      updateStatus: /* @__PURE__ */ __name((status = true) => set2((state) => __spreadProps(__spreadValues({}, state), {
        status
      })), "updateStatus"),
      updateSessionStatus: /* @__PURE__ */ __name((status) => set2((state) => __spreadProps(__spreadValues({}, state), {
        session_status: status
      })), "updateSessionStatus"),
      setErrors: /* @__PURE__ */ __name((errors) => set2((state) => __spreadProps(__spreadValues({}, state), {
        errors
      })), "setErrors"),
      setExpand: /* @__PURE__ */ __name((expand) => set2((state) => {
        if (window.ckyNoticeExpand) {
          window.ckyNoticeExpand.status = expand;
        }
        return __spreadProps(__spreadValues({}, state), {
          expand
        });
      }), "setExpand"),
      setConnectNotice: /* @__PURE__ */ __name((status) => set2((state) => {
        if (window.ckyConnectNotice) {
          window.ckyConnectNotice.status = status;
        }
        return __spreadProps(__spreadValues({}, state), {
          connect_notice: status
        });
      }), "setConnectNotice"),
      setDisconnectSuccessOverlay: /* @__PURE__ */ __name((show) => set2({ disconnect_success_overlay: show }), "setDisconnectSuccessOverlay"),
      setAffiliateBannerVisible: /* @__PURE__ */ __name((visible) => set2({ affiliate_banner_visible: visible }), "setAffiliateBannerVisible"),
      reInit: /* @__PURE__ */ __name(() => __async(null, null, function* () {
        try {
          const response = yield getSettings();
          if (response && typeof response === "object") {
            get2().updateSettings(response);
          }
        } catch (error) {
          console.error("Error reinitializing:", error);
          get2().setErrors({ reinit: "Failed to reinitialize settings" });
        }
      }), "reInit"),
      loadInfo: /* @__PURE__ */ __name((force = false) => __async(null, null, function* () {
        var _a3;
        try {
          const response = yield getSettingsInfo(force);
          if (response) {
            get2().setInfo(response);
            get2().updateStatus(true);
            set2({ info_loaded: true });
            const state = get2();
            const languages2 = state.info && state.info.languages ? state.info.languages : {};
            const defaultLang = languages2 && languages2.default ? languages2.default : "en";
            yield setDefaultLanguage(defaultLang);
            get2().checkURLMismatch();
            return true;
          } else {
            throw new Error("Failed to load info");
          }
        } catch (error) {
          console.error("Error loading info:", error);
          if ((_a3 = error == null ? void 0 : error.data) == null ? void 0 : _a3.status) {
            get2().updateStatus(false);
            if (error.data.status === 401) {
              get2().updateSessionStatus(false);
            }
          }
          get2().setErrors({ load: "Failed to load settings info" });
          return false;
        }
      }), "loadInfo"),
      save: /* @__PURE__ */ __name((clear = true) => __async(null, null, function* () {
        try {
          const value = get2().options;
          const response = yield saveSettings(value, clear);
          if (response) {
            get2().updateSettings(response);
            get2().loadInfo();
            return true;
          } else {
            return false;
          }
        } catch (error) {
          console.error("Error saving settings:", error);
          get2().setErrors({ save: "Failed to save settings" });
          return false;
        }
      }), "save"),
      checkURLMismatch: /* @__PURE__ */ __name(() => {
        var _a3, _b3;
        const state = get2();
        if (((_b3 = (_a3 = state.options) == null ? void 0 : _a3.account) == null ? void 0 : _b3.connected) === false) {
          return;
        }
        if (!checkDomain()) {
          get2().setErrors({
            urlMismatch: true
          });
        }
      }, "checkURLMismatch")
    };
  }, "createAppState");
  const useAppStore = create()(
    createAppState
  );
  const useSettingsStore = /* @__PURE__ */ __name(() => useAppStore(
    useShallow((state) => ({
      options: state.options,
      info: state.info,
      status: state.status,
      session_status: state.session_status,
      errors: state.errors,
      expand: state.expand,
      gcm: state.gcm,
      connect_notice: state.connect_notice,
      setOption: state.setOption,
      setInfo: state.setInfo,
      setGcmInfo: state.setGcmInfo,
      updateSettings: state.updateSettings,
      updateGcm: state.updateGcm,
      updateStatus: state.updateStatus,
      updateSessionStatus: state.updateSessionStatus,
      setErrors: state.setErrors,
      setExpand: state.setExpand,
      setConnectNotice: state.setConnectNotice,
      reInit: state.reInit,
      loadInfo: state.loadInfo,
      save: state.save,
      checkURLMismatch: state.checkURLMismatch
    }))
  ), "useSettingsStore");
  const store = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    useAppStore,
    useSettingsStore
  }, Symbol.toStringTag, { value: "Module" }));
  function getBootstrapLanguages() {
    var _a2;
    const w = typeof window !== "undefined" ? window.ckyConfig : null;
    const fromSettings = (_a2 = w == null ? void 0 : w.settings) == null ? void 0 : _a2.languages;
    const legacy = w == null ? void 0 : w.languages;
    const src = fromSettings && typeof fromSettings === "object" ? fromSettings : legacy && typeof legacy === "object" ? legacy : null;
    if (!src) {
      return { selected: ["en"], default: "en", current: "en" };
    }
    const selected = Array.isArray(src.selected) ? src.selected : ["en"];
    const def = typeof src.default === "string" ? src.default : "en";
    const cur = typeof src.current === "string" ? src.current : def;
    return { selected, default: def, current: cur };
  }
  __name(getBootstrapLanguages, "getBootstrapLanguages");
  function getInitialAvailableLanguages() {
    var _a2, _b2;
    const w = typeof window !== "undefined" ? window.ckyLanguages : null;
    if (Array.isArray(w) && w.length > 0) {
      return w;
    }
    const fallback = (_b2 = (_a2 = window.ckyConfig) == null ? void 0 : _a2.languages) == null ? void 0 : _b2.available;
    return Array.isArray(fallback) ? fallback : [];
  }
  __name(getInitialAvailableLanguages, "getInitialAvailableLanguages");
  function syncLanguageMirrorFromSettings() {
    if (typeof window === "undefined") return;
    const b = getBootstrapLanguages();
    const cfg = window.ckyConfig;
    if (!cfg) return;
    if (!cfg.languages) cfg.languages = {};
    cfg.languages.selected = b.selected;
    cfg.languages.default = b.default;
    cfg.languages.current = b.current;
  }
  __name(syncLanguageMirrorFromSettings, "syncLanguageMirrorFromSettings");
  function mirrorPendingLanguageState(state) {
    var _a2;
    if (typeof window === "undefined") return;
    const cfg = window.ckyConfig;
    if (!cfg) return;
    if (!cfg.languages) cfg.languages = {};
    cfg.languages.selected = state.selected;
    cfg.languages.default = state.default;
    cfg.languages.current = state.current;
    if (((_a2 = cfg.settings) == null ? void 0 : _a2.languages) && typeof cfg.settings.languages === "object") {
      cfg.settings.languages.selected = state.selected;
      cfg.settings.languages.default = state.default;
      cfg.settings.languages.current = state.current;
    }
  }
  __name(mirrorPendingLanguageState, "mirrorPendingLanguageState");
  const languageBootstrap = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    getBootstrapLanguages,
    getInitialAvailableLanguages,
    mirrorPendingLanguageState,
    syncLanguageMirrorFromSettings
  }, Symbol.toStringTag, { value: "Module" }));
  function getAvailableLanguages() {
    return __async(this, null, function* () {
      try {
        const response = yield ckyRest.get({
          path: "languages/available"
        });
        return response && Array.isArray(response) ? response : [];
      } catch (error) {
        console.error("Error fetching available languages:", error);
        return [];
      }
    });
  }
  __name(getAvailableLanguages, "getAvailableLanguages");
  function saveLanguageTranslations(selectedLanguages) {
    return __async(this, null, function* () {
      try {
        yield ckyRest.post({
          path: "languages/translations",
          data: selectedLanguages
        });
      } catch (error) {
        console.log("Translations API error (non-critical):", error);
      }
    });
  }
  __name(saveLanguageTranslations, "saveLanguageTranslations");
  function getLanguageConfig() {
    return __async(this, null, function* () {
      return getBootstrapLanguages();
    });
  }
  __name(getLanguageConfig, "getLanguageConfig");
  const boot = getBootstrapLanguages();
  const createLanguageState = /* @__PURE__ */ __name((set2, get2) => ({
    available: getInitialAvailableLanguages(),
    selected: boot.selected,
    default: boot.default,
    current: boot.current,
    loading: false,
    setAvailable: /* @__PURE__ */ __name((languages2) => set2((state) => __spreadProps(__spreadValues({}, state), {
      available: languages2
    })), "setAvailable"),
    setSelected: /* @__PURE__ */ __name((selected) => set2((state) => {
      const next = __spreadProps(__spreadValues({}, state), { selected });
      mirrorPendingLanguageState(next);
      return next;
    }), "setSelected"),
    setDefault: /* @__PURE__ */ __name((code) => set2((state) => {
      const next = __spreadProps(__spreadValues({}, state), { default: code });
      mirrorPendingLanguageState(next);
      return next;
    }), "setDefault"),
    setCurrent: /* @__PURE__ */ __name((code) => set2((state) => {
      const next = __spreadProps(__spreadValues({}, state), { current: code });
      mirrorPendingLanguageState(next);
      return next;
    }), "setCurrent"),
    setLoading: /* @__PURE__ */ __name((loading) => set2((state) => __spreadProps(__spreadValues({}, state), {
      loading
    })), "setLoading"),
    loadAvailableLanguages: /* @__PURE__ */ __name(() => __async(null, null, function* () {
      try {
        const languages2 = yield getAvailableLanguages();
        if (languages2 && languages2.length > 0) {
          get2().setAvailable(languages2);
          if (!window.ckyConfig) {
            window.ckyConfig = {};
          }
          if (!window.ckyConfig.languages) {
            window.ckyConfig.languages = {};
          }
          window.ckyConfig.languages.available = languages2;
        }
      } catch (error) {
        console.error("Error loading available languages:", error);
      }
    }), "loadAvailableLanguages"),
    saveSelected: /* @__PURE__ */ __name((..._0) => __async(null, [..._0], function* (options2 = {}) {
      var _a2;
      const {
        remove = false,
        clear = false,
        selected: overrideSelected
      } = options2;
      try {
        const selectedToSave = overrideSelected !== void 0 ? overrideSelected : get2().selected;
        if (!remove) {
          yield saveLanguageTranslations(selectedToSave);
        }
        const { setOption: setOption2 } = yield __vitePreload(() => __async(null, null, function* () {
          const { setOption: setOption3 } = yield Promise.resolve().then(() => common);
          return { setOption: setOption3 };
        }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href);
        const { useAppStore: useAppStore2 } = yield __vitePreload(() => __async(null, null, function* () {
          const { useAppStore: useAppStore3 } = yield Promise.resolve().then(() => store);
          return { useAppStore: useAppStore3 };
        }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href);
        const store$1 = useAppStore2.getState();
        const currentSettings = (store$1 == null ? void 0 : store$1.options) || ((_a2 = window.ckyConfig) == null ? void 0 : _a2.settings) || {};
        const languages2 = currentSettings.languages || {};
        languages2.selected = selectedToSave;
        setOption2("languages", languages2);
        if (store$1 && store$1.setOption) {
          store$1.setOption("languages", languages2);
        }
        const { saveOptions: saveOptions2 } = yield __vitePreload(() => __async(null, null, function* () {
          const { saveOptions: saveOptions3 } = yield Promise.resolve().then(() => common);
          return { saveOptions: saveOptions3 };
        }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href);
        const success = yield saveOptions2(clear);
        return { success, selected: selectedToSave };
      } catch (error) {
        console.error("Error saving selected languages:", error);
        throw error;
      }
    }), "saveSelected"),
    saveDefault: /* @__PURE__ */ __name((..._0) => __async(null, [..._0], function* (options2 = {}) {
      var _a2;
      const { clear = false } = options2;
      try {
        const defaultCode = get2().default;
        const { setOption: setOption2 } = yield __vitePreload(() => __async(null, null, function* () {
          const { setOption: setOption3 } = yield Promise.resolve().then(() => common);
          return { setOption: setOption3 };
        }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href);
        const { useAppStore: useAppStore2 } = yield __vitePreload(() => __async(null, null, function* () {
          const { useAppStore: useAppStore3 } = yield Promise.resolve().then(() => store);
          return { useAppStore: useAppStore3 };
        }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href);
        const store$1 = useAppStore2.getState();
        const currentSettings = (store$1 == null ? void 0 : store$1.options) || ((_a2 = window.ckyConfig) == null ? void 0 : _a2.settings) || {};
        const languages2 = currentSettings.languages || {};
        languages2.default = defaultCode;
        languages2.current = defaultCode;
        setOption2("languages", languages2);
        if (store$1 && store$1.setOption) {
          store$1.setOption("languages", languages2);
        }
        const { saveOptions: saveOptions2 } = yield __vitePreload(() => __async(null, null, function* () {
          const { saveOptions: saveOptions3 } = yield Promise.resolve().then(() => common);
          return { saveOptions: saveOptions3 };
        }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href);
        yield saveOptions2(clear);
        if (store$1 && store$1.setInfo) {
          const currentInfo = store$1.info;
          if (currentInfo && typeof currentInfo === "object") {
            store$1.setInfo(__spreadProps(__spreadValues({}, currentInfo), {
              defaultLanguage: defaultCode,
              languages: __spreadProps(__spreadValues({}, currentInfo.languages || {}), {
                default: defaultCode,
                current: defaultCode
              })
            }));
          }
        }
      } catch (error) {
        console.error("Error saving default language:", error);
        throw error;
      }
    }), "saveDefault"),
    init: /* @__PURE__ */ __name(() => __async(null, null, function* () {
      get2().setLoading(true);
      try {
        yield get2().loadAvailableLanguages();
        const config2 = yield getLanguageConfig();
        if (config2 && typeof config2 === "object") {
          if (config2.selected && Array.isArray(config2.selected)) {
            get2().setSelected(config2.selected);
          }
          if (config2.default) {
            get2().setDefault(config2.default);
          }
          if (config2.current) {
            get2().setCurrent(config2.current);
          }
        }
      } catch (error) {
        console.error("Error initializing languages:", error);
      } finally {
        get2().setLoading(false);
      }
    }), "init")
  }), "createLanguageState");
  const useLanguageStore = create()(
    createLanguageState
  );
  const languageStore = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    useLanguageStore
  }, Symbol.toStringTag, { value: "Module" }));
  const useBannerStore = create()(
    devtools(
      (set2, get2) => ({
        // Initial state
        items: false,
        current: false,
        preview: false,
        presets: [],
        configs: [],
        template: {},
        errors: {},
        // Actions
        setBanners: /* @__PURE__ */ __name((banners) => set2((state) => __spreadProps(__spreadValues({}, state), {
          items: banners
        })), "setBanners"),
        setCurrentBanner: /* @__PURE__ */ __name((banner2) => set2((state) => __spreadProps(__spreadValues({}, state), {
          current: banner2
        })), "setCurrentBanner"),
        setPreview: /* @__PURE__ */ __name((preview) => set2((state) => __spreadProps(__spreadValues({}, state), {
          preview
        })), "setPreview"),
        setPresets: /* @__PURE__ */ __name((presets) => set2((state) => __spreadProps(__spreadValues({}, state), {
          presets
        })), "setPresets"),
        setConfigs: /* @__PURE__ */ __name((configs) => set2((state) => __spreadProps(__spreadValues({}, state), {
          configs
        })), "setConfigs"),
        setTemplate: /* @__PURE__ */ __name((template) => set2((state) => __spreadProps(__spreadValues({}, state), {
          template
        })), "setTemplate"),
        setErrors: /* @__PURE__ */ __name((errors) => set2((state) => __spreadProps(__spreadValues({}, state), {
          errors
        })), "setErrors"),
        // Async actions
        reInit: /* @__PURE__ */ __name(() => __async(null, null, function* () {
          try {
            const response = yield ckyRest.get({
              path: "banners"
            });
            if (response && Array.isArray(response)) {
              const banners = response.map((item) => ({
                id: item.id || 0,
                name: item.name || "",
                slug: item.slug || "",
                default: item.default || false,
                status: item.status == true,
                properties: item.properties || {},
                contents: item.contents || {}
              }));
              get2().setBanners(banners);
            }
          } catch (error) {
            console.error("Error reinitializing banners:", error);
          }
        }), "reInit"),
        getBanners: /* @__PURE__ */ __name(() => __async(null, null, function* () {
          const items = get2().items;
          if (items !== false) {
            return JSON.parse(JSON.stringify(items));
          }
          yield get2().reInit();
          return Array.isArray(get2().items) ? get2().items : [];
        }), "getBanners"),
        getCurrentBanner: /* @__PURE__ */ __name(() => __async(null, null, function* () {
          const current = get2().current;
          if (current && current.id > 0) {
            return current;
          }
          try {
            const banners = yield get2().getBanners();
            if (Array.isArray(banners) && banners.length > 0) {
              let banner2 = banners.find((b) => b.default === true);
              if (!banner2) {
                banner2 = banners[0];
              }
              if (banner2) {
                get2().setCurrentBanner(banner2);
                return banner2;
              }
            }
          } catch (error) {
            console.error("Error getting current banner:", error);
          }
          return false;
        }), "getCurrentBanner"),
        getActiveBanner: /* @__PURE__ */ __name(() => __async(null, null, function* () {
          const banners = yield get2().getBanners();
          if (Array.isArray(banners) && banners.length > 0) {
            let banner2 = banners.find((b) => b.status == true);
            if (!banner2) {
              banner2 = banners[0];
            }
            if (banner2) {
              get2().setCurrentBanner(banner2);
              return banner2;
            }
          }
          return false;
        }), "getActiveBanner"),
        saveBanner: /* @__PURE__ */ __name((banner2, language) => __async(null, null, function* () {
          if (!banner2.id) {
            return false;
          }
          try {
            const params = language ? { language } : {};
            const response = yield ckyRest.put({
              path: `/banners/${banner2.id}`,
              data: banner2,
              params
            });
            if (response && response.id) {
              yield get2().reInit();
              return true;
            }
          } catch (error) {
            console.error("Error saving banner:", error);
          }
          return false;
        }), "saveBanner"),
        loadConfigs: /* @__PURE__ */ __name(() => __async(null, null, function* () {
          const configs = get2().configs;
          if (configs.length > 0) {
            return;
          }
          try {
            const response = yield ckyRest.get({
              path: "banners/configs"
            });
            if (response && Array.isArray(response)) {
              get2().setConfigs(response);
            }
          } catch (error) {
            console.error("Error loading configs:", error);
          }
        }), "loadConfigs"),
        loadTemplate: /* @__PURE__ */ __name((force = false) => __async(null, null, function* () {
          const current = get2().current;
          if (!current || !current.properties) {
            return null;
          }
          const type = current.properties.settings.type;
          const law = current.properties.settings.applicableLaw;
          const templates = get2().template;
          if (templates[law] && templates[law][type] && force === false) {
            return templates[law][type];
          }
          try {
            const { useLanguageStore: useLanguageStore2 } = yield __vitePreload(() => __async(null, null, function* () {
              const { useLanguageStore: useLanguageStore3 } = yield Promise.resolve().then(() => languageStore);
              return { useLanguageStore: useLanguageStore3 };
            }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href);
            const currentLanguage = useLanguageStore2.getState().current;
            const response = yield ckyRest.post({
              path: "banners/preview",
              params: {
                language: currentLanguage
              },
              data: current
            });
            if (response && response.html) {
              const updatedTemplates = __spreadValues({}, templates);
              if (!updatedTemplates[law]) {
                updatedTemplates[law] = {};
              }
              updatedTemplates[law][type] = response;
              get2().setTemplate(updatedTemplates);
              return updatedTemplates[law][type];
            }
          } catch (error) {
            console.error("Error loading template:", error);
          }
          return null;
        }), "loadTemplate")
      }),
      {
        name: "banner-store"
      }
    )
  );
  const bannerStore = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    useBannerStore
  }, Symbol.toStringTag, { value: "Module" }));
  const globals$1 = /* @__PURE__ */ __name(() => {
    var _a2;
    return (_a2 = window.ckyGlobals) != null ? _a2 : {};
  }, "globals$1");
  const siteUrl = /* @__PURE__ */ __name(() => {
    var _a2;
    return ((_a2 = globals$1().site) == null ? void 0 : _a2.url) || "";
  }, "siteUrl");
  const webApp = /* @__PURE__ */ __name(() => globals$1().webApp || {}, "webApp");
  const version = /* @__PURE__ */ __name(() => globals$1().pluginVersion || "", "version");
  const multilingual = /* @__PURE__ */ __name(() => !!globals$1().multilingual, "multilingual");
  let connectionTriggered = false;
  function setConnectionTriggered(value) {
    connectionTriggered = value;
  }
  __name(setConnectionTriggered, "setConnectionTriggered");
  function isConnectionTriggered() {
    return connectionTriggered;
  }
  __name(isConnectionTriggered, "isConnectionTriggered");
  function appendRegisterCommon(url) {
    url.searchParams.append("platform", "wordpress");
    url.searchParams.append("mode", "register");
    url.searchParams.append("website", siteUrl());
    url.searchParams.append("multilingual", String(multilingual()));
    url.searchParams.append("ref", `WPCY${version()}a`);
  }
  __name(appendRegisterCommon, "appendRegisterCommon");
  function appendAdditionalParams(url, additionalParams) {
    if (!additionalParams || typeof additionalParams !== "object" || Array.isArray(additionalParams)) return;
    for (const [key, value] of Object.entries(additionalParams)) {
      url.searchParams.append(key, String(value));
    }
  }
  __name(appendAdditionalParams, "appendAdditionalParams");
  function getSignupUrl() {
    const base = webApp().signUpUrl;
    if (!base) return "";
    const url = new URL(base);
    appendRegisterCommon(url);
    url.searchParams.append("plan", "free");
    return url.toString();
  }
  __name(getSignupUrl, "getSignupUrl");
  function getSignupUrlWithParams(feature = "", additionalParams = null) {
    const planSel = webApp().planSelectionUrl;
    const signUp = webApp().signUpUrl;
    const base = planSel || signUp;
    if (!base) return "";
    const url = new URL(base);
    appendRegisterCommon(url);
    if (feature) url.searchParams.append("feature", feature);
    appendAdditionalParams(url, additionalParams);
    return url.toString();
  }
  __name(getSignupUrlWithParams, "getSignupUrlWithParams");
  function getLoginUrl(upgrade = false, feature = "", additionalParams = null) {
    const base = webApp().loginUrl;
    if (!base) return "";
    const mode = upgrade ? "upgrade" : "connect";
    const url = new URL(base);
    url.searchParams.append("platform", "wordpress");
    url.searchParams.append("mode", mode);
    url.searchParams.append("website", siteUrl());
    url.searchParams.append("multilingual", String(multilingual()));
    if (upgrade) {
      url.searchParams.append("upgrade_source", "cypluginupgrade");
    }
    if (feature) {
      url.searchParams.append("feature", feature);
    }
    appendAdditionalParams(url, additionalParams);
    return url.toString();
  }
  __name(getLoginUrl, "getLoginUrl");
  function getSessionExpiredUrl(websiteId) {
    const base = webApp().loginUrl;
    if (!base) return "";
    const url = new URL(base);
    url.searchParams.append("platform", "wordpress");
    url.searchParams.append("mode", "reconnect");
    url.searchParams.append("website", siteUrl());
    if (websiteId) {
      url.searchParams.append("website_id", websiteId);
    }
    return url.toString();
  }
  __name(getSessionExpiredUrl, "getSessionExpiredUrl");
  function getCheckoutUrl(plan, currency) {
    const base = webApp().checkoutUrl;
    if (!base) return "";
    const url = new URL(base);
    url.searchParams.append("platform", "wordpress");
    url.searchParams.append("mode", "upgrade");
    url.searchParams.append("website", siteUrl());
    url.searchParams.append("plan", plan);
    url.searchParams.append("currency", currency);
    let ctaType = plan.split("-")[0];
    if (ctaType === "basic") ctaType = "b";
    else if (ctaType === "pro") ctaType = "c";
    else ctaType = "d";
    url.searchParams.append("ref", `WPCY${version()}${ctaType}`);
    return url.toString();
  }
  __name(getCheckoutUrl, "getCheckoutUrl");
  function getAppOrigin() {
    const u2 = webApp().url || "";
    if (!u2) return "";
    try {
      return new URL(u2).origin;
    } catch (e) {
      return "";
    }
  }
  __name(getAppOrigin, "getAppOrigin");
  const ConnectContext = reactExports.createContext(null);
  function emitWindowEvent(name) {
    if (typeof window === "undefined") return;
    window.dispatchEvent(new CustomEvent(name));
  }
  __name(emitWindowEvent, "emitWindowEvent");
  function openInNewWindow(url) {
    var _a2;
    if (!url) return;
    try {
      (_a2 = window.open(url, "_blank")) == null ? void 0 : _a2.focus();
    } catch (e) {
      alert(
        __$1(
          "Your browser blocked the authorization window from opening. Please check your popup settings.",
          "cookie-law-info"
        )
      );
    }
  }
  __name(openInNewWindow, "openInNewWindow");
  function pullSettingsAndApply(updateSettings, requireAccount) {
    return __async(this, null, function* () {
      const { getSettings: getSettings2 } = yield __vitePreload(() => __async(null, null, function* () {
        const { getSettings: getSettings3 } = yield Promise.resolve().then(() => settingsService);
        return { getSettings: getSettings3 };
      }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href);
      const response = yield getSettings2();
      if (!response) return;
      if (requireAccount && !response.account) return;
      updateSettings(response);
    });
  }
  __name(pullSettingsAndApply, "pullSettingsAndApply");
  function openWebAppPath(path) {
    var _a2, _b2;
    const account = getOption("account");
    if (!(account == null ? void 0 : account.connected)) return false;
    const webAppUrl = ((_b2 = (_a2 = window.ckyGlobals) == null ? void 0 : _a2.webApp) == null ? void 0 : _b2.url) || "";
    if (!webAppUrl) return false;
    const base = `${webAppUrl}/${path}`;
    const url = `${base}?${new URLSearchParams({ website: account.website_id || "" }).toString()}`;
    try {
      const a2 = document.createElement("a");
      a2.target = "_blank";
      a2.href = url;
      a2.rel = "noopener noreferrer";
      document.body.appendChild(a2);
      a2.click();
      document.body.removeChild(a2);
      return true;
    } catch (error) {
      console.error("Error redirecting to app:", error);
      return false;
    }
  }
  __name(openWebAppPath, "openWebAppPath");
  function ConnectProvider({ children }) {
    const navigate = useNavigate();
    const loadInfo = useAppStore((s2) => s2.loadInfo);
    const updateSettings = useAppStore((s2) => s2.updateSettings);
    const updateSessionStatus = useAppStore((s2) => s2.updateSessionStatus);
    const [showConnectSuccess, setShowConnectSuccess] = reactExports.useState(false);
    const [connectSuccessSyncing, setConnectSuccessSyncing] = reactExports.useState(false);
    const applyConnection = reactExports.useCallback(
      (data) => __async(null, null, function* () {
        if (!(data == null ? void 0 : data.email)) return;
        const account = getOption("account") || {};
        const api = getOption("api") || {};
        const onboarding = getOption("onboarding") || {};
        onboarding.step = 2;
        setOption("onboarding", onboarding);
        if (data.website_token) api.token = data.website_token;
        if (data.website_id) account.website_id = data.website_id;
        if (data.website_key) account.website_key = data.website_key;
        if (data.slug) account.plan = data.slug;
        account.status = true;
        account.connected = true;
        if (data.email) account.email = data.email;
        setOption("account", account);
        setOption("api", api);
        const saved = yield saveOptions();
        if (saved) {
          try {
            yield ckyRest.post({
              path: "/settings/sync",
              data: { priority: data.priority || "plugin" }
            });
          } catch (e) {
            console.warn("Cloud sync after connect:", e);
          }
          yield reloadSettings();
          yield pullSettingsAndApply(updateSettings, true);
          yield loadInfo(true);
          emitWindowEvent("afterSyncing");
        }
      }),
      [loadInfo, updateSettings]
    );
    const updateSession = reactExports.useCallback(
      (data) => __async(null, null, function* () {
        const account = getOption("account") || {};
        const api = getOption("api") || {};
        if (data.website_token) api.token = data.website_token;
        if (data.website_id) account.website_id = data.website_id;
        if (data.email) account.email = data.email;
        setOption("account", account);
        setOption("api", api);
        yield saveOptions();
        yield reloadSettings();
        yield pullSettingsAndApply(updateSettings, false);
        updateSessionStatus(true);
        yield loadInfo(true);
        emitWindowEvent("afterSyncing");
      }),
      [loadInfo, updateSettings, updateSessionStatus]
    );
    reactExports.useEffect(() => {
      const handleMessage = /* @__PURE__ */ __name((event) => __async(null, null, function* () {
        var _a2;
        if (!isConnectionTriggered()) return;
        const appOrigin = getAppOrigin();
        if (!appOrigin || event.origin !== appOrigin) return;
        if (!event.data || typeof event.data !== "string") return;
        let data;
        try {
          data = JSON.parse(event.data);
        } catch (e) {
          return;
        }
        setConnectionTriggered(false);
        const connected = (_a2 = getOption("account")) == null ? void 0 : _a2.connected;
        if (connected) {
          if (!useAppStore.getState().session_status) {
            yield updateSession(data);
          } else if ((data == null ? void 0 : data.upgrade) === "success") {
            yield loadInfo(true);
            emitWindowEvent("afterSyncing");
          }
        } else {
          setShowConnectSuccess(true);
          setConnectSuccessSyncing(true);
          yield applyConnection(
            data
          );
          setConnectSuccessSyncing(false);
          navigate({ to: "/dashboard" });
        }
      }), "handleMessage");
      window.addEventListener("message", handleMessage);
      return () => window.removeEventListener("message", handleMessage);
    }, [applyConnection, updateSession, loadInfo, navigate]);
    const connectToApp = reactExports.useCallback(
      (existing = false, feature = "", additionalParams = null) => {
        setConnectionTriggered(true);
        emitWindowEvent("beforeConnection");
        const hasObjectParams = additionalParams && typeof additionalParams === "object" && !Array.isArray(additionalParams);
        const url = existing ? getLoginUrl(false, feature, additionalParams) : hasObjectParams ? getSignupUrlWithParams(feature, additionalParams) : getSignupUrl();
        openInNewWindow(url);
      },
      []
    );
    const connectToPaidPlan = reactExports.useCallback((plan, currency) => {
      setConnectionTriggered(true);
      emitWindowEvent("beforeConnection");
      openInNewWindow(getCheckoutUrl(plan, currency));
    }, []);
    const sessionExpiredLogin = reactExports.useCallback(() => {
      var _a2;
      setConnectionTriggered(true);
      const websiteId = (_a2 = getOption("account")) == null ? void 0 : _a2.website_id;
      openInNewWindow(getSessionExpiredUrl(websiteId));
    }, []);
    const redirectToApp2 = reactExports.useCallback((path = "dashboard") => openWebAppPath(path), []);
    const value = reactExports.useMemo(
      () => ({
        connectToApp,
        connectToPaidPlan,
        sessionExpiredLogin,
        redirectToApp: redirectToApp2,
        showConnectSuccess,
        connectSuccessSyncing,
        setShowConnectSuccess
      }),
      [
        connectToApp,
        connectToPaidPlan,
        sessionExpiredLogin,
        redirectToApp2,
        showConnectSuccess,
        connectSuccessSyncing
      ]
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectContext.Provider, { value, children });
  }
  __name(ConnectProvider, "ConnectProvider");
  function useConnectFlow() {
    const ctx2 = reactExports.useContext(ConnectContext);
    if (!ctx2) {
      throw new Error("useConnectFlow must be used within a ConnectProvider");
    }
    return ctx2;
  }
  __name(useConnectFlow, "useConnectFlow");
  function useConnectFlowOptional() {
    return reactExports.useContext(ConnectContext);
  }
  __name(useConnectFlowOptional, "useConnectFlowOptional");
  const MODAL_439_CONTENT_CLASS = "cky:max-w-[439px] cky:rounded-[12px] cky:bg-white cky:w-full cky:border-none cky:gap-5";
  const MODAL_CORNER_CLOSE_CLASS = "cky:!right-4 cky:!top-4 cky:z-10";
  const MODAL_HEADER_INSET_CLASS = "cky:px-[30px] cky:pt-[30px] cky:pb-0";
  const MODAL_FEATURE_TEXT_CLASS = "cky:text-base cky:font-semibold cky:leading-6 cky:text-[#14142A] cky:text-center cky:m-0 cky:w-full";
  const MODAL_AVAILABILITY_TEXT_CLASS = "cky:text-[14px] cky:text-[#4E4B66] cky:text-center";
  const MODAL_AVAILABILITY_ROW_CLASS = "cky:flex cky:justify-center cky:w-full";
  const MODAL_CONNECT_ACTIONS_CLASS = "cky:flex cky:flex-col cky:items-center cky:justify-center cky:gap-4 cky:w-full";
  function globals() {
    return typeof window !== "undefined" ? window.ckyGlobals : void 0;
  }
  __name(globals, "globals");
  ((_Tc = globals()) == null ? void 0 : _Tc.multilingual) || false;
  ((_Uc = globals()) == null ? void 0 : _Uc.pluginVersion) || "";
  let applyFilterInFlight = null;
  function applyFilter(filterData = {}) {
    if (applyFilterInFlight) return applyFilterInFlight;
    const promise = ckyRest.post({
      path: "/settings/apply_filter",
      data: {
        filter_name: "cookieyes_cloudways_redirect",
        filter_data: filterData
      }
    }).then((response) => response).catch((error) => {
      console.error("Error applying filter:", error);
      return null;
    }).finally(() => {
      applyFilterInFlight = null;
    });
    applyFilterInFlight = promise;
    return promise;
  }
  __name(applyFilter, "applyFilter");
  function hasFilterData(response) {
    return !!(response && response.filter_result !== void 0 && response.filter_result !== null && !(Array.isArray(response.filter_result) && response.filter_result.length === 0));
  }
  __name(hasFilterData, "hasFilterData");
  function addQuery(url, obj) {
    const params = new URLSearchParams(obj);
    const q = params.toString();
    return q ? `${url}${url.includes("?") ? "&" : "?"}${q}` : url;
  }
  __name(addQuery, "addQuery");
  function getAppRedirectURL(path = "dashboard") {
    var _a2, _b2;
    const account = getOption("account");
    if (!(account == null ? void 0 : account.connected)) return false;
    const base = (_b2 = (_a2 = globals()) == null ? void 0 : _a2.webApp) == null ? void 0 : _b2.url;
    if (!base) return false;
    const url = base.replace(/\/$/, "") + "/" + path.replace(/^\//, "");
    const query = { website: String(account.website_id || "") };
    return addQuery(url, query);
  }
  __name(getAppRedirectURL, "getAppRedirectURL");
  function redirectToApp(path = "dashboard") {
    const url = getAppRedirectURL(path);
    if (!url) return;
    try {
      const a2 = document.createElement("a");
      a2.target = "_blank";
      a2.href = url;
      a2.rel = "noopener noreferrer";
      a2.click();
    } catch (e) {
      console.error("Redirect failed", e);
    }
  }
  __name(redirectToApp, "redirectToApp");
  function openFeatureUpgradeFlow(feature, upgradeSource) {
    var _a2, _b2, _c2;
    const account = getOption("account");
    if (!(account == null ? void 0 : account.connected)) return;
    const base = String(((_b2 = (_a2 = globals()) == null ? void 0 : _a2.webApp) == null ? void 0 : _b2.url) || "").replace(/\/$/, "");
    const siteInfo = ((_c2 = window.ckyConfig) == null ? void 0 : _c2.info) || {};
    const website = (siteInfo == null ? void 0 : siteInfo.website) || {};
    const canStartOptoutTrial2 = !!(siteInfo && website && website.canStartOptoutTrial);
    if (canStartOptoutTrial2) {
      const params = new URLSearchParams({
        upgrade_id: String(account.website_id || ""),
        openUpgrade: "true",
        upgrade_source: upgradeSource,
        from_trial: "true"
      });
      window.open(`${base}/settings?${params.toString()}`, "_blank", "noopener,noreferrer");
      return;
    }
    const search = new URLSearchParams({
      website: String(account.website_id || "")
    });
    if (feature) search.set("feature", feature);
    if (upgradeSource) search.set("upgrade_source", upgradeSource);
    window.open(`${base}/wp-plan-selector?${search.toString()}`, "_blank", "noopener,noreferrer");
  }
  __name(openFeatureUpgradeFlow, "openFeatureUpgradeFlow");
  const BTN_ACCESS_PLANS = __$1("Connect to Web App to Access", "cookie-law-info");
  const BTN_EXISTING_ACCOUNT = __$1("Have an account? Log in and connect", "cookie-law-info");
  function restoreBodyPointerAndScroll() {
    const { style } = document.body;
    const pe2 = style.pointerEvents;
    if (pe2 === "none" || pe2 === "") {
      style.pointerEvents = "auto";
    }
    if (style.overflow === "hidden") {
      style.overflow = "auto";
    }
  }
  __name(restoreBodyPointerAndScroll, "restoreBodyPointerAndScroll");
  function CkyConnectModal({
    ref,
    visible = false,
    availablePlan = "all",
    feature = "",
    className = "",
    container,
    onConnectToApp,
    title,
    message,
    featureText,
    availabilityText
  }) {
    const [isOpen, setIsOpen] = reactExports.useState(visible);
    const [hasFilter2, setHasFilter] = reactExports.useState(false);
    const primaryButtonRef = reactExports.useRef(null);
    const connectFlow = useConnectFlowOptional();
    const onConnectToAppRef = reactExports.useRef(onConnectToApp);
    onConnectToAppRef.current = onConnectToApp;
    const featureRef = reactExports.useRef(feature);
    featureRef.current = feature;
    const connectFlowRef = reactExports.useRef(connectFlow);
    connectFlowRef.current = connectFlow;
    const isScannerModal = reactExports.useMemo(
      () => className.includes("cky-app-modal-scanner"),
      [className]
    );
    reactExports.useImperativeHandle(
      ref,
      () => ({
        show: /* @__PURE__ */ __name(() => setIsOpen(true), "show"),
        close: /* @__PURE__ */ __name(() => setIsOpen(false), "close")
      }),
      []
    );
    reactExports.useEffect(() => {
      setIsOpen(visible);
    }, [visible]);
    reactExports.useEffect(() => {
      if (isScannerModal) return;
      let cancelled = false;
      void (() => __async(null, null, function* () {
        const response = yield applyFilter({});
        if (!cancelled && hasFilterData(response)) setHasFilter(true);
      }))();
      return () => {
        cancelled = true;
      };
    }, [isScannerModal]);
    reactExports.useEffect(() => {
      if (!isScannerModal) return;
      const observer = new MutationObserver(() => {
        restoreBodyPointerAndScroll();
      });
      observer.observe(document.body, {
        attributes: true,
        attributeFilter: ["style"]
      });
      document.body.style.pointerEvents = "auto";
      document.body.style.overflow = "auto";
      return () => observer.disconnect();
    }, [isScannerModal]);
    const handleConnectToApp = reactExports.useCallback((isExisting, additionalParams) => {
      var _a2;
      const direct = onConnectToAppRef.current;
      const feat = featureRef.current;
      if (direct) {
        direct(isExisting, feat);
        return;
      }
      (_a2 = connectFlowRef.current) == null ? void 0 : _a2.connectToApp(isExisting, feat, additionalParams);
    }, []);
    const handleNavigate = reactExports.useCallback(() => __async(null, null, function* () {
      const response = yield applyFilter({});
      if ((response == null ? void 0 : response.prevent_navigation) === true) return;
      const fr = response == null ? void 0 : response.filter_result;
      const isParamObject = fr && typeof fr === "object" && !Array.isArray(fr) && hasFilterData(response);
      if (isParamObject) {
        setIsOpen(false);
        restoreBodyPointerAndScroll();
        handleConnectToApp(false, fr);
        return;
      }
      setIsOpen(false);
      restoreBodyPointerAndScroll();
      const params = new URLSearchParams();
      params.set("available", availablePlan || "all");
      window.location.assign(`#/dashboard/plans?${params.toString()}`);
    }), [availablePlan, handleConnectToApp]);
    const handleConnectExistingClick = reactExports.useCallback(() => __async(null, null, function* () {
      const response = yield applyFilter({});
      if (response && response.prevent_navigation === true) return;
      if (response && hasFilterData(response)) {
        const fr = response.filter_result;
        if (fr && typeof fr === "object" && !Array.isArray(fr)) {
          handleConnectToApp(true, fr);
          return;
        }
      }
      handleConnectToApp(true);
    }), [handleConnectToApp]);
    const handleOpenChange = reactExports.useCallback(
      (open) => {
        if (isScannerModal) return;
        setIsOpen(open);
      },
      [isScannerModal]
    );
    const preventCloseWhenClickInsideContainer = reactExports.useCallback(
      (e) => {
        if (!isScannerModal || !container) return;
        const { target } = e;
        if (target instanceof Node && container.contains(target)) {
          e.preventDefault();
        }
      },
      [isScannerModal, container]
    );
    const dialogContentClassName = cn$1(
      MODAL_439_CONTENT_CLASS,
      isScannerModal && "cky:gap-0 cky:px-[30px] cky:pt-[30px] cky:pb-[30px] cky:overflow-hidden cky:min-w-0"
    );
    const dialogHeaderClassName = cn$1(MODAL_HEADER_INSET_CLASS, isScannerModal && "cky:hidden");
    const dialogFooterClassName = cn$1(
      "cky:flex-col cky:px-0 cky:pb-0 cky:pt-0 cky:border-none cky:min-w-0 cky:gap-5",
      isScannerModal ? "cky:flex cky:flex-col cky:items-center cky:justify-center cky:text-center cky:w-full cky:overflow-hidden" : "cky:px-[30px] cky:pb-[30px]"
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: isOpen, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      DialogContent,
      {
        "aria-describedby": void 0,
        className: dialogContentClassName,
        container: isScannerModal ? container : void 0,
        hideOverlay: isScannerModal,
        onOpenAutoFocus: /* @__PURE__ */ __name((e) => {
          var _a2;
          e.preventDefault();
          (_a2 = primaryButtonRef.current) == null ? void 0 : _a2.focus({ preventScroll: true });
        }, "onOpenAutoFocus"),
        onEscapeKeyDown: /* @__PURE__ */ __name((e) => isScannerModal && e.preventDefault(), "onEscapeKeyDown"),
        onPointerDownOutside: preventCloseWhenClickInsideContainer,
        onInteractOutside: preventCloseWhenClickInsideContainer,
        children: [
          !isScannerModal && /* @__PURE__ */ jsxRuntimeExports.jsx(DialogClose, { className: MODAL_CORNER_CLOSE_CLASS }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(DialogHeader, { showClose: false, className: dialogHeaderClassName, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { className: "cky:text-center", children: title || __$1("Connect to Web App", "cookie-law-info") }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { className: dialogFooterClassName, children: [
            featureText && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: MODAL_FEATURE_TEXT_CLASS, children: featureText }),
            availabilityText && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: MODAL_AVAILABILITY_ROW_CLASS, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              "span",
              {
                className: MODAL_AVAILABILITY_TEXT_CLASS,
                dangerouslySetInnerHTML: { __html: availabilityText }
              }
            ) }),
            message && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mb-0 cky:text-center cky:w-full", children: message }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: MODAL_CONNECT_ACTIONS_CLASS, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                Button,
                {
                  ref: primaryButtonRef,
                  onClick: /* @__PURE__ */ __name(() => void handleNavigate(), "onClick"),
                  className: cn$1("cky:w-auto cky:text-[14px]!", hasFilter2 && "cky-external-link"),
                  variant: "default",
                  children: BTN_ACCESS_PLANS
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:block cky:text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                Button,
                {
                  variant: "link",
                  external: true,
                  onClick: handleConnectExistingClick,
                  className: "cky:text-[16px]! cky:font-[500]! cky:hover:border-transparent cky:hover:no-underline cky:hover:opacity-100",
                  children: BTN_EXISTING_ACCOUNT
                }
              ) })
            ] })
          ] })
        ]
      }
    ) });
  }
  __name(CkyConnectModal, "CkyConnectModal");
  const STACK_CENTER = "cky:flex cky:flex-col cky:items-center";
  function CkyConnectSuccess() {
    const connectFlow = useConnectFlowOptional();
    const connectFlowRef = reactExports.useRef(connectFlow);
    connectFlowRef.current = connectFlow;
    const handleGoToApp = reactExports.useCallback(() => {
      const cf = connectFlowRef.current;
      cf == null ? void 0 : cf.redirectToApp("dashboard");
      cf == null ? void 0 : cf.setShowConnectSuccess(false);
    }, []);
    if (!(connectFlow == null ? void 0 : connectFlow.showConnectSuccess)) return null;
    const { connectSuccessSyncing } = connectFlow;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        id: "cky-connect-success",
        className: cn$1(
          "cky-connect-success",
          "cky:overflow-x-hidden cky:overflow-y-auto cky:bg-white cky:flex cky:justify-center cky:items-center cky:z-[999] cky:min-h-[280px]"
        ),
        children: connectSuccessSyncing ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:items-center cky:justify-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "cky:w-10 cky:h-10 cky:animate-spin cky:text-blue-600" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "cky:mt-4 cky:text-base cky:font-medium cky:text-gray-700 cky:text-center cky:max-w-sm", children: __$1(
            "Please wait while we connect your site to app.cookieyes.com",
            "cookie-law-info"
          ) })
        ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: STACK_CENTER, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "img",
            {
              src: assets.connectSuccess,
              alt: "",
              className: "cky:w-15 cky:h-15 cky:shrink-0"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mt-[15px] cky:mb-10 cky:text-center", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "cky:m-0 cky:!text-[22px] cky:font-semibold cky:text-text-primary", children: __$1("Your website is connected to app.cookieyes.com", "cookie-law-info") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:mt-2 cky:m-0 cky:!text-sm cky:text-gray-600", children: __$1(
              "You can now continue to manage all your existing settings and access all free CookieYes features from your web app account",
              "cookie-law-info"
            ) })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: STACK_CENTER, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "lg", external: true, onClick: handleGoToApp, className: "cky:font-medium", children: __$1("Go to CookieYes Web App", "cookie-law-info") }) })
        ] })
      }
    );
  }
  __name(CkyConnectSuccess, "CkyConnectSuccess");
  function CkyPopper({ content, isHtml = true, side = "bottom" }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky-popper-container cky:ml-[5px] cky:inline-block cky:align-middle", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip$1, { delayDuration: 200, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        Button,
        {
          type: "button",
          variant: "ghost",
          className: "cky-poppper-trigger cky:max-w-full cky:cursor-default! cky:border-0! cky:p-0! cky:bg-transparent! cky:hover:bg-transparent!",
          "aria-label": "More information",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "img",
            {
              src: assets.infoNew,
              alt: "",
              width: 16,
              height: 16,
              className: "cky-popper-icon cky:block cky:h-4 cky:w-4",
              "aria-hidden": true
            }
          )
        }
      ) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContentWithArrow, { side, sideOffset: 8, className: "cky:text-left", children: isHtml ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:block [&_a]:underline", dangerouslySetInnerHTML: { __html: content } }) : content })
    ] }) });
  }
  __name(CkyPopper, "CkyPopper");
  const DEFAULT_TIMEOUT = 5e3;
  function CkyDisconnectSuccess({
    show,
    onComplete,
    timeout = DEFAULT_TIMEOUT
  }) {
    const onCompleteRef = reactExports.useRef(onComplete);
    onCompleteRef.current = onComplete;
    reactExports.useEffect(() => {
      if (!show) return;
      const id = window.setTimeout(() => {
        var _a2;
        (_a2 = onCompleteRef.current) == null ? void 0 : _a2.call(onCompleteRef);
      }, timeout);
      return () => window.clearTimeout(id);
    }, [show, timeout]);
    if (!show) return null;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        id: "cky-connect-success",
        className: cn$1(
          "cky-connect-success",
          "cky:overflow-x-hidden cky:overflow-y-auto cky:bg-white cky:flex cky:justify-center cky:items-center cky:z-[999]"
        ),
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:items-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "img",
            {
              src: assets.connectSuccess,
              alt: "",
              className: "cky:w-15 cky:h-15 cky:shrink-0"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mt-[15px] cky:mb-10 cky:text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "cky:m-0 cky:text-base cky:font-semibold cky:text-text-primary", children: __$1(
            "Your website is now disconnected from app.cookieyes.com",
            "cookie-law-info"
          ) }) })
        ] })
      }
    );
  }
  __name(CkyDisconnectSuccess, "CkyDisconnectSuccess");
  const initializedEditors = /* @__PURE__ */ new Set();
  const MAX_RETRIES = 50;
  const RETRY_DELAY = 100;
  const EMPTY_PARAGRAPH_HTML = /<p><br><\/p>/g;
  const TINYMCE_BODY_STYLE = 'body{font-size:14px; color: #2C3338;font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif; -webkit-font-smoothing: subpixel-antialiased !important;}';
  const DEFAULT_EDITOR_HEIGHT_PX = 150;
  function editorHeightPx(height) {
    const n2 = Number.parseInt(String(height != null ? height : DEFAULT_EDITOR_HEIGHT_PX), 10);
    return Number.isFinite(n2) && n2 > 0 ? n2 : DEFAULT_EDITOR_HEIGHT_PX;
  }
  __name(editorHeightPx, "editorHeightPx");
  function getTinyMce() {
    if (typeof globalThis.window === "undefined") return void 0;
    return globalThis.window.tinymce;
  }
  __name(getTinyMce, "getTinyMce");
  function getTinyMceEditor(editorId) {
    var _a2, _b2;
    return (_b2 = (_a2 = getTinyMce()) == null ? void 0 : _a2.editors) == null ? void 0 : _b2[editorId];
  }
  __name(getTinyMceEditor, "getTinyMceEditor");
  function getWpEditorBridge() {
    var _a2;
    if (typeof globalThis.window === "undefined") return void 0;
    const wp = globalThis.window.wp;
    return (_a2 = wp == null ? void 0 : wp.oldEditor) != null ? _a2 : wp == null ? void 0 : wp.editor;
  }
  __name(getWpEditorBridge, "getWpEditorBridge");
  function WpEditor({
    value,
    onChange,
    id = "cky-richtext-editor",
    disabled = false,
    language = "en",
    height = "150",
    placeholder
  }) {
    const instanceId = reactExports.useId().replaceAll(":", "");
    const [editorId] = reactExports.useState(() => `${id}-${instanceId}`);
    const mountedRef = reactExports.useRef(false);
    const initializingRef = reactExports.useRef(false);
    const correctEditorRef = reactExports.useRef(null);
    const onChangeRef = reactExports.useRef(onChange);
    const valueRef = reactExports.useRef(value);
    onChangeRef.current = onChange;
    valueRef.current = value;
    const heightPx = editorHeightPx(height);
    const containerStyle = reactExports.useMemo(
      () => ({
        "--cky-wp-editor-height": `${heightPx}px`
      }),
      [heightPx]
    );
    const listener = reactExports.useCallback(() => {
      if (!correctEditorRef.current) return;
      const editor = correctEditorRef.current();
      if (!editor || typeof editor.getContent !== "function") return;
      const content = editor.getContent(editorId);
      onChangeRef.current(content.replace(EMPTY_PARAGRAPH_HTML, ""));
    }, [editorId]);
    const cleanup = reactExports.useCallback(() => {
      if (typeof window === "undefined") return;
      const instance = getTinyMceEditor(editorId);
      if (instance) {
        try {
          instance.remove();
        } catch (e) {
        }
      }
      initializedEditors.delete(editorId);
      mountedRef.current = false;
    }, [editorId]);
    const initializeEditor = reactExports.useCallback(() => {
      var _a2;
      if (initializedEditors.has(editorId) || typeof window === "undefined") {
        return;
      }
      const tinymce = getTinyMce();
      if ((_a2 = tinymce == null ? void 0 : tinymce.editors) == null ? void 0 : _a2[editorId]) {
        initializedEditors.add(editorId);
        mountedRef.current = true;
        initializingRef.current = false;
        return;
      }
      const checkWpEditor = /* @__PURE__ */ __name((retryCount = 0) => {
        var _a3, _b2, _c2, _d;
        if (retryCount >= MAX_RETRIES) {
          console.error(
            `WordPress editor initialization failed after ${MAX_RETRIES} attempts. Editor may not be available.`
          );
          initializingRef.current = false;
          return;
        }
        const bridge = getWpEditorBridge();
        if (!bridge) {
          setTimeout(() => checkWpEditor(retryCount + 1), RETRY_DELAY);
          return;
        }
        const textareaElement = document.getElementById(editorId);
        if (!(textareaElement == null ? void 0 : textareaElement.isConnected)) {
          setTimeout(() => checkWpEditor(retryCount + 1), RETRY_DELAY);
          return;
        }
        correctEditorRef.current = () => getWpEditorBridge();
        const editor = correctEditorRef.current();
        if (!(editor == null ? void 0 : editor.getDefaultSettings)) {
          setTimeout(() => checkWpEditor(retryCount + 1), RETRY_DELAY);
          return;
        }
        if (initializedEditors.has(editorId) || ((_a3 = tinymce == null ? void 0 : tinymce.editors) == null ? void 0 : _a3[editorId])) {
          initializedEditors.add(editorId);
          mountedRef.current = true;
          initializingRef.current = false;
          return;
        }
        const config2 = editor.getDefaultSettings() || {};
        const quicktags = (_b2 = config2.quicktags) != null ? _b2 : {};
        config2.quicktags = quicktags;
        quicktags.buttons = " ";
        const tinymceConfig = (_c2 = config2.tinymce) != null ? _c2 : {};
        config2.tinymce = tinymceConfig;
        tinymceConfig.toolbar1 = " ";
        tinymceConfig.toolbar2 = " ";
        tinymceConfig.height = heightPx;
        tinymceConfig.readonly = disabled;
        tinymceConfig.body_class = "cky-rich-text-editor";
        tinymceConfig.content_style = TINYMCE_BODY_STYLE;
        if (isRTLLanguage(language)) {
          tinymceConfig.directionality = "rtl";
          tinymceConfig.content_style = TINYMCE_BODY_STYLE + "body{direction:rtl;text-align:right;}";
        }
        tinymceConfig.resize = true;
        tinymceConfig.setup = (tinymceEditor) => {
          tinymceEditor.on("init", () => {
            tinymceEditor.setContent(valueRef.current || "");
          });
          tinymceEditor.on("change", () => {
            listener();
          });
        };
        if ((_d = tinymce == null ? void 0 : tinymce.editors) == null ? void 0 : _d[editorId]) {
          cleanup();
        }
        if (editor.initialize) {
          try {
            editor.initialize(editorId, config2);
            initializedEditors.add(editorId);
            mountedRef.current = true;
            initializingRef.current = false;
          } catch (error) {
            console.error("Error initializing WordPress editor:", error);
            initializingRef.current = false;
          }
        }
      }, "checkWpEditor");
      checkWpEditor(0);
    }, [cleanup, disabled, editorId, heightPx, language, listener]);
    const initializeEditorRef = reactExports.useRef(initializeEditor);
    initializeEditorRef.current = initializeEditor;
    reactExports.useEffect(() => {
      return () => {
        mountedRef.current = false;
        cleanup();
      };
    }, [cleanup]);
    reactExports.useEffect(() => {
      if (!mountedRef.current || !initializedEditors.has(editorId) || typeof window === "undefined") {
        return;
      }
      const editor = getTinyMceEditor(editorId);
      if ((editor == null ? void 0 : editor.getContent) && editor.getContent() !== value) {
        editor.setContent(value || "");
      }
    }, [value, editorId]);
    reactExports.useEffect(() => {
      var _a2, _b2;
      if (!mountedRef.current || !initializedEditors.has(editorId) || typeof window === "undefined") {
        return;
      }
      (_b2 = (_a2 = getTinyMceEditor(editorId)) == null ? void 0 : _a2.setMode) == null ? void 0 : _b2.call(_a2, disabled ? "readonly" : "design");
    }, [disabled, editorId]);
    reactExports.useEffect(() => {
      if (!mountedRef.current || !initializedEditors.has(editorId) || typeof window === "undefined") {
        return;
      }
      const editor = getTinyMceEditor(editorId);
      if (!(editor == null ? void 0 : editor.getBody)) return;
      const rtl = isRTLLanguage(language);
      try {
        const body = editor.getBody();
        if (body) {
          body.setAttribute("dir", rtl ? "rtl" : "ltr");
          body.style.direction = rtl ? "rtl" : "ltr";
          body.style.textAlign = rtl ? "right" : "";
        }
      } catch (e) {
      }
    }, [language, editorId]);
    const textareaRefCallback = reactExports.useCallback(
      (element) => {
        if (element && !initializedEditors.has(editorId) && !initializingRef.current) {
          initializingRef.current = true;
          requestAnimationFrame(() => {
            initializeEditorRef.current();
          });
        }
      },
      [editorId]
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn$1("cky-rich-text-editor-container", disabled && "cky-disabled"), style: containerStyle, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      "textarea",
      {
        ref: textareaRefCallback,
        id: editorId,
        defaultValue: value,
        className: "wp-editor-area cky-rich-text-editor cky-form-control",
        disabled,
        rows: 5,
        placeholder,
        onInput: listener
      }
    ) });
  }
  __name(WpEditor, "WpEditor");
  function ctaLabelFromInfo(info) {
    if (!info || typeof info !== "object") return __$1("Upgrade now", "cookie-law-info");
    const website = info.website;
    return (website == null ? void 0 : website.canStartOptoutTrial) ? __$1("Try Pro for free", "cookie-law-info") : __$1("Upgrade now", "cookie-law-info");
  }
  __name(ctaLabelFromInfo, "ctaLabelFromInfo");
  function CkyUpgradeModal({
    ref,
    visible = false,
    feature = "",
    upgradeSource = "",
    title,
    featureText,
    availabilityText
  }) {
    const [isOpen, setIsOpen] = reactExports.useState(visible);
    const primaryButtonRef = reactExports.useRef(null);
    const info = useAppStore((s2) => s2.info);
    const featureRef = reactExports.useRef(feature);
    const upgradeSourceRef = reactExports.useRef(upgradeSource);
    featureRef.current = feature;
    upgradeSourceRef.current = upgradeSource;
    const ctaLabel = ctaLabelFromInfo(info);
    reactExports.useImperativeHandle(
      ref,
      () => ({
        show: /* @__PURE__ */ __name(() => setIsOpen(true), "show"),
        close: /* @__PURE__ */ __name(() => setIsOpen(false), "close")
      }),
      []
    );
    reactExports.useEffect(() => {
      setIsOpen(visible);
    }, [visible]);
    reactExports.useEffect(() => {
      const onAfterConnection = /* @__PURE__ */ __name(() => setIsOpen(false), "onAfterConnection");
      window.addEventListener("afterConnection", onAfterConnection);
      return () => window.removeEventListener("afterConnection", onAfterConnection);
    }, []);
    const handleUpgrade = reactExports.useCallback(() => {
      openFeatureUpgradeFlow(featureRef.current, upgradeSourceRef.current);
      setIsOpen(false);
    }, []);
    const handleOpenAutoFocus = reactExports.useCallback((e) => {
      var _a2;
      e.preventDefault();
      (_a2 = primaryButtonRef.current) == null ? void 0 : _a2.focus({ preventScroll: true });
    }, []);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      DialogContent,
      {
        "aria-describedby": void 0,
        className: MODAL_439_CONTENT_CLASS,
        onOpenAutoFocus: handleOpenAutoFocus,
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(DialogClose, { className: MODAL_CORNER_CLOSE_CLASS }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(DialogHeader, { showClose: false, className: MODAL_HEADER_INSET_CLASS, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { className: "cky:text-center cky:text-[20px]! cky:font-semibold cky:leading-normal cky:m-0!", children: title }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { className: "cky:flex-col cky:px-[30px] cky:pb-[30px] cky:pt-0 cky:border-none cky:gap-5", children: [
            featureText ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: MODAL_FEATURE_TEXT_CLASS, children: featureText }) : null,
            availabilityText ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: MODAL_AVAILABILITY_ROW_CLASS, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              "span",
              {
                className: MODAL_AVAILABILITY_TEXT_CLASS,
                dangerouslySetInnerHTML: { __html: availabilityText }
              }
            ) }) : null,
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: MODAL_AVAILABILITY_ROW_CLASS, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
              Button,
              {
                ref: primaryButtonRef,
                variant: "default",
                className: "cky:inline-flex cky:items-center cky:justify-center cky:gap-2 cky:w-auto cky:text-[14px]!",
                onClick: handleUpgrade,
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "crown", width: "20px", height: "16px" }),
                  ctaLabel
                ]
              }
            ) })
          ] })
        ]
      }
    ) });
  }
  __name(CkyUpgradeModal, "CkyUpgradeModal");
  const DIALOG_CONTENT_BASE = "cky:gap-0 cky:bg-white cky:w-full cky:border cky:border-[#e8e8eb] cky:shadow-[0_5px_20px_rgba(0,0,0,0.1)] cky:py-[15px] cky:px-0 cky:rounded-t-[2px] cky:!rounded-b-none cky:sm:rounded-t-[2px] cky:sm:!rounded-b-none";
  const HEADER_CLASS = "cky:relative cky:border-0 cky:!flex-row cky:items-center cky:justify-between cky:!px-5 cky:py-0 cky:space-y-0 cky:min-w-0";
  const HEADSUP_CLOSE_CLASS = "cky:!right-[15px] cky:!top-1/2 cky:!bottom-auto cky:!-translate-y-1/2 cky:!left-auto";
  const TITLE_CLASS = "cky:flex-1 cky:min-w-0 cky:pr-8 cky:!justify-start cky:items-center cky:text-left cky:font-semibold cky:leading-snug cky:m-0! cky:flex-nowrap cky:!text-[16px] cky:!text-[#4e4b66] [&_span]:cky:!text-[16px] [&_span]:cky:!text-[#4e4b66]";
  const TITLE_WITH_ICON_ROW_CLASS = "cky:inline-flex cky:max-w-full cky:flex-nowrap cky:items-center cky:gap-2 cky:min-w-0";
  const BODY_WRAP_CLASS = "cky:px-5 cky:py-4";
  const DESCRIPTION_CLASS = "cky:!m-0 cky:!text-[#4E4B66]";
  const BODY_TEXT_CLASS = "cky:text-[13px] cky:text-[#4E4B66] cky:m-0 cky:leading-normal";
  const FOOTER_CLASS = "cky:flex cky:flex-row cky:flex-nowrap cky:justify-end cky:gap-[10px] cky:px-5 cky:pb-[0px] cky:pt-0 cky:sm:flex-row cky:rounded-none";
  const BTN_CLASS = "cky:h-auto cky:min-w-[80px] cky:px-[15px] cky:py-2 cky:!text-[14px] cky:!leading-4 cky:!font-medium cky:rounded-[3px]";
  const CANCEL_BTN_CLASS = cn$1(
    BTN_CLASS,
    "cky:bg-white cky:border cky:border-[#c9d0d6] cky:text-[#555d66] hover:cky:bg-[#fafafb] hover:cky:text-[#555d66]"
  );
  const CONFIRM_DEFAULT_CLASS = cn$1(BTN_CLASS, "cky:bg-primary cky:text-primary-foreground hover:cky:bg-primary/90");
  const CONFIRM_DESTRUCTIVE_CLASS = cn$1(
    BTN_CLASS,
    "cky:bg-destructive cky:text-destructive-foreground hover:cky:bg-destructive/90"
  );
  function CkyHeadsUpPopup({
    ref,
    header,
    headerIconSrc,
    headerIconAlt = "",
    body,
    cancelBtn,
    confirmBtn,
    confirmVariant = "destructive",
    maxWidth = "500",
    onDeleteItem,
    onClear
  }) {
    const [isOpen, setIsOpen] = reactExports.useState(false);
    const onClearRef = reactExports.useRef(onClear);
    onClearRef.current = onClear;
    const onDeleteItemRef = reactExports.useRef(onDeleteItem);
    onDeleteItemRef.current = onDeleteItem;
    reactExports.useImperativeHandle(
      ref,
      () => ({
        show: /* @__PURE__ */ __name(() => setIsOpen(true), "show"),
        closePopup: /* @__PURE__ */ __name(() => {
          var _a2;
          setIsOpen(false);
          (_a2 = onClearRef.current) == null ? void 0 : _a2.call(onClearRef);
        }, "closePopup")
      }),
      []
    );
    const handleConfirm = reactExports.useCallback(() => {
      var _a2;
      (_a2 = onDeleteItemRef.current) == null ? void 0 : _a2.call(onDeleteItemRef);
      setIsOpen(false);
    }, []);
    const handleCancel = reactExports.useCallback(() => {
      var _a2;
      setIsOpen(false);
      (_a2 = onClearRef.current) == null ? void 0 : _a2.call(onClearRef);
    }, []);
    const handleOpenChange = reactExports.useCallback((open) => {
      var _a2;
      setIsOpen(open);
      if (!open) (_a2 = onClearRef.current) == null ? void 0 : _a2.call(onClearRef);
    }, []);
    const handleOpenAutoFocus = reactExports.useCallback((e) => {
      e.preventDefault();
    }, []);
    const maxWClass = maxWidth === "600" ? "cky:max-w-[600px]" : "cky:max-w-[500px]";
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: isOpen, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      DialogContent,
      {
        className: cn$1("cky-headsup-popup", DIALOG_CONTENT_BASE, maxWClass),
        onOpenAutoFocus: handleOpenAutoFocus,
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(DialogHeader, { className: HEADER_CLASS, closeClassName: HEADSUP_CLOSE_CLASS, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { className: TITLE_CLASS, children: headerIconSrc ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: TITLE_WITH_ICON_ROW_CLASS, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "img",
              {
                src: headerIconSrc,
                alt: headerIconAlt,
                className: "cky:size-5 cky:shrink-0 cky:self-center",
                width: 20,
                height: 20
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:whitespace-nowrap", children: header })
          ] }) : header }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(DialogDescription, { asChild: true, className: DESCRIPTION_CLASS, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: BODY_WRAP_CLASS, children: typeof body === "string" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: BODY_TEXT_CLASS, dangerouslySetInnerHTML: { __html: body } }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-headsup-popup-body cky:text-[#4E4B66]", children: body }) }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { className: FOOTER_CLASS, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "button", onClick: handleCancel, variant: "outline", className: CANCEL_BTN_CLASS, children: cancelBtn }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Button,
              {
                type: "button",
                onClick: handleConfirm,
                variant: confirmVariant === "default" ? "default" : "destructive",
                className: confirmVariant === "default" ? CONFIRM_DEFAULT_CLASS : CONFIRM_DESTRUCTIVE_CLASS,
                children: confirmBtn
              }
            )
          ] })
        ]
      }
    ) });
  }
  __name(CkyHeadsUpPopup, "CkyHeadsUpPopup");
  const PARTNER_ITEMS = [
    {
      key: "agency",
      href: "https://www.cookieyes.com/partners/agency/?ref=cywpagb",
      icon: assets.partnerAgency,
      title: __$1("Agency Partner", "cookie-law-info"),
      description: __$1(
        "Partner with us as a reseller or agency to manage and sell CookieYes to your clients.",
        "cookie-law-info"
      )
    },
    {
      key: "affiliate",
      href: "https://www.cookieyes.com/partners/affiliates/?ref=cywpafb",
      icon: assets.partnerAffiliate,
      title: __$1("Affiliate Partner", "cookie-law-info"),
      description: __$1(
        "Earn rewards by referring CookieYes to your audience.",
        "cookie-law-info"
      )
    }
  ];
  const CkyBecomePartner = /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenu, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      Button,
      {
        type: "button",
        variant: "ghost",
        className: "cky:h-auto cky:gap-1 cky:border-0 cky:bg-transparent cky:p-0 cky:text-white cky:shadow-none cky:transition-colors cky:hover:bg-transparent cky:hover:text-gray-200 focus-visible:cky:ring-0 focus-visible:cky:ring-offset-0",
        children: [
          __$1("Become a Partner", "cookie-law-info"),
          /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "cky:h-4 cky:w-4" })
        ]
      }
    ) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuContent, { className: "cky:min-w-[200px] cky:max-w-[361px]", align: "end", children: PARTNER_ITEMS.map(({ key, href, icon, title, description }, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [
      index2 > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuSeparator, { className: "cky:!m-0" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuItem, { asChild: true, className: "cky:p-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "a",
        {
          href,
          target: "_blank",
          rel: "noopener noreferrer",
          className: "cky-become-partner-menu-link cky:flex cky:items-start cky:gap-3",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: icon, alt: "", width: 24, height: 24, "aria-hidden": "true", className: "cky:shrink-0" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:text-base! cky:font-semibold! cky:m-0! cky:!text-text-primary", children: title }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:mt-1 cky:text-xs cky:font-normal cky:leading-normal cky:m-0! cky:text-muted-foreground", children: description })
            ] })
          ]
        }
      ) })
    ] }, key)) })
  ] }), "CkyBecomePartner");
  const HEADER_NAV_LINKS = [
    {
      href: "https://www.cookieyes.com/documentation/how-to-install-cookieyes-wordpress-plugin/",
      icon: "help",
      label: __$1("Help Guides", "cookie-law-info")
    },
    {
      href: "https://www.cookieyes.com/support/",
      icon: "chat",
      label: __$1("Support", "cookie-law-info")
    }
  ];
  const CkyHeader = /* @__PURE__ */ __name(() => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:px-5 cky:py-4 cky-header-gradient", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-1/3", children: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "https://www.cookieyes.com/", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { width: "120px", icon: "logo", color: "#ffffff" }) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-2/3", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:justify-end cky:gap-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(CkyBecomePartner, {}),
        HEADER_NAV_LINKS.map(({ href, icon, label }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "a",
          {
            className: "cky:flex cky:items-center cky:text-white cky:hover:text-gray-200 cky:transition-colors",
            target: "_blank",
            href,
            rel: "noopener noreferrer",
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { width: "15px", icon, color: "#ffffff" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:ml-1 cky:text-white", children: label })
            ]
          },
          href
        ))
      ] }) })
    ] }) });
  }, "CkyHeader");
  function sprintfWp(format2, ...args) {
    return format2.replace(/%(\d+)\$[sd]/g, (_, i2) => String(args[Number(i2) - 1]));
  }
  __name(sprintfWp, "sprintfWp");
  function pickSingularPlural(single, plural, n2) {
    return n2 === 1 ? single : plural;
  }
  __name(pickSingularPlural, "pickSingularPlural");
  function formatNumber(n2) {
    return n2.toLocaleString("en-US");
  }
  __name(formatNumber, "formatNumber");
  const PAGEVIEW_DOCS_URL = "https://www.cookieyes.com/documentation/pageviews-info/";
  function asSettingsInfo(info) {
    return info && typeof info === "object" ? info : null;
  }
  __name(asSettingsInfo, "asSettingsInfo");
  const CkyPageviews = reactExports.memo(/* @__PURE__ */ __name(function CkyPageviews2() {
    const info = useAppStore((s2) => s2.info);
    const {
      pageViewsEnabled,
      planName,
      endsIn,
      showTrialExpiry,
      overageData,
      showOverageCount,
      formattedPageviewsText,
      formattedOverageText,
      pageviewTooltipHtml
    } = reactExports.useMemo(() => {
      var _a2, _b2, _c2, _d, _e2, _f, _g;
      const data = asSettingsInfo(info);
      const pv = data == null ? void 0 : data.pageviews;
      const pageViewsEnabled2 = !!pv;
      if (!data || !pv) {
        return {
          pageViewsEnabled: false,
          planName: "",
          endsIn: 0,
          showTrialExpiry: false,
          overageData: void 0,
          showOverageCount: false,
          formattedPageviewsText: "",
          formattedOverageText: "0",
          pageviewTooltipHtml: ""
        };
      }
      const plan = (_a2 = data.plan) != null ? _a2 : { name: "" };
      const website = (_b2 = data.website) != null ? _b2 : {};
      const overage = data.overage;
      const endsInVal = website.ends_in || 0;
      const showTrial = !!website.is_trial && endsInVal >= 0;
      const applicable = !!pv.limit && overage && overage.applicable && overage.enabled && ((_c2 = overage.overage_view_count) != null ? _c2 : 0) > 0;
      let countDisplay = (_d = pv.count) != null ? _d : 0;
      if (pv.count != null && pv.limit != null && pv.count > pv.limit && applicable) {
        countDisplay = pv.limit;
      }
      const pct = pv.limit ? Math.round(countDisplay * 100 / pv.limit) : 0;
      let formatted = formatNumber(countDisplay);
      if (pv.limit) {
        if (!applicable) {
          formatted += `/${formatNumber(pv.limit)}`;
        }
        formatted += ` (${pct}%)`;
      }
      const tooltipHtml = sprintfWp(
        __$1(
          /* translators: 1: Date when pageviews reset. 2: URL of the documentation page. */
          'Pageviews will reset on<br><b>%1$s</b>.<br><a class="cky-external-link cky:text-inherit! cky:underline!" href="%2$s" target="_blank">Learn more</a>',
          "cookie-law-info"
        ),
        (_e2 = pv.ends_at) != null ? _e2 : "",
        PAGEVIEW_DOCS_URL
      );
      return {
        pageViewsEnabled: pageViewsEnabled2,
        planName: (_f = plan.name) != null ? _f : "",
        endsIn: endsInVal,
        showTrialExpiry: showTrial,
        overageData: overage,
        showOverageCount: applicable,
        formattedPageviewsText: formatted,
        formattedOverageText: overage ? formatNumber((_g = overage.overage_view_count) != null ? _g : 0) : "0",
        pageviewTooltipHtml: tooltipHtml
      };
    }, [info]);
    if (!pageViewsEnabled) {
      return null;
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:items-end cky:justify-end cky:text-right", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "cky:text-sm cky:text-[var(--cky-text-secondary-dark,#4a5568)] cky:m-0!", children: [
        __$1("Current plan:", "cookie-law-info"),
        " ",
        /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: planName }),
        showTrialExpiry && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("b", { children: [
            " ",
            __$1("(Trial)", "cookie-law-info"),
            " "
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "cky:text-red-600", children: [
            __$1("Expires in", "cookie-law-info"),
            " ",
            /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: endsIn }),
            " ",
            pickSingularPlural(
              __$1("day", "cookie-law-info"),
              __$1("days", "cookie-law-info"),
              endsIn
            )
          ] })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:text-xs cky:text-gray-500 cky:flex cky:flex-wrap cky:items-center cky:justify-end cky:gap-x-1 cky:m-0!", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: __$1("Pageviews used: ", "cookie-law-info") }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("b", { className: "cky:text-[11px] cky:text-[var(--cky-text-secondary-dark,#4a5568)]", children: formattedPageviewsText }),
        showOverageCount && overageData && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "cky:text-xs cky:text-gray-500", children: [
          "+",
          " ",
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-[11px] cky:text-[var(--cky-text-secondary-dark,#4a5568)]", children: formattedOverageText }),
          " ",
          __$1("extra", "cookie-law-info")
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip$1, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Button,
            {
              variant: "ghost",
              className: "cky:inline-flex cky:h-4 cky:w-3 cky:p-0 cky:shrink-0 cky:border-0! cky:bg-transparent! cky:text-gray-400 hover:cky:bg-gray-100/80 hover:cky:text-gray-700",
              "aria-label": __$1("Learn more", "cookie-law-info"),
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "tooltip", width: "12px", height: "12px", color: "currentColor" })
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContentWithArrow, { side: "bottom", className: "cky:max-w-[240px] cky:text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "span",
            {
              dangerouslySetInnerHTML: {
                __html: pageviewTooltipHtml
              }
            }
          ) })
        ] }) })
      ] })
    ] });
  }, "CkyPageviews2"));
  function CrownNavUpgradeIcon({ className = "" }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className, "aria-hidden": true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      "svg",
      {
        width: "24",
        height: "16",
        viewBox: "0 0 24 24",
        fill: "none",
        xmlns: "http://www.w3.org/2000/svg",
        className: "cky:inline-block cky:align-middle",
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "path",
          {
            d: "M12 4.79999L16.8 12L22.8 7.19999L20.4 19.2H3.6L1.2 7.19999L7.2 12L12 4.79999Z",
            fill: "none",
            stroke: "currentColor",
            strokeWidth: "1.5",
            strokeLinecap: "round",
            strokeLinejoin: "round"
          }
        )
      }
    ) });
  }
  __name(CrownNavUpgradeIcon, "CrownNavUpgradeIcon");
  const ENTERPRISE_URL = "https://www.cookieyes.com/support/?query=enterprise&ref=cypluginupgrade#enterprise";
  function planNameLower(info) {
    var _a2;
    const planRaw = info && typeof info === "object" && ((_a2 = info.plan) == null ? void 0 : _a2.name) || "free";
    return String(planRaw).toLowerCase();
  }
  __name(planNameLower, "planNameLower");
  function canStartOptoutTrial(info) {
    const website = info && typeof info === "object" ? info.website : void 0;
    return !!(website && website.canStartOptoutTrial);
  }
  __name(canStartOptoutTrial, "canStartOptoutTrial");
  const CkyNavUpgrade = /* @__PURE__ */ __name(() => {
    var _a2;
    const { options: options2, info } = useAppStore(
      useShallow((s2) => ({ options: s2.options, info: s2.info }))
    );
    const account = (_a2 = options2 == null ? void 0 : options2.account) != null ? _a2 : {};
    const connected = !!account.connected;
    const { upgradeURL, buttonWidth, showCrown, label } = reactExports.useMemo(() => {
      var _a3, _b2, _c2, _d;
      const planLower = planNameLower(info);
      const canTrial = canStartOptoutTrial(info);
      let url = "";
      if (planLower === "ultimate") {
        url = ENTERPRISE_URL;
      } else {
        const base = String((_c2 = (_b2 = (_a3 = window.ckyGlobals) == null ? void 0 : _a3.webApp) == null ? void 0 : _b2.url) != null ? _c2 : "").replace(/\/$/, "");
        const params = new URLSearchParams({
          upgrade_id: String((_d = account.website_id) != null ? _d : ""),
          openUpgrade: "true",
          upgrade_source: "cypluginupgrade"
        });
        if (canTrial) {
          params.append("from_trial", "true");
        }
        url = `${base}/settings?${params.toString()}`;
      }
      return {
        upgradeURL: url,
        buttonWidth: canTrial ? "167px" : "107px",
        showCrown: planLower !== "ultimate",
        label: canTrial ? __$1("Try Pro for free", "cookie-law-info") : __$1("Upgrade", "cookie-law-info")
      };
    }, [info, account.website_id]);
    const openUpgrade = reactExports.useCallback(() => {
      const a2 = document.createElement("a");
      a2.href = upgradeURL;
      a2.target = "_blank";
      a2.rel = "noopener noreferrer";
      a2.click();
    }, [upgradeURL]);
    if (!connected) {
      return null;
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      Button,
      {
        variant: "upgrade",
        onClick: openUpgrade,
        className: "cky:h-9 cky:min-h-[36px] cky:gap-2 cky:rounded",
        style: { width: buttonWidth, minWidth: buttonWidth },
        children: [
          showCrown ? /* @__PURE__ */ jsxRuntimeExports.jsx(CrownNavUpgradeIcon, { className: "cky:shrink-0" }) : null,
          label
        ]
      }
    ) });
  }, "CkyNavUpgrade");
  function navTabFromPathname(pathname) {
    const trimmed = pathname.replace(/^\//, "");
    if (!trimmed) return "dashboard";
    return trimmed.split("/")[0];
  }
  __name(navTabFromPathname, "navTabFromPathname");
  const NAV_MENU_ITEMS = [
    { text: __$1("Dashboard", "cookie-law-info"), to: { name: "dashboard" }, native: true },
    { text: __$1("Cookie Banner", "cookie-law-info"), to: { name: "customize" } },
    { text: __$1("Cookie Manager", "cookie-law-info"), to: { name: "cookies" } },
    { text: __$1("Languages", "cookie-law-info"), to: { name: "languages" } },
    { text: __$1("Policy Generators", "cookie-law-info"), to: { name: "policies" } },
    {
      text: __$1("Google Consent Mode (GCM)", "cookie-law-info"),
      to: { name: "gcm" },
      native: true,
      hidden: true
    },
    {
      text: __$1("Site Settings", "cookie-law-info"),
      to: { name: "settings" },
      native: true,
      hidden: true
    }
  ];
  const CkyNavMenu = /* @__PURE__ */ __name(({ onNavigate }) => {
    var _a2;
    const navigate = useNavigate();
    const pathname = useRouterState({ select: /* @__PURE__ */ __name((s2) => s2.location.pathname, "select") });
    const navContainerRef = reactExports.useRef(null);
    const [activeTab, setActiveTab] = reactExports.useState(
      () => navTabFromPathname(pathname)
    );
    const { options: options2, info, session_status } = useAppStore(
      useShallow((s2) => ({
        options: s2.options,
        info: s2.info,
        session_status: s2.session_status
      }))
    );
    const disconnectSuccessOverlay = useAppStore((s2) => s2.disconnect_success_overlay);
    const account = (options2 == null ? void 0 : options2.account) || { connected: false };
    const isSuspended = !!(info && typeof info === "object" && ((_a2 = info.website) == null ? void 0 : _a2.status) === "suspended");
    const showNavExtras = !isSuspended && session_status && account.connected === true;
    const { visibleMenus, visibleTabValues } = reactExports.useMemo(() => {
      const visible = NAV_MENU_ITEMS.filter((item) => {
        if (!item.to) return false;
        if (!item.native && account.connected || item.hidden && !account.connected) {
          return false;
        }
        return true;
      });
      return {
        visibleMenus: visible,
        visibleTabValues: visible.map((item) => item.to.name)
      };
    }, [account.connected]);
    reactExports.useEffect(() => {
      setActiveTab(navTabFromPathname(pathname));
    }, [pathname]);
    const handleNavigate = reactExports.useCallback(
      (routeName) => {
        if (onNavigate) {
          onNavigate(routeName);
        } else {
          navigate({ to: `/${routeName}` });
        }
      },
      [navigate, onNavigate]
    );
    const resolvedTab = reactExports.useMemo(() => {
      var _a3;
      if (visibleTabValues.includes(activeTab)) {
        return activeTab;
      }
      return (_a3 = visibleTabValues[0]) != null ? _a3 : "dashboard";
    }, [visibleTabValues, activeTab]);
    reactExports.useEffect(() => {
      var _a3;
      if (disconnectSuccessOverlay) return;
      if (visibleTabValues.length === 0) return;
      if (!visibleTabValues.includes(activeTab)) {
        const next = (_a3 = visibleTabValues[0]) != null ? _a3 : "dashboard";
        setActiveTab(next);
        void navigate({ to: `/${next}`, replace: true });
      }
    }, [visibleTabValues, activeTab, navigate, disconnectSuccessOverlay]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: navContainerRef, className: "cky:px-8 cky:bg-white cky:relative", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:grid cky:w-full cky:min-w-0 cky:grid-cols-[minmax(0,7fr)_minmax(0,5fr)] cky:items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:min-w-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Tabs, { value: resolvedTab, onValueChange: handleNavigate, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TabsList, { className: "cky:bg-transparent cky:h-auto cky:p-0 cky:inline-flex cky:max-w-full cky:flex-nowrap cky:overflow-x-auto", children: visibleMenus.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsx(
        TabsTrigger,
        {
          value: item.to.name,
          className: "cky:data-[state=active]:bg-transparent cky:data-[state=active]:shadow-none cky:py-3.5 cky:px-0 cky:mx-2.5 cky:first:ml-0 cky:transition-all cky:duration-200 cky:cursor-pointer cky:border-0 cky:bg-transparent cky:data-[state=active]:text-blue-600 cky:data-[state=active]:text-[15px]! cky:data-[state=active]:font-semibold! cky:text-gray-700 cky:hover:text-[var(--cky-primary-dark)] cky:shrink-0",
          children: item.text
        },
        item.to.name
      )) }) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:min-w-0 cky:flex-row cky:items-center cky:justify-end cky:gap-2", children: showNavExtras ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(CkyPageviews, {}),
        /* @__PURE__ */ jsxRuntimeExports.jsx(CkyNavUpgrade, {})
      ] }) : null })
    ] }) });
  }, "CkyNavMenu");
  const LINK_BTN_BASE = "cky:p-0 cky:h-auto cky:text-[13px]! cky:font-normal! cky:hover:border-transparent cky:hover:no-underline cky:hover:opacity-100";
  const LINK_BTN_INLINE = `cky:inline-flex cky:items-center ${LINK_BTN_BASE}`;
  const PREMIUM_BADGE_ICON = "cky:ml-1 cky:w-[18px] cky:h-[18px] cky:p-0 cky:flex cky:items-center cky:justify-center";
  function capitalizeString(str) {
    if (!str) return str;
    return str.charAt(0).toUpperCase() + str.slice(1);
  }
  __name(capitalizeString, "capitalizeString");
  function getDefaultLanguageDisplayLabel(getInfo2, info) {
    var _a2, _b2, _c2;
    const raw = getInfo2("defaultLanguage");
    if (raw && typeof raw === "object") {
      const name = raw.name;
      if (typeof name === "string" && name) return name;
    }
    const langsObj = getInfo2("languages");
    const infoLangs = info == null ? void 0 : info.languages;
    const code = typeof raw === "string" && raw || String((_a2 = langsObj == null ? void 0 : langsObj.default) != null ? _a2 : "") || String((_b2 = infoLangs == null ? void 0 : infoLangs.default) != null ? _b2 : "") || "en";
    const c2 = code.toLowerCase();
    const list = (_c2 = window.ckyLanguages) != null ? _c2 : [];
    const found = list.find((l) => l.code.toLowerCase() === c2);
    return (found == null ? void 0 : found.name) || (c2 === "en" ? "English" : code);
  }
  __name(getDefaultLanguageDisplayLabel, "getDefaultLanguageDisplayLabel");
  function GeoTargetCta({ onClick, showPremiumBadge }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "link", onClick, className: LINK_BTN_INLINE, children: [
      __$1("Geo-target", "cookie-law-info"),
      showPremiumBadge ? /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { variant: "premium", className: PREMIUM_BADGE_ICON, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "crown", width: "10px", height: "8px" }) }) : null
    ] });
  }
  __name(GeoTargetCta, "GeoTargetCta");
  const CkyDashboardOverview = /* @__PURE__ */ __name(({
    getInfo: getInfoProp,
    getOption: getOptionProp,
    onNavigate
  }) => {
    var _a2, _b2;
    const { options: options2, info, status } = useAppStore(
      useShallow((s2) => ({ options: s2.options, info: s2.info, status: s2.status }))
    );
    const getOption2 = reactExports.useCallback(
      (key) => getOptionProp ? getOptionProp(key) : key === "account" ? options2 == null ? void 0 : options2.account : options2 == null ? void 0 : options2[key],
      [getOptionProp, options2]
    );
    const getInfo2 = reactExports.useCallback(
      (key) => getInfoProp ? getInfoProp(key) : info == null ? void 0 : info[key],
      [getInfoProp, info]
    );
    const ckyConnectModalRef = reactExports.useRef(null);
    const ckyLocationModalRef = reactExports.useRef(null);
    const ckyLanguageUpgradeModalRef = reactExports.useRef(null);
    const ckyLocationUpgradeModalRef = reactExports.useRef(null);
    const account = reactExports.useMemo(
      () => {
        var _a3, _b3;
        return (_b3 = (_a3 = getOption2("account")) != null ? _a3 : options2 == null ? void 0 : options2.account) != null ? _b3 : {};
      },
      [getOption2, options2]
    );
    const currentBanner = useBannerStore((s2) => s2.current);
    const defaultLanguageLabel = reactExports.useMemo(
      () => getDefaultLanguageDisplayLabel(getInfo2, info),
      [getInfo2, info]
    );
    const tablesMissing = Boolean(info && info.tables_missing);
    const connectedBanners = reactExports.useMemo(() => {
      if (!(account == null ? void 0 : account.connected)) return null;
      return getInfo2("banners");
    }, [account == null ? void 0 : account.connected, getInfo2]);
    const targetedLocation = reactExports.useMemo(() => {
      if (connectedBanners == null ? void 0 : connectedBanners.targetedLocation) {
        return String(connectedBanners.targetedLocation);
      }
      return "worldwide";
    }, [connectedBanners]);
    const applicableLaws = reactExports.useMemo(() => {
      var _a3, _b3;
      if (account == null ? void 0 : account.connected) {
        const banners = connectedBanners;
        if (banners == null ? void 0 : banners.laws) {
          const laws = banners.laws.split(/\s*&\s*/);
          if (banners.laws === "ccpa") {
            return "US State Laws";
          } else if (laws.includes("ccpa") && laws.includes("gdpr")) {
            return banners.is_iab_enabled ? "GDPR (IAB TCF v2.3) & US State Laws" : "GDPR & US State Laws";
          }
          return banners.is_iab_enabled ? "GDPR (IAB TCF v2.3)" : "GDPR";
        }
        return "GDPR";
      }
      const law = currentBanner && ((_b3 = (_a3 = currentBanner.properties) == null ? void 0 : _a3.settings) == null ? void 0 : _b3.applicableLaw) || "";
      return law === "gdpr" ? "GDPR" : "US State Laws";
    }, [account == null ? void 0 : account.connected, connectedBanners, currentBanner]);
    const bannerStatus = reactExports.useMemo(() => {
      var _a3, _b3;
      if (!info || !info.website || !(account == null ? void 0 : account.connected)) return true;
      const i2 = info;
      return !(((_a3 = i2.pageviews) == null ? void 0 : _a3.exceeded) && i2.status === "banner_disabled" || ((_b3 = i2.website) == null ? void 0 : _b3.status) === "suspended" || i2.banner_disabled_manually);
    }, [info, account == null ? void 0 : account.connected]);
    const connected = !!(account == null ? void 0 : account.connected);
    const planName = (_b2 = (_a2 = info == null ? void 0 : info.plan) == null ? void 0 : _a2.name) != null ? _b2 : "";
    const isFreePlan = planName === "Free";
    const showLanguagePremiumBadge = !connected || isFreePlan;
    const isGeoTargeted = targetedLocation !== "worldwide";
    const isFreeorBasicPlan = planName === "Free" || planName === "Basic";
    const isAgencyPlan = planName === "Agency";
    const showGeoPremiumBadge = !connected || (isFreeorBasicPlan || isAgencyPlan) && !isGeoTargeted;
    const handleNavigate = reactExports.useCallback(
      (path, query) => {
        if (onNavigate) {
          onNavigate(path, query);
        } else {
          window.location.href = `#/${path}`;
        }
      },
      [onNavigate]
    );
    const showConnectModal = reactExports.useCallback(() => {
      var _a3;
      (_a3 = ckyConnectModalRef.current) == null ? void 0 : _a3.show();
    }, []);
    const showLocationModal = reactExports.useCallback(() => {
      var _a3;
      (_a3 = ckyLocationModalRef.current) == null ? void 0 : _a3.show();
    }, []);
    const handleCtaClick = reactExports.useCallback(
      (webAppPath, pluginPath) => {
        if (connected) {
          redirectToApp(webAppPath);
        } else {
          handleNavigate(pluginPath);
        }
      },
      [connected, handleNavigate]
    );
    const handleCustomizeCtaClick = reactExports.useCallback(
      () => handleCtaClick("customize", "customize"),
      [handleCtaClick]
    );
    const handleAddLanguagesClick = reactExports.useCallback(() => {
      var _a3;
      if (!connected) {
        showConnectModal();
        return;
      }
      if (isFreePlan) {
        (_a3 = ckyLanguageUpgradeModalRef.current) == null ? void 0 : _a3.show();
        return;
      }
      redirectToApp("languages");
    }, [connected, isFreePlan, showConnectModal]);
    const handleGeoTargetClick = reactExports.useCallback(() => {
      var _a3;
      if (!connected) {
        showLocationModal();
        return;
      }
      if ((isFreeorBasicPlan || isAgencyPlan) && !isGeoTargeted) {
        (_a3 = ckyLocationUpgradeModalRef.current) == null ? void 0 : _a3.show();
        return;
      }
      redirectToApp("customize");
    }, [connected, isFreeorBasicPlan, isAgencyPlan, isGeoTargeted, showLocationModal]);
    const handlePreviewClick = reactExports.useCallback(() => {
      var _a3, _b3;
      const url = new URL(((_b3 = (_a3 = window.ckyGlobals) == null ? void 0 : _a3.site) == null ? void 0 : _b3.url) || window.location.origin);
      url.searchParams.append("cky_preview", "true");
      window.open(url.toString(), "_blank", "noopener,noreferrer");
    }, []);
    const cardLoader = getInfoProp ? false : !info;
    if (!status || tablesMissing) {
      return null;
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn$1("cky-dashboard-overview", connected ? "connected" : ""), children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardTitle, { children: __$1("Overview", "cookie-law-info") }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(CardContent, { className: cardLoader ? "cky:min-h-[160px]" : void 0, children: cardLoader ? /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:py-2" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mb-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-info-widget-container", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-info-widget", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-info-widget-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.status, alt: "status" }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-info-widget-content", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-info-widget-title", children: __$1("Banner status", "cookie-law-info") }),
              bannerStatus ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-info-widget-text", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-[15px] cky:font-semibold", style: { color: "#00aa62" }, children: __$1("Active", "cookie-law-info") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  Button,
                  {
                    variant: "ghost",
                    size: "icon",
                    className: "cky:w-6 cky:h-4 cky:p-0 cky:border-0",
                    onClick: handlePreviewClick,
                    children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "eye", width: "18px" })
                  }
                )
              ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky-info-widget-text cky-status-error", children: __$1("Inactive", "cookie-law-info") })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-info-widget", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-info-widget-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.reg, alt: "regulation" }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-info-widget-content", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-info-widget-title", children: __$1("Regulation", "cookie-law-info") }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-info-widget-text", children: [
                applicableLaws,
                " ",
                /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "link", onClick: handleCustomizeCtaClick, className: LINK_BTN_BASE, children: __$1("Change", "cookie-law-info") })
              ] })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-info-widget", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-info-widget-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.lang, alt: "language" }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-info-widget-content", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-info-widget-title", children: __$1("Language", "cookie-law-info") }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-info-widget-text", children: [
                defaultLanguageLabel,
                " ",
                /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { variant: "link", onClick: handleAddLanguagesClick, className: LINK_BTN_INLINE, children: [
                  __$1("Add languages", "cookie-law-info"),
                  showLanguagePremiumBadge ? /* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { variant: "premium", className: PREMIUM_BADGE_ICON, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "crown", width: "10px", height: "8px" }) }) : null
                ] })
              ] })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-info-widget", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-info-widget-icon", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.location, alt: "location" }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-info-widget-content", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-info-widget-title", children: __$1("Targeted location", "cookie-law-info") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-info-widget-text", children: connected ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "cky:text-[14px]", children: [
                capitalizeString(targetedLocation),
                " ",
                !isGeoTargeted ? /* @__PURE__ */ jsxRuntimeExports.jsx(GeoTargetCta, { onClick: handleGeoTargetClick, showPremiumBadge: showGeoPremiumBadge }) : null
              ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
                __$1("Worldwide ", "cookie-law-info"),
                /* @__PURE__ */ jsxRuntimeExports.jsx(GeoTargetCta, { onClick: handleGeoTargetClick, showPremiumBadge: showGeoPremiumBadge })
              ] }) })
            ] })
          ] })
        ] }) }) }),
        !cardLoader ? /* @__PURE__ */ jsxRuntimeExports.jsx(CardFooter, { className: "cky:bg-white", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Button,
          {
            variant: "link",
            className: cn$1(
              "cky:px-0 cky:py-2 cky:text-[16px]! cky:font-medium!",
              connected && "cky-external-link"
            ),
            onClick: handleCustomizeCtaClick,
            children: __$1("Customise Banner", "cookie-law-info")
          }
        ) }) }) : null
      ] }) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyConnectModal,
        {
          ref: ckyConnectModalRef,
          visible: false,
          availablePlan: "premium",
          feature: "language_limit",
          onNavigate: handleNavigate,
          title: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.addLanguage, alt: "languages" }),
          featureText: __$1("Display your banner in multiple languages tailored for your audience", "cookie-law-info"),
          availabilityText: __$1("Available in: <b>All premium plans</b>", "cookie-law-info")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyConnectModal,
        {
          ref: ckyLocationModalRef,
          visible: false,
          availablePlan: "pro",
          feature: "config_geo_rules",
          onNavigate: handleNavigate,
          title: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.geoTarget, alt: "location" }),
          featureText: __$1("Display your banner to visitors from selected locations!", "cookie-law-info"),
          availabilityText: __$1("Available in: <b>Pro</b> and <b>Ultimate</b> plans", "cookie-law-info")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyUpgradeModal,
        {
          ref: ckyLanguageUpgradeModalRef,
          feature: "language_limit",
          upgradeSource: "cywpal",
          title: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.addLanguage, alt: "languages" }),
          featureText: __$1("Display your banner in multiple languages tailored for your audience", "cookie-law-info"),
          availabilityText: __$1("Available in: <b>All premium plans</b>", "cookie-law-info")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyUpgradeModal,
        {
          ref: ckyLocationUpgradeModalRef,
          feature: "config_geo_rules",
          upgradeSource: "cywpgt",
          title: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.geoTarget, alt: "location" }),
          featureText: __$1("Display your banner to visitors from selected locations!", "cookie-law-info"),
          availabilityText: __$1("Available in: <b>Pro</b> and <b>Ultimate</b> plans", "cookie-law-info")
        }
      )
    ] });
  }, "CkyDashboardOverview");
  const CARD_BASE_CLASS = "cky:border-[#D7E1F2] cky:rounded-[5px] cky:bg-white cky:shadow-sm cky:transition-all cky:duration-200 cky:overflow-hidden";
  const BODY_BASE_CLASS = "cky:pt-4 cky:pb-4 cky:min-h-[152px] cky:relative";
  const CONNECT_EXPAND_VALUE = "connect-card-content";
  function CkyConnectCard({
    ref,
    showIcon = false,
    title,
    tagline = "",
    bodyClass = "",
    loading = false,
    children,
    headerAction,
    body,
    footer,
    outside
  }) {
    const { expand, connect_notice, status, setExpand } = useAppStore(
      useShallow((s2) => ({
        expand: s2.expand,
        connect_notice: s2.connect_notice,
        status: s2.status,
        setExpand: s2.setExpand
      }))
    );
    const [isConnectNoticeClosed, setIsConnectNoticeClosed] = reactExports.useState(connect_notice || false);
    const cardRef = reactExports.useRef(null);
    reactExports.useEffect(() => {
      if (connect_notice !== void 0) {
        setIsConnectNoticeClosed(connect_notice);
      }
    }, [connect_notice]);
    const persistExpand = reactExports.useCallback(
      (next) => __async(null, null, function* () {
        setExpand(next);
        try {
          yield updateExpand(next);
        } catch (error) {
          console.error("Error saving connect card expand status:", error);
        }
      }),
      [setExpand]
    );
    const hasActions = !!headerAction;
    const hasBodySlot = Boolean(body || children);
    const hasFooterSlot = !!footer;
    const cardClassName = reactExports.useMemo(() => {
      const parts = [CARD_BASE_CLASS];
      if (!expand) {
        parts.push("cky:h-[90px]", "cky:cursor-pointer");
      }
      if (expand && showIcon) {
        parts.push(isConnectNoticeClosed ? "cky-aria-expanded" : "cky-aria-expanded-notice");
      }
      return parts.join(" ");
    }, [expand, showIcon, isConnectNoticeClosed]);
    const bodyClassName = reactExports.useMemo(
      () => bodyClass ? `${BODY_BASE_CLASS} ${bodyClass}` : BODY_BASE_CLASS,
      [bodyClass]
    );
    const updateCardClasses = reactExports.useCallback(() => {
      const el = cardRef.current;
      if (!el) return;
      el.classList.remove("cky-aria-expanded-notice");
      el.classList.add("cky-aria-expanded");
    }, []);
    const onAccordionValueChange = reactExports.useCallback(
      (value) => persistExpand(value === CONNECT_EXPAND_VALUE),
      [persistExpand]
    );
    reactExports.useImperativeHandle(
      ref,
      () => ({
        collapseAccordion: /* @__PURE__ */ __name(() => persistExpand(false), "collapseAccordion"),
        expandAccordion: /* @__PURE__ */ __name(() => persistExpand(!useAppStore.getState().expand), "expandAccordion"),
        updateCardClasses
      }),
      [persistExpand, updateCardClasses]
    );
    if (!status) {
      return null;
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cardClassName, ref: cardRef, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Accordion,
        {
          type: "single",
          collapsible: true,
          className: "cky-connect-card-accordion cky:w-full cky:border-b-[1px] cky:border-[#D7E1F2] cky:p-5",
          value: expand ? CONNECT_EXPAND_VALUE : "",
          onValueChange: onAccordionValueChange,
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AccordionItem, { value: CONNECT_EXPAND_VALUE, className: "cky:border-none", children: [
            title && /* @__PURE__ */ jsxRuntimeExports.jsx(
              AccordionTrigger$1,
              {
                className: "cky-connect-card-trigger cky-accordion-chevron-right cky:m-0 cky:p-0 cky:pb-5 cky:hover:no-underline cky:w-full cky:flex cky:items-center cky:justify-between cky:cursor-pointer cky:relative cky:data-[state=open]:border-b cky:data-[state=open]:border-[#D7E1F2] cky:data-[state=open]:pb-5 [&>svg]:cky:absolute! [&>svg]:cky:right-[10px]! [&>svg]:cky:top-1/2! [&>svg]:cky:h-6 [&>svg]:cky:w-6 [&>svg]:cky:shrink-0!",
                children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:justify-between cky:w-full cky:gap-3", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:items-start cky:gap-[8px] cky:min-w-0 cky:flex-1", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("h5", { className: "cky:text-[18px]! cky:font-semibold cky:leading-[24px] cky:m-0! cky:p-0", children: title }),
                    tagline && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:text-[14px]! cky:font-normal cky:leading-[24px]! cky:text-gray-500 cky:m-0!", children: tagline })
                  ] }),
                  hasActions && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:items-center cky:gap-3 cky:shrink-0", children: headerAction })
                ] })
              }
            ),
            hasBodySlot && /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionContent, { className: bodyClassName, children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:pointer-events-none cky:opacity-60", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:animate-pulse cky:bg-gray-200 cky:h-4 cky:rounded cky:mb-2" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:animate-pulse cky:bg-gray-200 cky:h-4 cky:rounded cky:w-3/4" })
            ] }) : body || children })
          ] })
        }
      ),
      outside,
      hasFooterSlot && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:border-t cky:border-gray-200 cky:px-5 cky:py-4 cky:bg-gray-50", children: footer })
    ] });
  }
  __name(CkyConnectCard, "CkyConnectCard");
  const STEP_ROW_CLASS = "cky:flex cky:py-0 cky:px-[5px] cky:relative";
  const TIMELINE_RAIL_CLASS = "cky:flex cky:flex-col cky:items-center cky:mr-4";
  const SCAN_BENEFIT_ROW_CLASS = "cky:flex cky:items-start cky:gap-1.5";
  const SCAN_BENEFIT_TEXT_CLASS = "cky:text-sm! cky:m-0! cky:font-normal cky:text-gray-700 cky:pr-6 cky:max-w-[216px]";
  const SCAN_BENEFIT_MESSAGES = [
    "Detect cookies and trackers on all web pages",
    "Automatically classify cookies into categories",
    "Generate a detailed cookie declaration"
  ];
  const CkyConnectNotice = /* @__PURE__ */ __name(() => {
    var _a2;
    const navigate = useNavigate();
    const {
      options: options2,
      info,
      status: pluginStatus,
      connect_notice,
      setConnectNotice
    } = useAppStore(
      useShallow((s2) => ({
        options: s2.options,
        info: s2.info,
        status: s2.status,
        connect_notice: s2.connect_notice,
        setConnectNotice: s2.setConnectNotice
      }))
    );
    const ckyCardRef = reactExports.useRef(null);
    const { connectToApp } = useConnectFlow();
    const [syncing, setSyncing] = reactExports.useState(false);
    const [hasFilter2, setHasFilter] = reactExports.useState(false);
    const [isConnectNoticeClosed, setIsConnectNoticeClosed] = reactExports.useState(connect_notice);
    const account = (_a2 = options2 == null ? void 0 : options2.account) != null ? _a2 : {};
    const connected = !!(account == null ? void 0 : account.connected);
    const tablesMissing = !!(info == null ? void 0 : info.tables_missing);
    reactExports.useEffect(() => {
      if (connected) return;
      const onBefore = /* @__PURE__ */ __name(() => setSyncing(true), "onBefore");
      const onAfterSyncing = /* @__PURE__ */ __name(() => setSyncing(false), "onAfterSyncing");
      window.addEventListener("beforeConnection", onBefore);
      window.addEventListener("afterSyncing", onAfterSyncing);
      (() => __async(null, null, function* () {
        try {
          const response = yield applyFilter({});
          if (hasFilterData(response)) setHasFilter(true);
        } catch (e) {
          console.error("Error checking filter:", e);
        }
      }))();
      return () => {
        window.removeEventListener("beforeConnection", onBefore);
        window.removeEventListener("afterSyncing", onAfterSyncing);
      };
    }, [connected]);
    const expandAccordion = reactExports.useCallback(() => {
      var _a3, _b2;
      (_b2 = (_a3 = ckyCardRef.current) == null ? void 0 : _a3.expandAccordion) == null ? void 0 : _b2.call(_a3);
    }, []);
    const handleNoticeClose = reactExports.useCallback(() => __async(null, null, function* () {
      var _a3, _b2;
      (_b2 = (_a3 = ckyCardRef.current) == null ? void 0 : _a3.updateCardClasses) == null ? void 0 : _b2.call(_a3);
      setIsConnectNoticeClosed(true);
      setConnectNotice(true);
      try {
        yield updateConnectNotice(true);
      } catch (error) {
        console.error("Error closing notice:", error);
      }
    }), [setConnectNotice]);
    const connectAfterFilter = reactExports.useCallback(
      (isExistingAccount) => __async(null, null, function* () {
        const response = yield applyFilter({});
        if ((response == null ? void 0 : response.prevent_navigation) === true) return;
        if (hasFilterData(response) && (response == null ? void 0 : response.filter_result) && typeof response.filter_result === "object") {
          connectToApp(isExistingAccount, "", response.filter_result);
          return;
        }
        if (isExistingAccount) {
          connectToApp(true);
        } else {
          navigate({ to: "/dashboard/plans", search: { available: "all" } });
        }
      }),
      [connectToApp, navigate]
    );
    const handleExistingAccount = reactExports.useCallback(() => connectAfterFilter(true), [connectAfterFilter]);
    const handleConnectToNewAccount = reactExports.useCallback(() => connectAfterFilter(false), [connectAfterFilter]);
    const handleGoToWebApp = reactExports.useCallback(() => {
      redirectToApp();
    }, []);
    if (connected && !syncing && pluginStatus) {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mt-[30px] cky:mb-0 cky:bg-white cky:rounded cky:shadow-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:m-0 cky:py-[15px] cky:px-5", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:w-full cky:pt-[5px] cky:px-0 cky:pb-[3px]", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("h4", { className: "cky:m-0! cky:mb-4! cky:font-semibold cky:text-base! cky:flex! cky:items-center cky:gap-1.5", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.success, alt: "", className: "cky:w-4 cky:h-4 cky:shrink-0", style: { color: "#00aa63" } }),
          __$1("Your website is connected to CookieYes web app", "cookie-law-info")
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mb-[18px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:m-0! cky:text-sm!", children: __$1(
          "You can access all the plugin settings (Cookie Banner, Cookie Manager, Languages and Policy Generators) on the web app and unlock new features like Cookie Scanner and Consent Log.",
          "cookie-law-info"
        ) }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { className: "cky-external-link", onClick: handleGoToWebApp, children: __$1("Go to Web App", "cookie-law-info") })
      ] }) }) });
    }
    if (!tablesMissing) {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mt-[30px] cky:mb-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:items-center cky:-mx-[15px] cky:mb-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-full cky:px-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        CkyConnectCard,
        {
          ref: ckyCardRef,
          title: __$1("Get started with CookieYes", "cookie-law-info"),
          tagline: __$1(
            "Welcome to CookieYes! To become legally compliant for your use of cookies, here’s what you need to do.",
            "cookie-law-info"
          ),
          showIcon: true,
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: STEP_ROW_CLASS, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: TIMELINE_RAIL_CLASS, children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:flex-col cky:justify-center cky:items-center cky:rounded-full cky:border-2 cky:border-blue-600 cky:bg-blue-50 cky:mb-1 cky:mt-1 cky:w-7 cky:h-7", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.check, alt: "Check", className: "cky:w-4 cky:h-4" }) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-0.5 cky:h-12 cky:bg-blue-600" })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:text-base! cky:font-semibold cky:text-gray-700 cky:m-0!", children: __$1("Activate your cookie banner", "cookie-law-info") }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "cky:text-sm! cky:font-normal cky:text-gray-700 cky:m-0!", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: __$1("Well done!", "cookie-law-info") }),
                  " 🎉",
                  " ",
                  __$1("You have successfully implemented a cookie banner on your website.", "cookie-law-info")
                ] })
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: STEP_ROW_CLASS, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: TIMELINE_RAIL_CLASS, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:flex-col cky:justify-center cky:items-center cky:rounded-full cky:border-2 cky:border-blue-600 cky:bg-[#E8F1FE] cky:mb-1 cky:mt-1 cky:w-[28px] cky:h-[28px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-[12px] cky:h-[12px] cky:rounded-full cky:bg-blue-600" }) }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:text-base! cky:font-semibold cky:text-gray-700 cky:m-0! cky:mb-2", children: __$1("Connect and scan your website", "cookie-law-info") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:text-sm! cky:font-normal cky:text-gray-700 cky:m-0! cky:mb-4", children: __$1(
                  "To initiate an automatic cookie scan, you need to connect to the CookieYes web app. By connecting you can:",
                  "cookie-law-info"
                ) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:py-4 cky:pb-6 cky:flex-row cky:gap-2", children: SCAN_BENEFIT_MESSAGES.map((msg) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: SCAN_BENEFIT_ROW_CLASS, children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.check, alt: "", className: "cky:w-5 cky:h-5 cky:mt-0.5 cky:shrink-0" }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: SCAN_BENEFIT_TEXT_CLASS, children: t$1(msg) })
                ] }, msg)) })
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:w-full cky:max-w-full cky:flex-wrap cky:gap-3 cky:px-13", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                Button,
                {
                  className: hasFilter2 ? "cky-external-link" : "",
                  onClick: handleConnectToNewAccount,
                  children: __$1("Connect to a new account", "cookie-law-info")
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                Button,
                {
                  variant: "outline",
                  className: "cky:ml-0 cky:bg-white cky:text-blue-600 cky:border-blue-600 cky-external-link",
                  onClick: handleExistingAccount,
                  children: __$1("Connect to an existing account", "cookie-law-info")
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                Button,
                {
                  variant: "ghost",
                  className: "cky:ml-auto cky:bg-transparent cky:text-[#686876] cky:border-none cky:hover:bg-[#dfdfe2]",
                  onClick: expandAccordion,
                  children: __$1("Do it later", "cookie-law-info")
                }
              )
            ] }),
            !isConnectNoticeClosed && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:pt-4 cky:pb-0 cky:px-5", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Alert, { variant: "info", className: "cky:relative cky:py-[15px] cky:px-5", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(AlertTitle, { className: "cky:font-medium", children: __$1("Connecting to the web app: what to expect", "cookie-law-info") }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDescription, { className: "cky:pr-5", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:text-sm cky:mb-2.5!", children: __$1(
                  "When you connect to the web app, your banner will load from CookieYes’ external servers, and consent logs will be stored securely in the cloud. You’ll get access to advanced features and settings, and your banner will follow the monthly pageview limit of your selected plan.",
                  "cookie-law-info"
                ) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:text-sm cky:m-0!", children: __$1(
                  "You can disconnect anytime to switch back to the plugin’s free native version, but the advanced features will be removed.",
                  "cookie-law-info"
                ) })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                Button,
                {
                  variant: "ghost",
                  size: "icon",
                  className: "cky:absolute cky:top-2 cky:right-4 cky:text-[20px]! cky:font-light cky:p-0 cky:h-auto cky:w-auto cky:bg-transparent cky:border-none cky:text-gray-500 hover:cky:bg-transparent hover:cky:text-gray-700",
                  onClick: handleNoticeClose,
                  "aria-label": "Close",
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": "true", children: "×" })
                }
              )
            ] }) })
          ]
        }
      ) }) }) });
    }
    return null;
  }, "CkyConnectNotice");
  function sprintf(format2, ...args) {
    const out = format2.replace(/%(\d+)\$[sd]/g, (_, i2) => {
      var _a2;
      return String((_a2 = args[Number(i2) - 1]) != null ? _a2 : "");
    });
    const rest = [...args];
    return out.replace(/%[sb]/g, () => {
      var _a2;
      return String((_a2 = rest.shift()) != null ? _a2 : "");
    });
  }
  __name(sprintf, "sprintf");
  function localizedCategoryName(name, language, defaultLanguage) {
    return (name == null ? void 0 : name[language]) || (name == null ? void 0 : name[defaultLanguage]) || (name == null ? void 0 : name.en) || Object.values(name || {})[0] || "";
  }
  __name(localizedCategoryName, "localizedCategoryName");
  function categoryTabTitle(name, language) {
    var _a2;
    return (_a2 = name == null ? void 0 : name[language]) != null ? _a2 : "";
  }
  __name(categoryTabTitle, "categoryTabTitle");
  const PAGE_SHELL_CLASS = "cky:relative cky:bg-transparent cky:p-[15px]";
  const TABS_FRAME_CLASS = "cky:flex cky:w-full cky:border cky:border-gray-300";
  const TOOLTIP_TOP = "top";
  function createInitialErrors() {
    return {
      cookie: {
        id: false,
        domain: false,
        duration: false,
        description: false
      },
      category: {
        name: false,
        description: false
      }
    };
  }
  __name(createInitialErrors, "createInitialErrors");
  const DELETE_COOKIE_BODY_TEMPLATE = __$1(
    /* translators: %1$s: Cookie name. */
    "The cookie <b>%1$s</b> will be permanently deleted. This cookie will no longer be displayed on your cookie list nor be blocked prior to receiving user consent.",
    "cookie-law-info"
  );
  const SETTINGS_PATH = "admin.php?page=cookie-law-info#/settings";
  const DATE_OPTIONS = {
    year: "numeric",
    month: "short",
    day: "numeric"
  };
  function openAppRedirect(path) {
    const url = getAppRedirectURL(path);
    if (!url) return;
    window.open(url, "_blank", "noopener,noreferrer");
  }
  __name(openAppRedirect, "openAppRedirect");
  function openDashboardStartTrial() {
    const url = getAppRedirectURL("dashboard");
    if (!url) return;
    const join = url.includes("?") ? "&" : "?";
    window.open(`${url}${join}startTrial=true`, "_blank", "noopener,noreferrer");
  }
  __name(openDashboardStartTrial, "openDashboardStartTrial");
  function formatDeadlineDate(dateStr) {
    if (!dateStr) return "";
    try {
      const d = new Date(dateStr);
      return Number.isNaN(d.getTime()) ? "" : d.toLocaleDateString(void 0, DATE_OPTIONS);
    } catch (e) {
      return "";
    }
  }
  __name(formatDeadlineDate, "formatDeadlineDate");
  function buildMessageHtml(template, gracePeriod) {
    return sprintf(template, gracePeriod).replace(/<b>/g, "<strong>").replace(/<\/b>/g, "</strong>");
  }
  __name(buildMessageHtml, "buildMessageHtml");
  function getNoticeContent(website, infoStatus) {
    var _a2;
    const isSuspended = website.status === "suspended";
    const isSubscriptionCancelled = website.status === "subscriptionCancelled";
    const isTrial = !!website.is_trial;
    const isDraft = infoStatus === "draft";
    const hasPayment = !!website.payment_status;
    const selectedPlan = (_a2 = website.selected_plan) != null ? _a2 : "";
    const gracePeriod = formatDeadlineDate(website.grace_period_ends_at) || t$1("soon");
    const redirectToOrgSettings = /* @__PURE__ */ __name(() => {
      openAppRedirect("settings/organizations-and-sites");
    }, "redirectToOrgSettings");
    if (isSubscriptionCancelled) {
      const isTrialCancellation = isTrial && !hasPayment;
      return {
        header: __$1(
          isTrialCancellation ? "Your trial subscription is due for cancellation" : "Your subscription is due for cancellation",
          "cookie-law-info"
        ),
        message: buildMessageHtml(
          isTrialCancellation ? __$1(
            /* translators: %s: End date of the billing period (formatted). */
            "Your trial subscription will be cancelled at the end of your billing period on <b>%s</b>, and your site will be removed from the web app account",
            "cookie-law-info"
          ) : __$1(
            /* translators: %s: End date of the billing period (formatted). */
            "Your subscription will be cancelled at the end of your billing period on <b>%s</b>, and your site will be removed from the web app account.",
            "cookie-law-info"
          ),
          gracePeriod
        ),
        buttonText: __$1("Reactivate subscription", "cookie-law-info"),
        buttonAction: redirectToOrgSettings
      };
    }
    if (!hasPayment) {
      if (isTrial && !isSubscriptionCancelled && isDraft) {
        return {
          header: __$1("Start your free trial to activate your banner", "cookie-law-info"),
          message: buildMessageHtml(
            __$1(
              /* translators: %s: Last date to add a payment method (formatted). */
              "Your cookie banner is currently inactive. Add a payment method to start your 14-day free trial and activate your banner. If you don't proceed with the trial by <b>%s</b>, your site will be removed from the web app account",
              "cookie-law-info"
            ),
            gracePeriod
          ),
          buttonText: __$1("Start your free trial", "cookie-law-info"),
          buttonAction: openDashboardStartTrial
        };
      }
      if (website.status === "paymentMethodMissingPaid" && !isTrial) {
        return {
          header: __$1("No payment method available for this site", "cookie-law-info"),
          message: buildMessageHtml(
            __$1(
              /* translators: %s: Next renewal date (formatted). */
              "Add a payment method before the next renewal date, <b>%s</b>, to avoid suspension of your site. If no payment method is added by this date, your site will be removed from the web app account within 30 days of suspension.",
              "cookie-law-info"
            ),
            gracePeriod
          ),
          buttonText: __$1("Add payment method", "cookie-law-info"),
          buttonAction: redirectToOrgSettings
        };
      }
      if (selectedPlan === "free" && !isTrial || isTrial && selectedPlan !== "free" && isSuspended) {
        return {
          header: __$1("Select a plan to activate your banner", "cookie-law-info"),
          message: buildMessageHtml(
            __$1(
              /* translators: %s: Last date to choose a plan (formatted). */
              "Your cookie banner is currently inactive. Choose a plan to activate your banner and unlock advanced customisation and features. If you don't proceed with a plan by <b>%s</b>, your site will be removed from the web app account.",
              "cookie-law-info"
            ),
            gracePeriod
          ),
          buttonText: __$1("Select a plan", "cookie-law-info"),
          buttonAction: /* @__PURE__ */ __name(() => {
            openAppRedirect("wp-plan-selector");
          }, "buttonAction")
        };
      }
      if (!isTrial && selectedPlan !== "free" && isSuspended) {
        return {
          header: __$1("Complete your payment to activate your banner", "cookie-law-info"),
          message: buildMessageHtml(
            __$1(
              /* translators: %s: Last date to complete payment (formatted). */
              "Your site is currently suspended and your cookie banner is inactive due to payment failure. Complete your payment to activate the banner. If you don't proceed with the payment by <b>%s</b>, your site will be removed from the web app account",
              "cookie-law-info"
            ),
            gracePeriod
          ),
          buttonText: __$1("Complete your payment", "cookie-law-info"),
          buttonAction: redirectToOrgSettings
        };
      }
    }
    return null;
  }
  __name(getNoticeContent, "getNoticeContent");
  const CkySuspendedNotice = /* @__PURE__ */ __name(() => {
    var _a2;
    const info = useAppStore((s2) => s2.info);
    const website = (_a2 = info == null ? void 0 : info.website) != null ? _a2 : {};
    const infoStatus = typeof (info == null ? void 0 : info.status) === "string" ? info.status : "";
    const noteHtml = sprintf(
      __$1(
        /* translators: %1$s: opening bold tag, %2$s: closing bold tag, %3$s: settings page URL */
        `%1$sNote:%2$s To use the standalone plugin, you can <a href="%3$s">disconnect</a> from the web app. However, you'll lose advanced features and customizations.`,
        "cookie-law-info"
      ),
      "<strong>",
      "</strong>",
      SETTINGS_PATH
    );
    const content = reactExports.useMemo(() => getNoticeContent(website, infoStatus), [website, infoStatus]);
    if (!content) return null;
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      Alert,
      {
        variant: "warning",
        className: "cky:py-5 cky:px-4 cky:rounded cky:border cky:border-[#d7e1f2]",
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:gap-4 cky:justify-between cky:flex-wrap cky:items-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:w-13 cky:h-13 cky:rounded-lg cky:bg-[#FFC166] cky:p-[11px] cky:items-center cky:justify-center cky:shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "img",
            {
              src: assets.circleWarning,
              alt: "warning",
              className: "cky:w-[30px] cky:h-[30px]"
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-1 cky:flex-1 cky:min-w-0", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "cky:m-0! cky:font-semibold cky:text-base!", children: content.header }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              AlertDescription,
              {
                className: "cky:m-0! cky:text-[13px] cky:text-[#4E4B66] cky:[&_strong]:font-semibold",
                dangerouslySetInnerHTML: { __html: content.message }
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              AlertDescription,
              {
                className: "cky:mt-1 cky:m-0! cky:text-[13px] cky:text-[#4E4B66] cky:[&_strong]:font-semibold cky:[&_a]:underline",
                dangerouslySetInnerHTML: { __html: noteHtml }
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Button,
            {
              type: "button",
              size: "sm",
              className: "cky-external-link",
              onClick: content.buttonAction,
              children: content.buttonText
            }
          ) })
        ] })
      }
    ) });
  }, "CkySuspendedNotice");
  const TRIAL_DAYS = {
    TOTAL: 15,
    INFO_RANGE: { MIN: 1, MAX: 11 },
    WARNING_RANGE: { MIN: 12, MAX: 14 }
  };
  function getNoticeType(endsIn) {
    const currentDay = TRIAL_DAYS.TOTAL - endsIn;
    if (currentDay >= TRIAL_DAYS.INFO_RANGE.MIN && currentDay <= TRIAL_DAYS.INFO_RANGE.MAX) {
      return "info";
    }
    if (currentDay >= TRIAL_DAYS.WARNING_RANGE.MIN && currentDay <= TRIAL_DAYS.WARNING_RANGE.MAX) {
      return "warning";
    }
    return null;
  }
  __name(getNoticeType, "getNoticeType");
  function getNoticeIcon(noticeType) {
    return noticeType === "warning" ? assets.circleWarning : assets.rocket;
  }
  __name(getNoticeIcon, "getNoticeIcon");
  function getNoticeHeader(noticeType, plan, endsIn) {
    if (noticeType === "warning") {
      return sprintf$2(
        _n(
          /* translators: %1$d: number of days left in trial, %2$s: plan name */
          "Only %1$d day left in your %2$s trial",
          "Only %1$d days left in your %2$s trial",
          endsIn,
          "cookie-law-info"
        ),
        endsIn,
        plan
      );
    }
    return sprintf$2(__$2("🎉 You're on a 14-day %s trial", "cookie-law-info"), plan);
  }
  __name(getNoticeHeader, "getNoticeHeader");
  function getNoticeMessage(noticeType, isInOptinTrial, plan, trialEndsAt) {
    if (noticeType === "warning") {
      return isInOptinTrial ? sprintf$2(
        /* translators: %s: plan name */
        __$2("To avoid losing access to advanced features after the trial ends, add payment details now and continue on the %s plan seamlessly. You won't be charged until your trial ends.", "cookie-law-info"),
        plan
      ) : sprintf$2(
        /* translators: %s: plan name */
        __$2("To keep your cookie banner active after the trial, add payment details now and continue on the %s plan seamlessly. You won't be charged until your trial ends.", "cookie-law-info"),
        plan
      );
    }
    return isInOptinTrial ? sprintf$2(
      /* translators: %1$s: plan name, %2$s: trial end date */
      __$2("Your %1$s features are active until %2$s. After that, your plan will be downgraded to Free unless you add payment details. You won't be charged until your trial ends.", "cookie-law-info"),
      plan,
      trialEndsAt
    ) : sprintf$2(
      /* translators: %1$s: plan name, %2$s: trial end date */
      __$2("Your %1$s features are active until %2$s. After that, your cookie banner will be paused unless you add payment details. You won't be charged until your trial ends.", "cookie-law-info"),
      plan,
      trialEndsAt
    );
  }
  __name(getNoticeMessage, "getNoticeMessage");
  const CkyTrialStatusNotice = /* @__PURE__ */ __name(() => {
    const info = useAppStore((s2) => s2.info);
    const [isLoading, setIsLoading] = reactExports.useState(false);
    const { noticeType, noticeIcon, noticeHeader, noticeMessage, primaryButtonText, paymentData } = reactExports.useMemo(() => {
      var _a2, _b2, _c2, _d, _e2, _f, _g, _h, _i;
      const website = (_a2 = info == null ? void 0 : info.website) != null ? _a2 : {};
      const plan = info == null ? void 0 : info.plan;
      const planName = (_b2 = plan == null ? void 0 : plan.name) != null ? _b2 : "";
      const endsIn = (_c2 = website.ends_in) != null ? _c2 : 0;
      const trialEndsAt = (_d = website.trial_ends_at) != null ? _d : "";
      const isInOptinTrial = !!website.isInOptinTrial;
      const type = getNoticeType(endsIn);
      return {
        noticeType: type,
        noticeIcon: getNoticeIcon(type),
        noticeHeader: getNoticeHeader(type, planName, endsIn),
        noticeMessage: getNoticeMessage(type, isInOptinTrial, planName, trialEndsAt),
        primaryButtonText: __$2("Add payment details", "cookie-law-info"),
        paymentData: {
          currency: (_e2 = plan == null ? void 0 : plan.currency) != null ? _e2 : "USD",
          is_trial: (_f = website.is_trial) != null ? _f : false,
          is_trial_experiment: (_g = website.is_trial_experiment) != null ? _g : false,
          plan_id: (_h = plan == null ? void 0 : plan.id) != null ? _h : "",
          website_id: (_i = info == null ? void 0 : info.id) != null ? _i : ""
        }
      };
    }, [info]);
    const redirectToAddPayments = reactExports.useCallback(() => __async(null, null, function* () {
      var _a2;
      if (isLoading) return;
      setIsLoading(true);
      try {
        const response = yield ckyRest.post({
          path: "/settings/payments",
          data: paymentData
        });
        if ((response == null ? void 0 : response.success) && ((_a2 = response == null ? void 0 : response.data) == null ? void 0 : _a2.url)) {
          window.open(response.data.url, "_blank");
        }
      } finally {
        setIsLoading(false);
      }
    }), [isLoading, paymentData]);
    if (!noticeType) return null;
    const iconBg = noticeType === "info" ? "#B9D7FD" : "#FFC166";
    const headerColor = noticeType === "warning" ? "#7A4F01" : void 0;
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mt-[30px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      Alert,
      {
        variant: noticeType === "info" ? "default" : "warning",
        className: "cky:rounded-xl cky:border-0 cky:py-5 cky:px-5",
        style: { backgroundColor: noticeType === "info" ? "#E8F1FE" : void 0 },
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:gap-4 cky:justify-between cky:flex-wrap cky:items-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: "cky:flex cky:w-[50px] cky:h-[50px] cky:rounded-xl cky:p-[9px] cky:items-center cky:justify-center cky:shrink-0",
              style: { backgroundColor: iconBg },
              children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: noticeIcon, alt: noticeType, className: "cky:w-8 cky:h-8" })
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-1 cky:flex-1 cky:min-w-0 cky:max-w-[60%]", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "h4",
              {
                className: "cky:m-0! cky:font-semibold cky:text-base!",
                style: { color: headerColor },
                children: noticeHeader
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { className: "cky:m-0! cky:text-[13px] cky:text-[#4E4B66]", children: noticeMessage })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:ml-auto cky:shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Button,
            {
              type: "button",
              onClick: redirectToAddPayments,
              disabled: isLoading,
              className: "cky:whitespace-nowrap cky:text-base! cky:font-medium!",
              children: primaryButtonText
            }
          ) })
        ] })
      }
    ) });
  }, "CkyTrialStatusNotice");
  const REVIEW_URL = "https://wordpress.org/support/plugin/cookie-law-info/reviews/#new-post";
  const CkyReviewNotice = /* @__PURE__ */ __name(() => {
    var _a2, _b2;
    const [hidden, setHidden] = reactExports.useState(false);
    const noticeRef = reactExports.useRef(
      typeof window !== "undefined" ? (_a2 = window.ckyAppNotices) == null ? void 0 : _a2.review_notice : void 0
    );
    const notice = noticeRef.current;
    const expiry = (_b2 = notice == null ? void 0 : notice.expiration) != null ? _b2 : 0;
    const removeNotice = reactExports.useCallback(
      (..._0) => __async(null, [..._0], function* (dismissExpiry = expiry) {
        yield ckyRest.post({
          path: "settings/notices/review_notice",
          data: { expiry: dismissExpiry }
        });
        setHidden(true);
      }),
      [expiry]
    );
    const redirectReview = reactExports.useCallback(() => {
      window.open(REVIEW_URL, "_blank", "noopener,noreferrer");
    }, []);
    if (!notice || hidden) return null;
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        className: "cky:mt-[30px] cky:rounded-[5px] cky:border cky:border-[#d7e1f2] cky:bg-white cky:relative",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            Button,
            {
              variant: "ghost",
              size: "icon",
              "aria-label": t$1("Dismiss"),
              onClick: /* @__PURE__ */ __name(() => void removeNotice(), "onClick"),
              className: "cky:!h-7 cky:!w-7 cky:absolute cky:top-2 cky:right-3 cky:z-10 cky:p-0 cky:text-xl! cky:font-light cky:leading-none cky:text-gray-400! hover:cky:text-gray-600! cky:shadow-none! cky:border-0! cky:hover:bg-transparent! cky:active:bg-transparent!",
              children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": "true", children: "×" })
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:px-[15px] cky:py-[10px]", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mt-[5px] cky:mb-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.logo, width: 100, alt: "" }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "p",
              {
                className: "cky:mt-[15px] cky:mb-[5px] cky:text-sm cky:text-[#333]",
                dangerouslySetInnerHTML: {
                  __html: t$1(
                    "Hey, we at <b>CookieYes</b> would like to thank you for using our plugin. We would really appreciate if you could take a moment to drop a quick review that will inspire us to keep going."
                  )
                }
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:gap-0 cky:mt-[10px]", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "sm", onClick: redirectReview, children: t$1("Review now") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                Button,
                {
                  variant: "outline",
                  size: "sm",
                  onClick: /* @__PURE__ */ __name(() => void removeNotice(0), "onClick"),
                  className: "cky:ml-[10px] cky:text-[#333] cky:border-[#ccc] hover:cky:bg-[#f7f7f7]",
                  children: t$1("Never show again")
                }
              )
            ] })
          ] })
        ]
      }
    );
  }, "CkyReviewNotice");
  const CkyMigrationBackNotice = /* @__PURE__ */ __name(() => {
    var _a2, _b2, _c2;
    const notices = typeof window !== "undefined" ? window.ckyAppNotices : void 0;
    const migrationNotice = notices == null ? void 0 : notices.migration_notice;
    if (!migrationNotice) return null;
    const message = (_a2 = migrationNotice.message) != null ? _a2 : "";
    const legacyURL = typeof window !== "undefined" ? (_c2 = (_b2 = window.ckyGlobals) == null ? void 0 : _b2.legacyURL) != null ? _c2 : "" : "";
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mt-4 cky:mb-[-10px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { variant: "info", className: "cky:py-3 cky:px-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDescription, { className: "cky:m-0! cky:flex cky:flex-wrap cky:items-center cky:gap-3", children: [
      message && /* @__PURE__ */ jsxRuntimeExports.jsx("b", { className: "cky:mr-2 cky:text-[13px]", children: message }),
      legacyURL && /* @__PURE__ */ jsxRuntimeExports.jsx(
        Button,
        {
          variant: "primary",
          size: "sm",
          className: "cky:bg-transparent",
          onClick: /* @__PURE__ */ __name(() => {
            window.location.assign(legacyURL);
          }, "onClick"),
          children: __$1("Go back to previous version", "cookie-law-info")
        }
      )
    ] }) }) });
  }, "CkyMigrationBackNotice");
  const AFFILIATE_URL = "https://www.cookieyes.com/partners/affiliates/onboarding/?ref=aiaflwp";
  const CARD_CLASS = cn$1(
    "cky-affiliate-banner cky:relative cky:overflow-hidden cky:mb-0 cky:mx-[-20px]",
    "cky:border-0 cky:bg-transparent cky:shadow-[0_8px_26px_-4px_rgba(39,40,60,0.2)] cky:rounded-none",
    "cky:py-3 cky:px-[50px]",
    "cky:max-[782px]:py-4 cky:max-[782px]:px-4"
  );
  const CLOSE_BUTTON_CLASS = cn$1(
    "cky-affiliate-close cky:absolute cky:top-1.5 cky:right-3 cky:z-20",
    "cky:!h-7 cky:!w-7 cky:p-0 cky:shrink-0",
    "cky:text-[20px]! cky:font-light cky:leading-none cky:tracking-normal",
    "cky:text-white! cky:shadow-none! cky:border-0!",
    "cky:hover:bg-transparent! cky:hover:text-white! cky:hover:opacity-70!"
  );
  const AFFILIATE_CARD_BACKGROUND_STYLE = {
    backgroundImage: `url(${assets.affiliateBg})`,
    backgroundSize: "cover",
    backgroundPosition: "center",
    backgroundRepeat: "no-repeat"
  };
  const CkyAffiliateNotice = /* @__PURE__ */ __name(() => {
    const [visible, setVisible] = reactExports.useState(false);
    const [loaded, setLoaded] = reactExports.useState(false);
    const setAffiliateBannerVisible = useAppStore((s2) => s2.setAffiliateBannerVisible);
    reactExports.useEffect(() => {
      let cancelled = false;
      (() => __async(null, null, function* () {
        try {
          const res = yield ckyRest.get({ path: "settings/notices/affiliate_banner" });
          if (!cancelled) {
            const show = !!(res == null ? void 0 : res.show);
            setVisible(show);
            setAffiliateBannerVisible(show);
            setLoaded(true);
          }
        } catch (e) {
          if (!cancelled) setLoaded(true);
        }
      }))();
      return () => {
        cancelled = true;
      };
    }, [setAffiliateBannerVisible]);
    const handleDismiss = reactExports.useCallback(() => __async(null, null, function* () {
      setVisible(false);
      setAffiliateBannerVisible(false);
      try {
        yield ckyRest.post({
          path: "settings/notices/affiliate_banner",
          data: { expiry: 0 }
        });
      } catch (e) {
        console.error("Error dismissing affiliate banner:", e);
      }
    }), [setAffiliateBannerVisible]);
    const handleLearnMore = reactExports.useCallback(() => {
      const w = window.open(AFFILIATE_URL, "_blank", "noopener,noreferrer");
      if (w) w.opener = null;
    }, []);
    if (!loaded || !visible) return null;
    const highlightText = __$1("Join our affiliate program", "cookie-law-info");
    const baseText = __$1(
      " and earn commissions when your referrals become paying customers.",
      "cookie-law-info"
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: CARD_CLASS, style: AFFILIATE_CARD_BACKGROUND_STYLE, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Button,
        {
          variant: "ghost",
          size: "icon",
          "aria-label": __$1("Close", "cookie-law-info"),
          onClick: handleDismiss,
          className: CLOSE_BUTTON_CLASS,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": "true", children: "×" })
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        CardContent,
        {
          fullWidth: true,
          className: cn$1(
            "cky:!min-h-0 cky:flex cky:items-center cky:gap-10",
            "cky:relative cky:z-[1]",
            "cky:max-[1200px]:flex-wrap cky:max-[1200px]:gap-6",
            "cky:max-[782px]:flex-col cky:max-[782px]:items-start cky:max-[782px]:gap-5"
          ),
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex-1 cky:flex cky:flex-col", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:m-0! cky:text-lg! cky:font-bold cky:text-white cky:leading-[27px] cky:max-[782px]:text-base cky:max-[782px]:leading-6", children: __$1("Promote privacy by referring others to CookieYes.", "cookie-law-info") }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "cky:m-0! cky:text-sm! cky:font-normal cky:text-white cky:leading-5", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "span",
                  {
                    className: "cky:font-bold",
                    style: {
                      background: "linear-gradient(72deg, #E44B26 -64.63%, #F3CF4E 201.77%)",
                      WebkitBackgroundClip: "text",
                      WebkitTextFillColor: "transparent",
                      backgroundClip: "text"
                    },
                    children: highlightText
                  }
                ),
                baseText
              ] })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:shrink-0 cky:flex cky:items-center cky:gap-8 cky:max-[1200px]:flex-col cky:max-[1200px]:items-start cky:max-[1200px]:gap-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              Button,
              {
                variant: "outline",
                onClick: handleLearnMore,
                className: "cky-external-link cky:text-[#0D47A1] cky:bg-white cky:border-white hover:cky:bg-white/90 cky:shadow-[0_8px_26px_-4px_rgba(39,40,60,0.20)]",
                children: t$1("Learn More")
              }
            ) })
          ]
        }
      )
    ] });
  }, "CkyAffiliateNotice");
  const CkyTableMissingNotice = /* @__PURE__ */ __name(() => {
    const info = useAppStore((s2) => s2.info);
    const [loading, setLoading] = reactExports.useState(false);
    const tablesMissing = Boolean(info && typeof info === "object" && info.tables_missing);
    const reInstallTables = reactExports.useCallback(() => __async(null, null, function* () {
      setLoading(true);
      try {
        const response = yield ckyRest.post({
          path: "settings/reinstall"
        });
        if ((response == null ? void 0 : response.success) === true) {
          window.location.reload();
        }
      } catch (e) {
        console.error(e);
      } finally {
        setLoading(false);
      }
    }), []);
    if (!tablesMissing) return null;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        className: cn$1(
          "cky:relative cky:flex cky:justify-between",
          "cky:mt-5 cky:-mb-2.5",
          "cky:rounded-[4px] cky:border cky:border-transparent",
          "cky:bg-[#fad2d7]",
          "cky:shadow-[0_5px_15px_0_rgba(0,0,0,0.02)]"
        ),
        role: "alert",
        children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:m-0 cky:flex cky:w-full cky:items-center cky:px-[15px] cky:py-2.5", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:flex-1 cky:pt-[5px] cky:pb-[3px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-wrap cky:items-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:m-0! cky:border-0 cky:p-0 cky:text-[13px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: __$1(
            "Missing database tables: Some features may be disabled or not work as expected since one or more required tables are missing from the database.",
            "cookie-law-info"
          ) }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            Button,
            {
              size: "sm",
              className: "cky:ml-[25px] cky:shrink-0",
              loading,
              loadingText: __$1("Checking...", "cookie-law-info"),
              onClick: /* @__PURE__ */ __name(() => void reInstallTables(), "onClick"),
              children: __$1("Check again", "cookie-law-info")
            }
          )
        ] }) }) })
      }
    );
  }, "CkyTableMissingNotice");
  const TROUBLESHOOT_URL = "https://www.cookieyes.com/documentation/cy-wordpress-plugin-troubleshooting-guide/";
  const SUPPORT_URL = "https://www.cookieyes.com/support/";
  function getOrganizationsUrl() {
    return getAppRedirectURL("settings/organizations-and-sites") || "#";
  }
  __name(getOrganizationsUrl, "getOrganizationsUrl");
  const ErrorNotice = /* @__PURE__ */ __name(({ html }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mt-5 cky:mb-[-10px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { className: "cky:bg-[#FAD2D7] cky:border-transparent cky:shadow-[0_5px_15px_0_rgba(0,0,0,0.02)] cky:text-inherit", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDescription, { className: "cky:flex cky:items-start cky:gap-2.5 cky:m-0! cky:text-[13px]", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      "img",
      {
        src: assets.error,
        alt: "",
        "aria-hidden": "true",
        className: "cky:mt-0.5 cky:shrink-0",
        width: 15,
        height: 15
      }
    ),
    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { dangerouslySetInnerHTML: { __html: html } })
  ] }) }) }), "ErrorNotice");
  const CkyApiErrorNotice = /* @__PURE__ */ __name(() => {
    const { status, session_status, errors } = useAppStore(
      useShallow((s2) => ({
        status: s2.status,
        session_status: s2.session_status,
        errors: s2.errors
      }))
    );
    const showApiFailed = !status && session_status;
    if (!showApiFailed && !(errors == null ? void 0 : errors.urlMismatch)) return null;
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      showApiFailed && /* @__PURE__ */ jsxRuntimeExports.jsx(
        ErrorNotice,
        {
          html: __$1(
            /* translators: %s: URL of the troubleshooting documentation page. */
            'Unable to reach your web app account at the moment. Please reload the page to retry. If the issue persists, check out the <a href="%s" target="_blank">common issues causing this error</a> and try applying the suggested solutions.',
            "cookie-law-info"
          ).replace("%s", TROUBLESHOOT_URL)
        }
      ),
      (errors == null ? void 0 : errors.urlMismatch) && /* @__PURE__ */ jsxRuntimeExports.jsx(
        ErrorNotice,
        {
          html: __$1(
            /* translators: %1$s: URL to the Organisations & Sites page. %2$s: URL to contact support. */
            'Looks like your website URL has changed. To ensure the proper functioning of your banner, update the registered URL on your CookieYes account (navigate to the <a href="%1$s" target="_blank">Organisations &amp; Sites</a> page and click the More button associated with your site). Then, reload this page to retry. If the issue persists, please <a href="%2$s" target="_blank">contact us</a>.',
            "cookie-law-info"
          ).replace("%1$s", getOrganizationsUrl()).replace("%2$s", SUPPORT_URL)
        }
      )
    ] });
  }, "CkyApiErrorNotice");
  const LASTSCAN_SLUG$1 = "lastscan";
  const NOT_AVAILABLE = t$1("Not available");
  const STAT_ICON_COLORS = {
    cookie: "#1C5C98",
    categories: "#087357",
    scan: "#1160C6",
    pages: "#A6742A"
  };
  const sizePx = /* @__PURE__ */ __name((w) => w.includes("px") ? w : `${w}px`, "sizePx");
  function renderLastScanDisplay(hasLastScanDisplay, lastScanDate, lastScanTime) {
    if (!hasLastScanDisplay) {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-[14px]", children: NOT_AVAILABLE });
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-[14px]!", children: lastScanDate || lastScanTime ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      lastScanDate || NOT_AVAILABLE,
      lastScanTime ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
        " ",
        lastScanTime
      ] }) : null
    ] }) : NOT_AVAILABLE });
  }
  __name(renderLastScanDisplay, "renderLastScanDisplay");
  const CkyStatsCard = React.memo(/* @__PURE__ */ __name(function CkyStatsCard2({
    statistics,
    iconWidth = "30",
    iconBgColor,
    successScan = {},
    accountConnected = false
  }) {
    var _a2, _b2, _c2, _d;
    const isLastScan = statistics.slug === LASTSCAN_SLUG$1;
    const lastScanDate = String((_b2 = (_a2 = successScan == null ? void 0 : successScan.date) == null ? void 0 : _a2.date) != null ? _b2 : "").trim();
    const lastScanTime = String((_d = (_c2 = successScan == null ? void 0 : successScan.date) == null ? void 0 : _c2.time) != null ? _d : "").trim();
    const hasLastScanDisplay = accountConnected && ((successScan == null ? void 0 : successScan.status) === true || lastScanDate.length > 0 || lastScanTime.length > 0);
    const displayCount = isLastScan ? renderLastScanDisplay(hasLastScanDisplay, lastScanDate, lastScanTime) : statistics.count;
    const iconWrapStyle = iconBgColor ? { backgroundColor: iconBgColor } : void 0;
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:m-0", children: [
      statistics.icon ? /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          className: "cky:w-12 cky:h-12 cky:inline-flex cky:justify-center cky:items-center cky:rounded-lg cky:mr-[13px]",
          style: iconWrapStyle,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            CkyIcon,
            {
              icon: statistics.icon,
              width: sizePx(iconWidth),
              height: sizePx(iconWidth),
              color: STAT_ICON_COLORS[statistics.icon]
            }
          )
        }
      ) : null,
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:leading-normal cky:text-[13px] cky:text-[#4E4B66]", children: statistics.title }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:text-[20px] cky:font-semibold cky:leading-[27px] cky:pt-1", children: displayCount })
      ] })
    ] });
  }, "CkyStatsCard2"));
  const LASTSCAN_SLUG = "lastscan";
  const defaultStats = [
    { slug: "cookies", icon: "cookie", title: t$1("Total cookies"), count: 0 },
    { slug: "categories", icon: "categories", title: t$1("Categories"), count: 0 },
    {
      slug: LASTSCAN_SLUG,
      icon: "scan",
      title: t$1("Last successful scan (UTC)"),
      count: t$1("Not available")
    },
    { slug: "pages", icon: "pages", title: t$1("Pages scanned"), count: 0 }
  ];
  const ICON_BG_COLORS = ["#E8F1FE", "#E5F4EF", "#C4DDFD", "#FFE8C6"];
  function cloneDefaultStats() {
    return defaultStats.map((s2) => __spreadValues({}, s2));
  }
  __name(cloneDefaultStats, "cloneDefaultStats");
  function normalizeCount(raw) {
    if (raw === void 0 || raw === null) return 0;
    const n2 = Number(raw);
    return Number.isNaN(n2) ? 0 : n2;
  }
  __name(normalizeCount, "normalizeCount");
  const CkyScanSummary = /* @__PURE__ */ __name(() => {
    var _a2, _b2;
    const { options: options2, info } = useAppStore(
      useShallow((s2) => ({ options: s2.options, info: s2.info }))
    );
    const [loading, setLoading] = reactExports.useState(true);
    const [stats, setStats] = reactExports.useState(cloneDefaultStats);
    const account = (_a2 = options2 == null ? void 0 : options2.account) != null ? _a2 : {};
    const successScan = (_b2 = info == null ? void 0 : info.success_scan) != null ? _b2 : {};
    const showLoader = loading || !info;
    reactExports.useEffect(() => {
      let cancelled = false;
      const fetchSummary = /* @__PURE__ */ __name(() => __async(null, null, function* () {
        setLoading(true);
        try {
          const response = yield ckyRest.get({ path: "dashboard/summary" });
          if (cancelled) return;
          if (response && typeof response === "object") {
            setStats(
              (prev) => prev.map((item) => {
                if (item.slug === LASTSCAN_SLUG) return item;
                return __spreadProps(__spreadValues({}, item), { count: normalizeCount(response[item.slug]) });
              })
            );
          }
        } catch (error) {
          if (!cancelled) console.error("Cookie Summary fetch failed:", error);
        } finally {
          if (!cancelled) setLoading(false);
        }
      }), "fetchSummary");
      fetchSummary();
      return () => {
        cancelled = true;
      };
    }, []);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardTitle, { children: t$1("Cookie Summary") }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(CardContent, { className: "cky:pb-8 cky:h-[255px]", children: showLoader ? /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:flex-wrap", children: stats.map((stat, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex-[0_0_50%] cky:pr-3 cky:pt-[30px] cky:pb-[30px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyStatsCard,
        {
          statistics: stat,
          iconBgColor: ICON_BG_COLORS[index2],
          successScan,
          accountConnected: !!(account == null ? void 0 : account.connected)
        }
      ) }, stat.slug)) }) })
    ] });
  }, "CkyScanSummary");
  const FAQ_SOURCE = [
    {
      id: "faq1",
      q: "How do I customise the cookie consent banner?",
      a: 'You can customise the banner by clicking the "Customise Banner" button on the plugin dashboard. It will take you to the web app settings, where you have several options to customise the banner to your liking.'
    },
    {
      id: "faq2",
      q: "How do I scan web pages for cookies?",
      a: 'Click the "Go to Web App" to access the web app. There, you will find the option to initiate a cookie scan for your website. Our premium plan offers a scheduled scan feature that automates this process for you.'
    },
    {
      id: "faq3",
      q: "What are pageviews?",
      a: "Pageviews are the number of times the web pages containing CookieYes banner have been loaded or reloaded. This excludes known bot traffic."
    },
    {
      id: "faq4",
      q: "What happens if the monthly pageview limit exceeds?",
      a: "The cookie banner will no longer be displayed on your site, which will result in non-compliance. You can either upgrade to a higher plan for an increased pageview limit or disconnect your site from the web app."
    },
    {
      id: "faq5",
      q: "What happens if I disconnect my site from the app?",
      a: "When you disconnect from the web app, you can continue using the plugin. However, this means you will lose your banner customisation and access to advanced features."
    },
    {
      id: "faq6",
      q: "How do I disconnect the plugin from the web app?",
      a: 'Go to "Site settings" on the plugin dashboard and click "Disconnect" to disconnect the plugin from the web app.'
    }
  ];
  const defaultFaqs = FAQ_SOURCE.map(({ id, q, a: a2 }) => ({
    id,
    question: t$1(q),
    answer: t$1(a2)
  }));
  const CkyFaqWidget = /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mt-[30px]", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-faq-title cky:mb-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "cky:m-0! cky:text-base! cky:font-semibold!", children: t$1("Frequently Asked Questions") }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Accordion, { type: "single", collapsible: true, className: "cky:w-full cky:py-0 cky:px-5", children: defaultFaqs.map((faq) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
      AccordionItem,
      {
        value: faq.id,
        className: "cky:border-gray-200 cky:[&>h3]:!my-3",
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionTrigger$1, { className: "cky:p-0! cky:app-accordion-title cky:border-none cky:data-[state=open]:text-[#1578F7] cky:hover:no-underline cky:cursor-pointer cky:flex cky:justify-between cky:items-center cky:w-full cky:[&>svg]:h-5 cky:[&>svg]:w-5 cky:[&>svg]:-rotate-90 cky:data-[state=open]:[&>svg]:!rotate-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:m-0! cky:text-[14px]! cky:font-medium cky:text-left cky:flex-1 cky:min-w-0 cky:mr-2", children: faq.question }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionContent, { className: "cky:px-0! cky:pb-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:m-0! cky:text-sm cky:text-gray-600", children: faq.answer }) })
        ]
      },
      faq.id
    )) })
  ] }), "CkyFaqWidget");
  const ENTERPRISE_SUPPORT_URL = "https://www.cookieyes.com/support/?query=enterprise&ref=cypluginupgrade#enterprise";
  const UPGRADE = {
    title: t$1("Upgrade to our best plans as your website grows"),
    description: t$1("Access advanced features and future-proof your business against legal risks."),
    features: [
      t$1("Advanced banner customisation"),
      t$1("Increased monthly pageviews/month"),
      t$1("Geo-targeted cookie banners"),
      t$1("Scheduled scan for automatic updates")
    ],
    cta: t$1("Upgrade Now")
  };
  function asRecord(v) {
    return v && typeof v === "object" ? v : {};
  }
  __name(asRecord, "asRecord");
  function apiSaysCanStartOptoutTrial(website, info) {
    return website.canStartOptoutTrial === true || website.can_start_optout_trial === true || info.canStartOptoutTrial === true || info.can_start_optout_trial === true;
  }
  __name(apiSaysCanStartOptoutTrial, "apiSaysCanStartOptoutTrial");
  function getWebAppBaseUrl() {
    var _a2, _b2, _c2;
    if (typeof window === "undefined") return "";
    return (_c2 = (_b2 = (_a2 = window.ckyGlobals) == null ? void 0 : _a2.webApp) == null ? void 0 : _b2.url) != null ? _c2 : "";
  }
  __name(getWebAppBaseUrl, "getWebAppBaseUrl");
  function buildSettingsUpgradeUrl(base, websiteId, canStartOptoutTrial2) {
    const params = new URLSearchParams({
      upgrade_id: websiteId,
      openUpgrade: "true",
      upgrade_source: "cypluginupgrade"
    });
    if (canStartOptoutTrial2) params.append("from_trial", "true");
    return `${base.replace(/\/$/, "")}/settings?${params.toString()}`;
  }
  __name(buildSettingsUpgradeUrl, "buildSettingsUpgradeUrl");
  function computeUpgradeLink(account, planRaw, website, info) {
    var _a2;
    const plan = String(planRaw != null ? planRaw : "free");
    const planLower = (plan || "free").toLowerCase();
    const apiSaysCanStart = apiSaysCanStartOptoutTrial(website, info);
    const isFreePlan = planLower === "free";
    const isTrial = !!website.is_trial;
    const canStartOptoutTrial2 = apiSaysCanStart || isFreePlan && !isTrial;
    const upgradeURL = planLower === "ultimate" ? ENTERPRISE_SUPPORT_URL : buildSettingsUpgradeUrl(
      getWebAppBaseUrl(),
      String((_a2 = account == null ? void 0 : account.website_id) != null ? _a2 : ""),
      canStartOptoutTrial2
    );
    const ctaLabel = canStartOptoutTrial2 ? t$1("Try Pro for free") : UPGRADE.cta;
    return { upgradeURL, ctaLabel };
  }
  __name(computeUpgradeLink, "computeUpgradeLink");
  const CkyUpgradeWidget = /* @__PURE__ */ __name(() => {
    const { options: options2, info } = useAppStore(
      useShallow((s2) => ({ options: s2.options, info: s2.info }))
    );
    const { upgradeURL, ctaLabel } = reactExports.useMemo(() => {
      var _a2, _b2, _c2, _d, _e2;
      const account = (_a2 = options2 == null ? void 0 : options2.account) != null ? _a2 : {};
      const planRaw = (_e2 = (_d = (_b2 = info == null ? void 0 : info.website) == null ? void 0 : _b2.selected_plan) != null ? _d : (_c2 = info == null ? void 0 : info.plan) == null ? void 0 : _c2.name) != null ? _e2 : "free";
      const website = asRecord(info == null ? void 0 : info.website);
      const infoRec = asRecord(info);
      return computeUpgradeLink(account, planRaw, website, infoRec);
    }, [options2 == null ? void 0 : options2.account, info]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { className: "cky:mt-[30px] cky:rounded-[5px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { className: "cky:py-6 cky:px-6", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:w-full", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "cky:text-[20px]! cky:leading-[30px] cky:m-0! cky:mb-2!", children: UPGRADE.title }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:py-2 cky:text-[14px]! cky:leading-5 cky:m-0!", children: UPGRADE.description })
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-premium-features-list cky:my-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "cky:list-none cky:pl-0 cky:m-0", children: UPGRADE.features.map((feature) => /* @__PURE__ */ jsxRuntimeExports.jsx(
        "li",
        {
          className: "cky:before:content-['✓'] cky:before:text-[#1578F7] cky:before:font-extrabold cky:before:mr-1.5 cky:font-normal cky:mb-[10px]",
          children: feature
        },
        feature
      )) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        Button,
        {
          asChild: true,
          className: "cky:min-w-[186px] cky:text-base! cky:rounded-[5px]! cky:py-3 cky:px-6! cky:font-semibold! cky:gap-2 cky:bg-[#1578F7]! cky:text-white! cky:border cky:border-[#1578F7]! hover:cky:bg-[#1266d9]! hover:cky:border-[#1266d9]! cky:no-underline cky:inline-flex cky:items-center cky:justify-center",
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "a",
            {
              href: upgradeURL,
              target: "_blank",
              rel: "noopener noreferrer",
              className: "cky:inline-flex cky:items-center cky:justify-center cky:gap-2 cky:min-w-[186px]",
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "crownOutline", width: "20px", height: "20px" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:inline-block", children: ctaLabel })
              ]
            }
          )
        }
      ) })
    ] }) });
  }, "CkyUpgradeWidget");
  const CONSENT_COLORS = {
    accepted: "rgba(51, 168, 129, 0.5)",
    rejected: "rgba(236, 74, 94, 0.5)",
    partial: "rgba(68, 147, 249, 0.5)"
  };
  const CONSENT_COLORS_SOLID = {
    accepted: "#33A881",
    rejected: "#EC4A5E",
    partial: "#4493F9"
  };
  const CONSENT_COLORS_HOVER = {
    accepted: "#5BC49E",
    rejected: "#F07A87",
    partial: "#6BABFA"
  };
  const CONSENT_TYPES = ["accepted", "rejected", "partial"];
  const PIE_MARGIN = { top: 0, right: 0, bottom: 0, left: 0 };
  const TOOLTIP_WRAPPER_STYLE$1 = { outline: "none" };
  const TOOLTIP_CONTENT_STYLE$1 = {
    margin: 0,
    padding: 0,
    backgroundColor: "transparent",
    border: "none"
  };
  const LEGEND_WRAPPER_STYLE = {
    position: "absolute",
    left: "auto",
    top: 0,
    right: 5,
    bottom: 0,
    justifyContent: "center",
    display: "flex",
    flexDirection: "column",
    overflow: "auto",
    padding: "0 10px"
  };
  function getCount(consents, type) {
    var _a2;
    if (!Array.isArray(consents)) return 0;
    const item = consents.find((c2) => c2.type === type);
    return (_a2 = item == null ? void 0 : item.count) != null ? _a2 : 0;
  }
  __name(getCount, "getCount");
  function consentActiveShape(props) {
    var _a2, _b2;
    const p2 = props;
    const name = String((_a2 = p2.name) != null ? _a2 : "");
    const fill = name ? (_b2 = CONSENT_COLORS_HOVER[name]) != null ? _b2 : p2.fill : p2.fill;
    const _c2 = p2, {
      fill: fillFromProps,
      filter,
      opacity,
      fillOpacity,
      style
    } = _c2, rest = __objRest(_c2, [
      "fill",
      "filter",
      "opacity",
      "fillOpacity",
      "style"
    ]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx("g", { "data-cky-consent-name": name, style: { outline: "none" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Sector, __spreadProps(__spreadValues({}, rest), { fill, fillOpacity: 1, stroke: "none" })) });
  }
  __name(consentActiveShape, "consentActiveShape");
  function consentInactiveShape(props) {
    var _a2;
    const p2 = props;
    const name = String((_a2 = p2.name) != null ? _a2 : "");
    return /* @__PURE__ */ jsxRuntimeExports.jsx("g", { "data-cky-consent-name": name, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Sector, __spreadProps(__spreadValues({}, p2), { stroke: "none" })) });
  }
  __name(consentInactiveShape, "consentInactiveShape");
  const CkyConsentChart = /* @__PURE__ */ __name(() => {
    const info = useAppStore((s2) => s2.info);
    const [loading, setLoading] = reactExports.useState(true);
    const [counts, setCounts] = reactExports.useState([0, 0, 0]);
    const consentLabels = {
      accepted: __$1("Accepted", "cookie-law-info"),
      rejected: __$1("Rejected", "cookie-law-info"),
      partial: __$1("Partially Accepted", "cookie-law-info")
    };
    const chartConfig2 = {
      accepted: { label: consentLabels.accepted, color: CONSENT_COLORS_SOLID.accepted },
      rejected: { label: consentLabels.rejected, color: CONSENT_COLORS_SOLID.rejected },
      partial: { label: consentLabels.partial, color: CONSENT_COLORS_SOLID.partial }
    };
    const legendItems = CONSENT_TYPES.map((key) => ({
      name: key,
      label: consentLabels[key],
      color: CONSENT_COLORS[key]
    }));
    const totalConsentsLabel = __$1("Total Consents", "cookie-law-info");
    const chartData = reactExports.useMemo(
      () => CONSENT_TYPES.map((name, i2) => ({
        name,
        value: counts[i2],
        fill: CONSENT_COLORS[name]
      })).filter((d) => d.value > 0),
      [counts]
    );
    const chartDataKey = reactExports.useMemo(() => chartData.map((d) => d.value).join("-"), [chartData]);
    const hasData = chartData.length > 0;
    const totalConsents = counts[0] + counts[1] + counts[2];
    const cardLoader = !info || loading;
    const renderTooltipContent = /* @__PURE__ */ __name(({
      active,
      payload
    }) => {
      var _a2, _b2;
      if (!active || !(payload == null ? void 0 : payload.length) || !chartData.length) return null;
      const item = payload[0];
      const name = (_a2 = item.payload) == null ? void 0 : _a2.name;
      const value = typeof item.value === "number" ? item.value : 0;
      const pct = totalConsents > 0 ? (value / totalConsents * 100).toFixed(0) : "0";
      const label = name ? (_b2 = consentLabels[name]) != null ? _b2 : name : "";
      const color2 = name ? CONSENT_COLORS_SOLID[name] : void 0;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          className: "cky-chart-tooltip cky:rounded cky:p-[2px] cky:text-xs cky:text-white cky:font-normal",
          style: { backgroundColor: "#5f5d73" },
          children: [
            color2 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { color: color2 }, children: [
              pct,
              "%"
            ] }) : null,
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
              label,
              ": ",
              value.toLocaleString()
            ] })
          ]
        }
      );
    }, "renderTooltipContent");
    const handleViewReports = reactExports.useCallback(() => redirectToApp("website-reports"), []);
    reactExports.useEffect(() => {
      let cancelled = false;
      const fetchData = /* @__PURE__ */ __name(() => __async(null, null, function* () {
        var _a2;
        setLoading(true);
        try {
          const raw = yield ckyRest.get({
            path: "consent_logs/statistics"
          });
          if (cancelled) return;
          const response = Array.isArray(raw) ? raw : (_a2 = raw == null ? void 0 : raw.data) != null ? _a2 : [];
          if (Array.isArray(response) && response.length > 0) {
            setCounts(CONSENT_TYPES.map((t2) => getCount(response, t2)));
          }
        } catch (e) {
          if (!cancelled) console.error(e);
        } finally {
          if (!cancelled) setLoading(false);
        }
      }), "fetchData");
      fetchData();
      return () => {
        cancelled = true;
      };
    }, []);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(CardTitle, { children: __$1("Consent trends", "cookie-law-info") }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(CardSubtitle, { className: "cky:pl-1", children: __$1("(Last 7 days)", "cookie-law-info") })
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(CardContent, { className: "cky:flex cky:flex-col cky:relative cky:h-[198px] cky:min-h-[152px] cky:py-4 cky:px-5", children: cardLoader ? /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, {}) : !hasData ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-empty-state cky:absolute cky:top-1/2 cky:left-0 cky:right-0 cky:-translate-y-1/2 cky:flex cky:flex-col cky:items-center cky:justify-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "blank", width: "80px", height: "80px", color: "#d1d1d1" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:mt-2 cky:text-sm cky:m-0", children: __$1("No consents were logged", "cookie-law-info") })
      ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
        ChartContainer,
        {
          config: chartConfig2,
          className: "cky-consent-chart cky:h-full cky:w-full",
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs(PieChart, { margin: PIE_MARGIN, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Pie,
              {
                data: chartData,
                dataKey: "value",
                nameKey: "name",
                cx: "50%",
                cy: "50%",
                innerRadius: 60,
                outerRadius: 75,
                strokeWidth: 0,
                paddingAngle: 0,
                isAnimationActive: false,
                label: /* @__PURE__ */ __name(({ cx: cx2, cy, name }) => chartData.length > 0 && name === chartData[0].name ? /* @__PURE__ */ jsxRuntimeExports.jsxs("text", { x: cx2, y: cy, textAnchor: "middle", dominantBaseline: "middle", className: "cky:fill-[#4E4B66]", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("tspan", { x: cx2, dy: "-0.5em", className: "cky:text-[32px] cky:font-bold", children: totalConsents.toLocaleString() }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("tspan", { x: cx2, dy: "2.5em", className: "cky:text-[12px]", children: totalConsentsLabel })
                ] }) : null, "label"),
                activeShape: consentActiveShape,
                inactiveShape: consentInactiveShape,
                children: chartData.map((entry, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(Cell, { fill: entry.fill }, `cell-${index2}`))
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Tooltip,
              {
                wrapperStyle: TOOLTIP_WRAPPER_STYLE$1,
                contentStyle: TOOLTIP_CONTENT_STYLE$1,
                content: renderTooltipContent
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Legend,
              {
                layout: "vertical",
                align: "right",
                verticalAlign: "middle",
                wrapperStyle: LEGEND_WRAPPER_STYLE,
                content: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:flex-col cky:justify-center cky:gap-[5px]", children: legendItems.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:gap-2", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "span",
                    {
                      className: "cky:inline-block cky:w-3 cky:h-3 cky:shrink-0 cky:rounded-full cky:relative cky:-left-2 cky:top-0 cky:border-0 cky:border-solid",
                      style: { backgroundColor: item.color }
                    }
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-[12px] cky:text-[#4E4B66] cky:font-normal", children: item.label })
                ] }, item.name)) }), "content")
              }
            )
          ] }, chartDataKey)
        }
      ) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(CardFooter, { className: "cky:border-t cky:border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        Button,
        {
          variant: "link",
          size: "default",
          className: "cky-external-link cky:py-2 cky:px-0 cky:text-base! cky:leading-6 cky:font-medium! cky:border-none cky:hover:border-blue-500 cky:hover:border-solid",
          onClick: handleViewReports,
          children: __$1("View All", "cookie-law-info")
        }
      ) }) })
    ] });
  }, "CkyConsentChart");
  const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
  function formatPageviewDate(ddMmYyyy) {
    const parts = ddMmYyyy.split("-");
    if (parts.length !== 3) return ddMmYyyy;
    const [d, m2, y2] = parts;
    const monthIdx = parseInt(m2, 10) - 1;
    if (monthIdx < 0 || monthIdx > 11) return ddMmYyyy;
    const day = parseInt(d, 10);
    return `${MONTHS[monthIdx]} ${day}, ${y2}`;
  }
  __name(formatPageviewDate, "formatPageviewDate");
  const chartConfig = {
    total: { label: __$1("Views", "cookie-law-info"), color: "#4493F9" }
  };
  const STROKE_MUTED = "#D7E1F2";
  const Y_AXIS_TICK_FILL = "#4E4B66";
  const AREA_CHART_MARGIN = { top: 20, right: 8, left: 18, bottom: 24 };
  const X_AXIS_TICK_STYLE = { fontSize: 12, fill: Y_AXIS_TICK_FILL };
  const TOOLTIP_WRAPPER_STYLE = { outline: "none" };
  const TOOLTIP_CONTENT_STYLE = {
    margin: 0,
    padding: 0,
    backgroundColor: "transparent",
    border: "none"
  };
  const TOOLTIP_CURSOR = { stroke: STROKE_MUTED, strokeWidth: 1 };
  const ACTIVE_DOT_PROPS = { r: 5 };
  const EXTRA_PAGEVIEWS_CLASS = "cky:text-[#B3DED0]";
  function renderYAxisTick(props) {
    const { x: x2 = 0, y: y2 = 0, payload } = props;
    const value = payload == null ? void 0 : payload.value;
    const text = value != null ? Number(value).toLocaleString() : "";
    return /* @__PURE__ */ jsxRuntimeExports.jsx("g", { transform: `translate(${x2},${y2})`, children: /* @__PURE__ */ jsxRuntimeExports.jsx("text", { x: 0, y: 0, dy: 4, textAnchor: "end", fill: Y_AXIS_TICK_FILL, fontSize: 11, fontFamily: "inherit", children: text }) });
  }
  __name(renderYAxisTick, "renderYAxisTick");
  function pageviewTooltipBody(item) {
    const { views, overage_views, total } = item;
    if (views > 0 && overage_views === 0) {
      return `${views} pageviews`;
    }
    if (views === 0 && overage_views > 0) {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: EXTRA_PAGEVIEWS_CLASS, children: [
        overage_views,
        " extra pageviews"
      ] });
    }
    if (views > 0 && overage_views > 0) {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        total,
        " (",
        views,
        " +",
        " ",
        /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: EXTRA_PAGEVIEWS_CLASS, children: [
          overage_views,
          " extra pageviews"
        ] }),
        ")"
      ] });
    }
    return "0 pageviews";
  }
  __name(pageviewTooltipBody, "pageviewTooltipBody");
  function PageviewTooltipContent({
    active,
    payload
  }) {
    if (!active || !(payload == null ? void 0 : payload.length)) return null;
    const item = payload[0].payload;
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:bg-[#5f5d73] cky:p-[2px] cky:px-2 cky:text-[13px] cky:font-normal cky:rounded cky:text-white", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:block cky:mb-1 cky:text-[#C7CADE]", children: item.x }),
      pageviewTooltipBody(item)
    ] });
  }
  __name(PageviewTooltipContent, "PageviewTooltipContent");
  const CkyPageviewChart = /* @__PURE__ */ __name(() => {
    const info = useAppStore((s2) => s2.info);
    const [loading, setLoading] = reactExports.useState(true);
    const [pageViewsData, setPageViewsData] = reactExports.useState([]);
    const chartData = reactExports.useMemo(
      () => pageViewsData.map((item, xIndex) => {
        const views = item.views || 0;
        const overage_views = item.overage_views || 0;
        return {
          xIndex,
          x: formatPageviewDate(item.date),
          date: item.date,
          views,
          overage_views,
          total: views + overage_views
        };
      }),
      [pageViewsData]
    );
    const hasData = chartData.length > 0;
    const cardLoader = !info || loading;
    const xAxisDomain = reactExports.useMemo(() => {
      const n2 = chartData.length;
      if (n2 <= 1) return [0, 1];
      return [0, n2 - 1];
    }, [chartData.length]);
    const xAxisTicks = reactExports.useMemo(
      () => Array.from({ length: chartData.length }, (_, i2) => i2),
      [chartData.length]
    );
    const yDomain = reactExports.useMemo(() => {
      if (!chartData.length) return [0, 100];
      const values = chartData.map((d) => d.total);
      const yMax = Math.max(...values);
      const yMin = Math.min(...values);
      const yMaxRounded = yMax + (10 - yMax % 10) + 100;
      const yMinRounded = yMin + (10 - yMin % 10) - 100;
      return [Math.max(0, yMinRounded), yMaxRounded];
    }, [chartData]);
    const yTicks = reactExports.useMemo(() => {
      const [min2, max2] = yDomain;
      if (min2 >= max2) return [min2, max2];
      return [min2, Math.round((min2 + max2) / 2), max2];
    }, [yDomain]);
    const formatXTick = reactExports.useCallback(
      (v) => {
        var _a2, _b2;
        return (_b2 = (_a2 = chartData[Number(v)]) == null ? void 0 : _a2.x) != null ? _b2 : "";
      },
      [chartData]
    );
    const handleViewReports = reactExports.useCallback(() => redirectToApp("website-reports"), []);
    reactExports.useEffect(() => {
      let cancelled = false;
      const fetchData = /* @__PURE__ */ __name(() => __async(null, null, function* () {
        var _a2;
        setLoading(true);
        try {
          const raw = yield ckyRest.get({
            path: "pageviews/chart"
          });
          if (cancelled) return;
          const data = Array.isArray(raw) ? raw : (_a2 = raw == null ? void 0 : raw.data) != null ? _a2 : [];
          if (data.length > 0) {
            setPageViewsData(data);
          }
        } catch (e) {
          if (!cancelled) console.error("Error fetching pageviews:", e);
        } finally {
          if (!cancelled) setLoading(false);
        }
      }), "fetchData");
      fetchData();
      return () => {
        cancelled = true;
      };
    }, []);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: "cky:mt-4 cky:w-full cky:border cky:border-[#d7e1f2] cky:rounded-[5px] cky:bg-white", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { className: "cky:border-b cky:border-[#d7e1f2] cky:py-3 cky:px-5", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardTitle, { className: "cky:text-base cky:leading-6 cky:block cky:m-0 cky:p-0", children: __$1("Pageviews", "cookie-law-info") }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(CardContent, { className: "cky:w-full cky:py-4 cky:px-5 cky:min-h-[152px] cky:relative", children: cardLoader ? /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, {}) : !hasData ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-empty-state cky:absolute cky:top-1/2 cky:left-0 cky:right-0 cky:-translate-y-1/2 cky:flex cky:flex-col cky:items-center cky:justify-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "blank", width: "80px", height: "80px", color: "#d1d1d1" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:mt-2 cky:text-sm cky:m-0", children: __$1("No pageviews found!", "cookie-law-info") })
      ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
        ChartContainer,
        {
          config: chartConfig,
          className: "cky:h-[215px] cky:w-full cky:overflow-visible",
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AreaChart, { data: chartData, margin: AREA_CHART_MARGIN, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              CartesianGrid,
              {
                horizontal: true,
                vertical: false,
                stroke: STROKE_MUTED,
                strokeDasharray: "0"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              XAxis,
              {
                type: "number",
                dataKey: "xIndex",
                domain: xAxisDomain,
                ticks: xAxisTicks,
                allowDecimals: false,
                minTickGap: 28,
                tickLine: false,
                tickMargin: 10,
                axisLine: { stroke: STROKE_MUTED },
                tick: X_AXIS_TICK_STYLE,
                tickFormatter: formatXTick
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              YAxis,
              {
                orientation: "left",
                domain: yDomain,
                ticks: yTicks,
                allowDecimals: false,
                tickLine: false,
                axisLine: false,
                width: 36,
                tick: renderYAxisTick
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Tooltip,
              {
                wrapperStyle: TOOLTIP_WRAPPER_STYLE,
                contentStyle: TOOLTIP_CONTENT_STYLE,
                content: PageviewTooltipContent,
                cursor: TOOLTIP_CURSOR
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Area,
              {
                type: "monotone",
                dataKey: "total",
                name: "Views",
                stroke: "#C7CADE",
                strokeWidth: 1.5,
                fill: "#4493F9",
                fillOpacity: 0.5,
                isAnimationActive: true,
                dot: chartData.length === 1,
                activeDot: ACTIVE_DOT_PROPS
              }
            )
          ] })
        }
      ) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(CardFooter, { className: "cky:p-0 cky:border-t cky:border-[#d7e1f2]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:py-2 cky:px-5 cky:flex cky:items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        Button,
        {
          variant: "link",
          size: "default",
          className: "cky-external-link cky:border-0 cky:text-base! cky:py-2 cky:px-0 cky:hover:border cky:hover:border-[#1863dc] cky:hover:bg-transparent cky:hover:text-[#1863dc]",
          onClick: handleViewReports,
          children: __$1("View All", "cookie-law-info")
        }
      ) }) })
    ] });
  }, "CkyPageviewChart");
  const CkyWaitUpdate = /* @__PURE__ */ __name(({
    inputId = "cky-wait-update",
    className = ""
  }) => {
    const waitForUpdate = useAppStore((s2) => {
      var _a2;
      return (_a2 = s2.gcm) == null ? void 0 : _a2.wait_for_update;
    });
    const [errors, setErrors] = reactExports.useState({});
    const hasErrors = reactExports.useMemo(() => Object.values(errors).some(Boolean), [errors]);
    const checkForErrors = reactExports.useCallback((value) => {
      const newErrors = {};
      if (value === null || value === void 0 || value < 0) {
        newErrors.maxLimit = true;
      }
      setErrors(newErrors);
    }, []);
    const handleInputChange = reactExports.useCallback(
      (e) => {
        const value = parseInt(e.target.value, 10) || 0;
        checkForErrors(value);
        const { gcm: current, updateGcm } = useAppStore.getState();
        updateGcm(__spreadProps(__spreadValues({}, current), {
          wait_for_update: value
        }));
      },
      [checkForErrors]
    );
    reactExports.useEffect(() => {
      if (waitForUpdate !== void 0) {
        checkForErrors(waitForUpdate);
      }
    }, [waitForUpdate, checkForErrors]);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyInput,
        {
          id: inputId,
          type: "number",
          min: 0,
          value: (waitForUpdate != null ? waitForUpdate : 0) || 0,
          onChange: handleInputChange,
          className: cn$1(hasErrors && "cky:!border-red-500")
        }
      ),
      errors.maxLimit && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:text-red-500 cky:text-sm", children: __$1("The value must be a positive integer.", "cookie-law-info") }) })
    ] });
  }, "CkyWaitUpdate");
  function GcmHeadsUpModal({ onClose, ref }) {
    const [isOpen, setIsOpen] = reactExports.useState(false);
    const cancelButtonRef = reactExports.useRef(null);
    const skipRevertRef = reactExports.useRef(false);
    const handleDialogOpenChange = reactExports.useCallback(
      (open) => {
        setIsOpen(open);
        if (open) return;
        const keepGcmEnabled = skipRevertRef.current;
        skipRevertRef.current = false;
        if (!keepGcmEnabled) {
          const { gcm: gcm2, updateGcm } = useAppStore.getState();
          updateGcm(__spreadProps(__spreadValues({}, gcm2), {
            status: false
          }));
          onClose == null ? void 0 : onClose();
        }
      },
      [onClose]
    );
    const handleEnableGcm = reactExports.useCallback(() => {
      skipRevertRef.current = true;
      handleDialogOpenChange(false);
    }, [handleDialogOpenChange]);
    const handleCancel = reactExports.useCallback(() => {
      handleDialogOpenChange(false);
    }, [handleDialogOpenChange]);
    reactExports.useImperativeHandle(
      ref,
      () => ({
        show: /* @__PURE__ */ __name(() => handleDialogOpenChange(true), "show"),
        close: /* @__PURE__ */ __name(() => handleDialogOpenChange(false), "close")
      }),
      [handleDialogOpenChange]
    );
    const handleOpenAutoFocus = reactExports.useCallback((e) => {
      var _a2;
      e.preventDefault();
      (_a2 = cancelButtonRef.current) == null ? void 0 : _a2.focus();
    }, []);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: isOpen, onOpenChange: handleDialogOpenChange, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      DialogContent,
      {
        className: cn$1(
          CKY_DIALOG_CONTENT_CLASS,
          "cky:gap-0 cky:!rounded-[2px] cky:border-0 cky:py-[15px] cky:px-0"
        ),
        onOpenAutoFocus: handleOpenAutoFocus,
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            DialogHeader,
            {
              className: "cky:border-b-0 cky:pr-0",
              closeClassName: "cky:!right-[15px] cky:!top-0",
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { className: "cky:text-left cky:px-5 cky:text-base cky:font-semibold cky:m-0", children: __$1("Heads up!", "cookie-law-info") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(DialogDescription, { className: "cky:py-4 cky:px-5 cky:!m-0 cky:text-left cky:text-[13px] cky:text-text-primary", children: __$1(
                  "Please ensure that you've NOT manually added any custom scripts for implementing Google Consent Mode (GCM) on your site. If such scripts are present, remove them before enabling GCM here.",
                  "cookie-law-info"
                ) })
              ]
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { className: cn$1(CKY_DIALOG_FOOTER_CLASS, "cky:!p-0 cky:!px-5"), children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { ref: cancelButtonRef, variant: "outline", onClick: handleCancel, children: __$1("Cancel", "cookie-law-info") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: handleEnableGcm, className: "cky:ml-[10px] cky:font-medium!", children: __$1("Enable GCM", "cookie-law-info") })
          ] })
        ]
      }
    ) });
  }
  __name(GcmHeadsUpModal, "GcmHeadsUpModal");
  GcmHeadsUpModal.displayName = "GcmHeadsUpModal";
  const DEFAULT_REGION_ITEM = {
    analytics: "denied",
    advertisement: "denied",
    functional: "denied",
    necessary: "granted",
    ad_user_data: "denied",
    ad_personalization: "denied",
    regions: "All"
  };
  const CONSENT_DENIED_GRANTED_OPTIONS = [
    { index: "denied", value: __$1("Denied", "cookie-law-info") },
    { index: "granted", value: __$1("Granted", "cookie-law-info") }
  ];
  const CONSENT_SELECT_FIELDS = [
    { field: "analytics", label: __$1("Analytics", "cookie-law-info") },
    { field: "advertisement", label: __$1("Advertisement", "cookie-law-info") },
    { field: "functional", label: __$1("Functional", "cookie-law-info") },
    { field: "necessary", label: __$1("Necessary", "cookie-law-info") },
    { field: "ad_user_data", label: __$1("Share user data with Google", "cookie-law-info") },
    { field: "ad_personalization", label: __$1("Use data for ads personalisation", "cookie-law-info") }
  ];
  function ConsentSettingModal({ onClear, ref }) {
    const [isOpen, setIsOpen] = reactExports.useState(false);
    const [item, setItem] = reactExports.useState(null);
    const [itemIndex, setItemIndex] = reactExports.useState(null);
    const contentRef = reactExports.useRef(null);
    const handleOpenAutoFocus = reactExports.useCallback((e) => {
      var _a2;
      e.preventDefault();
      (_a2 = contentRef.current) == null ? void 0 : _a2.focus();
    }, []);
    const clearConsentSettingModal = reactExports.useCallback(() => {
      setItem(null);
      setItemIndex(null);
      onClear == null ? void 0 : onClear();
    }, [onClear]);
    const closeConsentSettingModal = reactExports.useCallback(() => {
      setIsOpen(false);
      clearConsentSettingModal();
    }, [clearConsentSettingModal]);
    reactExports.useImperativeHandle(
      ref,
      () => ({
        show: /* @__PURE__ */ __name((itemData = void 0, index2 = void 0) => {
          if (itemData && Object.keys(itemData).length > 0) {
            setItem(__spreadValues({}, itemData));
          } else {
            setItem(__spreadValues({}, DEFAULT_REGION_ITEM));
          }
          setItemIndex(index2 != null ? index2 : null);
          setIsOpen(true);
        }, "show"),
        close: closeConsentSettingModal
      }),
      [closeConsentSettingModal]
    );
    const handleOpenChange = reactExports.useCallback(
      (open) => {
        setIsOpen(open);
        if (!open) clearConsentSettingModal();
      },
      [clearConsentSettingModal]
    );
    const addOrEditRegion = reactExports.useCallback(() => {
      if (!item) return;
      const { gcm: gcm2, updateGcm } = useAppStore.getState();
      if (!gcm2) return;
      const regions = [...gcm2.default_settings || []];
      if (itemIndex === null) {
        regions.push(item);
      } else {
        regions[itemIndex] = item;
      }
      updateGcm(__spreadProps(__spreadValues({}, gcm2), {
        default_settings: regions
      }));
      closeConsentSettingModal();
    }, [item, itemIndex, closeConsentSettingModal]);
    const updateItem = reactExports.useCallback((field, value) => {
      setItem((prev) => prev ? __spreadProps(__spreadValues({}, prev), { [field]: value }) : prev);
    }, []);
    const displayItem = item != null ? item : DEFAULT_REGION_ITEM;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: isOpen, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      DialogContent,
      {
        ref: contentRef,
        tabIndex: -1,
        className: cn$1(CKY_DIALOG_CONTENT_CLASS, "cky:rounded-[2px]! cky:gap-0 cky:outline-none"),
        onOpenAutoFocus: handleOpenAutoFocus,
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogHeader, { className: "cky:border-b cky:border-gray-200 cky:p-[20px_30px]", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { className: "cky:m-0 cky:text-base! cky:font-semibold cky:leading-[18px]", children: itemIndex !== null ? __$1("Edit Region", "cookie-law-info") : __$1("New Region", "cookie-law-info") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(DialogDescription, { className: "cky:sr-only", children: itemIndex !== null ? __$1("Configure consent settings for this region", "cookie-law-info") : __$1("Add a new region with custom consent settings", "cookie-law-info") })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:p-[20px_30px] cky:max-h-[calc(100vh-3.5rem)] cky:overflow-y-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:grid cky:grid-cols-2 cky:gap-x-[30px] cky:gap-y-5", children: [
            CONSENT_SELECT_FIELDS.map(({ field, label }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:space-y-2.5", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "cky:block cky:text-sm", children: label }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                Select,
                {
                  value: displayItem[field],
                  onValueChange: /* @__PURE__ */ __name((value) => updateItem(field, value), "onValueChange"),
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { variant: "modal", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, {}) }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { position: "popper", children: CONSENT_DENIED_GRANTED_OPTIONS.map((val) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: val.index, variant: "modal", children: val.value }, val.index)) })
                  ]
                }
              )
            ] }, field)),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:col-span-2 cky:space-y-2.5", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "cky:block cky:text-sm", children: __$1("Region", "cookie-law-info") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                CkyInput,
                {
                  type: "text",
                  value: displayItem.regions,
                  onChange: /* @__PURE__ */ __name((e) => updateItem("regions", e.target.value), "onChange"),
                  required: true,
                  className: "cky:w-full cky:mb-5!"
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: "cky:text-sm cky:mt-5 cky:pt-[4px]",
                  dangerouslySetInnerHTML: {
                    __html: __$1(
                      /* translators: %1$s: URL to the ISO 3166-2 regions reference (Wikipedia). */
                      'By specifying "All", consent will apply to all regions. You can specify a comma-separated list of <a href="%1$s" target="_blank" class="cky:font-semibold">regions</a> to apply consent to specific regions.',
                      "cookie-law-info"
                    ).replace("%1$s", "https://en.wikipedia.org/wiki/ISO_3166-2")
                  }
                }
              )
            ] })
          ] }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { className: CKY_DIALOG_FOOTER_CLASS, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "outline", onClick: closeConsentSettingModal, children: __$1("Cancel", "cookie-law-info") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: addOrEditRegion, className: "cky:font-medium!", children: __$1("Save Changes", "cookie-law-info") })
          ] })
        ]
      }
    ) });
  }
  __name(ConsentSettingModal, "ConsentSettingModal");
  ConsentSettingModal.displayName = "ConsentSettingModal";
  const languages$1 = {
    get: /* @__PURE__ */ __name(function() {
      return __async(this, null, function* () {
        try {
          return yield getAvailableLanguages();
        } catch (error) {
          console.error(error);
          return [];
        }
      });
    }, "get"),
    getLanguageDetails: /* @__PURE__ */ __name(function(availableLangs, selectedLangs) {
      const languageDetails = availableLangs.filter((lang) => selectedLangs.includes(lang.code));
      return languageDetails;
    }, "getLanguageDetails"),
    getName(code, availableLanguages) {
      const language = availableLanguages.find((lang) => lang.code === code);
      return language !== void 0 ? language.name : "";
    },
    deleteLanguage: /* @__PURE__ */ __name(function(code, updateSelected, saveSelected, reInit) {
      return __async(this, null, function* () {
        if (code) {
          const languagesConfig = getOption("languages");
          const languages2 = languagesConfig.selected || [];
          const index2 = languages2.indexOf(code);
          if (index2 !== -1) {
            languages2.splice(index2, 1);
          }
          updateSelected(languages2);
          yield saveSelected({ remove: true });
          yield purgeCache();
          yield reInit();
          return true;
        }
        return false;
      });
    }, "deleteLanguage"),
    getTranslatedLanguages() {
      return [
        "en",
        "de",
        "fr",
        "it",
        "es",
        "nl",
        "bg",
        "da",
        "ru",
        "ar",
        "pl",
        "pt",
        "ca",
        "hu",
        "sv",
        "hr",
        "zh",
        "uk",
        "sk",
        "tr",
        "lt",
        "cs",
        "fi",
        "no",
        "pt-br",
        "sl",
        "ro",
        "th",
        "et",
        "lv",
        "el",
        "eu",
        "bs",
        "gl",
        "ja",
        "ko",
        "mt",
        "sr",
        "tl",
        "cy",
        "sr-latn"
      ];
    },
    deepEqual(object1, object2) {
      const keys1 = Object.keys(object1);
      const keys2 = Object.keys(object2);
      if (keys1.length !== keys2.length) {
        return false;
      }
      for (const key of keys1) {
        const val1 = object1[key];
        const val2 = object2[key];
        const areObjects = this.isObject(val1) && this.isObject(val2);
        if (areObjects && !this.deepEqual(val1, val2) || !areObjects && val1 !== val2) {
          return false;
        }
      }
      return true;
    },
    isObject(object2) {
      return object2 != null && typeof object2 === "object";
    }
  };
  function saveDefaultBannerForLanguage(language) {
    return __async(this, null, function* () {
      var _a2;
      const list = yield ckyRest.get({ path: "banners" });
      if (!Array.isArray(list) || list.length === 0) {
        return;
      }
      const banner2 = (_a2 = list.find((b) => b.default === true)) != null ? _a2 : list[0];
      if (!banner2 || !banner2.id) {
        return;
      }
      yield ckyRest.put({
        path: `banners/${banner2.id}`,
        data: banner2,
        params: { language }
      });
    });
  }
  __name(saveDefaultBannerForLanguage, "saveDefaultBannerForLanguage");
  const SECTION_PADDING = "cky:px-[30px]";
  function isLanguageTranslated(lang) {
    return languages$1.getTranslatedLanguages().includes(lang);
  }
  __name(isLanguageTranslated, "isLanguageTranslated");
  function CkyLanguageSelector({ ref, onLanguageChanged }) {
    const [isOpen, setIsOpen] = reactExports.useState(false);
    const [loading, setLoading] = reactExports.useState(false);
    const [selectedLanguage, setSelectedLanguage] = reactExports.useState("");
    const searchWrapperRef = reactExports.useRef(null);
    const searchInputRef = reactExports.useRef(null);
    const reInit = useAppStore((s2) => s2.reInit);
    const { triggerNotification } = useGlobalUtilities();
    const {
      available,
      selected,
      default: defaultLang,
      current,
      setDefault,
      setCurrent,
      setSelected,
      saveSelected,
      saveDefault
    } = useLanguageStore();
    const handleClose = reactExports.useCallback(() => {
      setIsOpen(false);
    }, []);
    reactExports.useEffect(() => {
      setSelectedLanguage(defaultLang);
    }, [defaultLang]);
    const focusSearchInput = reactExports.useCallback(() => {
      var _a2, _b2;
      const input = (_b2 = searchInputRef.current) != null ? _b2 : (_a2 = searchWrapperRef.current) == null ? void 0 : _a2.querySelector("input");
      input == null ? void 0 : input.focus({ preventScroll: true });
    }, []);
    reactExports.useEffect(() => {
      if (!isOpen) return;
      const t2 = window.setTimeout(() => focusSearchInput(), 50);
      return () => clearTimeout(t2);
    }, [isOpen, focusSearchInput]);
    reactExports.useImperativeHandle(
      ref,
      () => ({
        open: /* @__PURE__ */ __name(() => {
          setIsOpen(true);
          setSelectedLanguage(defaultLang);
        }, "open"),
        close: handleClose
      }),
      [defaultLang, handleClose]
    );
    const revertPendingLanguageSelection = reactExports.useCallback(() => {
      setDefault(useLanguageStore.getState().current);
    }, [setDefault]);
    const handleCancel = reactExports.useCallback(() => {
      revertPendingLanguageSelection();
      setIsOpen(false);
    }, [revertPendingLanguageSelection]);
    const handleChange = reactExports.useCallback(() => __async(null, null, function* () {
      if (selectedLanguage === current) return;
      setLoading(true);
      try {
        setSelected([selectedLanguage]);
        yield saveSelected({ clear: false });
        setDefault(selectedLanguage);
        setCurrent(selectedLanguage);
        yield saveDefault({ clear: false });
        try {
          yield saveDefaultBannerForLanguage(selectedLanguage);
        } catch (bannerErr) {
          console.error(bannerErr);
        }
        yield purgeCache();
        yield reInit();
        if (typeof window !== "undefined") {
          window.dispatchEvent(new CustomEvent("cky:language-changed"));
        }
        onLanguageChanged == null ? void 0 : onLanguageChanged();
        setIsOpen(false);
        triggerNotification({
          type: "success",
          message: __$1("Default language changed successfully!", "cookie-law-info")
        });
      } catch (error) {
        console.error("Error changing language:", error);
        triggerNotification({
          type: "error",
          message: __$1(
            "Problem occurred while adding languages. Please try again later!",
            "cookie-law-info"
          )
        });
      } finally {
        setLoading(false);
      }
    }), [
      selectedLanguage,
      current,
      setSelected,
      saveSelected,
      setDefault,
      setCurrent,
      saveDefault,
      reInit,
      onLanguageChanged,
      triggerNotification
    ]);
    const getLanguageName = reactExports.useCallback(
      (code) => languages$1.getName(code, available),
      [available]
    );
    const filteredLanguages = reactExports.useMemo(() => {
      if (available.length === 0) return [];
      const selectedFirst = [];
      const others = [];
      available.forEach((item) => {
        if (selected.includes(item.code)) {
          selectedFirst.push(item);
        } else {
          others.push(item);
        }
      });
      return [...selectedFirst, ...others].filter((item) => item.code !== current);
    }, [available, selected, current]);
    const handleCheckboxChange = reactExports.useCallback(
      (code, checked) => {
        if (!checked) {
          setSelectedLanguage(current);
          setDefault(current);
          return;
        }
        setSelectedLanguage(code);
        setDefault(code);
      },
      [current, setDefault]
    );
    const handleDialogOpenChange = reactExports.useCallback(
      (open) => {
        if (!open) {
          revertPendingLanguageSelection();
          setIsOpen(false);
        } else {
          setIsOpen(open);
        }
      },
      [revertPendingLanguageSelection]
    );
    const handleOpenAutoFocus = reactExports.useCallback(
      (e) => {
        e.preventDefault();
        window.requestAnimationFrame(() => focusSearchInput());
      },
      [focusSearchInput]
    );
    const handleCloseAutoFocus = reactExports.useCallback((e) => {
      e.preventDefault();
    }, []);
    const selectedIsTranslated = reactExports.useMemo(
      () => isLanguageTranslated(selectedLanguage),
      [selectedLanguage]
    );
    const isDisabled = current === selectedLanguage;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: isOpen, onOpenChange: handleDialogOpenChange, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
      DialogContent,
      {
        className: "cky:max-w-[720px] cky:rounded-[2px] cky:bg-white cky:p-0 cky:gap-0 [&>button:last-child]:cky:right-[30px] [&>button:last-child]:cky:top-5",
        onOpenAutoFocus: handleOpenAutoFocus,
        onCloseAutoFocus: handleCloseAutoFocus,
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogHeader, { className: cn$1(SECTION_PADDING, "cky:pt-5 cky:pb-5 cky:border-b cky:border-gray-200"), children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { className: "cky:text-xl cky:font-semibold cky:text-[#14142A] cky:text-left", children: __$1("Change language", "cookie-law-info") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(DialogDescription, { className: "cky:sr-only", children: __$1(
              "Select a language to change the default language for your cookie banner",
              "cookie-law-info"
            ) })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn$1(SECTION_PADDING, "cky:pt-5 cky:pb-4"), children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { variant: "info", className: "cky:mb-[10px] cky:py-2.5 cky:px-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-start cky:gap-2 cky:pt-[5px] cky:pb-[3px]", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.info, alt: "", className: "cky:w-5 cky:h-5" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { className: "cky:text-[13px]", children: __$1(
                "Any changes you've made to the current language will be discarded",
                "cookie-law-info"
              ) })
            ] }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(Accordion, { type: "single", collapsible: true, defaultValue: "language-selector", className: "cky:w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
              AccordionItem,
              {
                value: "language-selector",
                className: "cky:border-none cky-language-selector-accordion-item",
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionTrigger$1, { className: "cky-language-selector-trigger cky-accordion-chevron-right cky:relative cky:w-full cky:py-2 cky:pl-[27px] cky:pr-[10px] cky:min-h-[40px] cky:h-auto cky:border cky:border-[#ddd] cky:rounded-[3px] cky:bg-white cky:!text-[14px] cky:!font-normal cky:leading-4 cky:shadow-none cky:outline-none cky:transition-all cky:duration-300 cky:ease-in-out cky:cursor-pointer cky:hover:no-underline cky:data-[state=open]:rounded-b-none cky:appearance-none [&>svg]:cky:!absolute [&>svg]:cky:!right-[10px] [&>svg]:cky:!top-1/2 [&>svg]:cky:!-translate-y-1/2 [&>svg]:cky:!h-[10px] [&>svg]:cky:!w-[10px]", children: __$1("Select default language", "cookie-law-info") }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionContent, { className: "cky:!pt-0 cky:!pb-0 cky:border cky:border-t-0 cky:border-[#ddd] cky:rounded-b-[3px] cky:rounded-t-none cky:bg-white cky:p-0 cky:shadow-[0_3px_7px_0_rgba(0,0,0,0.07)]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Command, { className: "cky-language-selector-command cky:rounded-none cky:border-0 cky:bg-white", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mb-0 cky:border-b cky:border-[#ddd]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "div",
                      {
                        ref: searchWrapperRef,
                        className: "cky-language-selector-search cky:flex cky:flex-1 cky:w-full cky:items-center cky:!border-0 cky:!px-0 [&_svg]:cky:hidden cky:outline-none cky:focus:outline-none",
                        role: "group",
                        "aria-label": __$1("Search languages", "cookie-law-info"),
                        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                          CommandInput,
                          {
                            ref: searchInputRef,
                            placeholder: __$1("Search...", "cookie-law-info"),
                            className: "cky:w-full cky:min-w-0 cky:h-auto cky:rounded-none cky:bg-transparent cky:relative cky:z-[1] cky:!py-[5px] cky:!px-0 cky:!border-none cky:!shadow-none cky:placeholder:!text-gray-500 cky:outline-none"
                          }
                        )
                      }
                    ) }),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs(CommandList, { className: "cky:max-h-[180px]", children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx(CommandEmpty, { children: __$1("No language found.", "cookie-law-info") }),
                      /* @__PURE__ */ jsxRuntimeExports.jsx(CommandGroup, { className: "cky:py-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
                        CommandItem,
                        {
                          disabled: true,
                          className: "cky:opacity-100! cky:cursor-not-allowed cky:flex cky:items-center cky:justify-between cky:min-h-[40px] cky:px-[10px] cky:py-0 cky:aria-selected:bg-transparent cky:data-[selected=true]:bg-transparent",
                          children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:justify-center cky:mb-[5px]", children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsx(
                                CkyCheckbox,
                                {
                                  id: `cky-checkbox-language-${current}`,
                                  checked: true,
                                  disabled: true,
                                  className: "cky:!m-0 cky:mr-[5px] cky:data-[state=checked]:!bg-[#D1D1D1] cky:!border-[#C7CADE] cky:data-[state=checked]:!border-[#C7CADE]"
                                }
                              ),
                              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                                Label$1,
                                {
                                  htmlFor: `cky-checkbox-language-${current}`,
                                  className: "cky:text-sm cky:cursor-not-allowed cky:mb-0 cky:py-[10px] cky:px-[5px] cky:ml-0",
                                  children: [
                                    getLanguageName(current),
                                    " (",
                                    current,
                                    ")"
                                  ]
                                }
                              )
                            ] }),
                            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-[12px] cky:text-[#4E4B66]", children: __$1("Default", "cookie-law-info") })
                          ]
                        }
                      ) }),
                      /* @__PURE__ */ jsxRuntimeExports.jsx(CommandGroup, { className: "cky:py-0", children: filteredLanguages.map((item) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
                        CommandItem,
                        {
                          value: `${item.name} ${item.code}`,
                          onSelect: /* @__PURE__ */ __name(() => handleCheckboxChange(item.code, selectedLanguage !== item.code), "onSelect"),
                          className: "cky:flex cky:items-center cky:justify-between cky:min-h-[40px] cky:px-[10px] cky:py-0 cky:aria-selected:bg-transparent cky:data-[selected=true]:bg-transparent",
                          children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:justify-center cky:mb-[5px]", children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsx(
                                CkyCheckbox,
                                {
                                  id: `cky-checkbox-language-${item.code}`,
                                  checked: selectedLanguage === item.code,
                                  onCheckedChange: /* @__PURE__ */ __name((checked) => handleCheckboxChange(item.code, checked === true), "onCheckedChange"),
                                  className: "cky:!m-0 cky:mr-[5px]",
                                  onClick: /* @__PURE__ */ __name((e) => e.stopPropagation(), "onClick")
                                }
                              ),
                              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                                Label$1,
                                {
                                  htmlFor: `cky-checkbox-language-${item.code}`,
                                  className: "cky:text-sm cky:cursor-pointer cky:mb-0 cky:py-[10px] cky:px-[5px] cky:ml-0 cky:text-[#14142A]",
                                  children: [
                                    item.name,
                                    " (",
                                    item.code,
                                    ")"
                                  ]
                                }
                              )
                            ] }),
                            !isLanguageTranslated(item.code) && selectedLanguage === item.code && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "cky:flex cky:items-center cky:bg-[#FFF8D9] cky:rounded-[3px] cky:text-[13px] cky:text-[#a66300] cky:mb-0 cky:px-[5px] cky:py-[5px]", children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.warning, alt: "", className: "cky:h-[13px] cky:mr-[5px]" }),
                              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:inline-block cky:leading-[18.2px]", children: __$1("Translations not available", "cookie-law-info") })
                            ] })
                          ]
                        },
                        item.code
                      )) })
                    ] })
                  ] }) })
                ]
              }
            ) }),
            !isDisabled && !loading && /* @__PURE__ */ jsxRuntimeExports.jsx(
              Alert,
              {
                variant: selectedIsTranslated ? "info" : "warning",
                className: "cky:mt-[15px]",
                children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-start cky:gap-2 cky:pt-[5px] cky:pb-[3px]", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "img",
                    {
                      src: selectedIsTranslated ? assets.info : assets.warning,
                      alt: "",
                      className: "cky:w-5 cky:h-5 cky:shrink-0"
                    }
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { className: "cky:text-[13px]", children: selectedIsTranslated ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "span",
                    {
                      dangerouslySetInnerHTML: {
                        __html: __$1(
                          "By clicking <b>Change</b>, the translations for the selected language, sourced externally from the CookieYes web app, will be downloaded to the plugin.",
                          "cookie-law-info"
                        )
                      }
                    }
                  ) : __$1(
                    "Translations are not available for the language you have selected, so the banner content that has not been translated will be displayed in English.",
                    "cookie-law-info"
                  ) })
                ] })
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { className: cn$1(CKY_DIALOG_FOOTER_CLASS, "cky:pb-[30px]", SECTION_PADDING), children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "button", onClick: handleCancel, variant: "outline", className: "cky:!text-sm", children: __$1("Cancel", "cookie-law-info") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Button,
              {
                type: "button",
                onClick: /* @__PURE__ */ __name(() => void handleChange(), "onClick"),
                disabled: isDisabled || loading,
                className: "cky:!text-sm",
                children: loading ? __$1("Changing...", "cookie-law-info") : __$1("Change", "cookie-law-info")
              }
            )
          ] })
        ]
      }
    ) });
  }
  __name(CkyLanguageSelector, "CkyLanguageSelector");
  function callRest(operation) {
    return __async(this, null, function* () {
      try {
        return yield Promise.resolve(operation());
      } catch (error) {
        console.error(error);
        throw error;
      }
    });
  }
  __name(callRest, "callRest");
  function debouncePromise(fn, ms = 0) {
    let timeoutId;
    const pending = [];
    return (...args) => new Promise((res, rej) => {
      clearTimeout(timeoutId);
      timeoutId = setTimeout(() => {
        const currentPending = [...pending];
        pending.length = 0;
        Promise.resolve(fn(...args)).then(
          (data) => {
            currentPending.forEach(({ resolve }) => resolve(data));
          },
          (error) => {
            currentPending.forEach(({ reject }) => reject(error));
          }
        );
      }, ms);
      pending.push({ resolve: res, reject: rej });
    });
  }
  __name(debouncePromise, "debouncePromise");
  function strippedContent(description) {
    if (!description) {
      return "";
    }
    return description.replace(/(<([^>]+)>)/gi, "");
  }
  __name(strippedContent, "strippedContent");
  const TH_CLASS = "cky:text-left cky:p-1.5 cky:font-bold";
  const TD_CLASS = "cky:p-1.5";
  const ICON_BTN_CLASS = "cky:w-8 cky:h-8 cky:p-0 cky:hover:bg-gray-100 cky:border-0";
  const ICON_BTN_DELETE_CLASS = `${ICON_BTN_CLASS} cky:ml-[11px]`;
  const CookieRow = React.memo(/* @__PURE__ */ __name(function CookieRow2({
    cookie,
    language,
    onEditCookie,
    onDeleteCookie
  }) {
    var _a2, _b2;
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-wrap cky:justify-between cky:items-center cky:my-[5px] cky:mx-[1px] cky:mb-[15px] cky:bg-[#f6f7f7]", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-[83.33333333%] cky:p-2.5", children: /* @__PURE__ */ jsxRuntimeExports.jsx("table", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("tbody", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: TH_CLASS, children: __$1("Cookie", "cookie-law-info") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: TD_CLASS, children: cookie.name })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: TH_CLASS, children: __$1("Duration", "cookie-law-info") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: TD_CLASS, children: ((_a2 = cookie.duration) == null ? void 0 : _a2[language]) || "" })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: TH_CLASS, children: __$1("Description", "cookie-law-info") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: TD_CLASS, children: strippedContent(((_b2 = cookie.description) == null ? void 0 : _b2[language]) || "") })
        ] })
      ] }) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:w-[16.66666667%] cky:flex cky:justify-end cky:items-center cky:p-[50px_10px]", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip$1, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Button,
            {
              variant: "ghost",
              size: "icon",
              className: ICON_BTN_CLASS,
              onClick: /* @__PURE__ */ __name(() => onEditCookie == null ? void 0 : onEditCookie(cookie), "onClick"),
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "edit", width: "14px", height: "14px", color: "#000000" })
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContentWithArrow, { side: "top", children: __$1("Edit cookie", "cookie-law-info") })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip$1, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Button,
            {
              variant: "ghost",
              size: "icon",
              className: ICON_BTN_DELETE_CLASS,
              onClick: /* @__PURE__ */ __name(() => onDeleteCookie == null ? void 0 : onDeleteCookie(cookie), "onClick"),
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "trash", width: "14px", height: "14px", color: "#eb4034" })
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContentWithArrow, { side: "top", children: __$1("Delete cookie", "cookie-law-info") })
        ] })
      ] })
    ] });
  }, "CookieRow2"));
  function CookieSection({
    title,
    items,
    keyPrefix,
    language,
    onEditCookie,
    onDeleteCookie
  }) {
    if (items.length === 0) return null;
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "cky:text-[#a0a0a0] cky:block cky:mb-2 cky:text-sm", children: title }),
      items.map((cookie, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
        CookieRow,
        {
          cookie,
          language,
          onEditCookie,
          onDeleteCookie
        },
        cookie.id || `${keyPrefix}-${index2}`
      ))
    ] });
  }
  __name(CookieSection, "CookieSection");
  const CookiesTable = /* @__PURE__ */ __name(({
    cookies: cookies2,
    language,
    onEditCookie,
    onDeleteCookie
  }) => {
    const { list, discovered, selfDeclared } = reactExports.useMemo(() => {
      const arr = cookies2 != null ? cookies2 : [];
      return {
        list: arr,
        discovered: arr.filter((c2) => c2.discovered === true),
        selfDeclared: arr.filter((c2) => c2.discovered == false)
      };
    }, [cookies2]);
    if (list.length === 0) {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:min-h-[200px] cky:flex cky:items-center cky:justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:text-center cky:flex cky:flex-col cky:items-center cky:justify-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "blank", width: "100px", height: "100px", color: "#d1d1d1" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:mt-4 cky:text-gray-500", children: __$1("No cookies found for this category!", "cookie-law-info") })
      ] }) });
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CookieSection,
        {
          title: __$1("Discovered Cookies", "cookie-law-info"),
          items: discovered,
          keyPrefix: "discovered",
          language,
          onEditCookie,
          onDeleteCookie
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CookieSection,
        {
          title: __$1("Self-declared Cookies", "cookie-law-info"),
          items: selfDeclared,
          keyPrefix: "declared",
          language,
          onEditCookie,
          onDeleteCookie
        }
      )
    ] });
  }, "CookiesTable");
  const normalizeCookies = /* @__PURE__ */ __name((cookies2) => {
    if (!cookies2) return [];
    if (Array.isArray(cookies2)) return cookies2;
    if (typeof cookies2 === "object" && "id" in cookies2) {
      return [cookies2];
    }
    if (typeof cookies2 === "object") {
      return Object.values(cookies2);
    }
    return [];
  }, "normalizeCookies");
  const normalizeCookieCategory = /* @__PURE__ */ __name((category) => {
    return __spreadProps(__spreadValues({}, category), {
      cookies: normalizeCookies(category.cookie_list || category.cookies || [])
    });
  }, "normalizeCookieCategory");
  const cookieApi = {
    getCookies() {
      return __async(this, arguments, function* (params = {}) {
        return callRest(() => __async(null, null, function* () {
          const response = yield ckyRest.get({
            path: "cookies/",
            params
          });
          return normalizeCookies(response);
        }));
      });
    },
    getCookie(id) {
      return __async(this, null, function* () {
        return callRest(
          () => ckyRest.get({
            path: `cookies/${id}`
          })
        );
      });
    },
    createCookie(data) {
      return __async(this, null, function* () {
        return callRest(
          () => ckyRest.post({
            path: "cookies/",
            data
          })
        );
      });
    },
    updateCookie(id, data) {
      return __async(this, null, function* () {
        return callRest(
          () => ckyRest.put({
            path: `cookies/${id}`,
            data
          })
        );
      });
    },
    deleteCookie(id) {
      return __async(this, null, function* () {
        return callRest(
          () => ckyRest.delete({
            path: `cookies/${id}`
          })
        );
      });
    },
    getCookieCategories() {
      return __async(this, arguments, function* (params = {}) {
        return callRest(() => __async(null, null, function* () {
          const response = yield ckyRest.get({
            path: "cookies/categories",
            params
          });
          if (Array.isArray(response)) {
            return response.map(normalizeCookieCategory);
          }
          return [];
        }));
      });
    },
    getCookieCategory(id) {
      return __async(this, null, function* () {
        return callRest(() => __async(null, null, function* () {
          const response = yield ckyRest.get({
            path: `cookies/categories/${id}`
          });
          return normalizeCookieCategory(response);
        }));
      });
    },
    createCookieCategory(data) {
      return __async(this, null, function* () {
        return callRest(
          () => ckyRest.post({
            path: "cookies/categories",
            data
          })
        );
      });
    },
    updateCookieCategory(id, data) {
      return __async(this, null, function* () {
        return callRest(
          () => ckyRest.put({
            path: `cookies/categories/${id}`,
            data
          })
        );
      });
    },
    deleteCookieCategory(id) {
      return __async(this, null, function* () {
        return callRest(
          () => ckyRest.delete({
            path: `cookies/categories/${id}`
          })
        );
      });
    },
    bulkUpdateCookieCategory(categories) {
      return __async(this, null, function* () {
        const data = categories.map((item) => {
          const _a2 = item, { cookies: cookies2 } = _a2, rest = __objRest(_a2, ["cookies"]);
          return rest;
        });
        return callRest(
          () => ckyRest.post({
            path: "cookies/categories/bulk",
            data: { categories: data }
          })
        );
      });
    }
  };
  const SCRIPT_URL_PATTERN_ALERT_HTML = sprintf(
    __$1(
      /* translators: 1: Example third-party script tag shown as escaped text. 2: Example Script URL Pattern hostname. */
      'If the third-party script setting this cookie is %1$s then you can specify its "Script URL Pattern" as <b>%2$s</b>',
      "cookie-law-info"
    ),
    "&lt;script async src='https://www.google-analytics.com/analytics.js'&gt;&lt;/script&gt;",
    "google-analytics.com"
  );
  const TabCookies = /* @__PURE__ */ __name(() => {
    var _a2, _b2, _c2;
    const [loading, setLoading] = reactExports.useState(true);
    const [hasFetched, setHasFetched] = reactExports.useState(false);
    const [categories, setCategories] = reactExports.useState([]);
    const [currentCategory, setCurrentCategory] = reactExports.useState(null);
    const [activeTab, setActiveTab] = reactExports.useState("");
    const [language, setLanguage] = reactExports.useState(
      () => useLanguageStore.getState().current || "en"
    );
    const prevStoreCurrentRef = reactExports.useRef(null);
    const [currentCookie, setCurrentCookie] = reactExports.useState(null);
    const [currentCategoryEdit, setCurrentCategoryEdit] = reactExports.useState(null);
    const [cookieModalOpen, setCookieModalOpen] = reactExports.useState(false);
    const [categoryModalOpen, setCategoryModalOpen] = reactExports.useState(false);
    const [cookieName, setCookieName] = reactExports.useState(false);
    const [cookieId, setCookieId] = reactExports.useState(false);
    const [errors, setErrors] = reactExports.useState(createInitialErrors);
    const [saving, setSaving] = reactExports.useState(false);
    const { triggerNotification } = useGlobalUtilities();
    const headsUpPopupRef = reactExports.useRef(null);
    const {
      available,
      selected,
      default: defaultLanguage,
      current
    } = useLanguageStore();
    const rtl = isRTLLanguage(language);
    const tablesMissing = useAppStore(
      (s2) => Boolean(
        s2.info && typeof s2.info === "object" && s2.info.tables_missing
      )
    );
    const isLoaded = !loading && hasFetched && !tablesMissing;
    const loadItems = reactExports.useCallback((showFullLoading = false) => __async(null, null, function* () {
      if (showFullLoading) {
        setLoading(true);
      }
      try {
        const response = yield cookieApi.getCookieCategories();
        if (response && Array.isArray(response)) {
          setCategories(response);
          setCurrentCategory((prev) => {
            var _a3;
            if (response.length === 0) return null;
            if (prev && response.some((c2) => c2.id === prev.id)) {
              return (_a3 = response.find((c2) => c2.id === prev.id)) != null ? _a3 : response[0];
            }
            return response[0];
          });
          setActiveTab((prev) => {
            if (response.length === 0) return "";
            if (prev && response.some((c2) => String(c2.id) === prev)) return prev;
            return String(response[0].id);
          });
        }
      } catch (error) {
        console.error(error);
      } finally {
        setLoading(false);
        setHasFetched(true);
      }
    }), []);
    reactExports.useEffect(() => {
      void loadItems(true);
      if (available.length === 0) {
        useLanguageStore.getState().init();
      }
    }, []);
    reactExports.useEffect(() => {
      const onLanguageChanged = /* @__PURE__ */ __name(() => {
        void loadItems(true);
      }, "onLanguageChanged");
      window.addEventListener("cky:language-changed", onLanguageChanged);
      return () => window.removeEventListener("cky:language-changed", onLanguageChanged);
    }, [loadItems]);
    reactExports.useEffect(() => {
      if (categories.length > 0 && !activeTab) {
        setActiveTab(String(categories[0].id));
        setCurrentCategory(categories[0]);
      }
    }, [categories, activeTab]);
    const getLanguageContents = reactExports.useCallback((item = {}) => {
      const data = {};
      selected.forEach((langCode) => {
        data[langCode] = Object.prototype.hasOwnProperty.call(item, langCode) ? item[langCode] : "";
      });
      return data;
    }, [selected]);
    const selectedLanguages = reactExports.useMemo(
      () => available.filter((item) => selected.includes(item.code)),
      [available, selected]
    );
    const handleLanguageChange = reactExports.useCallback((value) => {
      setLanguage(value);
    }, []);
    const getFallbackLanguage = reactExports.useCallback((selectedAvailableCodes) => {
      if (selectedAvailableCodes.includes(current)) {
        return current;
      }
      if (selectedAvailableCodes.includes(defaultLanguage)) {
        return defaultLanguage;
      }
      return selectedAvailableCodes[0];
    }, [current, defaultLanguage]);
    reactExports.useEffect(() => {
      if (available.length > 0 && selected.length > 0) {
        const selectedAvailableCodes = available.filter((lang) => selected.includes(lang.code)).map((lang) => lang.code);
        if (selectedAvailableCodes.length > 0) {
          const fallbackLanguage = getFallbackLanguage(selectedAvailableCodes);
          const storeCurrentChanged = prevStoreCurrentRef.current !== null && prevStoreCurrentRef.current !== current;
          if (!selectedAvailableCodes.includes(language)) {
            setLanguage(fallbackLanguage);
          } else if (storeCurrentChanged && selectedAvailableCodes.includes(current)) {
            setLanguage(current);
          }
          prevStoreCurrentRef.current = current;
        }
      }
    }, [available, selected, current, defaultLanguage, language, getFallbackLanguage]);
    const handleTabChange = reactExports.useCallback((tabId) => {
      setActiveTab(tabId);
      const category = categories.find((cat) => String(cat.id) === tabId);
      if (category) setCurrentCategory(category);
    }, [categories]);
    const resetErrors = reactExports.useCallback((type) => {
      setErrors(
        (prev) => type === "cookie" ? __spreadProps(__spreadValues({}, prev), {
          cookie: { id: false, domain: false, duration: false, description: false }
        }) : __spreadProps(__spreadValues({}, prev), {
          category: { name: false, description: false }
        })
      );
    }, []);
    const validateCookieFields = reactExports.useCallback((cookie) => {
      const newErrors = {
        id: !(cookie.name && cookie.name.trim()),
        domain: !(cookie.domain && cookie.domain.trim()),
        duration: !(cookie.duration[language] && cookie.duration[language].trim()),
        description: !(cookie.description[language] && cookie.description[language].trim())
      };
      setErrors((prev) => __spreadProps(__spreadValues({}, prev), { cookie: newErrors }));
      return !newErrors.id && !newErrors.domain && !newErrors.duration && !newErrors.description;
    }, [language]);
    const validateCategoryFields = reactExports.useCallback((category) => {
      const categoryName = localizedCategoryName(category.name, language, defaultLanguage);
      const newErrors = {
        name: !(categoryName && categoryName.trim()),
        description: !(category.description[language] && category.description[language].trim())
      };
      setErrors((prev) => __spreadProps(__spreadValues({}, prev), { category: newErrors }));
      return !newErrors.name && !newErrors.description;
    }, [language, defaultLanguage]);
    const openCookieModal = /* @__PURE__ */ __name((cookie) => {
      if (cookie) {
        setCurrentCookie(__spreadProps(__spreadValues({}, cookie), {
          duration: cookie.duration || getLanguageContents(),
          description: cookie.description || getLanguageContents()
        }));
      } else {
        setCurrentCookie({
          name: "",
          domain: "",
          duration: getLanguageContents(),
          description: getLanguageContents(),
          category: (currentCategory == null ? void 0 : currentCategory.id) || ""
        });
      }
      resetErrors("cookie");
      setCookieModalOpen(true);
    }, "openCookieModal");
    const closeCookieModal = /* @__PURE__ */ __name(() => {
      setCookieModalOpen(false);
      setCurrentCookie(null);
      resetErrors("cookie");
    }, "closeCookieModal");
    const openCookieCategoryModal = /* @__PURE__ */ __name((category) => {
      setCurrentCategoryEdit(__spreadProps(__spreadValues({}, category), {
        name: category.name || getLanguageContents(),
        description: category.description || getLanguageContents()
      }));
      resetErrors("category");
      setCategoryModalOpen(true);
    }, "openCookieCategoryModal");
    const closeCookieCategoryModal = /* @__PURE__ */ __name(() => {
      setCategoryModalOpen(false);
      setCurrentCategoryEdit(null);
      resetErrors("category");
    }, "closeCookieCategoryModal");
    const addOrEditCookie = /* @__PURE__ */ __name(() => __async(null, null, function* () {
      if (!currentCookie) return;
      setSaving(true);
      try {
        const validated = validateCookieFields(currentCookie);
        if (validated) {
          let response;
          if (currentCookie.id && currentCookie.id > 0) {
            response = yield cookieApi.updateCookie(currentCookie.id, currentCookie);
          } else {
            response = yield cookieApi.createCookie(currentCookie);
          }
          if (response) {
            yield loadItems();
            closeCookieModal();
            triggerNotification({ type: "success", message: __$1("Successfully updated", "cookie-law-info") });
          }
        }
      } catch (error) {
        console.error(error);
        triggerNotification({ type: "error", message: __$1("Problem occurred while saving your settings. Please try again later!", "cookie-law-info") });
      } finally {
        setSaving(false);
      }
    }), "addOrEditCookie");
    const addOrEditCookieCategory = /* @__PURE__ */ __name(() => __async(null, null, function* () {
      if (!currentCategoryEdit) return;
      setSaving(true);
      try {
        const validated = validateCategoryFields(currentCategoryEdit);
        if (validated) {
          let response;
          if (currentCategoryEdit.id) {
            response = yield cookieApi.updateCookieCategory(currentCategoryEdit.id, currentCategoryEdit);
          } else {
            response = yield cookieApi.createCookieCategory(currentCategoryEdit);
          }
          if (response) {
            yield loadItems();
            closeCookieCategoryModal();
            triggerNotification({ type: "success", message: __$1("Successfully updated", "cookie-law-info") });
          }
        }
      } catch (error) {
        console.error(error);
        triggerNotification({ type: "error", message: __$1("Problem occurred while saving your settings. Please try again later!", "cookie-law-info") });
      } finally {
        setSaving(false);
      }
    }), "addOrEditCookieCategory");
    const deleteCookieConfirmation = /* @__PURE__ */ __name((cookie) => {
      setCookieName(cookie.name);
      setCookieId(cookie.id || false);
      if (headsUpPopupRef.current) {
        headsUpPopupRef.current.show();
      }
    }, "deleteCookieConfirmation");
    const deleteCookie = /* @__PURE__ */ __name(() => __async(null, null, function* () {
      if (cookieId) {
        try {
          const response = yield cookieApi.deleteCookie(cookieId);
          if (response && response.id > 0) {
            yield loadItems();
            triggerNotification({ type: "success", message: __$1("Successfully deleted the cookie", "cookie-law-info") });
          } else {
            triggerNotification({ type: "error", message: __$1("Failed", "cookie-law-info") });
          }
        } catch (error) {
          console.error(error);
          triggerNotification({ type: "error", message: __$1("Problem occurred while saving your settings. Please try again later!", "cookie-law-info") });
        }
      }
      if (headsUpPopupRef.current) {
        headsUpPopupRef.current.closePopup();
      }
      setCookieName(false);
      setCookieId(false);
    }), "deleteCookie");
    const clearHeadsUpPopup = /* @__PURE__ */ __name(() => {
      setCookieName(false);
      setCookieId(false);
    }, "clearHeadsUpPopup");
    const bodyContent = reactExports.useMemo(
      () => sprintf(DELETE_COOKIE_BODY_TEMPLATE, cookieName || ""),
      [cookieName]
    );
    if (!isLoaded) {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: PAGE_SHELL_CLASS, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-nav-tab-section cky-nav-tab-section-cookies cky:w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-nav-tab cky-vertical-tab cky:flex cky:w-full cky:border cky:border-gray-300", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-nav-tabs-container cky:w-[18%]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "ul",
          {
            className: "cky-vertical-tabs cky:list-none cky:m-0 cky:pl-0 cky:h-full cky:border-r cky:border-gray-300",
            style: { padding: 15 },
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:p-3 cky:space-y-2" }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:p-3 cky:space-y-2" }) })
            ]
          }
        ) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-nav-tab-content-container cky:relative cky:w-[82%] cky:p-[15px_20px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-nav-tab-content cky:flex cky:flex-col cky:gap-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:p-0 cky:space-y-3" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:p-0 cky:space-y-3" })
        ] }) })
      ] }) }) }) });
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: PAGE_SHELL_CLASS, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs(Tabs, { value: activeTab, defaultValue: activeTab || void 0, onValueChange: handleTabChange, className: TABS_FRAME_CLASS, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-[18%]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TabsList, { className: "cky:m-0 cky:p-0 cky:w-full cky:h-full cky:flex-col cky:items-start cky:justify-normal cky:bg-transparent", children: [
          categories.map((category) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `cky:border-l-4 cky:border-b cky:border-b-gray-300 cky:w-full ${activeTab === String(category.id) ? "cky:border-l-blue-500" : "cky:border-l-transparent cky:border-r-1 cky:border-r-gray-300"}`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
            TabsTrigger,
            {
              value: String(category.id),
              className: "cky:m-0 cky:flex cky:items-center cky:p-[15px_10px] cky:w-full cky:cursor-pointer cky:bg-transparent cky:font-medium cky:text-gray-700 cky:hover:cky:text-blue-600 cky:focus:cky:text-blue-600 cky:active:cky:text-blue-600 cky:data-[state=active]:bg-white cky:data-[state=active]:text-blue-600 cky:data-[state=active]:shadow-none cky:justify-between cky:rounded-none",
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `cky:font-medium ${activeTab === String(category.id) ? "cky:text-blue-600" : ""}`, children: categoryTabTitle(category.name, language) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `cky:text-sm cky:font-medium ${activeTab === String(category.id) ? "cky:text-blue-600" : "cky:text-gray-500"}`, children: `(${category.cookies.length})` })
              ]
            }
          ) }, category.id)),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-full cky:h-full cky:border-r cky:border-r-gray-300" })
        ] }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-[82%] cky:p-[15px_20px] cky:relative", children: categories.map((category) => /* @__PURE__ */ jsxRuntimeExports.jsx(
          TabsContent,
          {
            value: String(category.id),
            className: "cky:mt-0",
            children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn$1(rtl && "cky-app-rtl"), children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:justify-between cky:items-center cky:mb-5", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:w-1/3", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "cky:m-0! cky:text-[16px]! cky:leading-[18px]! cky:font-medium", children: __$1("Cookie List", "cookie-law-info") }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    Button,
                    {
                      variant: "primary",
                      className: "cky:ml-2.5",
                      onClick: /* @__PURE__ */ __name(() => openCookieModal(), "onClick"),
                      children: __$1(" + Add Cookie", "cookie-law-info")
                    }
                  )
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:w-2/3 cky:justify-end", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("h5", { className: "cky:m-[0.5em_0]! cky:text-[15px]! cky:font-medium", children: __$1("Edit content in: ", "cookie-law-info") }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs(
                    Select,
                    {
                      value: language,
                      onValueChange: handleLanguageChange,
                      children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { className: "cky:ml-[10px] cky:min-w-[150px] cky:max-w-[400px] cky:w-auto cky:h-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: __$1("Select language...", "cookie-law-info") }) }),
                        /* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { children: selectedLanguages.map((lang) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: lang.code, variant: "modal", children: lang.name }, lang.code)) })
                      ]
                    }
                  )
                ] })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-nav-tab-section-header cky:flex cky:items-center cky:justify-between cky:px-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:gap-3", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx("h5", { className: "cky-cookies-title cky:m-0! cky:pb-0.5 cky:font-[500]! cky:text-[15px]!", children: categoryTabTitle(category.name, language) }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip$1, { children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                      Button,
                      {
                        variant: "ghost",
                        size: "icon",
                        className: "cky:bg-transparent cky:border-none cky:p-0 cky:h-auto cky:w-auto cky:hover:cky:opacity-70 cky:transition-opacity",
                        onClick: /* @__PURE__ */ __name(() => openCookieCategoryModal(category), "onClick"),
                        children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "edit", width: "14px", height: "14px", color: "#000000" })
                      }
                    ) }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContentWithArrow, { side: TOOLTIP_TOP, children: __$1("Edit category", "cookie-law-info") })
                  ] })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-category-description cky:text-sm cky:mt-1", children: strippedContent(category.description[language] || category.description[defaultLanguage] || "") })
              ] }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:pt-5", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                CookiesTable,
                {
                  cookies: category.cookies,
                  language,
                  onEditCookie: openCookieModal,
                  onDeleteCookie: deleteCookieConfirmation
                }
              ) })
            ] })
          },
          category.id
        )) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: cookieModalOpen, onOpenChange: setCookieModalOpen, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        DialogContent,
        {
          "aria-describedby": void 0,
          className: cn$1(
            CKY_DIALOG_CONTENT_CLASS,
            "cky:flex cky:flex-col cky:bg-white cky:border-none cky:p-0 cky:gap-0 [&>button:last-child]:cky:right-[30px] [&>button:last-child]:cky:top-5",
            rtl && "cky-app-rtl"
          ),
          onOpenAutoFocus: /* @__PURE__ */ __name((e) => e.preventDefault(), "onOpenAutoFocus"),
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(DialogHeader, { className: "cky:px-[30px] cky:py-[20px] cky:border-b cky:border-b-[#dfe1e5]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { className: "cky:text-left cky:text-[16px]! cky:leading-[18px]!", children: (currentCookie == null ? void 0 : currentCookie.id) ? __$1("Edit Cookie", "cookie-law-info") : __$1("New Cookie", "cookie-law-info") }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:relative cky:px-[30px] cky:py-[20px] cky:max-h-[calc(100vh-3.5rem)] cky:overflow-y-auto", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-1/2 cky:pr-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mb-4", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs(Label$1, { className: "cky:mb-[10px] cky:inline-block cky:text-[14px]", children: [
                    __$1("Cookie ID", "cookie-law-info"),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-red-500", children: " *" })
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    CkyInput,
                    {
                      type: "text",
                      value: (currentCookie == null ? void 0 : currentCookie.name) || "",
                      onChange: /* @__PURE__ */ __name((e) => setCurrentCookie((prev) => prev ? __spreadProps(__spreadValues({}, prev), { name: e.target.value }) : prev), "onChange")
                    }
                  ),
                  errors.cookie.id && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:text-red-500", children: __$1("Cookie ID is required", "cookie-law-info") })
                ] }) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-1/2 cky:pl-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mb-4", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs(Label$1, { className: "cky:mb-[10px] cky:inline-block cky:text-[14px]", children: [
                    __$1("Domain", "cookie-law-info"),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-red-500", children: " *" })
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    CkyInput,
                    {
                      type: "text",
                      value: (currentCookie == null ? void 0 : currentCookie.domain) || "",
                      onChange: /* @__PURE__ */ __name((e) => setCurrentCookie((prev) => prev ? __spreadProps(__spreadValues({}, prev), { domain: e.target.value }) : prev), "onChange")
                    }
                  ),
                  errors.cookie.domain && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:text-red-500", children: __$1("Domain is required", "cookie-law-info") })
                ] }) })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-1/2 cky:pr-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mb-4", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs(Label$1, { className: "cky:mb-[10px] cky:inline-block cky:text-[14px]", children: [
                    __$1("Duration", "cookie-law-info"),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-red-500", children: " *" })
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    CkyInput,
                    {
                      type: "text",
                      required: true,
                      value: ((_a2 = currentCookie == null ? void 0 : currentCookie.duration) == null ? void 0 : _a2[language]) || "",
                      onChange: /* @__PURE__ */ __name((e) => {
                        setCurrentCookie((prev) => {
                          if (!prev) return prev;
                          const newDuration = __spreadValues({}, prev.duration);
                          newDuration[language] = e.target.value;
                          return __spreadProps(__spreadValues({}, prev), { duration: newDuration });
                        });
                      }, "onChange")
                    }
                  ),
                  errors.cookie.duration && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:text-red-500", children: __$1("Duration is required", "cookie-law-info") })
                ] }) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-1/2 cky:pl-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mb-4", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs(Label$1, { className: "cky:mb-[10px] cky:inline-block cky:text-[14px]", children: [
                    __$1("Category", "cookie-law-info"),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-red-500", children: " *" })
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs(
                    Select,
                    {
                      value: (currentCookie == null ? void 0 : currentCookie.category) != null ? String(currentCookie.category) : "",
                      onValueChange: /* @__PURE__ */ __name((value) => setCurrentCookie((prev) => prev ? __spreadProps(__spreadValues({}, prev), { category: value }) : prev), "onValueChange"),
                      disabled: !(currentCookie == null ? void 0 : currentCookie.id),
                      children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: __$1("Select category...", "cookie-law-info") }) }),
                        /* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { children: categories.map((cat) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: String(cat.id), children: localizedCategoryName(cat.name, language, defaultLanguage) }, cat.id)) })
                      ]
                    }
                  )
                ] }) })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:mt-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mb-2", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs(Label$1, { className: "cky:mb-1 cky:inline-block cky:text-[14px]", children: [
                  __$1("Description", "cookie-law-info"),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-red-500", children: " *" })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:-mt-[30px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  WpEditor,
                  {
                    value: ((_b2 = currentCookie == null ? void 0 : currentCookie.description) == null ? void 0 : _b2[language]) || "",
                    onChange: /* @__PURE__ */ __name((value) => {
                      setCurrentCookie((prev) => {
                        if (!prev) return prev;
                        const newDescription = __spreadValues({}, prev.description);
                        newDescription[language] = value;
                        return __spreadProps(__spreadValues({}, prev), { description: newDescription });
                      });
                    }, "onChange"),
                    language,
                    height: "100"
                  }
                ) }),
                errors.cookie.description && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:text-red-500", children: __$1("Description is required", "cookie-law-info") })
              ] }) }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Accordion, { type: "single", collapsible: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AccordionItem, { value: "advanced", className: "cky:border-none", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionTrigger$1, { className: "cky:cursor-pointer cky:text-blue-600 hover:cky:no-underline cky:font-medium! cky:text-[14px]! cky:border-b-0 cky:py-0! cky:gap-2 cky-accordion-trigger", children: __$1("Advanced Options", "cookie-law-info") }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs(AccordionContent, { children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs(Label$1, { className: "cky:mb-[10px] cky:flex cky:items-center cky:gap-1", children: [
                    __$1("Script URL Pattern", "cookie-law-info"),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip$1, { children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:cursor-pointer", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                        CkyIcon,
                        {
                          icon: "tooltip",
                          width: "12px",
                          height: "12px",
                          color: "#A6A8B1"
                        }
                      ) }) }),
                      /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipContentWithArrow, { side: "right", children: __$1("Our auto-blocking mechanism will use the Script URL Pattern to identify the third-party script (setting a cookie) by purpose category, and consequently, the associated cookie will be automatically blocked prior to receiving user consent for the respective category.", "cookie-law-info") })
                    ] })
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:text-[14px]! cky:m-0!", children: __$1(
                    "URL pattern for blocking the third-party script settings of this cookie",
                    "cookie-law-info"
                  ) }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { variant: "warning", className: "cky:my-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "p",
                    {
                      className: "cky:text-[12px]! cky:m-0!",
                      dangerouslySetInnerHTML: { __html: SCRIPT_URL_PATTERN_ALERT_HTML }
                    }
                  ) }) }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    CkyInput,
                    {
                      type: "text",
                      className: "cky:m-0!",
                      value: (currentCookie == null ? void 0 : currentCookie.url_pattern) || "",
                      onChange: /* @__PURE__ */ __name((e) => setCurrentCookie((prev) => prev ? __spreadProps(__spreadValues({}, prev), { url_pattern: e.target.value }) : prev), "onChange"),
                      placeholder: __$1("Please enter a valid Script URL Pattern. Eg:- google-analytics.com", "cookie-law-info")
                    }
                  )
                ] })
              ] }) }) }) })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { className: CKY_DIALOG_FOOTER_CLASS, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                Button,
                {
                  variant: "outline",
                  onClick: closeCookieModal,
                  className: "cky:ml-2.5",
                  children: __$1("Cancel", "cookie-law-info")
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                Button,
                {
                  onClick: addOrEditCookie,
                  disabled: saving,
                  className: "cky:ml-2.5",
                  children: saving ? __$1("Saving...", "cookie-law-info") : __$1("Save Changes", "cookie-law-info")
                }
              )
            ] })
          ]
        }
      ) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: categoryModalOpen, onOpenChange: setCategoryModalOpen, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        DialogContent,
        {
          "aria-describedby": void 0,
          className: cn$1(
            CKY_DIALOG_CONTENT_CLASS,
            "cky:bg-white cky:border-none cky:flex cky:flex-col cky:p-0 cky:gap-0 [&>button:last-child]:cky:right-[30px] [&>button:last-child]:cky:top-5",
            rtl && "cky-app-rtl"
          ),
          onOpenAutoFocus: /* @__PURE__ */ __name((e) => e.preventDefault(), "onOpenAutoFocus"),
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(DialogHeader, { className: "cky:px-[30px] cky:py-[20px] cky:border-b cky:border-b-[#dfe1e5]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { className: "cky:text-left cky:leading-[18px]", children: __$1("Edit Category", "cookie-law-info") }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:px-[30px] cky:py-[20px] cky:max-h-[calc(100vh-3.5rem)] cky:overflow-y-auto", children: currentCategoryEdit && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mb-5", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs(Label$1, { className: "cky:block cky:mb-[10px] cky:text-sm cky:font-normal", children: [
                  __$1("Name", "cookie-law-info"),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-red-500", children: " *" })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  CkyInput,
                  {
                    type: "text",
                    className: cn$1(errors.category.name && "cky:!border-red-500"),
                    required: true,
                    value: currentCategoryEdit.name[language] || "",
                    onChange: /* @__PURE__ */ __name((e) => {
                      const newName = __spreadValues({}, currentCategoryEdit.name);
                      newName[language] = e.target.value;
                      setCurrentCategoryEdit(__spreadProps(__spreadValues({}, currentCategoryEdit), { name: newName }));
                    }, "onChange")
                  }
                ),
                errors.category.name && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:text-red-500 cky:py-1.5 cky:text-sm", children: __$1("Name is required", "cookie-law-info") })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mb-2", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs(Label$1, { className: "cky:block cky:text-sm cky:font-normal cky:mb-1", children: [
                  __$1("Description", "cookie-law-info"),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-red-500", children: " *" })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:-mt-[30px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  WpEditor,
                  {
                    value: ((_c2 = currentCategoryEdit == null ? void 0 : currentCategoryEdit.description) == null ? void 0 : _c2[language]) || "",
                    onChange: /* @__PURE__ */ __name((value) => {
                      setCurrentCategoryEdit((prev) => {
                        if (!prev) return prev;
                        const newDescription = __spreadValues({}, prev.description);
                        newDescription[language] = value;
                        return __spreadProps(__spreadValues({}, prev), { description: newDescription });
                      });
                    }, "onChange"),
                    language,
                    height: "100"
                  }
                ) }),
                errors.category.description && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:text-red-500 cky:py-1.5 cky:text-sm", children: __$1("Description is required", "cookie-law-info") })
              ] })
            ] }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { className: CKY_DIALOG_FOOTER_CLASS, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "outline", onClick: closeCookieCategoryModal, children: __$1("Cancel", "cookie-law-info") }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: addOrEditCookieCategory, disabled: saving, className: "cky:ml-[10px]", children: saving ? __$1("Saving...", "cookie-law-info") : __$1("Save Changes", "cookie-law-info") })
            ] })
          ]
        }
      ) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyHeadsUpPopup,
        {
          ref: headsUpPopupRef,
          header: __$1("Delete cookie?", "cookie-law-info"),
          body: bodyContent,
          cancelBtn: __$1("Cancel", "cookie-law-info"),
          confirmBtn: __$1("Delete cookie", "cookie-law-info"),
          onDeleteItem: deleteCookie,
          onClear: clearHeadsUpPopup
        }
      )
    ] }) });
  }, "TabCookies");
  const HERO_STYLE = {
    backgroundImage: `url(${assets.scanResult})`,
    backgroundSize: "contain",
    backgroundPosition: "top center",
    backgroundRepeat: "no-repeat"
  };
  const TabScanner = /* @__PURE__ */ __name(() => {
    const [container, setContainer] = reactExports.useState(null);
    const containerRef = reactExports.useCallback((node) => {
      if (node) setContainer(node);
    }, []);
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:w-full cky:min-h-[417px] cky:flex cky:flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        className: "cky:flex-1 cky:relative cky:flex cky:items-center cky:justify-center cky:min-h-[447px]",
        style: HERO_STYLE,
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            ref: containerRef,
            className: "cky:absolute cky:left-0 cky:right-0 cky:top-[50%] cky:transform cky:-translate-y-1/2 cky:mt-0 cky:mb-0 cky:ml-auto cky:mr-auto cky:h-auto cky:z-0 cky:w-[439px] cky:max-w-[100%] cky:rounded-[8px] cky:overflow-hidden cky:shadow-[0px_0px_5px_0px_rgba(0,0,0,0.06),0px_9px_10px_0px_rgba(0,0,0,0.02),0px_17px_23px_0px_rgba(0,0,0,0.03)] cky:bg-transparent cky:border cky:border-solid cky:border-[#C7CADE]",
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              CkyConnectModal,
              {
                visible: true,
                className: "cky-app-modal-scanner",
                container: container || void 0,
                featureText: __$1(
                  "Scan your website to generate a detailed cookie list and track your scan details",
                  "cookie-law-info"
                ),
                availabilityText: __$1("Available in: <b>All plans</b>", "cookie-law-info")
              }
            )
          }
        )
      }
    ) });
  }, "TabScanner");
  function getContentSectionsForLaw(law = "") {
    if (!law) return [];
    if (law === "ccpa") {
      return [
        { id: "notice" },
        { id: "opt-out-center" },
        { id: "cookie-list" },
        { id: "revisit-consent" },
        { id: "blocked-content" }
      ];
    }
    return [
      { id: "notice" },
      { id: "preference" },
      { id: "cookie-list" },
      { id: "revisit-consent" },
      { id: "blocked-content" }
    ];
  }
  __name(getContentSectionsForLaw, "getContentSectionsForLaw");
  function getContentPackForLanguage(contents, lang, fallbackLang = "en") {
    if (!contents || typeof contents !== "object") return {};
    const direct = contents[lang];
    if (direct && typeof direct === "object" && !Array.isArray(direct)) {
      if (Object.keys(direct).length > 0) {
        return direct;
      }
    }
    const fallback = contents[fallbackLang];
    if (fallback && typeof fallback === "object" && !Array.isArray(fallback)) {
      return fallback;
    }
    return {};
  }
  __name(getContentPackForLanguage, "getContentPackForLanguage");
  function renderContentSections(sections, renderers) {
    return sections.map(({ id }) => renderers[id]());
  }
  __name(renderContentSections, "renderContentSections");
  var isCheckBoxInput = /* @__PURE__ */ __name((element) => element.type === "checkbox", "isCheckBoxInput");
  var isDateObject = /* @__PURE__ */ __name((value) => value instanceof Date, "isDateObject");
  var isNullOrUndefined = /* @__PURE__ */ __name((value) => value == null, "isNullOrUndefined");
  const isObjectType = /* @__PURE__ */ __name((value) => typeof value === "object", "isObjectType");
  var isObject$1 = /* @__PURE__ */ __name((value) => !isNullOrUndefined(value) && !Array.isArray(value) && isObjectType(value) && !isDateObject(value), "isObject$1");
  var getEventValue = /* @__PURE__ */ __name((event) => isObject$1(event) && event.target ? isCheckBoxInput(event.target) ? event.target.checked : event.target.value : event, "getEventValue");
  var isNameInFieldArray = /* @__PURE__ */ __name((names, name) => name.split(".").some((part, index2, arr) => !isNaN(Number(part)) && names.has(arr.slice(0, index2).join("."))), "isNameInFieldArray");
  var isPlainObject = /* @__PURE__ */ __name((tempObject) => {
    const prototypeCopy = tempObject.constructor && tempObject.constructor.prototype;
    return isObject$1(prototypeCopy) && prototypeCopy.hasOwnProperty("isPrototypeOf");
  }, "isPlainObject");
  var isWeb = typeof window !== "undefined" && typeof window.HTMLElement !== "undefined" && typeof document !== "undefined";
  function cloneObject(data) {
    if (data instanceof Date) {
      return new Date(data);
    }
    const isFileListInstance = typeof FileList !== "undefined" && data instanceof FileList;
    if (isWeb && (data instanceof Blob || isFileListInstance)) {
      return data;
    }
    const isArray2 = Array.isArray(data);
    if (!isArray2 && !(isObject$1(data) && isPlainObject(data))) {
      return data;
    }
    const copy2 = isArray2 ? [] : Object.create(Object.getPrototypeOf(data));
    for (const key in data) {
      if (Object.prototype.hasOwnProperty.call(data, key)) {
        copy2[key] = cloneObject(data[key]);
      }
    }
    return copy2;
  }
  __name(cloneObject, "cloneObject");
  var isKey = /* @__PURE__ */ __name((value) => /^\w*$/.test(value), "isKey");
  var isUndefined = /* @__PURE__ */ __name((val) => val === void 0, "isUndefined");
  var compact = /* @__PURE__ */ __name((value) => Array.isArray(value) ? value.filter(Boolean) : [], "compact");
  var stringToPath = /* @__PURE__ */ __name((input) => compact(input.replace(/["|']|\]/g, "").split(/\.|\[/)), "stringToPath");
  var get = /* @__PURE__ */ __name((object2, path, defaultValue) => {
    if (!path || !isObject$1(object2)) {
      return defaultValue;
    }
    const paths = isKey(path) ? [path] : stringToPath(path);
    const result = paths.reduce((result2, key) => {
      return isNullOrUndefined(result2) ? void 0 : result2[key];
    }, object2);
    return isUndefined(result) || result === object2 ? isUndefined(object2[path]) ? defaultValue : object2[path] : result;
  }, "get");
  var isBoolean = /* @__PURE__ */ __name((value) => typeof value === "boolean", "isBoolean");
  var isFunction$1 = /* @__PURE__ */ __name((value) => typeof value === "function", "isFunction$1");
  var set = /* @__PURE__ */ __name((object2, path, value) => {
    let index2 = -1;
    const tempPath = isKey(path) ? [path] : stringToPath(path);
    const length = tempPath.length;
    const lastIndex = length - 1;
    while (++index2 < length) {
      const key = tempPath[index2];
      let newValue = value;
      if (index2 !== lastIndex) {
        const objValue = object2[key];
        newValue = isObject$1(objValue) || Array.isArray(objValue) ? objValue : !isNaN(+tempPath[index2 + 1]) ? [] : {};
      }
      if (key === "__proto__" || key === "constructor" || key === "prototype") {
        return;
      }
      object2[key] = newValue;
      object2 = object2[key];
    }
  }, "set");
  const EVENTS = {
    BLUR: "blur",
    FOCUS_OUT: "focusout",
    CHANGE: "change",
    SUBMIT: "submit",
    TRIGGER: "trigger",
    VALID: "valid"
  };
  const VALIDATION_MODE = {
    onBlur: "onBlur",
    onChange: "onChange",
    onSubmit: "onSubmit",
    onTouched: "onTouched",
    all: "all"
  };
  const INPUT_VALIDATION_RULES = {
    max: "max",
    min: "min",
    maxLength: "maxLength",
    minLength: "minLength",
    pattern: "pattern",
    required: "required",
    validate: "validate"
  };
  const FORM_ERROR_TYPE = "form";
  const ROOT_ERROR_TYPE = "root";
  const HookFormControlContext = React.createContext(null);
  HookFormControlContext.displayName = "HookFormControlContext";
  const useFormControlContext = /* @__PURE__ */ __name(() => React.useContext(HookFormControlContext), "useFormControlContext");
  var getProxyFormState = /* @__PURE__ */ __name((formState, control, localProxyFormState, isRoot = true) => {
    const result = {};
    for (const key in formState) {
      Object.defineProperty(result, key, {
        get: /* @__PURE__ */ __name(() => {
          const _key = key;
          if (control._proxyFormState[_key] !== VALIDATION_MODE.all) {
            control._proxyFormState[_key] = !isRoot || VALIDATION_MODE.all;
          }
          localProxyFormState && (localProxyFormState[_key] = true);
          return formState[_key];
        }, "get")
      });
    }
    return result;
  }, "getProxyFormState");
  const useIsomorphicLayoutEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
  function useFormState(props) {
    const formControl = useFormControlContext();
    const { control = formControl, disabled, name, exact } = props || {};
    const [formState, updateFormState] = React.useState(() => __spreadProps(__spreadValues({}, control._formState), {
      defaultValues: control._defaultValues
    }));
    const _localProxyFormState = React.useRef({
      isDirty: false,
      isLoading: false,
      dirtyFields: false,
      touchedFields: false,
      validatingFields: false,
      isValidating: false,
      isValid: false,
      errors: false
    });
    useIsomorphicLayoutEffect(() => control._subscribe({
      name,
      formState: _localProxyFormState.current,
      exact,
      callback: /* @__PURE__ */ __name((formState2) => {
        !disabled && updateFormState(__spreadProps(__spreadValues(__spreadValues({}, control._formState), formState2), {
          defaultValues: control._defaultValues
        }));
      }, "callback")
    }), [name, disabled, exact]);
    React.useEffect(() => {
      _localProxyFormState.current.isValid && control._setValid(true);
    }, [control]);
    return React.useMemo(() => getProxyFormState(formState, control, _localProxyFormState.current, false), [formState, control]);
  }
  __name(useFormState, "useFormState");
  var isString = /* @__PURE__ */ __name((value) => typeof value === "string", "isString");
  var generateWatchOutput = /* @__PURE__ */ __name((names, _names, formValues, isGlobal, defaultValue) => {
    if (isString(names)) {
      isGlobal && _names.watch.add(names);
      return get(formValues, names, defaultValue);
    }
    if (Array.isArray(names)) {
      return names.map((fieldName) => (isGlobal && _names.watch.add(fieldName), get(formValues, fieldName)));
    }
    isGlobal && (_names.watchAll = true);
    return formValues;
  }, "generateWatchOutput");
  var isPrimitive = /* @__PURE__ */ __name((value) => isNullOrUndefined(value) || !isObjectType(value), "isPrimitive");
  function deepEqual(object1, object2, visited = /* @__PURE__ */ new WeakSet()) {
    if (object1 === object2) {
      return true;
    }
    if (isPrimitive(object1) || isPrimitive(object2)) {
      return Object.is(object1, object2);
    }
    if (isDateObject(object1) && isDateObject(object2)) {
      return Object.is(object1.getTime(), object2.getTime());
    }
    const keys1 = Object.keys(object1);
    const keys2 = Object.keys(object2);
    if (keys1.length !== keys2.length) {
      return false;
    }
    if (visited.has(object1) || visited.has(object2)) {
      return true;
    }
    visited.add(object1);
    visited.add(object2);
    for (const key of keys1) {
      const val1 = object1[key];
      if (!(key in object2)) {
        return false;
      }
      if (key !== "ref") {
        const val2 = object2[key];
        if (isDateObject(val1) && isDateObject(val2) || (isObject$1(val1) || Array.isArray(val1)) && (isObject$1(val2) || Array.isArray(val2)) ? !deepEqual(val1, val2, visited) : !Object.is(val1, val2)) {
          return false;
        }
      }
    }
    return true;
  }
  __name(deepEqual, "deepEqual");
  function useWatch(props) {
    const formControl = useFormControlContext();
    const { control = formControl, name, defaultValue, disabled, exact, compute } = props || {};
    const _defaultValue = React.useRef(defaultValue);
    const _compute = React.useRef(compute);
    const _computeFormValues = React.useRef(void 0);
    const _prevControl = React.useRef(control);
    const _prevName = React.useRef(name);
    _compute.current = compute;
    const [value, updateValue] = React.useState(() => {
      const defaultValue2 = control._getWatch(name, _defaultValue.current);
      return _compute.current ? _compute.current(defaultValue2) : defaultValue2;
    });
    const getCurrentOutput = React.useCallback((values) => {
      const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
      return _compute.current ? _compute.current(formValues) : formValues;
    }, [control._formValues, control._names, name]);
    const refreshValue = React.useCallback((values) => {
      if (!disabled) {
        const formValues = generateWatchOutput(name, control._names, values || control._formValues, false, _defaultValue.current);
        if (_compute.current) {
          const computedFormValues = _compute.current(formValues);
          if (!deepEqual(computedFormValues, _computeFormValues.current)) {
            updateValue(computedFormValues);
            _computeFormValues.current = computedFormValues;
          }
        } else {
          updateValue(formValues);
        }
      }
    }, [control._formValues, control._names, disabled, name]);
    useIsomorphicLayoutEffect(() => {
      if (_prevControl.current !== control || !deepEqual(_prevName.current, name)) {
        _prevControl.current = control;
        _prevName.current = name;
        refreshValue();
      }
      return control._subscribe({
        name,
        formState: {
          values: true
        },
        exact,
        callback: /* @__PURE__ */ __name((formState) => {
          refreshValue(formState.values);
        }, "callback")
      });
    }, [control, exact, name, refreshValue]);
    React.useEffect(() => control._removeUnmounted());
    const controlChanged = _prevControl.current !== control;
    const prevName = _prevName.current;
    const computedOutput = React.useMemo(() => {
      if (disabled) {
        return null;
      }
      const nameChanged = !controlChanged && !deepEqual(prevName, name);
      const shouldReturnImmediate = controlChanged || nameChanged;
      return shouldReturnImmediate ? getCurrentOutput() : null;
    }, [disabled, controlChanged, name, prevName, getCurrentOutput]);
    return computedOutput !== null ? computedOutput : value;
  }
  __name(useWatch, "useWatch");
  function useController(props) {
    const formControl = useFormControlContext();
    const { name, disabled, control = formControl, shouldUnregister, defaultValue, exact = true } = props;
    const isArrayField = isNameInFieldArray(control._names.array, name);
    const defaultValueMemo = React.useMemo(() => get(control._formValues, name, get(control._defaultValues, name, defaultValue)), [control, name, defaultValue]);
    const value = useWatch({
      control,
      name,
      defaultValue: defaultValueMemo,
      exact
    });
    const formState = useFormState({
      control,
      name,
      exact
    });
    const _props = React.useRef(props);
    const _registerProps = React.useRef(control.register(name, __spreadValues(__spreadProps(__spreadValues({}, props.rules), {
      value
    }), isBoolean(props.disabled) ? { disabled: props.disabled } : {})));
    _props.current = props;
    const fieldState = React.useMemo(() => Object.defineProperties({}, {
      invalid: {
        enumerable: true,
        get: /* @__PURE__ */ __name(() => !!get(formState.errors, name), "get")
      },
      isDirty: {
        enumerable: true,
        get: /* @__PURE__ */ __name(() => !!get(formState.dirtyFields, name), "get")
      },
      isTouched: {
        enumerable: true,
        get: /* @__PURE__ */ __name(() => !!get(formState.touchedFields, name), "get")
      },
      isValidating: {
        enumerable: true,
        get: /* @__PURE__ */ __name(() => !!get(formState.validatingFields, name), "get")
      },
      error: {
        enumerable: true,
        get: /* @__PURE__ */ __name(() => get(formState.errors, name), "get")
      }
    }), [formState, name]);
    const onChange = React.useCallback((event) => _registerProps.current.onChange({
      target: {
        value: getEventValue(event),
        name
      },
      type: EVENTS.CHANGE
    }), [name]);
    const onBlur = React.useCallback(() => _registerProps.current.onBlur({
      target: {
        value: get(control._formValues, name),
        name
      },
      type: EVENTS.BLUR
    }), [name, control._formValues]);
    const ref = React.useCallback((elm) => {
      const field2 = get(control._fields, name);
      if (field2 && field2._f && elm) {
        field2._f.ref = {
          focus: /* @__PURE__ */ __name(() => isFunction$1(elm.focus) && elm.focus(), "focus"),
          select: /* @__PURE__ */ __name(() => isFunction$1(elm.select) && elm.select(), "select"),
          setCustomValidity: /* @__PURE__ */ __name((message) => isFunction$1(elm.setCustomValidity) && elm.setCustomValidity(message), "setCustomValidity"),
          reportValidity: /* @__PURE__ */ __name(() => isFunction$1(elm.reportValidity) && elm.reportValidity(), "reportValidity")
        };
      }
    }, [control._fields, name]);
    const field = React.useMemo(() => __spreadProps(__spreadValues({
      name,
      value
    }, isBoolean(disabled) || formState.disabled ? { disabled: formState.disabled || disabled } : {}), {
      onChange,
      onBlur,
      ref
    }), [name, disabled, formState.disabled, onChange, onBlur, ref, value]);
    React.useEffect(() => {
      const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
      control.register(name, __spreadValues(__spreadValues({}, _props.current.rules), isBoolean(_props.current.disabled) ? { disabled: _props.current.disabled } : {}));
      const updateMounted = /* @__PURE__ */ __name((name2, value2) => {
        const field2 = get(control._fields, name2);
        if (field2 && field2._f) {
          field2._f.mount = value2;
        }
      }, "updateMounted");
      updateMounted(name, true);
      if (_shouldUnregisterField) {
        const value2 = cloneObject(get(control._options.defaultValues, name, _props.current.defaultValue));
        set(control._defaultValues, name, value2);
        if (isUndefined(get(control._formValues, name))) {
          set(control._formValues, name, value2);
        }
      }
      !isArrayField && control.register(name);
      return () => {
        (isArrayField ? _shouldUnregisterField && !control._state.action : _shouldUnregisterField) ? control.unregister(name) : updateMounted(name, false);
      };
    }, [name, control, isArrayField, shouldUnregister]);
    React.useEffect(() => {
      control._setDisabledField({
        disabled,
        name
      });
    }, [disabled, name, control]);
    return React.useMemo(() => ({
      field,
      formState,
      fieldState
    }), [field, formState, fieldState]);
  }
  __name(useController, "useController");
  const Controller = /* @__PURE__ */ __name((props) => props.render(useController(props)), "Controller");
  const HookFormContext = React.createContext(null);
  HookFormContext.displayName = "HookFormContext";
  var appendErrors = /* @__PURE__ */ __name((name, validateAllFieldCriteria, errors, type, message) => validateAllFieldCriteria ? __spreadProps(__spreadValues({}, errors[name]), {
    types: __spreadProps(__spreadValues({}, errors[name] && errors[name].types ? errors[name].types : {}), {
      [type]: message || true
    })
  }) : {}, "appendErrors");
  var convertToArrayPayload = /* @__PURE__ */ __name((value) => Array.isArray(value) ? value : [value], "convertToArrayPayload");
  var createSubject = /* @__PURE__ */ __name(() => {
    let _observers = [];
    const next = /* @__PURE__ */ __name((value) => {
      for (const observer of _observers) {
        observer.next && observer.next(value);
      }
    }, "next");
    const subscribe2 = /* @__PURE__ */ __name((observer) => {
      _observers.push(observer);
      return {
        unsubscribe: /* @__PURE__ */ __name(() => {
          _observers = _observers.filter((o2) => o2 !== observer);
        }, "unsubscribe")
      };
    }, "subscribe");
    const unsubscribe = /* @__PURE__ */ __name(() => {
      _observers = [];
    }, "unsubscribe");
    return {
      get observers() {
        return _observers;
      },
      next,
      subscribe: subscribe2,
      unsubscribe
    };
  }, "createSubject");
  function extractFormValues(fieldsState, formValues) {
    const values = {};
    for (const key in fieldsState) {
      if (fieldsState.hasOwnProperty(key)) {
        const fieldState = fieldsState[key];
        const fieldValue = formValues[key];
        if (fieldState && isObject$1(fieldState) && fieldValue) {
          const nestedFieldsState = extractFormValues(fieldState, fieldValue);
          if (isObject$1(nestedFieldsState)) {
            values[key] = nestedFieldsState;
          }
        } else if (fieldsState[key]) {
          values[key] = fieldValue;
        }
      }
    }
    return values;
  }
  __name(extractFormValues, "extractFormValues");
  var isEmptyObject = /* @__PURE__ */ __name((value) => isObject$1(value) && !Object.keys(value).length, "isEmptyObject");
  var isFileInput = /* @__PURE__ */ __name((element) => element.type === "file", "isFileInput");
  var isHTMLElement = /* @__PURE__ */ __name((value) => {
    if (!isWeb) {
      return false;
    }
    const owner = value ? value.ownerDocument : 0;
    return value instanceof (owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement);
  }, "isHTMLElement");
  var isMultipleSelect = /* @__PURE__ */ __name((element) => element.type === `select-multiple`, "isMultipleSelect");
  var isRadioInput = /* @__PURE__ */ __name((element) => element.type === "radio", "isRadioInput");
  var isRadioOrCheckbox = /* @__PURE__ */ __name((ref) => isRadioInput(ref) || isCheckBoxInput(ref), "isRadioOrCheckbox");
  var live = /* @__PURE__ */ __name((ref) => isHTMLElement(ref) && ref.isConnected, "live");
  function baseGet(object2, updatePath) {
    const length = updatePath.slice(0, -1).length;
    let index2 = 0;
    while (index2 < length) {
      if (isNullOrUndefined(object2)) {
        object2 = void 0;
        break;
      }
      object2 = object2[updatePath[index2]];
      index2++;
    }
    return object2;
  }
  __name(baseGet, "baseGet");
  function isEmptyArray(obj) {
    for (const key in obj) {
      if (obj.hasOwnProperty(key) && !isUndefined(obj[key])) {
        return false;
      }
    }
    return true;
  }
  __name(isEmptyArray, "isEmptyArray");
  function unset(object2, path) {
    if (isString(path) && Object.prototype.hasOwnProperty.call(object2, path)) {
      delete object2[path];
      return object2;
    }
    const paths = Array.isArray(path) ? path : isKey(path) ? [path] : stringToPath(path);
    const childObject = paths.length === 1 ? object2 : baseGet(object2, paths);
    const index2 = paths.length - 1;
    const key = paths[index2];
    if (childObject) {
      delete childObject[key];
    }
    if (index2 !== 0 && (isObject$1(childObject) && isEmptyObject(childObject) || Array.isArray(childObject) && isEmptyArray(childObject))) {
      unset(object2, paths.slice(0, -1));
    }
    return object2;
  }
  __name(unset, "unset");
  var objectHasFunction = /* @__PURE__ */ __name((data) => {
    for (const key in data) {
      if (isFunction$1(data[key])) {
        return true;
      }
    }
    return false;
  }, "objectHasFunction");
  function isTraversable(value) {
    return Array.isArray(value) || isObject$1(value) && !objectHasFunction(value);
  }
  __name(isTraversable, "isTraversable");
  function markFieldsDirty(data, fields = {}) {
    for (const key in data) {
      const value = data[key];
      if (isTraversable(value)) {
        fields[key] = Array.isArray(value) ? [] : {};
        markFieldsDirty(value, fields[key]);
      } else if (!isUndefined(value)) {
        fields[key] = true;
      }
    }
    return fields;
  }
  __name(markFieldsDirty, "markFieldsDirty");
  function pruneDirtyFields(value) {
    if (value === false) {
      return void 0;
    }
    if (value === true) {
      return true;
    }
    if (Array.isArray(value)) {
      const result = value.map((value2) => pruneDirtyFields(value2));
      return result.some((value2) => value2 !== void 0) ? result : void 0;
    }
    if (isObject$1(value)) {
      const result = {};
      for (const key in value) {
        const pruned = pruneDirtyFields(value[key]);
        if (!isUndefined(pruned)) {
          result[key] = pruned;
        }
      }
      return Object.keys(result).length ? result : void 0;
    }
    return void 0;
  }
  __name(pruneDirtyFields, "pruneDirtyFields");
  function getDirtyFields(data, formValues, dirtyFieldsFromValues) {
    if (!dirtyFieldsFromValues) {
      dirtyFieldsFromValues = markFieldsDirty(formValues);
    }
    for (const key in data) {
      const value = data[key];
      if (isTraversable(value)) {
        if (isUndefined(formValues) || isPrimitive(dirtyFieldsFromValues[key])) {
          dirtyFieldsFromValues[key] = markFieldsDirty(value, Array.isArray(value) ? [] : {});
        } else {
          getDirtyFields(value, isNullOrUndefined(formValues) ? {} : formValues[key], dirtyFieldsFromValues[key]);
        }
      } else {
        const formValue = formValues[key];
        dirtyFieldsFromValues[key] = !deepEqual(value, formValue);
      }
    }
    return pruneDirtyFields(dirtyFieldsFromValues) || {};
  }
  __name(getDirtyFields, "getDirtyFields");
  const defaultResult = {
    value: false,
    isValid: false
  };
  const validResult = { value: true, isValid: true };
  var getCheckboxValue = /* @__PURE__ */ __name((options2) => {
    if (Array.isArray(options2)) {
      if (options2.length > 1) {
        const values = options2.filter((option) => option && option.checked && !option.disabled).map((option) => option.value);
        return { value: values, isValid: !!values.length };
      }
      return options2[0].checked && !options2[0].disabled ? (
        // @ts-expect-error expected to work in the browser
        options2[0].attributes && !isUndefined(options2[0].attributes.value) ? isUndefined(options2[0].value) || options2[0].value === "" ? validResult : { value: options2[0].value, isValid: true } : validResult
      ) : defaultResult;
    }
    return defaultResult;
  }, "getCheckboxValue");
  var getFieldValueAs = /* @__PURE__ */ __name((value, { valueAsNumber, valueAsDate, setValueAs }) => isUndefined(value) ? value : valueAsNumber ? value === "" ? NaN : value ? +value : value : valueAsDate && isString(value) ? new Date(value) : setValueAs ? setValueAs(value) : value, "getFieldValueAs");
  const defaultReturn = {
    isValid: false,
    value: null
  };
  var getRadioValue = /* @__PURE__ */ __name((options2) => Array.isArray(options2) ? options2.reduce((previous, option) => option && option.checked && !option.disabled ? {
    isValid: true,
    value: option.value
  } : previous, defaultReturn) : defaultReturn, "getRadioValue");
  function getFieldValue(_f) {
    const ref = _f.ref;
    if (isFileInput(ref)) {
      return ref.files;
    }
    if (isRadioInput(ref)) {
      return getRadioValue(_f.refs).value;
    }
    if (isMultipleSelect(ref)) {
      return [...ref.selectedOptions].map(({ value }) => value);
    }
    if (isCheckBoxInput(ref)) {
      return getCheckboxValue(_f.refs).value;
    }
    return getFieldValueAs(isUndefined(ref.value) ? _f.ref.value : ref.value, _f);
  }
  __name(getFieldValue, "getFieldValue");
  var getResolverOptions = /* @__PURE__ */ __name((fieldsNames, _fields, criteriaMode, shouldUseNativeValidation) => {
    const fields = {};
    for (const name of fieldsNames) {
      const field = get(_fields, name);
      field && set(fields, name, field._f);
    }
    return {
      criteriaMode,
      names: [...fieldsNames],
      fields,
      shouldUseNativeValidation
    };
  }, "getResolverOptions");
  var isRegex = /* @__PURE__ */ __name((value) => value instanceof RegExp, "isRegex");
  var getRuleValue = /* @__PURE__ */ __name((rule) => isUndefined(rule) ? rule : isRegex(rule) ? rule.source : isObject$1(rule) ? isRegex(rule.value) ? rule.value.source : rule.value : rule, "getRuleValue");
  var getValidationModes = /* @__PURE__ */ __name((mode) => ({
    isOnSubmit: !mode || mode === VALIDATION_MODE.onSubmit,
    isOnBlur: mode === VALIDATION_MODE.onBlur,
    isOnChange: mode === VALIDATION_MODE.onChange,
    isOnAll: mode === VALIDATION_MODE.all,
    isOnTouch: mode === VALIDATION_MODE.onTouched
  }), "getValidationModes");
  const ASYNC_FUNCTION = "AsyncFunction";
  var hasPromiseValidation = /* @__PURE__ */ __name((fieldReference) => !!fieldReference && !!fieldReference.validate && !!(isFunction$1(fieldReference.validate) && fieldReference.validate.constructor.name === ASYNC_FUNCTION || isObject$1(fieldReference.validate) && Object.values(fieldReference.validate).find((validateFunction) => validateFunction.constructor.name === ASYNC_FUNCTION)), "hasPromiseValidation");
  var hasValidation = /* @__PURE__ */ __name((options2) => options2.mount && (options2.required || options2.min || options2.max || options2.maxLength || options2.minLength || options2.pattern || options2.validate), "hasValidation");
  var isWatched = /* @__PURE__ */ __name((name, _names, isBlurEvent) => !isBlurEvent && (_names.watchAll || _names.watch.has(name) || [..._names.watch].some((watchName) => name.startsWith(watchName) && /^\.\w+/.test(name.slice(watchName.length)))), "isWatched");
  const iterateFieldsByAction = /* @__PURE__ */ __name((fields, action, fieldsNames, abortEarly) => {
    for (const key of fieldsNames || Object.keys(fields)) {
      const field = get(fields, key);
      if (field) {
        const _a2 = field, { _f } = _a2, currentField = __objRest(_a2, ["_f"]);
        if (_f) {
          if (_f.refs && _f.refs[0] && action(_f.refs[0], key) && !abortEarly) {
            return true;
          } else if (_f.ref && action(_f.ref, _f.name) && !abortEarly) {
            return true;
          } else {
            if (iterateFieldsByAction(currentField, action)) {
              break;
            }
          }
        } else if (isObject$1(currentField)) {
          if (iterateFieldsByAction(currentField, action)) {
            break;
          }
        }
      }
    }
    return;
  }, "iterateFieldsByAction");
  function schemaErrorLookup(errors, _fields, name) {
    const error = get(errors, name);
    if (error || isKey(name)) {
      return {
        error,
        name
      };
    }
    const names = name.split(".");
    while (names.length) {
      const fieldName = names.join(".");
      const field = get(_fields, fieldName);
      const foundError = get(errors, fieldName);
      if (field && !Array.isArray(field) && name !== fieldName) {
        return { name };
      }
      if (foundError && foundError.type) {
        return {
          name: fieldName,
          error: foundError
        };
      }
      if (foundError && foundError.root && foundError.root.type) {
        return {
          name: `${fieldName}.root`,
          error: foundError.root
        };
      }
      names.pop();
    }
    return {
      name
    };
  }
  __name(schemaErrorLookup, "schemaErrorLookup");
  var shouldRenderFormState = /* @__PURE__ */ __name((formStateData, _proxyFormState, updateFormState, isRoot) => {
    updateFormState(formStateData);
    const _a2 = formStateData, { name } = _a2, formState = __objRest(_a2, ["name"]);
    return isEmptyObject(formState) || isRoot && Object.keys(formState).length >= Object.keys(_proxyFormState).length || Object.keys(formState).find((key) => _proxyFormState[key] === (!isRoot || VALIDATION_MODE.all));
  }, "shouldRenderFormState");
  var shouldSubscribeByName = /* @__PURE__ */ __name((name, signalName, exact) => !name || !signalName || name === signalName || convertToArrayPayload(name).some((currentName) => currentName && (exact ? currentName === signalName : currentName.startsWith(signalName) || signalName.startsWith(currentName))), "shouldSubscribeByName");
  var skipValidation = /* @__PURE__ */ __name((isBlurEvent, isTouched, isSubmitted, reValidateMode, mode) => {
    if (mode.isOnAll) {
      return false;
    } else if (!isSubmitted && mode.isOnTouch) {
      return !(isTouched || isBlurEvent);
    } else if (isSubmitted ? reValidateMode.isOnBlur : mode.isOnBlur) {
      return !isBlurEvent;
    } else if (isSubmitted ? reValidateMode.isOnChange : mode.isOnChange) {
      return isBlurEvent;
    }
    return true;
  }, "skipValidation");
  var unsetEmptyArray = /* @__PURE__ */ __name((ref, name) => !compact(get(ref, name)).length && unset(ref, name), "unsetEmptyArray");
  var updateFieldArrayRootError = /* @__PURE__ */ __name((errors, error, name) => {
    const fieldArrayErrors = convertToArrayPayload(get(errors, name));
    set(fieldArrayErrors, ROOT_ERROR_TYPE, error[name]);
    set(errors, name, fieldArrayErrors);
    return errors;
  }, "updateFieldArrayRootError");
  function getValidateError(result, ref, type = "validate") {
    if (isString(result) || Array.isArray(result) && result.every(isString) || isBoolean(result) && !result) {
      return {
        type,
        message: isString(result) ? result : "",
        ref
      };
    }
  }
  __name(getValidateError, "getValidateError");
  var getValueAndMessage = /* @__PURE__ */ __name((validationData) => isObject$1(validationData) && !isRegex(validationData) ? validationData : {
    value: validationData,
    message: ""
  }, "getValueAndMessage");
  var validateField = /* @__PURE__ */ __name((field, disabledFieldNames, formValues, validateAllFieldCriteria, shouldUseNativeValidation, isFieldArray) => __async(null, null, function* () {
    const { ref, refs, required, maxLength, minLength, min: min2, max: max2, pattern, validate, name, valueAsNumber, mount } = field._f;
    const inputValue = get(formValues, name);
    if (!mount || disabledFieldNames.has(name)) {
      return {};
    }
    const inputRef = refs ? refs[0] : ref;
    const setCustomValidity = /* @__PURE__ */ __name((message) => {
      if (shouldUseNativeValidation && inputRef.reportValidity) {
        inputRef.setCustomValidity(isBoolean(message) ? "" : message || "");
        inputRef.reportValidity();
      }
    }, "setCustomValidity");
    const error = {};
    const isRadio = isRadioInput(ref);
    const isCheckBox = isCheckBoxInput(ref);
    const isRadioOrCheckbox2 = isRadio || isCheckBox;
    const isEmpty = (valueAsNumber || isFileInput(ref)) && isUndefined(ref.value) && isUndefined(inputValue) || isHTMLElement(ref) && ref.value === "" || inputValue === "" || Array.isArray(inputValue) && !inputValue.length || valueAsNumber && typeof inputValue === "number" && isNaN(inputValue);
    const appendErrorsCurry = appendErrors.bind(null, name, validateAllFieldCriteria, error);
    const getMinMaxMessage = /* @__PURE__ */ __name((exceedMax, maxLengthMessage, minLengthMessage, maxType = INPUT_VALIDATION_RULES.maxLength, minType = INPUT_VALIDATION_RULES.minLength) => {
      const message = exceedMax ? maxLengthMessage : minLengthMessage;
      error[name] = __spreadValues({
        type: exceedMax ? maxType : minType,
        message,
        ref
      }, appendErrorsCurry(exceedMax ? maxType : minType, message));
    }, "getMinMaxMessage");
    if (isFieldArray ? !Array.isArray(inputValue) || !inputValue.length : required && (!isRadioOrCheckbox2 && (isEmpty || isNullOrUndefined(inputValue)) || isBoolean(inputValue) && !inputValue || isCheckBox && !getCheckboxValue(refs).isValid || isRadio && !getRadioValue(refs).isValid)) {
      const { value, message } = isString(required) ? { value: !!required, message: required } : getValueAndMessage(required);
      if (value) {
        error[name] = __spreadValues({
          type: INPUT_VALIDATION_RULES.required,
          message,
          ref: inputRef
        }, appendErrorsCurry(INPUT_VALIDATION_RULES.required, message));
        if (!validateAllFieldCriteria) {
          setCustomValidity(message);
          return error;
        }
      }
    }
    if (!isEmpty && (!isNullOrUndefined(min2) || !isNullOrUndefined(max2))) {
      let exceedMax;
      let exceedMin;
      const maxOutput = getValueAndMessage(max2);
      const minOutput = getValueAndMessage(min2);
      if (!isNullOrUndefined(inputValue) && !isNaN(inputValue)) {
        const valueNumber = ref.valueAsNumber || (inputValue ? +inputValue : inputValue);
        if (!isNullOrUndefined(maxOutput.value)) {
          exceedMax = valueNumber > maxOutput.value;
        }
        if (!isNullOrUndefined(minOutput.value)) {
          exceedMin = valueNumber < minOutput.value;
        }
      } else {
        const valueDate = ref.valueAsDate || new Date(inputValue);
        const convertTimeToDate = /* @__PURE__ */ __name((time2) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + time2), "convertTimeToDate");
        const isTime = ref.type == "time";
        const isWeek = ref.type == "week";
        if (isString(maxOutput.value) && inputValue) {
          exceedMax = isTime ? convertTimeToDate(inputValue) > convertTimeToDate(maxOutput.value) : isWeek ? inputValue > maxOutput.value : valueDate > new Date(maxOutput.value);
        }
        if (isString(minOutput.value) && inputValue) {
          exceedMin = isTime ? convertTimeToDate(inputValue) < convertTimeToDate(minOutput.value) : isWeek ? inputValue < minOutput.value : valueDate < new Date(minOutput.value);
        }
      }
      if (exceedMax || exceedMin) {
        getMinMaxMessage(!!exceedMax, maxOutput.message, minOutput.message, INPUT_VALIDATION_RULES.max, INPUT_VALIDATION_RULES.min);
        if (!validateAllFieldCriteria) {
          setCustomValidity(error[name].message);
          return error;
        }
      }
    }
    if ((maxLength || minLength) && !isEmpty && (isString(inputValue) || isFieldArray && Array.isArray(inputValue))) {
      const maxLengthOutput = getValueAndMessage(maxLength);
      const minLengthOutput = getValueAndMessage(minLength);
      const exceedMax = !isNullOrUndefined(maxLengthOutput.value) && inputValue.length > +maxLengthOutput.value;
      const exceedMin = !isNullOrUndefined(minLengthOutput.value) && inputValue.length < +minLengthOutput.value;
      if (exceedMax || exceedMin) {
        getMinMaxMessage(exceedMax, maxLengthOutput.message, minLengthOutput.message);
        if (!validateAllFieldCriteria) {
          setCustomValidity(error[name].message);
          return error;
        }
      }
    }
    if (pattern && !isEmpty && isString(inputValue)) {
      const { value: patternValue, message } = getValueAndMessage(pattern);
      if (isRegex(patternValue) && !inputValue.match(patternValue)) {
        error[name] = __spreadValues({
          type: INPUT_VALIDATION_RULES.pattern,
          message,
          ref
        }, appendErrorsCurry(INPUT_VALIDATION_RULES.pattern, message));
        if (!validateAllFieldCriteria) {
          setCustomValidity(message);
          return error;
        }
      }
    }
    if (validate) {
      if (isFunction$1(validate)) {
        const result = yield validate(inputValue, formValues);
        const validateError = getValidateError(result, inputRef);
        if (validateError) {
          error[name] = __spreadValues(__spreadValues({}, validateError), appendErrorsCurry(INPUT_VALIDATION_RULES.validate, validateError.message));
          if (!validateAllFieldCriteria) {
            setCustomValidity(validateError.message);
            return error;
          }
        }
      } else if (isObject$1(validate)) {
        let validationResult = {};
        for (const key in validate) {
          if (!isEmptyObject(validationResult) && !validateAllFieldCriteria) {
            break;
          }
          const validateError = getValidateError(yield validate[key](inputValue, formValues), inputRef, key);
          if (validateError) {
            validationResult = __spreadValues(__spreadValues({}, validateError), appendErrorsCurry(key, validateError.message));
            setCustomValidity(validateError.message);
            if (validateAllFieldCriteria) {
              error[name] = validationResult;
            }
          }
        }
        if (!isEmptyObject(validationResult)) {
          error[name] = __spreadValues({
            ref: inputRef
          }, validationResult);
          if (!validateAllFieldCriteria) {
            return error;
          }
        }
      }
    }
    setCustomValidity(true);
    return error;
  }), "validateField");
  const defaultOptions = {
    mode: VALIDATION_MODE.onSubmit,
    reValidateMode: VALIDATION_MODE.onChange,
    shouldFocusError: true
  };
  const DEFAULT_FORM_STATE = {
    submitCount: 0,
    isDirty: false,
    isReady: false,
    isValidating: false,
    isSubmitted: false,
    isSubmitting: false,
    isSubmitSuccessful: false,
    isValid: false,
    touchedFields: {},
    dirtyFields: {},
    validatingFields: {}
  };
  function createFormControl(props = {}) {
    let _options = __spreadValues(__spreadValues({}, defaultOptions), props);
    let _formState = __spreadProps(__spreadValues({}, cloneObject(DEFAULT_FORM_STATE)), {
      isLoading: isFunction$1(_options.defaultValues),
      errors: _options.errors || {},
      disabled: _options.disabled || false
    });
    let _fields = {};
    let _defaultValues = isObject$1(_options.defaultValues) || isObject$1(_options.values) ? cloneObject(_options.defaultValues || _options.values) || {} : {};
    let _formValues = _options.shouldUnregister ? {} : cloneObject(_defaultValues);
    let _state = {
      action: false,
      mount: false,
      watch: false,
      keepIsValid: false
    };
    let _names = {
      mount: /* @__PURE__ */ new Set(),
      disabled: /* @__PURE__ */ new Set(),
      unMount: /* @__PURE__ */ new Set(),
      array: /* @__PURE__ */ new Set(),
      watch: /* @__PURE__ */ new Set(),
      registerName: /* @__PURE__ */ new Set()
    };
    let delayErrorCallback;
    let timer = 0;
    const defaultProxyFormState = {
      isDirty: false,
      dirtyFields: false,
      validatingFields: false,
      touchedFields: false,
      isValidating: false,
      isValid: false,
      errors: false
    };
    const _proxyFormState = __spreadValues({}, defaultProxyFormState);
    let _proxySubscribeFormState = __spreadValues({}, _proxyFormState);
    const _subjects = {
      array: createSubject(),
      state: createSubject()
    };
    const shouldDisplayAllAssociatedErrors = _options.criteriaMode === VALIDATION_MODE.all;
    const debounce = /* @__PURE__ */ __name((callback) => (wait) => {
      clearTimeout(timer);
      timer = setTimeout(callback, wait);
    }, "debounce");
    const _setValid = /* @__PURE__ */ __name((shouldUpdateValid) => __async(null, null, function* () {
      if (_state.keepIsValid) {
        return;
      }
      if (!_options.disabled && (_proxyFormState.isValid || _proxySubscribeFormState.isValid || shouldUpdateValid)) {
        let isValid2;
        if (_options.resolver) {
          isValid2 = isEmptyObject((yield _runSchema()).errors);
          _updateIsValidating();
        } else {
          isValid2 = yield executeBuiltInValidation({
            fields: _fields,
            onlyCheckValid: true,
            eventType: EVENTS.VALID
          });
        }
        if (isValid2 !== _formState.isValid) {
          _subjects.state.next({
            isValid: isValid2
          });
        }
      }
    }), "_setValid");
    const _updateIsValidating = /* @__PURE__ */ __name((names, isValidating) => {
      if (!_options.disabled && (_proxyFormState.isValidating || _proxyFormState.validatingFields || _proxySubscribeFormState.isValidating || _proxySubscribeFormState.validatingFields)) {
        (names || Array.from(_names.mount)).forEach((name) => {
          if (name) {
            isValidating ? set(_formState.validatingFields, name, isValidating) : unset(_formState.validatingFields, name);
          }
        });
        _subjects.state.next({
          validatingFields: _formState.validatingFields,
          isValidating: !isEmptyObject(_formState.validatingFields)
        });
      }
    }, "_updateIsValidating");
    const _updateDirtyFields = /* @__PURE__ */ __name(() => {
      _formState.dirtyFields = getDirtyFields(_defaultValues, _formValues);
    }, "_updateDirtyFields");
    const _setFieldArray = /* @__PURE__ */ __name((name, values = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => {
      if (args && method && !_options.disabled) {
        _state.action = true;
        if (shouldUpdateFieldsAndState && Array.isArray(get(_fields, name))) {
          const fieldValues = method(get(_fields, name), args.argA, args.argB);
          shouldSetValues && set(_fields, name, fieldValues);
        }
        if (shouldUpdateFieldsAndState && Array.isArray(get(_formState.errors, name))) {
          const errors = method(get(_formState.errors, name), args.argA, args.argB);
          shouldSetValues && set(_formState.errors, name, errors);
          unsetEmptyArray(_formState.errors, name);
        }
        if ((_proxyFormState.touchedFields || _proxySubscribeFormState.touchedFields) && shouldUpdateFieldsAndState && Array.isArray(get(_formState.touchedFields, name))) {
          const touchedFields = method(get(_formState.touchedFields, name), args.argA, args.argB);
          shouldSetValues && set(_formState.touchedFields, name, touchedFields);
        }
        if (_proxyFormState.dirtyFields || _proxySubscribeFormState.dirtyFields) {
          _updateDirtyFields();
        }
        _subjects.state.next({
          name,
          isDirty: _getDirty(name, values),
          dirtyFields: _formState.dirtyFields,
          errors: _formState.errors,
          isValid: _formState.isValid
        });
      } else {
        set(_formValues, name, values);
      }
    }, "_setFieldArray");
    const updateErrors = /* @__PURE__ */ __name((name, error) => {
      set(_formState.errors, name, error);
      _subjects.state.next({
        errors: _formState.errors
      });
    }, "updateErrors");
    const _setErrors = /* @__PURE__ */ __name((errors) => {
      _formState.errors = errors;
      _subjects.state.next({
        errors: _formState.errors,
        isValid: false
      });
    }, "_setErrors");
    const updateValidAndValue = /* @__PURE__ */ __name((name, shouldSkipSetValueAs, value, ref) => {
      const field = get(_fields, name);
      if (field) {
        const wasUnsetInFormValues = isUndefined(get(_formValues, name));
        const defaultValue = get(_formValues, name, isUndefined(value) ? get(_defaultValues, name) : value);
        isUndefined(defaultValue) || ref && ref.defaultChecked || shouldSkipSetValueAs ? set(_formValues, name, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f)) : setFieldValue(name, defaultValue);
        if (_state.mount && !_state.action) {
          _setValid();
          if (wasUnsetInFormValues && _formState.isDirty && (_proxyFormState.isDirty || _proxySubscribeFormState.isDirty)) {
            const isDirty2 = _getDirty();
            if (!isDirty2) {
              _formState.isDirty = false;
              _subjects.state.next(__spreadValues({}, _formState));
            }
          }
        }
      }
    }, "updateValidAndValue");
    const updateTouchAndDirty = /* @__PURE__ */ __name((name, fieldValue, isBlurEvent, shouldDirty, shouldRender) => {
      let shouldUpdateField = false;
      let isPreviousDirty = false;
      const output = {
        name
      };
      if (!_options.disabled) {
        if (!isBlurEvent || shouldDirty) {
          if (_proxyFormState.isDirty || _proxySubscribeFormState.isDirty) {
            isPreviousDirty = _formState.isDirty;
            _formState.isDirty = output.isDirty = _getDirty();
            shouldUpdateField = isPreviousDirty !== output.isDirty;
          }
          const isCurrentFieldPristine = deepEqual(get(_defaultValues, name), fieldValue);
          isPreviousDirty = !!get(_formState.dirtyFields, name);
          isCurrentFieldPristine ? unset(_formState.dirtyFields, name) : set(_formState.dirtyFields, name, true);
          output.dirtyFields = _formState.dirtyFields;
          shouldUpdateField = shouldUpdateField || (_proxyFormState.dirtyFields || _proxySubscribeFormState.dirtyFields) && isPreviousDirty !== !isCurrentFieldPristine;
        }
        if (isBlurEvent) {
          const isPreviousFieldTouched = get(_formState.touchedFields, name);
          if (!isPreviousFieldTouched) {
            set(_formState.touchedFields, name, isBlurEvent);
            output.touchedFields = _formState.touchedFields;
            shouldUpdateField = shouldUpdateField || (_proxyFormState.touchedFields || _proxySubscribeFormState.touchedFields) && isPreviousFieldTouched !== isBlurEvent;
          }
        }
        shouldUpdateField && shouldRender && _subjects.state.next(output);
      }
      return shouldUpdateField ? output : {};
    }, "updateTouchAndDirty");
    const shouldRenderByError = /* @__PURE__ */ __name((name, isValid2, error, fieldState) => {
      const previousFieldError = get(_formState.errors, name);
      const shouldUpdateValid = (_proxyFormState.isValid || _proxySubscribeFormState.isValid) && isBoolean(isValid2) && _formState.isValid !== isValid2;
      if (_options.delayError && error) {
        delayErrorCallback = debounce(() => updateErrors(name, error));
        delayErrorCallback(_options.delayError);
      } else {
        clearTimeout(timer);
        delayErrorCallback = null;
        error ? set(_formState.errors, name, error) : unset(_formState.errors, name);
      }
      if ((error ? !deepEqual(previousFieldError, error) : previousFieldError) || !isEmptyObject(fieldState) || shouldUpdateValid) {
        const updatedFormState = __spreadProps(__spreadValues(__spreadValues({}, fieldState), shouldUpdateValid && isBoolean(isValid2) ? { isValid: isValid2 } : {}), {
          errors: _formState.errors,
          name
        });
        _formState = __spreadValues(__spreadValues({}, _formState), updatedFormState);
        _subjects.state.next(updatedFormState);
      }
    }, "shouldRenderByError");
    const _runSchema = /* @__PURE__ */ __name((name) => __async(null, null, function* () {
      _updateIsValidating(name, true);
      return yield _options.resolver(_formValues, _options.context, getResolverOptions(name || _names.mount, _fields, _options.criteriaMode, _options.shouldUseNativeValidation));
    }), "_runSchema");
    const executeSchemaAndUpdateState = /* @__PURE__ */ __name((names) => __async(null, null, function* () {
      const { errors } = yield _runSchema(names);
      _updateIsValidating(names);
      if (names) {
        for (const name of names) {
          const error = get(errors, name);
          error ? set(_formState.errors, name, error) : unset(_formState.errors, name);
        }
      } else {
        _formState.errors = errors;
      }
      return errors;
    }), "executeSchemaAndUpdateState");
    const validateForm = /* @__PURE__ */ __name((_0) => __async(null, [_0], function* ({ name, eventType }) {
      if (props.validate) {
        const result = yield props.validate({
          formValues: _formValues,
          formState: _formState,
          name,
          eventType
        });
        if (isObject$1(result)) {
          for (const key in result) {
            const error = result[key];
            if (error) {
              setError(`${FORM_ERROR_TYPE}.${key}`, {
                message: isString(result.message) ? result.message : "",
                type: INPUT_VALIDATION_RULES.validate
              });
            }
          }
        } else if (isString(result) || !result) {
          setError(FORM_ERROR_TYPE, {
            message: result || "",
            type: INPUT_VALIDATION_RULES.validate
          });
        } else {
          clearErrors(FORM_ERROR_TYPE);
        }
        return result;
      }
      return true;
    }), "validateForm");
    const executeBuiltInValidation = /* @__PURE__ */ __name((_0) => __async(null, [_0], function* ({ fields, onlyCheckValid, name, eventType, context = {
      valid: true,
      runRootValidation: false
    } }) {
      if (props.validate) {
        context.runRootValidation = true;
        const result = yield validateForm({
          name,
          eventType
        });
        if (!result) {
          context.valid = false;
          if (onlyCheckValid) {
            return context.valid;
          }
        }
      }
      for (const name2 in fields) {
        const field = fields[name2];
        if (field) {
          const _a2 = field, { _f } = _a2, fieldValue = __objRest(_a2, ["_f"]);
          if (_f) {
            const isFieldArrayRoot = _names.array.has(_f.name);
            const isPromiseFunction = field._f && hasPromiseValidation(field._f);
            if (isPromiseFunction && _proxyFormState.validatingFields) {
              _updateIsValidating([_f.name], true);
            }
            const fieldError = yield validateField(field, _names.disabled, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation && !onlyCheckValid, isFieldArrayRoot);
            if (isPromiseFunction && _proxyFormState.validatingFields) {
              _updateIsValidating([_f.name]);
            }
            if (fieldError[_f.name]) {
              context.valid = false;
              if (onlyCheckValid) {
                break;
              }
            }
            !onlyCheckValid && (get(fieldError, _f.name) ? isFieldArrayRoot ? updateFieldArrayRootError(_formState.errors, fieldError, _f.name) : set(_formState.errors, _f.name, fieldError[_f.name]) : unset(_formState.errors, _f.name));
            if (props.shouldUseNativeValidation && fieldError[_f.name]) {
              break;
            }
          }
          !isEmptyObject(fieldValue) && (yield executeBuiltInValidation({
            context,
            onlyCheckValid,
            fields: fieldValue,
            name: name2,
            eventType
          }));
        }
      }
      return context.valid;
    }), "executeBuiltInValidation");
    const _removeUnmounted = /* @__PURE__ */ __name(() => {
      for (const name of _names.unMount) {
        const field = get(_fields, name);
        field && (field._f.refs ? field._f.refs.every((ref) => !live(ref)) : !live(field._f.ref)) && unregister(name);
      }
      _names.unMount = /* @__PURE__ */ new Set();
    }, "_removeUnmounted");
    const _getDirty = /* @__PURE__ */ __name((name, data) => !_options.disabled && (name && data && set(_formValues, name, data), !deepEqual(getValues(), _defaultValues)), "_getDirty");
    const _getWatch = /* @__PURE__ */ __name((names, defaultValue, isGlobal) => generateWatchOutput(names, _names, __spreadValues({}, _state.mount ? _formValues : isUndefined(defaultValue) ? _defaultValues : isString(names) ? { [names]: defaultValue } : defaultValue), isGlobal, defaultValue), "_getWatch");
    const _getFieldArray = /* @__PURE__ */ __name((name) => compact(get(_state.mount ? _formValues : _defaultValues, name, _options.shouldUnregister ? get(_defaultValues, name, []) : [])), "_getFieldArray");
    const setFieldValue = /* @__PURE__ */ __name((name, value, options2 = {}) => {
      const field = get(_fields, name);
      let fieldValue = value;
      if (field) {
        const fieldReference = field._f;
        if (fieldReference) {
          !fieldReference.disabled && set(_formValues, name, getFieldValueAs(value, fieldReference));
          fieldValue = isHTMLElement(fieldReference.ref) && isNullOrUndefined(value) ? "" : value;
          if (isMultipleSelect(fieldReference.ref)) {
            [...fieldReference.ref.options].forEach((optionRef) => optionRef.selected = fieldValue.includes(optionRef.value));
          } else if (fieldReference.refs) {
            if (isCheckBoxInput(fieldReference.ref)) {
              fieldReference.refs.forEach((checkboxRef) => {
                if (!checkboxRef.defaultChecked || !checkboxRef.disabled) {
                  if (Array.isArray(fieldValue)) {
                    checkboxRef.checked = !!fieldValue.find((data) => data === checkboxRef.value);
                  } else {
                    checkboxRef.checked = fieldValue === checkboxRef.value || !!fieldValue;
                  }
                }
              });
            } else {
              fieldReference.refs.forEach((radioRef) => radioRef.checked = radioRef.value === fieldValue);
            }
          } else if (isFileInput(fieldReference.ref)) {
            fieldReference.ref.value = "";
          } else {
            fieldReference.ref.value = fieldValue;
            if (!fieldReference.ref.type) {
              _subjects.state.next({
                name,
                values: cloneObject(_formValues)
              });
            }
          }
        }
      }
      (options2.shouldDirty || options2.shouldTouch) && updateTouchAndDirty(name, fieldValue, options2.shouldTouch, options2.shouldDirty, true);
      options2.shouldValidate && trigger(name);
    }, "setFieldValue");
    const setFieldValues = /* @__PURE__ */ __name((name, value, options2) => {
      for (const fieldKey in value) {
        if (!value.hasOwnProperty(fieldKey)) {
          return;
        }
        const fieldValue = value[fieldKey];
        const fieldName = name + "." + fieldKey;
        const field = get(_fields, fieldName);
        (_names.array.has(name) || isObject$1(fieldValue) || field && !field._f) && !isDateObject(fieldValue) ? setFieldValues(fieldName, fieldValue, options2) : setFieldValue(fieldName, fieldValue, options2);
      }
    }, "setFieldValues");
    const setValue = /* @__PURE__ */ __name((name, value, options2 = {}) => {
      const field = get(_fields, name);
      const isFieldArray = _names.array.has(name);
      const cloneValue = cloneObject(value);
      const previousValue = get(_formValues, name);
      const isValueUnchanged = deepEqual(previousValue, cloneValue);
      set(_formValues, name, cloneValue);
      if (isFieldArray) {
        _subjects.array.next({
          name,
          values: cloneObject(_formValues)
        });
        if ((_proxyFormState.isDirty || _proxyFormState.dirtyFields || _proxySubscribeFormState.isDirty || _proxySubscribeFormState.dirtyFields) && options2.shouldDirty) {
          _updateDirtyFields();
          _subjects.state.next({
            name,
            dirtyFields: _formState.dirtyFields,
            isDirty: _getDirty(name, cloneValue)
          });
        }
      } else {
        const isEmpty = Array.isArray(cloneValue) && !cloneValue.length || isEmptyObject(cloneValue);
        if (!field || field._f || isNullOrUndefined(cloneValue) || isEmpty) {
          setFieldValue(name, cloneValue, options2);
        } else {
          setFieldValues(name, cloneValue, options2);
        }
      }
      if (!isValueUnchanged) {
        const watched = isWatched(name, _names);
        _subjects.state.next(__spreadProps(__spreadValues({}, watched && _formState), {
          name: _state.mount || watched ? name : void 0,
          values: cloneObject(_formValues)
        }));
      }
    }, "setValue");
    const setValues = /* @__PURE__ */ __name((formValues) => {
      const updatedFormValues = isFunction$1(formValues) ? formValues(_formValues) : formValues;
      if (!deepEqual(_formValues, updatedFormValues)) {
        _formValues = __spreadValues(__spreadValues({}, _formValues), updatedFormValues);
        _subjects.state.next(__spreadProps(__spreadValues({}, _formState), { values: _formValues }));
      }
    }, "setValues");
    const onChange = /* @__PURE__ */ __name((event) => __async(null, null, function* () {
      _state.mount = true;
      const target = event.target;
      let name = target.name;
      let isFieldValueUpdated = true;
      const field = get(_fields, name);
      const _updateIsFieldValueUpdated = /* @__PURE__ */ __name((fieldValue) => {
        isFieldValueUpdated = Number.isNaN(fieldValue) || isDateObject(fieldValue) && isNaN(fieldValue.getTime()) || deepEqual(fieldValue, get(_formValues, name, fieldValue));
      }, "_updateIsFieldValueUpdated");
      const validationModeBeforeSubmit = getValidationModes(_options.mode);
      const validationModeAfterSubmit = getValidationModes(_options.reValidateMode);
      if (field) {
        let error;
        let isValid2;
        const fieldValue = target.type ? getFieldValue(field._f) : getEventValue(event);
        const isBlurEvent = event.type === EVENTS.BLUR || event.type === EVENTS.FOCUS_OUT;
        const shouldSkipValidation = !hasValidation(field._f) && !props.validate && !_options.resolver && !get(_formState.errors, name) && !field._f.deps || skipValidation(isBlurEvent, get(_formState.touchedFields, name), _formState.isSubmitted, validationModeAfterSubmit, validationModeBeforeSubmit);
        const watched = isWatched(name, _names, isBlurEvent);
        set(_formValues, name, fieldValue);
        if (isBlurEvent) {
          if (!target || !target.readOnly) {
            field._f.onBlur && field._f.onBlur(event);
            delayErrorCallback && delayErrorCallback(0);
          }
        } else if (field._f.onChange) {
          field._f.onChange(event);
        }
        const fieldState = updateTouchAndDirty(name, fieldValue, isBlurEvent);
        const shouldRender = !isEmptyObject(fieldState) || watched;
        !isBlurEvent && _subjects.state.next({
          name,
          type: event.type,
          values: cloneObject(_formValues)
        });
        if (shouldSkipValidation) {
          if (_proxyFormState.isValid || _proxySubscribeFormState.isValid) {
            if (_options.mode === "onBlur") {
              if (isBlurEvent) {
                _setValid();
              }
            } else if (!isBlurEvent) {
              _setValid();
            }
          }
          return shouldRender && _subjects.state.next(__spreadValues({ name }, watched ? {} : fieldState));
        }
        if (!_options.resolver && props.validate) {
          yield validateForm({
            name,
            eventType: event.type
          });
        }
        !isBlurEvent && watched && _subjects.state.next(__spreadValues({}, _formState));
        if (_options.resolver) {
          const { errors } = yield _runSchema([name]);
          _updateIsValidating([name]);
          _updateIsFieldValueUpdated(fieldValue);
          if (isFieldValueUpdated) {
            const previousErrorLookupResult = schemaErrorLookup(_formState.errors, _fields, name);
            const errorLookupResult = schemaErrorLookup(errors, _fields, previousErrorLookupResult.name || name);
            error = errorLookupResult.error;
            name = errorLookupResult.name;
            isValid2 = isEmptyObject(errors);
          }
        } else {
          _updateIsValidating([name], true);
          error = (yield validateField(field, _names.disabled, _formValues, shouldDisplayAllAssociatedErrors, _options.shouldUseNativeValidation))[name];
          _updateIsValidating([name]);
          _updateIsFieldValueUpdated(fieldValue);
          if (isFieldValueUpdated) {
            if (error) {
              isValid2 = false;
            } else if (_proxyFormState.isValid || _proxySubscribeFormState.isValid) {
              isValid2 = yield executeBuiltInValidation({
                fields: _fields,
                onlyCheckValid: true,
                name,
                eventType: event.type
              });
            }
          }
        }
        if (isFieldValueUpdated) {
          field._f.deps && (!Array.isArray(field._f.deps) || field._f.deps.length > 0) && trigger(field._f.deps);
          shouldRenderByError(name, isValid2, error, fieldState);
        }
      }
    }), "onChange");
    const _focusInput = /* @__PURE__ */ __name((ref, key) => {
      if (get(_formState.errors, key) && ref.focus) {
        ref.focus();
        return 1;
      }
      return;
    }, "_focusInput");
    const trigger = /* @__PURE__ */ __name((_0, ..._1) => __async(null, [_0, ..._1], function* (name, options2 = {}) {
      let isValid2;
      let validationResult;
      const fieldNames = convertToArrayPayload(name);
      if (_options.resolver) {
        const errors = yield executeSchemaAndUpdateState(isUndefined(name) ? name : fieldNames);
        isValid2 = isEmptyObject(errors);
        validationResult = name ? !fieldNames.some((name2) => get(errors, name2)) : isValid2;
      } else if (name) {
        validationResult = (yield Promise.all(fieldNames.map((fieldName) => __async(null, null, function* () {
          const field = get(_fields, fieldName);
          return yield executeBuiltInValidation({
            fields: field && field._f ? { [fieldName]: field } : field,
            eventType: EVENTS.TRIGGER
          });
        })))).every(Boolean);
        !(!validationResult && !_formState.isValid) && _setValid();
      } else {
        validationResult = isValid2 = yield executeBuiltInValidation({
          fields: _fields,
          name,
          eventType: EVENTS.TRIGGER
        });
      }
      _subjects.state.next(__spreadProps(__spreadValues(__spreadValues({}, !isString(name) || (_proxyFormState.isValid || _proxySubscribeFormState.isValid) && isValid2 !== _formState.isValid ? {} : { name }), _options.resolver || !name ? { isValid: isValid2 } : {}), {
        errors: _formState.errors
      }));
      options2.shouldFocus && !validationResult && iterateFieldsByAction(_fields, _focusInput, name ? fieldNames : _names.mount);
      return validationResult;
    }), "trigger");
    const getValues = /* @__PURE__ */ __name((fieldNames, config2) => {
      let values = __spreadValues({}, _state.mount ? _formValues : _defaultValues);
      if (config2) {
        values = extractFormValues(config2.dirtyFields ? _formState.dirtyFields : _formState.touchedFields, values);
      }
      return isUndefined(fieldNames) ? values : isString(fieldNames) ? get(values, fieldNames) : fieldNames.map((name) => get(values, name));
    }, "getValues");
    const getFieldState = /* @__PURE__ */ __name((name, formState) => ({
      invalid: !!get((formState || _formState).errors, name),
      isDirty: !!get((formState || _formState).dirtyFields, name),
      error: get((formState || _formState).errors, name),
      isValidating: !!get(_formState.validatingFields, name),
      isTouched: !!get((formState || _formState).touchedFields, name)
    }), "getFieldState");
    const clearErrors = /* @__PURE__ */ __name((name) => {
      const names = name ? convertToArrayPayload(name) : void 0;
      names === null || names === void 0 ? void 0 : names.forEach((inputName) => unset(_formState.errors, inputName));
      if (names) {
        names.forEach((inputName) => {
          _subjects.state.next({
            name: inputName,
            errors: _formState.errors
          });
        });
      } else {
        _subjects.state.next({
          errors: {}
        });
      }
    }, "clearErrors");
    const setError = /* @__PURE__ */ __name((name, error, options2) => {
      const ref = (get(_fields, name, { _f: {} })._f || {}).ref;
      const currentError = get(_formState.errors, name) || {};
      const _a2 = currentError, { ref: currentRef, message, type } = _a2, restOfErrorTree = __objRest(_a2, ["ref", "message", "type"]);
      set(_formState.errors, name, __spreadProps(__spreadValues(__spreadValues({}, restOfErrorTree), error), {
        ref
      }));
      _subjects.state.next({
        name,
        errors: _formState.errors,
        isValid: false
      });
      options2 && options2.shouldFocus && ref && ref.focus && ref.focus();
    }, "setError");
    const watch = /* @__PURE__ */ __name((name, defaultValue) => isFunction$1(name) ? _subjects.state.subscribe({
      next: /* @__PURE__ */ __name((payload) => "values" in payload && name(payload.values || _getWatch(void 0, defaultValue), payload), "next")
    }) : _getWatch(name, defaultValue, true), "watch");
    const _subscribe = /* @__PURE__ */ __name((props2) => _subjects.state.subscribe({
      next: /* @__PURE__ */ __name((formState) => {
        if (shouldSubscribeByName(props2.name, formState.name, props2.exact) && shouldRenderFormState(formState, props2.formState || _proxyFormState, _setFormState, props2.reRenderRoot)) {
          const snapshot = __spreadValues({}, _formValues);
          props2.callback(__spreadProps(__spreadValues(__spreadValues({
            values: snapshot
          }, _formState), formState), {
            defaultValues: _defaultValues
          }));
        }
      }, "next")
    }).unsubscribe, "_subscribe");
    const subscribe2 = /* @__PURE__ */ __name((props2) => {
      _state.mount = true;
      _proxySubscribeFormState = __spreadValues(__spreadValues({}, _proxySubscribeFormState), props2.formState);
      return _subscribe(__spreadProps(__spreadValues({}, props2), {
        formState: __spreadValues(__spreadValues({}, defaultProxyFormState), props2.formState)
      }));
    }, "subscribe");
    const unregister = /* @__PURE__ */ __name((name, options2 = {}) => {
      for (const fieldName of name ? convertToArrayPayload(name) : _names.mount) {
        _names.mount.delete(fieldName);
        _names.array.delete(fieldName);
        if (!options2.keepValue) {
          unset(_fields, fieldName);
          unset(_formValues, fieldName);
        }
        !options2.keepError && unset(_formState.errors, fieldName);
        !options2.keepDirty && unset(_formState.dirtyFields, fieldName);
        !options2.keepTouched && unset(_formState.touchedFields, fieldName);
        !options2.keepIsValidating && unset(_formState.validatingFields, fieldName);
        !_options.shouldUnregister && !options2.keepDefaultValue && unset(_defaultValues, fieldName);
      }
      _subjects.state.next({
        values: cloneObject(_formValues)
      });
      _subjects.state.next(__spreadValues(__spreadValues({}, _formState), !options2.keepDirty ? {} : { isDirty: _getDirty() }));
      !options2.keepIsValid && _setValid();
    }, "unregister");
    const _setDisabledField = /* @__PURE__ */ __name(({ disabled, name }) => {
      if (isBoolean(disabled) && _state.mount || !!disabled || _names.disabled.has(name)) {
        const wasDisabled = _names.disabled.has(name);
        const isDisabled = !!disabled;
        const disabledStateChanged = wasDisabled !== isDisabled;
        disabled ? _names.disabled.add(name) : _names.disabled.delete(name);
        disabledStateChanged && _state.mount && !_state.action && _setValid();
      }
    }, "_setDisabledField");
    const register = /* @__PURE__ */ __name((name, options2 = {}) => {
      let field = get(_fields, name);
      const disabledIsDefined = isBoolean(options2.disabled) || isBoolean(_options.disabled);
      const shouldRevalidateRemount = !_names.registerName.has(name) && field && field._f && !field._f.mount;
      set(_fields, name, __spreadProps(__spreadValues({}, field || {}), {
        _f: __spreadValues(__spreadProps(__spreadValues({}, field && field._f ? field._f : { ref: { name } }), {
          name,
          mount: true
        }), options2)
      }));
      _names.mount.add(name);
      if (field && !shouldRevalidateRemount) {
        _setDisabledField({
          disabled: isBoolean(options2.disabled) ? options2.disabled : _options.disabled,
          name
        });
      } else {
        updateValidAndValue(name, true, options2.value);
      }
      return __spreadProps(__spreadValues(__spreadValues({}, disabledIsDefined ? { disabled: options2.disabled || _options.disabled } : {}), _options.progressive ? {
        required: !!options2.required,
        min: getRuleValue(options2.min),
        max: getRuleValue(options2.max),
        minLength: getRuleValue(options2.minLength),
        maxLength: getRuleValue(options2.maxLength),
        pattern: getRuleValue(options2.pattern)
      } : {}), {
        name,
        onChange,
        onBlur: onChange,
        ref: /* @__PURE__ */ __name((ref) => {
          if (ref) {
            _names.registerName.add(name);
            register(name, options2);
            _names.registerName.delete(name);
            field = get(_fields, name);
            const fieldRef = isUndefined(ref.value) ? ref.querySelectorAll ? ref.querySelectorAll("input,select,textarea")[0] || ref : ref : ref;
            const radioOrCheckbox = isRadioOrCheckbox(fieldRef);
            const refs = field._f.refs || [];
            if (radioOrCheckbox ? refs.find((option) => option === fieldRef) : fieldRef === field._f.ref) {
              return;
            }
            set(_fields, name, {
              _f: __spreadValues(__spreadValues({}, field._f), radioOrCheckbox ? {
                refs: [
                  ...refs.filter(live),
                  fieldRef,
                  ...Array.isArray(get(_defaultValues, name)) ? [{}] : []
                ],
                ref: { type: fieldRef.type, name }
              } : { ref: fieldRef })
            });
            updateValidAndValue(name, false, void 0, fieldRef);
          } else {
            field = get(_fields, name, {});
            if (field._f) {
              field._f.mount = false;
            }
            (_options.shouldUnregister || options2.shouldUnregister) && !(isNameInFieldArray(_names.array, name) && _state.action) && _names.unMount.add(name);
          }
        }, "ref")
      });
    }, "register");
    const _focusError = /* @__PURE__ */ __name(() => _options.shouldFocusError && iterateFieldsByAction(_fields, _focusInput, _names.mount), "_focusError");
    const _disableForm = /* @__PURE__ */ __name((disabled) => {
      if (isBoolean(disabled)) {
        _subjects.state.next({ disabled });
        iterateFieldsByAction(_fields, (ref, name) => {
          const currentField = get(_fields, name);
          if (currentField) {
            ref.disabled = currentField._f.disabled || disabled;
            if (Array.isArray(currentField._f.refs)) {
              currentField._f.refs.forEach((inputRef) => {
                inputRef.disabled = currentField._f.disabled || disabled;
              });
            }
          }
        }, 0, false);
      }
    }, "_disableForm");
    const handleSubmit = /* @__PURE__ */ __name((onValid, onInvalid) => (e) => __async(null, null, function* () {
      let onValidError = void 0;
      if (e) {
        e.preventDefault && e.preventDefault();
        e.persist && e.persist();
      }
      let fieldValues = cloneObject(_formValues);
      _subjects.state.next({
        isSubmitting: true
      });
      if (_options.resolver) {
        const { errors, values } = yield _runSchema();
        _updateIsValidating();
        _formState.errors = errors;
        fieldValues = cloneObject(values);
      } else {
        yield executeBuiltInValidation({
          fields: _fields,
          eventType: EVENTS.SUBMIT
        });
      }
      if (_names.disabled.size) {
        for (const name of _names.disabled) {
          unset(fieldValues, name);
        }
      }
      unset(_formState.errors, ROOT_ERROR_TYPE);
      if (isEmptyObject(_formState.errors)) {
        _subjects.state.next({
          errors: {}
        });
        try {
          yield onValid(fieldValues, e);
        } catch (error) {
          onValidError = error;
        }
      } else {
        if (onInvalid) {
          yield onInvalid(__spreadValues({}, _formState.errors), e);
        }
        _focusError();
        setTimeout(_focusError);
      }
      _subjects.state.next({
        isSubmitted: true,
        isSubmitting: false,
        isSubmitSuccessful: isEmptyObject(_formState.errors) && !onValidError,
        submitCount: _formState.submitCount + 1,
        errors: _formState.errors
      });
      if (onValidError) {
        throw onValidError;
      }
    }), "handleSubmit");
    const resetField = /* @__PURE__ */ __name((name, options2 = {}) => {
      if (get(_fields, name)) {
        if (isUndefined(options2.defaultValue)) {
          setValue(name, cloneObject(get(_defaultValues, name)));
        } else {
          setValue(name, options2.defaultValue);
          set(_defaultValues, name, cloneObject(options2.defaultValue));
        }
        if (!options2.keepTouched) {
          unset(_formState.touchedFields, name);
        }
        if (!options2.keepDirty) {
          unset(_formState.dirtyFields, name);
          _formState.isDirty = options2.defaultValue ? _getDirty(name, cloneObject(get(_defaultValues, name))) : _getDirty();
        }
        if (!options2.keepError) {
          unset(_formState.errors, name);
          _proxyFormState.isValid && _setValid();
        }
        _subjects.state.next(__spreadValues({}, _formState));
      }
    }, "resetField");
    const _reset = /* @__PURE__ */ __name((formValues, keepStateOptions = {}) => {
      const updatedValues = formValues ? cloneObject(formValues) : _defaultValues;
      const cloneUpdatedValues = cloneObject(updatedValues);
      const isEmptyResetValues = isEmptyObject(formValues);
      const values = isEmptyResetValues ? _defaultValues : cloneUpdatedValues;
      if (!keepStateOptions.keepDefaultValues) {
        _defaultValues = updatedValues;
      }
      if (!keepStateOptions.keepValues) {
        if (keepStateOptions.keepDirtyValues) {
          const fieldsToCheck = /* @__PURE__ */ new Set([
            ..._names.mount,
            ...Object.keys(getDirtyFields(_defaultValues, _formValues))
          ]);
          for (const fieldName of Array.from(fieldsToCheck)) {
            const isDirty2 = get(_formState.dirtyFields, fieldName);
            const existingValue = get(_formValues, fieldName);
            const newValue = get(values, fieldName);
            if (isDirty2 && !isUndefined(existingValue)) {
              set(values, fieldName, existingValue);
            } else if (!isDirty2 && !isUndefined(newValue)) {
              setValue(fieldName, newValue);
            }
          }
        } else {
          if (isWeb && isUndefined(formValues)) {
            for (const name of _names.mount) {
              const field = get(_fields, name);
              if (field && field._f) {
                const fieldReference = Array.isArray(field._f.refs) ? field._f.refs[0] : field._f.ref;
                if (isHTMLElement(fieldReference)) {
                  const form = fieldReference.closest("form");
                  if (form) {
                    form.reset();
                    break;
                  }
                }
              }
            }
          }
          if (keepStateOptions.keepFieldsRef) {
            for (const fieldName of _names.mount) {
              setValue(fieldName, get(values, fieldName));
            }
          } else {
            _fields = {};
          }
        }
        _formValues = _options.shouldUnregister ? keepStateOptions.keepDefaultValues ? cloneObject(_defaultValues) : {} : cloneObject(values);
        _subjects.array.next({
          values: __spreadValues({}, values)
        });
        _subjects.state.next({
          values: __spreadValues({}, values)
        });
      }
      _names = {
        mount: keepStateOptions.keepDirtyValues ? _names.mount : /* @__PURE__ */ new Set(),
        unMount: /* @__PURE__ */ new Set(),
        array: /* @__PURE__ */ new Set(),
        registerName: /* @__PURE__ */ new Set(),
        disabled: /* @__PURE__ */ new Set(),
        watch: /* @__PURE__ */ new Set(),
        watchAll: false,
        focus: ""
      };
      _state.mount = !_proxyFormState.isValid || !!keepStateOptions.keepIsValid || !!keepStateOptions.keepDirtyValues || !_options.shouldUnregister && !isEmptyObject(values);
      _state.watch = !!_options.shouldUnregister;
      _state.keepIsValid = !!keepStateOptions.keepIsValid;
      _state.action = false;
      if (!keepStateOptions.keepErrors) {
        _formState.errors = {};
      }
      _subjects.state.next({
        submitCount: keepStateOptions.keepSubmitCount ? _formState.submitCount : 0,
        isDirty: isEmptyResetValues ? false : keepStateOptions.keepDirty ? _formState.isDirty : !!(keepStateOptions.keepDefaultValues && !deepEqual(formValues, _defaultValues)),
        isSubmitted: keepStateOptions.keepIsSubmitted ? _formState.isSubmitted : false,
        dirtyFields: isEmptyResetValues ? {} : keepStateOptions.keepDirtyValues ? keepStateOptions.keepDefaultValues && _formValues ? getDirtyFields(_defaultValues, _formValues) : _formState.dirtyFields : keepStateOptions.keepDefaultValues && formValues ? getDirtyFields(_defaultValues, formValues) : keepStateOptions.keepDirty ? _formState.dirtyFields : {},
        touchedFields: keepStateOptions.keepTouched ? _formState.touchedFields : {},
        errors: keepStateOptions.keepErrors ? _formState.errors : {},
        isSubmitSuccessful: keepStateOptions.keepIsSubmitSuccessful ? _formState.isSubmitSuccessful : false,
        isSubmitting: false,
        defaultValues: _defaultValues
      });
    }, "_reset");
    const reset = /* @__PURE__ */ __name((formValues, keepStateOptions) => _reset(isFunction$1(formValues) ? formValues(_formValues) : formValues, __spreadValues(__spreadValues({}, _options.resetOptions), keepStateOptions)), "reset");
    const setFocus = /* @__PURE__ */ __name((name, options2 = {}) => {
      const field = get(_fields, name);
      const fieldReference = field && field._f;
      if (fieldReference) {
        const fieldRef = fieldReference.refs ? fieldReference.refs[0] : fieldReference.ref;
        if (fieldRef.focus) {
          setTimeout(() => {
            fieldRef.focus();
            options2.shouldSelect && isFunction$1(fieldRef.select) && fieldRef.select();
          });
        }
      }
    }, "setFocus");
    const _setFormState = /* @__PURE__ */ __name((updatedFormState) => {
      _formState = __spreadValues(__spreadValues({}, _formState), updatedFormState);
    }, "_setFormState");
    const _resetDefaultValues = /* @__PURE__ */ __name(() => isFunction$1(_options.defaultValues) && _options.defaultValues().then((values) => {
      reset(values, _options.resetOptions);
      _subjects.state.next({
        isLoading: false
      });
    }), "_resetDefaultValues");
    const methods = {
      control: {
        register,
        unregister,
        getFieldState,
        handleSubmit,
        setError,
        _subscribe,
        _runSchema,
        _updateIsValidating,
        _focusError,
        _getWatch,
        _getDirty,
        _setValid,
        _setFieldArray,
        _setDisabledField,
        _setErrors,
        _getFieldArray,
        _reset,
        _resetDefaultValues,
        _removeUnmounted,
        _disableForm,
        _subjects,
        _proxyFormState,
        get _fields() {
          return _fields;
        },
        get _formValues() {
          return _formValues;
        },
        get _state() {
          return _state;
        },
        set _state(value) {
          _state = value;
        },
        get _defaultValues() {
          return _defaultValues;
        },
        get _names() {
          return _names;
        },
        set _names(value) {
          _names = value;
        },
        get _formState() {
          return _formState;
        },
        get _options() {
          return _options;
        },
        set _options(value) {
          _options = __spreadValues(__spreadValues({}, _options), value);
        }
      },
      subscribe: subscribe2,
      trigger,
      register,
      handleSubmit,
      watch,
      setValue,
      setValues,
      getValues,
      reset,
      resetField,
      clearErrors,
      unregister,
      setError,
      setFocus,
      getFieldState
    };
    return __spreadProps(__spreadValues({}, methods), {
      formControl: methods
    });
  }
  __name(createFormControl, "createFormControl");
  function useForm(props = {}) {
    const _formControl = React.useRef(void 0);
    const _values = React.useRef(void 0);
    const [formState, updateFormState] = React.useState(() => __spreadProps(__spreadValues({}, cloneObject(DEFAULT_FORM_STATE)), {
      isLoading: isFunction$1(props.defaultValues),
      errors: props.errors || {},
      disabled: props.disabled || false,
      defaultValues: isFunction$1(props.defaultValues) ? void 0 : props.defaultValues
    }));
    if (!_formControl.current) {
      if (props.formControl) {
        _formControl.current = __spreadProps(__spreadValues({}, props.formControl), {
          formState
        });
        if (props.defaultValues && !isFunction$1(props.defaultValues)) {
          props.formControl.reset(props.defaultValues, props.resetOptions);
        }
      } else {
        const _a2 = createFormControl(props), { formControl } = _a2, rest = __objRest(_a2, ["formControl"]);
        _formControl.current = __spreadProps(__spreadValues({}, rest), {
          formState
        });
      }
    }
    const control = _formControl.current.control;
    control._options = props;
    useIsomorphicLayoutEffect(() => {
      const sub = control._subscribe({
        formState: control._proxyFormState,
        callback: /* @__PURE__ */ __name(() => updateFormState(__spreadValues({}, control._formState)), "callback"),
        reRenderRoot: true
      });
      updateFormState((data) => __spreadProps(__spreadValues({}, data), {
        isReady: true
      }));
      control._formState.isReady = true;
      return sub;
    }, [control]);
    React.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);
    React.useEffect(() => {
      if (props.mode) {
        control._options.mode = props.mode;
      }
      if (props.reValidateMode) {
        control._options.reValidateMode = props.reValidateMode;
      }
    }, [control, props.mode, props.reValidateMode]);
    React.useEffect(() => {
      if (props.errors) {
        control._setErrors(props.errors);
        control._focusError();
      }
    }, [control, props.errors]);
    React.useEffect(() => {
      props.shouldUnregister && control._subjects.state.next({
        values: control._getWatch()
      });
    }, [control, props.shouldUnregister]);
    React.useEffect(() => {
      if (control._proxyFormState.isDirty) {
        const isDirty2 = control._getDirty();
        if (isDirty2 !== formState.isDirty) {
          control._subjects.state.next({
            isDirty: isDirty2
          });
        }
      }
    }, [control, formState.isDirty]);
    React.useEffect(() => {
      var _a3;
      if (props.values && !deepEqual(props.values, _values.current)) {
        control._reset(props.values, __spreadValues({
          keepFieldsRef: true
        }, control._options.resetOptions));
        if (!((_a3 = control._options.resetOptions) === null || _a3 === void 0 ? void 0 : _a3.keepIsValid)) {
          control._setValid();
        }
        _values.current = props.values;
        updateFormState((state) => __spreadValues({}, state));
      } else {
        control._resetDefaultValues();
      }
    }, [control, props.values]);
    React.useEffect(() => {
      if (!control._state.mount) {
        control._setValid();
        control._state.mount = true;
      }
      if (control._state.watch) {
        control._state.watch = false;
        control._subjects.state.next(__spreadValues({}, control._formState));
      }
      control._removeUnmounted();
    });
    _formControl.current.formState = React.useMemo(() => getProxyFormState(formState, control), [control, formState]);
    return _formControl.current;
  }
  __name(useForm, "useForm");
  const s = /* @__PURE__ */ __name((e, s2, o2) => {
    if (e && "reportValidity" in e) {
      const r2 = get(o2, s2);
      e.setCustomValidity(r2 && r2.message || ""), e.reportValidity();
    }
  }, "s"), o = /* @__PURE__ */ __name((t2, e) => {
    for (const o2 in e.fields) {
      const r2 = e.fields[o2];
      r2 && r2.ref && "reportValidity" in r2.ref ? s(r2.ref, o2, t2) : r2.refs && r2.refs.forEach((e3) => s(e3, o2, t2));
    }
  }, "o"), r = /* @__PURE__ */ __name((s2, r2) => {
    r2.shouldUseNativeValidation && o(s2, r2);
    const f = {};
    for (const o2 in s2) {
      const n2 = get(r2.fields, o2), a2 = Object.assign(s2[o2] || {}, { ref: n2 && n2.ref });
      if (i(r2.names || Object.keys(s2), o2)) {
        const s3 = Object.assign({}, get(f, o2));
        set(s3, "root", a2), set(f, o2, s3);
      } else set(f, o2, a2);
    }
    return f;
  }, "r"), i = /* @__PURE__ */ __name((t2, e) => t2.some((t3) => t3.startsWith(e + ".")), "i");
  var n = /* @__PURE__ */ __name(function(r2, e) {
    for (var n2 = {}; r2.length; ) {
      var t2 = r2[0], s2 = t2.code, i2 = t2.message, a2 = t2.path.join(".");
      if (!n2[a2]) if ("unionErrors" in t2) {
        var u2 = t2.unionErrors[0].errors[0];
        n2[a2] = { message: u2.message, type: u2.code };
      } else n2[a2] = { message: i2, type: s2 };
      if ("unionErrors" in t2 && t2.unionErrors.forEach(function(e3) {
        return e3.errors.forEach(function(e4) {
          return r2.push(e4);
        });
      }), e) {
        var c2 = n2[a2].types, f = c2 && c2[t2.code];
        n2[a2] = appendErrors(a2, e, n2, s2, f ? [].concat(f, t2.message) : t2.message);
      }
      r2.shift();
    }
    return n2;
  }, "n"), t = /* @__PURE__ */ __name(function(o$1, t2, s2) {
    return void 0 === s2 && (s2 = {}), function(i2, a2, u2) {
      try {
        return Promise.resolve((function(e, n2) {
          try {
            var a3 = Promise.resolve(o$1["sync" === s2.mode ? "parse" : "parseAsync"](i2, t2)).then(function(e3) {
              return u2.shouldUseNativeValidation && o({}, u2), { errors: {}, values: s2.raw ? i2 : e3 };
            });
          } catch (r2) {
            return n2(r2);
          }
          return a3 && a3.then ? a3.then(void 0, n2) : a3;
        })(0, function(r$12) {
          if ((function(r2) {
            return Array.isArray(null == r2 ? void 0 : r2.errors);
          })(r$12)) return { values: {}, errors: r(n(r$12.errors, !u2.shouldUseNativeValidation && "all" === u2.criteriaMode), u2) };
          throw r$12;
        }));
      } catch (r2) {
        return Promise.reject(r2);
      }
    };
  }, "t");
  var util;
  (function(util2) {
    util2.assertEqual = (_) => {
    };
    function assertIs(_arg) {
    }
    __name(assertIs, "assertIs");
    util2.assertIs = assertIs;
    function assertNever(_x2) {
      throw new Error();
    }
    __name(assertNever, "assertNever");
    util2.assertNever = assertNever;
    util2.arrayToEnum = (items) => {
      const obj = {};
      for (const item of items) {
        obj[item] = item;
      }
      return obj;
    };
    util2.getValidEnumValues = (obj) => {
      const validKeys = util2.objectKeys(obj).filter((k2) => typeof obj[obj[k2]] !== "number");
      const filtered = {};
      for (const k2 of validKeys) {
        filtered[k2] = obj[k2];
      }
      return util2.objectValues(filtered);
    };
    util2.objectValues = (obj) => {
      return util2.objectKeys(obj).map(function(e) {
        return obj[e];
      });
    };
    util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object2) => {
      const keys2 = [];
      for (const key in object2) {
        if (Object.prototype.hasOwnProperty.call(object2, key)) {
          keys2.push(key);
        }
      }
      return keys2;
    };
    util2.find = (arr, checker) => {
      for (const item of arr) {
        if (checker(item))
          return item;
      }
      return void 0;
    };
    util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
    function joinValues(array2, separator = " | ") {
      return array2.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
    }
    __name(joinValues, "joinValues");
    util2.joinValues = joinValues;
    util2.jsonStringifyReplacer = (_, value) => {
      if (typeof value === "bigint") {
        return value.toString();
      }
      return value;
    };
  })(util || (util = {}));
  var objectUtil;
  (function(objectUtil2) {
    objectUtil2.mergeShapes = (first, second2) => {
      return __spreadValues(__spreadValues({}, first), second2);
    };
  })(objectUtil || (objectUtil = {}));
  const ZodParsedType = util.arrayToEnum([
    "string",
    "nan",
    "number",
    "integer",
    "float",
    "boolean",
    "date",
    "bigint",
    "symbol",
    "function",
    "undefined",
    "null",
    "array",
    "object",
    "unknown",
    "promise",
    "void",
    "never",
    "map",
    "set"
  ]);
  const getParsedType = /* @__PURE__ */ __name((data) => {
    const t2 = typeof data;
    switch (t2) {
      case "undefined":
        return ZodParsedType.undefined;
      case "string":
        return ZodParsedType.string;
      case "number":
        return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
      case "boolean":
        return ZodParsedType.boolean;
      case "function":
        return ZodParsedType.function;
      case "bigint":
        return ZodParsedType.bigint;
      case "symbol":
        return ZodParsedType.symbol;
      case "object":
        if (Array.isArray(data)) {
          return ZodParsedType.array;
        }
        if (data === null) {
          return ZodParsedType.null;
        }
        if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
          return ZodParsedType.promise;
        }
        if (typeof Map !== "undefined" && data instanceof Map) {
          return ZodParsedType.map;
        }
        if (typeof Set !== "undefined" && data instanceof Set) {
          return ZodParsedType.set;
        }
        if (typeof Date !== "undefined" && data instanceof Date) {
          return ZodParsedType.date;
        }
        return ZodParsedType.object;
      default:
        return ZodParsedType.unknown;
    }
  }, "getParsedType");
  const ZodIssueCode = util.arrayToEnum([
    "invalid_type",
    "invalid_literal",
    "custom",
    "invalid_union",
    "invalid_union_discriminator",
    "invalid_enum_value",
    "unrecognized_keys",
    "invalid_arguments",
    "invalid_return_type",
    "invalid_date",
    "invalid_string",
    "too_small",
    "too_big",
    "invalid_intersection_types",
    "not_multiple_of",
    "not_finite"
  ]);
  const _ZodError = class _ZodError extends Error {
    get errors() {
      return this.issues;
    }
    constructor(issues) {
      super();
      this.issues = [];
      this.addIssue = (sub) => {
        this.issues = [...this.issues, sub];
      };
      this.addIssues = (subs = []) => {
        this.issues = [...this.issues, ...subs];
      };
      const actualProto = new.target.prototype;
      if (Object.setPrototypeOf) {
        Object.setPrototypeOf(this, actualProto);
      } else {
        this.__proto__ = actualProto;
      }
      this.name = "ZodError";
      this.issues = issues;
    }
    format(_mapper) {
      const mapper = _mapper || function(issue) {
        return issue.message;
      };
      const fieldErrors = { _errors: [] };
      const processError = /* @__PURE__ */ __name((error) => {
        for (const issue of error.issues) {
          if (issue.code === "invalid_union") {
            issue.unionErrors.map(processError);
          } else if (issue.code === "invalid_return_type") {
            processError(issue.returnTypeError);
          } else if (issue.code === "invalid_arguments") {
            processError(issue.argumentsError);
          } else if (issue.path.length === 0) {
            fieldErrors._errors.push(mapper(issue));
          } else {
            let curr = fieldErrors;
            let i2 = 0;
            while (i2 < issue.path.length) {
              const el = issue.path[i2];
              const terminal = i2 === issue.path.length - 1;
              if (!terminal) {
                curr[el] = curr[el] || { _errors: [] };
              } else {
                curr[el] = curr[el] || { _errors: [] };
                curr[el]._errors.push(mapper(issue));
              }
              curr = curr[el];
              i2++;
            }
          }
        }
      }, "processError");
      processError(this);
      return fieldErrors;
    }
    static assert(value) {
      if (!(value instanceof _ZodError)) {
        throw new Error(`Not a ZodError: ${value}`);
      }
    }
    toString() {
      return this.message;
    }
    get message() {
      return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
    }
    get isEmpty() {
      return this.issues.length === 0;
    }
    flatten(mapper = (issue) => issue.message) {
      const fieldErrors = {};
      const formErrors = [];
      for (const sub of this.issues) {
        if (sub.path.length > 0) {
          const firstEl = sub.path[0];
          fieldErrors[firstEl] = fieldErrors[firstEl] || [];
          fieldErrors[firstEl].push(mapper(sub));
        } else {
          formErrors.push(mapper(sub));
        }
      }
      return { formErrors, fieldErrors };
    }
    get formErrors() {
      return this.flatten();
    }
  };
  __name(_ZodError, "ZodError");
  let ZodError = _ZodError;
  ZodError.create = (issues) => {
    const error = new ZodError(issues);
    return error;
  };
  const errorMap = /* @__PURE__ */ __name((issue, _ctx) => {
    let message;
    switch (issue.code) {
      case ZodIssueCode.invalid_type:
        if (issue.received === ZodParsedType.undefined) {
          message = "Required";
        } else {
          message = `Expected ${issue.expected}, received ${issue.received}`;
        }
        break;
      case ZodIssueCode.invalid_literal:
        message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
        break;
      case ZodIssueCode.unrecognized_keys:
        message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
        break;
      case ZodIssueCode.invalid_union:
        message = `Invalid input`;
        break;
      case ZodIssueCode.invalid_union_discriminator:
        message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
        break;
      case ZodIssueCode.invalid_enum_value:
        message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
        break;
      case ZodIssueCode.invalid_arguments:
        message = `Invalid function arguments`;
        break;
      case ZodIssueCode.invalid_return_type:
        message = `Invalid function return type`;
        break;
      case ZodIssueCode.invalid_date:
        message = `Invalid date`;
        break;
      case ZodIssueCode.invalid_string:
        if (typeof issue.validation === "object") {
          if ("includes" in issue.validation) {
            message = `Invalid input: must include "${issue.validation.includes}"`;
            if (typeof issue.validation.position === "number") {
              message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
            }
          } else if ("startsWith" in issue.validation) {
            message = `Invalid input: must start with "${issue.validation.startsWith}"`;
          } else if ("endsWith" in issue.validation) {
            message = `Invalid input: must end with "${issue.validation.endsWith}"`;
          } else {
            util.assertNever(issue.validation);
          }
        } else if (issue.validation !== "regex") {
          message = `Invalid ${issue.validation}`;
        } else {
          message = "Invalid";
        }
        break;
      case ZodIssueCode.too_small:
        if (issue.type === "array")
          message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
        else if (issue.type === "string")
          message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
        else if (issue.type === "number")
          message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
        else if (issue.type === "bigint")
          message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
        else if (issue.type === "date")
          message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
        else
          message = "Invalid input";
        break;
      case ZodIssueCode.too_big:
        if (issue.type === "array")
          message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
        else if (issue.type === "string")
          message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
        else if (issue.type === "number")
          message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
        else if (issue.type === "bigint")
          message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
        else if (issue.type === "date")
          message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
        else
          message = "Invalid input";
        break;
      case ZodIssueCode.custom:
        message = `Invalid input`;
        break;
      case ZodIssueCode.invalid_intersection_types:
        message = `Intersection results could not be merged`;
        break;
      case ZodIssueCode.not_multiple_of:
        message = `Number must be a multiple of ${issue.multipleOf}`;
        break;
      case ZodIssueCode.not_finite:
        message = "Number must be finite";
        break;
      default:
        message = _ctx.defaultError;
        util.assertNever(issue);
    }
    return { message };
  }, "errorMap");
  let overrideErrorMap = errorMap;
  function getErrorMap() {
    return overrideErrorMap;
  }
  __name(getErrorMap, "getErrorMap");
  const makeIssue = /* @__PURE__ */ __name((params) => {
    const { data, path, errorMaps, issueData } = params;
    const fullPath = [...path, ...issueData.path || []];
    const fullIssue = __spreadProps(__spreadValues({}, issueData), {
      path: fullPath
    });
    if (issueData.message !== void 0) {
      return __spreadProps(__spreadValues({}, issueData), {
        path: fullPath,
        message: issueData.message
      });
    }
    let errorMessage = "";
    const maps = errorMaps.filter((m2) => !!m2).slice().reverse();
    for (const map2 of maps) {
      errorMessage = map2(fullIssue, { data, defaultError: errorMessage }).message;
    }
    return __spreadProps(__spreadValues({}, issueData), {
      path: fullPath,
      message: errorMessage
    });
  }, "makeIssue");
  function addIssueToContext(ctx2, issueData) {
    const overrideMap = getErrorMap();
    const issue = makeIssue({
      issueData,
      data: ctx2.data,
      path: ctx2.path,
      errorMaps: [
        ctx2.common.contextualErrorMap,
        // contextual error map is first priority
        ctx2.schemaErrorMap,
        // then schema-bound map if available
        overrideMap,
        // then global override map
        overrideMap === errorMap ? void 0 : errorMap
        // then global default map
      ].filter((x2) => !!x2)
    });
    ctx2.common.issues.push(issue);
  }
  __name(addIssueToContext, "addIssueToContext");
  const _ParseStatus = class _ParseStatus {
    constructor() {
      this.value = "valid";
    }
    dirty() {
      if (this.value === "valid")
        this.value = "dirty";
    }
    abort() {
      if (this.value !== "aborted")
        this.value = "aborted";
    }
    static mergeArray(status, results) {
      const arrayValue = [];
      for (const s2 of results) {
        if (s2.status === "aborted")
          return INVALID;
        if (s2.status === "dirty")
          status.dirty();
        arrayValue.push(s2.value);
      }
      return { status: status.value, value: arrayValue };
    }
    static mergeObjectAsync(status, pairs) {
      return __async(this, null, function* () {
        const syncPairs = [];
        for (const pair of pairs) {
          const key = yield pair.key;
          const value = yield pair.value;
          syncPairs.push({
            key,
            value
          });
        }
        return _ParseStatus.mergeObjectSync(status, syncPairs);
      });
    }
    static mergeObjectSync(status, pairs) {
      const finalObject = {};
      for (const pair of pairs) {
        const { key, value } = pair;
        if (key.status === "aborted")
          return INVALID;
        if (value.status === "aborted")
          return INVALID;
        if (key.status === "dirty")
          status.dirty();
        if (value.status === "dirty")
          status.dirty();
        if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
          finalObject[key.value] = value.value;
        }
      }
      return { status: status.value, value: finalObject };
    }
  };
  __name(_ParseStatus, "ParseStatus");
  let ParseStatus = _ParseStatus;
  const INVALID = Object.freeze({
    status: "aborted"
  });
  const DIRTY = /* @__PURE__ */ __name((value) => ({ status: "dirty", value }), "DIRTY");
  const OK = /* @__PURE__ */ __name((value) => ({ status: "valid", value }), "OK");
  const isAborted = /* @__PURE__ */ __name((x2) => x2.status === "aborted", "isAborted");
  const isDirty = /* @__PURE__ */ __name((x2) => x2.status === "dirty", "isDirty");
  const isValid = /* @__PURE__ */ __name((x2) => x2.status === "valid", "isValid");
  const isAsync = /* @__PURE__ */ __name((x2) => typeof Promise !== "undefined" && x2 instanceof Promise, "isAsync");
  var errorUtil;
  (function(errorUtil2) {
    errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
    errorUtil2.toString = (message) => typeof message === "string" ? message : message == null ? void 0 : message.message;
  })(errorUtil || (errorUtil = {}));
  const _ParseInputLazyPath = class _ParseInputLazyPath {
    constructor(parent, value, path, key) {
      this._cachedPath = [];
      this.parent = parent;
      this.data = value;
      this._path = path;
      this._key = key;
    }
    get path() {
      if (!this._cachedPath.length) {
        if (Array.isArray(this._key)) {
          this._cachedPath.push(...this._path, ...this._key);
        } else {
          this._cachedPath.push(...this._path, this._key);
        }
      }
      return this._cachedPath;
    }
  };
  __name(_ParseInputLazyPath, "ParseInputLazyPath");
  let ParseInputLazyPath = _ParseInputLazyPath;
  const handleResult = /* @__PURE__ */ __name((ctx2, result) => {
    if (isValid(result)) {
      return { success: true, data: result.value };
    } else {
      if (!ctx2.common.issues.length) {
        throw new Error("Validation failed but no issues detected.");
      }
      return {
        success: false,
        get error() {
          if (this._error)
            return this._error;
          const error = new ZodError(ctx2.common.issues);
          this._error = error;
          return this._error;
        }
      };
    }
  }, "handleResult");
  function processCreateParams(params) {
    if (!params)
      return {};
    const { errorMap: errorMap2, invalid_type_error, required_error, description } = params;
    if (errorMap2 && (invalid_type_error || required_error)) {
      throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
    }
    if (errorMap2)
      return { errorMap: errorMap2, description };
    const customMap = /* @__PURE__ */ __name((iss, ctx2) => {
      var _a2, _b2;
      const { message } = params;
      if (iss.code === "invalid_enum_value") {
        return { message: message != null ? message : ctx2.defaultError };
      }
      if (typeof ctx2.data === "undefined") {
        return { message: (_a2 = message != null ? message : required_error) != null ? _a2 : ctx2.defaultError };
      }
      if (iss.code !== "invalid_type")
        return { message: ctx2.defaultError };
      return { message: (_b2 = message != null ? message : invalid_type_error) != null ? _b2 : ctx2.defaultError };
    }, "customMap");
    return { errorMap: customMap, description };
  }
  __name(processCreateParams, "processCreateParams");
  const _ZodType = class _ZodType {
    get description() {
      return this._def.description;
    }
    _getType(input) {
      return getParsedType(input.data);
    }
    _getOrReturnCtx(input, ctx2) {
      return ctx2 || {
        common: input.parent.common,
        data: input.data,
        parsedType: getParsedType(input.data),
        schemaErrorMap: this._def.errorMap,
        path: input.path,
        parent: input.parent
      };
    }
    _processInputParams(input) {
      return {
        status: new ParseStatus(),
        ctx: {
          common: input.parent.common,
          data: input.data,
          parsedType: getParsedType(input.data),
          schemaErrorMap: this._def.errorMap,
          path: input.path,
          parent: input.parent
        }
      };
    }
    _parseSync(input) {
      const result = this._parse(input);
      if (isAsync(result)) {
        throw new Error("Synchronous parse encountered promise.");
      }
      return result;
    }
    _parseAsync(input) {
      const result = this._parse(input);
      return Promise.resolve(result);
    }
    parse(data, params) {
      const result = this.safeParse(data, params);
      if (result.success)
        return result.data;
      throw result.error;
    }
    safeParse(data, params) {
      var _a2;
      const ctx2 = {
        common: {
          issues: [],
          async: (_a2 = params == null ? void 0 : params.async) != null ? _a2 : false,
          contextualErrorMap: params == null ? void 0 : params.errorMap
        },
        path: (params == null ? void 0 : params.path) || [],
        schemaErrorMap: this._def.errorMap,
        parent: null,
        data,
        parsedType: getParsedType(data)
      };
      const result = this._parseSync({ data, path: ctx2.path, parent: ctx2 });
      return handleResult(ctx2, result);
    }
    "~validate"(data) {
      var _a2, _b2;
      const ctx2 = {
        common: {
          issues: [],
          async: !!this["~standard"].async
        },
        path: [],
        schemaErrorMap: this._def.errorMap,
        parent: null,
        data,
        parsedType: getParsedType(data)
      };
      if (!this["~standard"].async) {
        try {
          const result = this._parseSync({ data, path: [], parent: ctx2 });
          return isValid(result) ? {
            value: result.value
          } : {
            issues: ctx2.common.issues
          };
        } catch (err) {
          if ((_b2 = (_a2 = err == null ? void 0 : err.message) == null ? void 0 : _a2.toLowerCase()) == null ? void 0 : _b2.includes("encountered")) {
            this["~standard"].async = true;
          }
          ctx2.common = {
            issues: [],
            async: true
          };
        }
      }
      return this._parseAsync({ data, path: [], parent: ctx2 }).then((result) => isValid(result) ? {
        value: result.value
      } : {
        issues: ctx2.common.issues
      });
    }
    parseAsync(data, params) {
      return __async(this, null, function* () {
        const result = yield this.safeParseAsync(data, params);
        if (result.success)
          return result.data;
        throw result.error;
      });
    }
    safeParseAsync(data, params) {
      return __async(this, null, function* () {
        const ctx2 = {
          common: {
            issues: [],
            contextualErrorMap: params == null ? void 0 : params.errorMap,
            async: true
          },
          path: (params == null ? void 0 : params.path) || [],
          schemaErrorMap: this._def.errorMap,
          parent: null,
          data,
          parsedType: getParsedType(data)
        };
        const maybeAsyncResult = this._parse({ data, path: ctx2.path, parent: ctx2 });
        const result = yield isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult);
        return handleResult(ctx2, result);
      });
    }
    refine(check, message) {
      const getIssueProperties = /* @__PURE__ */ __name((val) => {
        if (typeof message === "string" || typeof message === "undefined") {
          return { message };
        } else if (typeof message === "function") {
          return message(val);
        } else {
          return message;
        }
      }, "getIssueProperties");
      return this._refinement((val, ctx2) => {
        const result = check(val);
        const setError = /* @__PURE__ */ __name(() => ctx2.addIssue(__spreadValues({
          code: ZodIssueCode.custom
        }, getIssueProperties(val))), "setError");
        if (typeof Promise !== "undefined" && result instanceof Promise) {
          return result.then((data) => {
            if (!data) {
              setError();
              return false;
            } else {
              return true;
            }
          });
        }
        if (!result) {
          setError();
          return false;
        } else {
          return true;
        }
      });
    }
    refinement(check, refinementData) {
      return this._refinement((val, ctx2) => {
        if (!check(val)) {
          ctx2.addIssue(typeof refinementData === "function" ? refinementData(val, ctx2) : refinementData);
          return false;
        } else {
          return true;
        }
      });
    }
    _refinement(refinement) {
      return new ZodEffects({
        schema: this,
        typeName: ZodFirstPartyTypeKind.ZodEffects,
        effect: { type: "refinement", refinement }
      });
    }
    superRefine(refinement) {
      return this._refinement(refinement);
    }
    constructor(def) {
      this.spa = this.safeParseAsync;
      this._def = def;
      this.parse = this.parse.bind(this);
      this.safeParse = this.safeParse.bind(this);
      this.parseAsync = this.parseAsync.bind(this);
      this.safeParseAsync = this.safeParseAsync.bind(this);
      this.spa = this.spa.bind(this);
      this.refine = this.refine.bind(this);
      this.refinement = this.refinement.bind(this);
      this.superRefine = this.superRefine.bind(this);
      this.optional = this.optional.bind(this);
      this.nullable = this.nullable.bind(this);
      this.nullish = this.nullish.bind(this);
      this.array = this.array.bind(this);
      this.promise = this.promise.bind(this);
      this.or = this.or.bind(this);
      this.and = this.and.bind(this);
      this.transform = this.transform.bind(this);
      this.brand = this.brand.bind(this);
      this.default = this.default.bind(this);
      this.catch = this.catch.bind(this);
      this.describe = this.describe.bind(this);
      this.pipe = this.pipe.bind(this);
      this.readonly = this.readonly.bind(this);
      this.isNullable = this.isNullable.bind(this);
      this.isOptional = this.isOptional.bind(this);
      this["~standard"] = {
        version: 1,
        vendor: "zod",
        validate: /* @__PURE__ */ __name((data) => this["~validate"](data), "validate")
      };
    }
    optional() {
      return ZodOptional.create(this, this._def);
    }
    nullable() {
      return ZodNullable.create(this, this._def);
    }
    nullish() {
      return this.nullable().optional();
    }
    array() {
      return ZodArray.create(this);
    }
    promise() {
      return ZodPromise.create(this, this._def);
    }
    or(option) {
      return ZodUnion.create([this, option], this._def);
    }
    and(incoming) {
      return ZodIntersection.create(this, incoming, this._def);
    }
    transform(transform) {
      return new ZodEffects(__spreadProps(__spreadValues({}, processCreateParams(this._def)), {
        schema: this,
        typeName: ZodFirstPartyTypeKind.ZodEffects,
        effect: { type: "transform", transform }
      }));
    }
    default(def) {
      const defaultValueFunc = typeof def === "function" ? def : () => def;
      return new ZodDefault(__spreadProps(__spreadValues({}, processCreateParams(this._def)), {
        innerType: this,
        defaultValue: defaultValueFunc,
        typeName: ZodFirstPartyTypeKind.ZodDefault
      }));
    }
    brand() {
      return new ZodBranded(__spreadValues({
        typeName: ZodFirstPartyTypeKind.ZodBranded,
        type: this
      }, processCreateParams(this._def)));
    }
    catch(def) {
      const catchValueFunc = typeof def === "function" ? def : () => def;
      return new ZodCatch(__spreadProps(__spreadValues({}, processCreateParams(this._def)), {
        innerType: this,
        catchValue: catchValueFunc,
        typeName: ZodFirstPartyTypeKind.ZodCatch
      }));
    }
    describe(description) {
      const This = this.constructor;
      return new This(__spreadProps(__spreadValues({}, this._def), {
        description
      }));
    }
    pipe(target) {
      return ZodPipeline.create(this, target);
    }
    readonly() {
      return ZodReadonly.create(this);
    }
    isOptional() {
      return this.safeParse(void 0).success;
    }
    isNullable() {
      return this.safeParse(null).success;
    }
  };
  __name(_ZodType, "ZodType");
  let ZodType = _ZodType;
  const cuidRegex = /^c[^\s-]{8,}$/i;
  const cuid2Regex = /^[0-9a-z]+$/;
  const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
  const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
  const nanoidRegex = /^[a-z0-9_-]{21}$/i;
  const jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
  const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
  const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
  const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
  let emojiRegex;
  const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
  const ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
  const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
  const ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
  const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
  const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
  const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
  const dateRegex = new RegExp(`^${dateRegexSource}$`);
  function timeRegexSource(args) {
    let secondsRegexSource = `[0-5]\\d`;
    if (args.precision) {
      secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
    } else if (args.precision == null) {
      secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
    }
    const secondsQuantifier = args.precision ? "+" : "?";
    return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
  }
  __name(timeRegexSource, "timeRegexSource");
  function timeRegex(args) {
    return new RegExp(`^${timeRegexSource(args)}$`);
  }
  __name(timeRegex, "timeRegex");
  function datetimeRegex(args) {
    let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
    const opts = [];
    opts.push(args.local ? `Z?` : `Z`);
    if (args.offset)
      opts.push(`([+-]\\d{2}:?\\d{2})`);
    regex = `${regex}(${opts.join("|")})`;
    return new RegExp(`^${regex}$`);
  }
  __name(datetimeRegex, "datetimeRegex");
  function isValidIP(ip, version2) {
    if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) {
      return true;
    }
    if ((version2 === "v6" || !version2) && ipv6Regex.test(ip)) {
      return true;
    }
    return false;
  }
  __name(isValidIP, "isValidIP");
  function isValidJWT(jwt, alg) {
    if (!jwtRegex.test(jwt))
      return false;
    try {
      const [header] = jwt.split(".");
      if (!header)
        return false;
      const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
      const decoded = JSON.parse(atob(base64));
      if (typeof decoded !== "object" || decoded === null)
        return false;
      if ("typ" in decoded && (decoded == null ? void 0 : decoded.typ) !== "JWT")
        return false;
      if (!decoded.alg)
        return false;
      if (alg && decoded.alg !== alg)
        return false;
      return true;
    } catch (e) {
      return false;
    }
  }
  __name(isValidJWT, "isValidJWT");
  function isValidCidr(ip, version2) {
    if ((version2 === "v4" || !version2) && ipv4CidrRegex.test(ip)) {
      return true;
    }
    if ((version2 === "v6" || !version2) && ipv6CidrRegex.test(ip)) {
      return true;
    }
    return false;
  }
  __name(isValidCidr, "isValidCidr");
  const _ZodString = class _ZodString extends ZodType {
    _parse(input) {
      if (this._def.coerce) {
        input.data = String(input.data);
      }
      const parsedType = this._getType(input);
      if (parsedType !== ZodParsedType.string) {
        const ctx3 = this._getOrReturnCtx(input);
        addIssueToContext(ctx3, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.string,
          received: ctx3.parsedType
        });
        return INVALID;
      }
      const status = new ParseStatus();
      let ctx2 = void 0;
      for (const check of this._def.checks) {
        if (check.kind === "min") {
          if (input.data.length < check.value) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.too_small,
              minimum: check.value,
              type: "string",
              inclusive: true,
              exact: false,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "max") {
          if (input.data.length > check.value) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.too_big,
              maximum: check.value,
              type: "string",
              inclusive: true,
              exact: false,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "length") {
          const tooBig = input.data.length > check.value;
          const tooSmall = input.data.length < check.value;
          if (tooBig || tooSmall) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            if (tooBig) {
              addIssueToContext(ctx2, {
                code: ZodIssueCode.too_big,
                maximum: check.value,
                type: "string",
                inclusive: true,
                exact: true,
                message: check.message
              });
            } else if (tooSmall) {
              addIssueToContext(ctx2, {
                code: ZodIssueCode.too_small,
                minimum: check.value,
                type: "string",
                inclusive: true,
                exact: true,
                message: check.message
              });
            }
            status.dirty();
          }
        } else if (check.kind === "email") {
          if (!emailRegex.test(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "email",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "emoji") {
          if (!emojiRegex) {
            emojiRegex = new RegExp(_emojiRegex, "u");
          }
          if (!emojiRegex.test(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "emoji",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "uuid") {
          if (!uuidRegex.test(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "uuid",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "nanoid") {
          if (!nanoidRegex.test(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "nanoid",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "cuid") {
          if (!cuidRegex.test(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "cuid",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "cuid2") {
          if (!cuid2Regex.test(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "cuid2",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "ulid") {
          if (!ulidRegex.test(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "ulid",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "url") {
          try {
            new URL(input.data);
          } catch (e) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "url",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "regex") {
          check.regex.lastIndex = 0;
          const testResult = check.regex.test(input.data);
          if (!testResult) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "regex",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "trim") {
          input.data = input.data.trim();
        } else if (check.kind === "includes") {
          if (!input.data.includes(check.value, check.position)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.invalid_string,
              validation: { includes: check.value, position: check.position },
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "toLowerCase") {
          input.data = input.data.toLowerCase();
        } else if (check.kind === "toUpperCase") {
          input.data = input.data.toUpperCase();
        } else if (check.kind === "startsWith") {
          if (!input.data.startsWith(check.value)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.invalid_string,
              validation: { startsWith: check.value },
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "endsWith") {
          if (!input.data.endsWith(check.value)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.invalid_string,
              validation: { endsWith: check.value },
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "datetime") {
          const regex = datetimeRegex(check);
          if (!regex.test(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.invalid_string,
              validation: "datetime",
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "date") {
          const regex = dateRegex;
          if (!regex.test(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.invalid_string,
              validation: "date",
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "time") {
          const regex = timeRegex(check);
          if (!regex.test(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.invalid_string,
              validation: "time",
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "duration") {
          if (!durationRegex.test(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "duration",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "ip") {
          if (!isValidIP(input.data, check.version)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "ip",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "jwt") {
          if (!isValidJWT(input.data, check.alg)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "jwt",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "cidr") {
          if (!isValidCidr(input.data, check.version)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "cidr",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "base64") {
          if (!base64Regex.test(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "base64",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "base64url") {
          if (!base64urlRegex.test(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              validation: "base64url",
              code: ZodIssueCode.invalid_string,
              message: check.message
            });
            status.dirty();
          }
        } else {
          util.assertNever(check);
        }
      }
      return { status: status.value, value: input.data };
    }
    _regex(regex, validation, message) {
      return this.refinement((data) => regex.test(data), __spreadValues({
        validation,
        code: ZodIssueCode.invalid_string
      }, errorUtil.errToObj(message)));
    }
    _addCheck(check) {
      return new _ZodString(__spreadProps(__spreadValues({}, this._def), {
        checks: [...this._def.checks, check]
      }));
    }
    email(message) {
      return this._addCheck(__spreadValues({ kind: "email" }, errorUtil.errToObj(message)));
    }
    url(message) {
      return this._addCheck(__spreadValues({ kind: "url" }, errorUtil.errToObj(message)));
    }
    emoji(message) {
      return this._addCheck(__spreadValues({ kind: "emoji" }, errorUtil.errToObj(message)));
    }
    uuid(message) {
      return this._addCheck(__spreadValues({ kind: "uuid" }, errorUtil.errToObj(message)));
    }
    nanoid(message) {
      return this._addCheck(__spreadValues({ kind: "nanoid" }, errorUtil.errToObj(message)));
    }
    cuid(message) {
      return this._addCheck(__spreadValues({ kind: "cuid" }, errorUtil.errToObj(message)));
    }
    cuid2(message) {
      return this._addCheck(__spreadValues({ kind: "cuid2" }, errorUtil.errToObj(message)));
    }
    ulid(message) {
      return this._addCheck(__spreadValues({ kind: "ulid" }, errorUtil.errToObj(message)));
    }
    base64(message) {
      return this._addCheck(__spreadValues({ kind: "base64" }, errorUtil.errToObj(message)));
    }
    base64url(message) {
      return this._addCheck(__spreadValues({
        kind: "base64url"
      }, errorUtil.errToObj(message)));
    }
    jwt(options2) {
      return this._addCheck(__spreadValues({ kind: "jwt" }, errorUtil.errToObj(options2)));
    }
    ip(options2) {
      return this._addCheck(__spreadValues({ kind: "ip" }, errorUtil.errToObj(options2)));
    }
    cidr(options2) {
      return this._addCheck(__spreadValues({ kind: "cidr" }, errorUtil.errToObj(options2)));
    }
    datetime(options2) {
      var _a2, _b2;
      if (typeof options2 === "string") {
        return this._addCheck({
          kind: "datetime",
          precision: null,
          offset: false,
          local: false,
          message: options2
        });
      }
      return this._addCheck(__spreadValues({
        kind: "datetime",
        precision: typeof (options2 == null ? void 0 : options2.precision) === "undefined" ? null : options2 == null ? void 0 : options2.precision,
        offset: (_a2 = options2 == null ? void 0 : options2.offset) != null ? _a2 : false,
        local: (_b2 = options2 == null ? void 0 : options2.local) != null ? _b2 : false
      }, errorUtil.errToObj(options2 == null ? void 0 : options2.message)));
    }
    date(message) {
      return this._addCheck({ kind: "date", message });
    }
    time(options2) {
      if (typeof options2 === "string") {
        return this._addCheck({
          kind: "time",
          precision: null,
          message: options2
        });
      }
      return this._addCheck(__spreadValues({
        kind: "time",
        precision: typeof (options2 == null ? void 0 : options2.precision) === "undefined" ? null : options2 == null ? void 0 : options2.precision
      }, errorUtil.errToObj(options2 == null ? void 0 : options2.message)));
    }
    duration(message) {
      return this._addCheck(__spreadValues({ kind: "duration" }, errorUtil.errToObj(message)));
    }
    regex(regex, message) {
      return this._addCheck(__spreadValues({
        kind: "regex",
        regex
      }, errorUtil.errToObj(message)));
    }
    includes(value, options2) {
      return this._addCheck(__spreadValues({
        kind: "includes",
        value,
        position: options2 == null ? void 0 : options2.position
      }, errorUtil.errToObj(options2 == null ? void 0 : options2.message)));
    }
    startsWith(value, message) {
      return this._addCheck(__spreadValues({
        kind: "startsWith",
        value
      }, errorUtil.errToObj(message)));
    }
    endsWith(value, message) {
      return this._addCheck(__spreadValues({
        kind: "endsWith",
        value
      }, errorUtil.errToObj(message)));
    }
    min(minLength, message) {
      return this._addCheck(__spreadValues({
        kind: "min",
        value: minLength
      }, errorUtil.errToObj(message)));
    }
    max(maxLength, message) {
      return this._addCheck(__spreadValues({
        kind: "max",
        value: maxLength
      }, errorUtil.errToObj(message)));
    }
    length(len, message) {
      return this._addCheck(__spreadValues({
        kind: "length",
        value: len
      }, errorUtil.errToObj(message)));
    }
    /**
     * Equivalent to `.min(1)`
     */
    nonempty(message) {
      return this.min(1, errorUtil.errToObj(message));
    }
    trim() {
      return new _ZodString(__spreadProps(__spreadValues({}, this._def), {
        checks: [...this._def.checks, { kind: "trim" }]
      }));
    }
    toLowerCase() {
      return new _ZodString(__spreadProps(__spreadValues({}, this._def), {
        checks: [...this._def.checks, { kind: "toLowerCase" }]
      }));
    }
    toUpperCase() {
      return new _ZodString(__spreadProps(__spreadValues({}, this._def), {
        checks: [...this._def.checks, { kind: "toUpperCase" }]
      }));
    }
    get isDatetime() {
      return !!this._def.checks.find((ch) => ch.kind === "datetime");
    }
    get isDate() {
      return !!this._def.checks.find((ch) => ch.kind === "date");
    }
    get isTime() {
      return !!this._def.checks.find((ch) => ch.kind === "time");
    }
    get isDuration() {
      return !!this._def.checks.find((ch) => ch.kind === "duration");
    }
    get isEmail() {
      return !!this._def.checks.find((ch) => ch.kind === "email");
    }
    get isURL() {
      return !!this._def.checks.find((ch) => ch.kind === "url");
    }
    get isEmoji() {
      return !!this._def.checks.find((ch) => ch.kind === "emoji");
    }
    get isUUID() {
      return !!this._def.checks.find((ch) => ch.kind === "uuid");
    }
    get isNANOID() {
      return !!this._def.checks.find((ch) => ch.kind === "nanoid");
    }
    get isCUID() {
      return !!this._def.checks.find((ch) => ch.kind === "cuid");
    }
    get isCUID2() {
      return !!this._def.checks.find((ch) => ch.kind === "cuid2");
    }
    get isULID() {
      return !!this._def.checks.find((ch) => ch.kind === "ulid");
    }
    get isIP() {
      return !!this._def.checks.find((ch) => ch.kind === "ip");
    }
    get isCIDR() {
      return !!this._def.checks.find((ch) => ch.kind === "cidr");
    }
    get isBase64() {
      return !!this._def.checks.find((ch) => ch.kind === "base64");
    }
    get isBase64url() {
      return !!this._def.checks.find((ch) => ch.kind === "base64url");
    }
    get minLength() {
      let min2 = null;
      for (const ch of this._def.checks) {
        if (ch.kind === "min") {
          if (min2 === null || ch.value > min2)
            min2 = ch.value;
        }
      }
      return min2;
    }
    get maxLength() {
      let max2 = null;
      for (const ch of this._def.checks) {
        if (ch.kind === "max") {
          if (max2 === null || ch.value < max2)
            max2 = ch.value;
        }
      }
      return max2;
    }
  };
  __name(_ZodString, "ZodString");
  let ZodString = _ZodString;
  ZodString.create = (params) => {
    var _a2;
    return new ZodString(__spreadValues({
      checks: [],
      typeName: ZodFirstPartyTypeKind.ZodString,
      coerce: (_a2 = params == null ? void 0 : params.coerce) != null ? _a2 : false
    }, processCreateParams(params)));
  };
  function floatSafeRemainder(val, step) {
    const valDecCount = (val.toString().split(".")[1] || "").length;
    const stepDecCount = (step.toString().split(".")[1] || "").length;
    const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
    const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
    const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
    return valInt % stepInt / __pow(10, decCount);
  }
  __name(floatSafeRemainder, "floatSafeRemainder");
  const _ZodNumber = class _ZodNumber extends ZodType {
    constructor() {
      super(...arguments);
      this.min = this.gte;
      this.max = this.lte;
      this.step = this.multipleOf;
    }
    _parse(input) {
      if (this._def.coerce) {
        input.data = Number(input.data);
      }
      const parsedType = this._getType(input);
      if (parsedType !== ZodParsedType.number) {
        const ctx3 = this._getOrReturnCtx(input);
        addIssueToContext(ctx3, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.number,
          received: ctx3.parsedType
        });
        return INVALID;
      }
      let ctx2 = void 0;
      const status = new ParseStatus();
      for (const check of this._def.checks) {
        if (check.kind === "int") {
          if (!util.isInteger(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.invalid_type,
              expected: "integer",
              received: "float",
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "min") {
          const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
          if (tooSmall) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.too_small,
              minimum: check.value,
              type: "number",
              inclusive: check.inclusive,
              exact: false,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "max") {
          const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
          if (tooBig) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.too_big,
              maximum: check.value,
              type: "number",
              inclusive: check.inclusive,
              exact: false,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "multipleOf") {
          if (floatSafeRemainder(input.data, check.value) !== 0) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.not_multiple_of,
              multipleOf: check.value,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "finite") {
          if (!Number.isFinite(input.data)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.not_finite,
              message: check.message
            });
            status.dirty();
          }
        } else {
          util.assertNever(check);
        }
      }
      return { status: status.value, value: input.data };
    }
    gte(value, message) {
      return this.setLimit("min", value, true, errorUtil.toString(message));
    }
    gt(value, message) {
      return this.setLimit("min", value, false, errorUtil.toString(message));
    }
    lte(value, message) {
      return this.setLimit("max", value, true, errorUtil.toString(message));
    }
    lt(value, message) {
      return this.setLimit("max", value, false, errorUtil.toString(message));
    }
    setLimit(kind, value, inclusive, message) {
      return new _ZodNumber(__spreadProps(__spreadValues({}, this._def), {
        checks: [
          ...this._def.checks,
          {
            kind,
            value,
            inclusive,
            message: errorUtil.toString(message)
          }
        ]
      }));
    }
    _addCheck(check) {
      return new _ZodNumber(__spreadProps(__spreadValues({}, this._def), {
        checks: [...this._def.checks, check]
      }));
    }
    int(message) {
      return this._addCheck({
        kind: "int",
        message: errorUtil.toString(message)
      });
    }
    positive(message) {
      return this._addCheck({
        kind: "min",
        value: 0,
        inclusive: false,
        message: errorUtil.toString(message)
      });
    }
    negative(message) {
      return this._addCheck({
        kind: "max",
        value: 0,
        inclusive: false,
        message: errorUtil.toString(message)
      });
    }
    nonpositive(message) {
      return this._addCheck({
        kind: "max",
        value: 0,
        inclusive: true,
        message: errorUtil.toString(message)
      });
    }
    nonnegative(message) {
      return this._addCheck({
        kind: "min",
        value: 0,
        inclusive: true,
        message: errorUtil.toString(message)
      });
    }
    multipleOf(value, message) {
      return this._addCheck({
        kind: "multipleOf",
        value,
        message: errorUtil.toString(message)
      });
    }
    finite(message) {
      return this._addCheck({
        kind: "finite",
        message: errorUtil.toString(message)
      });
    }
    safe(message) {
      return this._addCheck({
        kind: "min",
        inclusive: true,
        value: Number.MIN_SAFE_INTEGER,
        message: errorUtil.toString(message)
      })._addCheck({
        kind: "max",
        inclusive: true,
        value: Number.MAX_SAFE_INTEGER,
        message: errorUtil.toString(message)
      });
    }
    get minValue() {
      let min2 = null;
      for (const ch of this._def.checks) {
        if (ch.kind === "min") {
          if (min2 === null || ch.value > min2)
            min2 = ch.value;
        }
      }
      return min2;
    }
    get maxValue() {
      let max2 = null;
      for (const ch of this._def.checks) {
        if (ch.kind === "max") {
          if (max2 === null || ch.value < max2)
            max2 = ch.value;
        }
      }
      return max2;
    }
    get isInt() {
      return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
    }
    get isFinite() {
      let max2 = null;
      let min2 = null;
      for (const ch of this._def.checks) {
        if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
          return true;
        } else if (ch.kind === "min") {
          if (min2 === null || ch.value > min2)
            min2 = ch.value;
        } else if (ch.kind === "max") {
          if (max2 === null || ch.value < max2)
            max2 = ch.value;
        }
      }
      return Number.isFinite(min2) && Number.isFinite(max2);
    }
  };
  __name(_ZodNumber, "ZodNumber");
  let ZodNumber = _ZodNumber;
  ZodNumber.create = (params) => {
    return new ZodNumber(__spreadValues({
      checks: [],
      typeName: ZodFirstPartyTypeKind.ZodNumber,
      coerce: (params == null ? void 0 : params.coerce) || false
    }, processCreateParams(params)));
  };
  const _ZodBigInt = class _ZodBigInt extends ZodType {
    constructor() {
      super(...arguments);
      this.min = this.gte;
      this.max = this.lte;
    }
    _parse(input) {
      if (this._def.coerce) {
        try {
          input.data = BigInt(input.data);
        } catch (e) {
          return this._getInvalidInput(input);
        }
      }
      const parsedType = this._getType(input);
      if (parsedType !== ZodParsedType.bigint) {
        return this._getInvalidInput(input);
      }
      let ctx2 = void 0;
      const status = new ParseStatus();
      for (const check of this._def.checks) {
        if (check.kind === "min") {
          const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
          if (tooSmall) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.too_small,
              type: "bigint",
              minimum: check.value,
              inclusive: check.inclusive,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "max") {
          const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
          if (tooBig) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.too_big,
              type: "bigint",
              maximum: check.value,
              inclusive: check.inclusive,
              message: check.message
            });
            status.dirty();
          }
        } else if (check.kind === "multipleOf") {
          if (input.data % check.value !== BigInt(0)) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.not_multiple_of,
              multipleOf: check.value,
              message: check.message
            });
            status.dirty();
          }
        } else {
          util.assertNever(check);
        }
      }
      return { status: status.value, value: input.data };
    }
    _getInvalidInput(input) {
      const ctx2 = this._getOrReturnCtx(input);
      addIssueToContext(ctx2, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.bigint,
        received: ctx2.parsedType
      });
      return INVALID;
    }
    gte(value, message) {
      return this.setLimit("min", value, true, errorUtil.toString(message));
    }
    gt(value, message) {
      return this.setLimit("min", value, false, errorUtil.toString(message));
    }
    lte(value, message) {
      return this.setLimit("max", value, true, errorUtil.toString(message));
    }
    lt(value, message) {
      return this.setLimit("max", value, false, errorUtil.toString(message));
    }
    setLimit(kind, value, inclusive, message) {
      return new _ZodBigInt(__spreadProps(__spreadValues({}, this._def), {
        checks: [
          ...this._def.checks,
          {
            kind,
            value,
            inclusive,
            message: errorUtil.toString(message)
          }
        ]
      }));
    }
    _addCheck(check) {
      return new _ZodBigInt(__spreadProps(__spreadValues({}, this._def), {
        checks: [...this._def.checks, check]
      }));
    }
    positive(message) {
      return this._addCheck({
        kind: "min",
        value: BigInt(0),
        inclusive: false,
        message: errorUtil.toString(message)
      });
    }
    negative(message) {
      return this._addCheck({
        kind: "max",
        value: BigInt(0),
        inclusive: false,
        message: errorUtil.toString(message)
      });
    }
    nonpositive(message) {
      return this._addCheck({
        kind: "max",
        value: BigInt(0),
        inclusive: true,
        message: errorUtil.toString(message)
      });
    }
    nonnegative(message) {
      return this._addCheck({
        kind: "min",
        value: BigInt(0),
        inclusive: true,
        message: errorUtil.toString(message)
      });
    }
    multipleOf(value, message) {
      return this._addCheck({
        kind: "multipleOf",
        value,
        message: errorUtil.toString(message)
      });
    }
    get minValue() {
      let min2 = null;
      for (const ch of this._def.checks) {
        if (ch.kind === "min") {
          if (min2 === null || ch.value > min2)
            min2 = ch.value;
        }
      }
      return min2;
    }
    get maxValue() {
      let max2 = null;
      for (const ch of this._def.checks) {
        if (ch.kind === "max") {
          if (max2 === null || ch.value < max2)
            max2 = ch.value;
        }
      }
      return max2;
    }
  };
  __name(_ZodBigInt, "ZodBigInt");
  let ZodBigInt = _ZodBigInt;
  ZodBigInt.create = (params) => {
    var _a2;
    return new ZodBigInt(__spreadValues({
      checks: [],
      typeName: ZodFirstPartyTypeKind.ZodBigInt,
      coerce: (_a2 = params == null ? void 0 : params.coerce) != null ? _a2 : false
    }, processCreateParams(params)));
  };
  const _ZodBoolean = class _ZodBoolean extends ZodType {
    _parse(input) {
      if (this._def.coerce) {
        input.data = Boolean(input.data);
      }
      const parsedType = this._getType(input);
      if (parsedType !== ZodParsedType.boolean) {
        const ctx2 = this._getOrReturnCtx(input);
        addIssueToContext(ctx2, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.boolean,
          received: ctx2.parsedType
        });
        return INVALID;
      }
      return OK(input.data);
    }
  };
  __name(_ZodBoolean, "ZodBoolean");
  let ZodBoolean = _ZodBoolean;
  ZodBoolean.create = (params) => {
    return new ZodBoolean(__spreadValues({
      typeName: ZodFirstPartyTypeKind.ZodBoolean,
      coerce: (params == null ? void 0 : params.coerce) || false
    }, processCreateParams(params)));
  };
  const _ZodDate = class _ZodDate extends ZodType {
    _parse(input) {
      if (this._def.coerce) {
        input.data = new Date(input.data);
      }
      const parsedType = this._getType(input);
      if (parsedType !== ZodParsedType.date) {
        const ctx3 = this._getOrReturnCtx(input);
        addIssueToContext(ctx3, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.date,
          received: ctx3.parsedType
        });
        return INVALID;
      }
      if (Number.isNaN(input.data.getTime())) {
        const ctx3 = this._getOrReturnCtx(input);
        addIssueToContext(ctx3, {
          code: ZodIssueCode.invalid_date
        });
        return INVALID;
      }
      const status = new ParseStatus();
      let ctx2 = void 0;
      for (const check of this._def.checks) {
        if (check.kind === "min") {
          if (input.data.getTime() < check.value) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.too_small,
              message: check.message,
              inclusive: true,
              exact: false,
              minimum: check.value,
              type: "date"
            });
            status.dirty();
          }
        } else if (check.kind === "max") {
          if (input.data.getTime() > check.value) {
            ctx2 = this._getOrReturnCtx(input, ctx2);
            addIssueToContext(ctx2, {
              code: ZodIssueCode.too_big,
              message: check.message,
              inclusive: true,
              exact: false,
              maximum: check.value,
              type: "date"
            });
            status.dirty();
          }
        } else {
          util.assertNever(check);
        }
      }
      return {
        status: status.value,
        value: new Date(input.data.getTime())
      };
    }
    _addCheck(check) {
      return new _ZodDate(__spreadProps(__spreadValues({}, this._def), {
        checks: [...this._def.checks, check]
      }));
    }
    min(minDate, message) {
      return this._addCheck({
        kind: "min",
        value: minDate.getTime(),
        message: errorUtil.toString(message)
      });
    }
    max(maxDate, message) {
      return this._addCheck({
        kind: "max",
        value: maxDate.getTime(),
        message: errorUtil.toString(message)
      });
    }
    get minDate() {
      let min2 = null;
      for (const ch of this._def.checks) {
        if (ch.kind === "min") {
          if (min2 === null || ch.value > min2)
            min2 = ch.value;
        }
      }
      return min2 != null ? new Date(min2) : null;
    }
    get maxDate() {
      let max2 = null;
      for (const ch of this._def.checks) {
        if (ch.kind === "max") {
          if (max2 === null || ch.value < max2)
            max2 = ch.value;
        }
      }
      return max2 != null ? new Date(max2) : null;
    }
  };
  __name(_ZodDate, "ZodDate");
  let ZodDate = _ZodDate;
  ZodDate.create = (params) => {
    return new ZodDate(__spreadValues({
      checks: [],
      coerce: (params == null ? void 0 : params.coerce) || false,
      typeName: ZodFirstPartyTypeKind.ZodDate
    }, processCreateParams(params)));
  };
  const _ZodSymbol = class _ZodSymbol extends ZodType {
    _parse(input) {
      const parsedType = this._getType(input);
      if (parsedType !== ZodParsedType.symbol) {
        const ctx2 = this._getOrReturnCtx(input);
        addIssueToContext(ctx2, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.symbol,
          received: ctx2.parsedType
        });
        return INVALID;
      }
      return OK(input.data);
    }
  };
  __name(_ZodSymbol, "ZodSymbol");
  let ZodSymbol = _ZodSymbol;
  ZodSymbol.create = (params) => {
    return new ZodSymbol(__spreadValues({
      typeName: ZodFirstPartyTypeKind.ZodSymbol
    }, processCreateParams(params)));
  };
  const _ZodUndefined = class _ZodUndefined extends ZodType {
    _parse(input) {
      const parsedType = this._getType(input);
      if (parsedType !== ZodParsedType.undefined) {
        const ctx2 = this._getOrReturnCtx(input);
        addIssueToContext(ctx2, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.undefined,
          received: ctx2.parsedType
        });
        return INVALID;
      }
      return OK(input.data);
    }
  };
  __name(_ZodUndefined, "ZodUndefined");
  let ZodUndefined = _ZodUndefined;
  ZodUndefined.create = (params) => {
    return new ZodUndefined(__spreadValues({
      typeName: ZodFirstPartyTypeKind.ZodUndefined
    }, processCreateParams(params)));
  };
  const _ZodNull = class _ZodNull extends ZodType {
    _parse(input) {
      const parsedType = this._getType(input);
      if (parsedType !== ZodParsedType.null) {
        const ctx2 = this._getOrReturnCtx(input);
        addIssueToContext(ctx2, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.null,
          received: ctx2.parsedType
        });
        return INVALID;
      }
      return OK(input.data);
    }
  };
  __name(_ZodNull, "ZodNull");
  let ZodNull = _ZodNull;
  ZodNull.create = (params) => {
    return new ZodNull(__spreadValues({
      typeName: ZodFirstPartyTypeKind.ZodNull
    }, processCreateParams(params)));
  };
  const _ZodAny = class _ZodAny extends ZodType {
    constructor() {
      super(...arguments);
      this._any = true;
    }
    _parse(input) {
      return OK(input.data);
    }
  };
  __name(_ZodAny, "ZodAny");
  let ZodAny = _ZodAny;
  ZodAny.create = (params) => {
    return new ZodAny(__spreadValues({
      typeName: ZodFirstPartyTypeKind.ZodAny
    }, processCreateParams(params)));
  };
  const _ZodUnknown = class _ZodUnknown extends ZodType {
    constructor() {
      super(...arguments);
      this._unknown = true;
    }
    _parse(input) {
      return OK(input.data);
    }
  };
  __name(_ZodUnknown, "ZodUnknown");
  let ZodUnknown = _ZodUnknown;
  ZodUnknown.create = (params) => {
    return new ZodUnknown(__spreadValues({
      typeName: ZodFirstPartyTypeKind.ZodUnknown
    }, processCreateParams(params)));
  };
  const _ZodNever = class _ZodNever extends ZodType {
    _parse(input) {
      const ctx2 = this._getOrReturnCtx(input);
      addIssueToContext(ctx2, {
        code: ZodIssueCode.invalid_type,
        expected: ZodParsedType.never,
        received: ctx2.parsedType
      });
      return INVALID;
    }
  };
  __name(_ZodNever, "ZodNever");
  let ZodNever = _ZodNever;
  ZodNever.create = (params) => {
    return new ZodNever(__spreadValues({
      typeName: ZodFirstPartyTypeKind.ZodNever
    }, processCreateParams(params)));
  };
  const _ZodVoid = class _ZodVoid extends ZodType {
    _parse(input) {
      const parsedType = this._getType(input);
      if (parsedType !== ZodParsedType.undefined) {
        const ctx2 = this._getOrReturnCtx(input);
        addIssueToContext(ctx2, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.void,
          received: ctx2.parsedType
        });
        return INVALID;
      }
      return OK(input.data);
    }
  };
  __name(_ZodVoid, "ZodVoid");
  let ZodVoid = _ZodVoid;
  ZodVoid.create = (params) => {
    return new ZodVoid(__spreadValues({
      typeName: ZodFirstPartyTypeKind.ZodVoid
    }, processCreateParams(params)));
  };
  const _ZodArray = class _ZodArray extends ZodType {
    _parse(input) {
      const { ctx: ctx2, status } = this._processInputParams(input);
      const def = this._def;
      if (ctx2.parsedType !== ZodParsedType.array) {
        addIssueToContext(ctx2, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.array,
          received: ctx2.parsedType
        });
        return INVALID;
      }
      if (def.exactLength !== null) {
        const tooBig = ctx2.data.length > def.exactLength.value;
        const tooSmall = ctx2.data.length < def.exactLength.value;
        if (tooBig || tooSmall) {
          addIssueToContext(ctx2, {
            code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,
            minimum: tooSmall ? def.exactLength.value : void 0,
            maximum: tooBig ? def.exactLength.value : void 0,
            type: "array",
            inclusive: true,
            exact: true,
            message: def.exactLength.message
          });
          status.dirty();
        }
      }
      if (def.minLength !== null) {
        if (ctx2.data.length < def.minLength.value) {
          addIssueToContext(ctx2, {
            code: ZodIssueCode.too_small,
            minimum: def.minLength.value,
            type: "array",
            inclusive: true,
            exact: false,
            message: def.minLength.message
          });
          status.dirty();
        }
      }
      if (def.maxLength !== null) {
        if (ctx2.data.length > def.maxLength.value) {
          addIssueToContext(ctx2, {
            code: ZodIssueCode.too_big,
            maximum: def.maxLength.value,
            type: "array",
            inclusive: true,
            exact: false,
            message: def.maxLength.message
          });
          status.dirty();
        }
      }
      if (ctx2.common.async) {
        return Promise.all([...ctx2.data].map((item, i2) => {
          return def.type._parseAsync(new ParseInputLazyPath(ctx2, item, ctx2.path, i2));
        })).then((result2) => {
          return ParseStatus.mergeArray(status, result2);
        });
      }
      const result = [...ctx2.data].map((item, i2) => {
        return def.type._parseSync(new ParseInputLazyPath(ctx2, item, ctx2.path, i2));
      });
      return ParseStatus.mergeArray(status, result);
    }
    get element() {
      return this._def.type;
    }
    min(minLength, message) {
      return new _ZodArray(__spreadProps(__spreadValues({}, this._def), {
        minLength: { value: minLength, message: errorUtil.toString(message) }
      }));
    }
    max(maxLength, message) {
      return new _ZodArray(__spreadProps(__spreadValues({}, this._def), {
        maxLength: { value: maxLength, message: errorUtil.toString(message) }
      }));
    }
    length(len, message) {
      return new _ZodArray(__spreadProps(__spreadValues({}, this._def), {
        exactLength: { value: len, message: errorUtil.toString(message) }
      }));
    }
    nonempty(message) {
      return this.min(1, message);
    }
  };
  __name(_ZodArray, "ZodArray");
  let ZodArray = _ZodArray;
  ZodArray.create = (schema, params) => {
    return new ZodArray(__spreadValues({
      type: schema,
      minLength: null,
      maxLength: null,
      exactLength: null,
      typeName: ZodFirstPartyTypeKind.ZodArray
    }, processCreateParams(params)));
  };
  function deepPartialify(schema) {
    if (schema instanceof ZodObject) {
      const newShape = {};
      for (const key in schema.shape) {
        const fieldSchema = schema.shape[key];
        newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
      }
      return new ZodObject(__spreadProps(__spreadValues({}, schema._def), {
        shape: /* @__PURE__ */ __name(() => newShape, "shape")
      }));
    } else if (schema instanceof ZodArray) {
      return new ZodArray(__spreadProps(__spreadValues({}, schema._def), {
        type: deepPartialify(schema.element)
      }));
    } else if (schema instanceof ZodOptional) {
      return ZodOptional.create(deepPartialify(schema.unwrap()));
    } else if (schema instanceof ZodNullable) {
      return ZodNullable.create(deepPartialify(schema.unwrap()));
    } else if (schema instanceof ZodTuple) {
      return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));
    } else {
      return schema;
    }
  }
  __name(deepPartialify, "deepPartialify");
  const _ZodObject = class _ZodObject extends ZodType {
    constructor() {
      super(...arguments);
      this._cached = null;
      this.nonstrict = this.passthrough;
      this.augment = this.extend;
    }
    _getCached() {
      if (this._cached !== null)
        return this._cached;
      const shape = this._def.shape();
      const keys2 = util.objectKeys(shape);
      this._cached = { shape, keys: keys2 };
      return this._cached;
    }
    _parse(input) {
      const parsedType = this._getType(input);
      if (parsedType !== ZodParsedType.object) {
        const ctx3 = this._getOrReturnCtx(input);
        addIssueToContext(ctx3, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.object,
          received: ctx3.parsedType
        });
        return INVALID;
      }
      const { status, ctx: ctx2 } = this._processInputParams(input);
      const { shape, keys: shapeKeys } = this._getCached();
      const extraKeys = [];
      if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
        for (const key in ctx2.data) {
          if (!shapeKeys.includes(key)) {
            extraKeys.push(key);
          }
        }
      }
      const pairs = [];
      for (const key of shapeKeys) {
        const keyValidator = shape[key];
        const value = ctx2.data[key];
        pairs.push({
          key: { status: "valid", value: key },
          value: keyValidator._parse(new ParseInputLazyPath(ctx2, value, ctx2.path, key)),
          alwaysSet: key in ctx2.data
        });
      }
      if (this._def.catchall instanceof ZodNever) {
        const unknownKeys = this._def.unknownKeys;
        if (unknownKeys === "passthrough") {
          for (const key of extraKeys) {
            pairs.push({
              key: { status: "valid", value: key },
              value: { status: "valid", value: ctx2.data[key] }
            });
          }
        } else if (unknownKeys === "strict") {
          if (extraKeys.length > 0) {
            addIssueToContext(ctx2, {
              code: ZodIssueCode.unrecognized_keys,
              keys: extraKeys
            });
            status.dirty();
          }
        } else if (unknownKeys === "strip") ;
        else {
          throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
        }
      } else {
        const catchall = this._def.catchall;
        for (const key of extraKeys) {
          const value = ctx2.data[key];
          pairs.push({
            key: { status: "valid", value: key },
            value: catchall._parse(
              new ParseInputLazyPath(ctx2, value, ctx2.path, key)
              //, ctx.child(key), value, getParsedType(value)
            ),
            alwaysSet: key in ctx2.data
          });
        }
      }
      if (ctx2.common.async) {
        return Promise.resolve().then(() => __async(this, null, function* () {
          const syncPairs = [];
          for (const pair of pairs) {
            const key = yield pair.key;
            const value = yield pair.value;
            syncPairs.push({
              key,
              value,
              alwaysSet: pair.alwaysSet
            });
          }
          return syncPairs;
        })).then((syncPairs) => {
          return ParseStatus.mergeObjectSync(status, syncPairs);
        });
      } else {
        return ParseStatus.mergeObjectSync(status, pairs);
      }
    }
    get shape() {
      return this._def.shape();
    }
    strict(message) {
      errorUtil.errToObj;
      return new _ZodObject(__spreadValues(__spreadProps(__spreadValues({}, this._def), {
        unknownKeys: "strict"
      }), message !== void 0 ? {
        errorMap: /* @__PURE__ */ __name((issue, ctx2) => {
          var _a2, _b2, _c2, _d;
          const defaultError = (_c2 = (_b2 = (_a2 = this._def).errorMap) == null ? void 0 : _b2.call(_a2, issue, ctx2).message) != null ? _c2 : ctx2.defaultError;
          if (issue.code === "unrecognized_keys")
            return {
              message: (_d = errorUtil.errToObj(message).message) != null ? _d : defaultError
            };
          return {
            message: defaultError
          };
        }, "errorMap")
      } : {}));
    }
    strip() {
      return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
        unknownKeys: "strip"
      }));
    }
    passthrough() {
      return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
        unknownKeys: "passthrough"
      }));
    }
    // const AugmentFactory =
    //   <Def extends ZodObjectDef>(def: Def) =>
    //   <Augmentation extends ZodRawShape>(
    //     augmentation: Augmentation
    //   ): ZodObject<
    //     extendShape<ReturnType<Def["shape"]>, Augmentation>,
    //     Def["unknownKeys"],
    //     Def["catchall"]
    //   > => {
    //     return new ZodObject({
    //       ...def,
    //       shape: () => ({
    //         ...def.shape(),
    //         ...augmentation,
    //       }),
    //     }) as any;
    //   };
    extend(augmentation) {
      return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
        shape: /* @__PURE__ */ __name(() => __spreadValues(__spreadValues({}, this._def.shape()), augmentation), "shape")
      }));
    }
    /**
     * Prior to zod@1.0.12 there was a bug in the
     * inferred type of merged objects. Please
     * upgrade if you are experiencing issues.
     */
    merge(merging) {
      const merged = new _ZodObject({
        unknownKeys: merging._def.unknownKeys,
        catchall: merging._def.catchall,
        shape: /* @__PURE__ */ __name(() => __spreadValues(__spreadValues({}, this._def.shape()), merging._def.shape()), "shape"),
        typeName: ZodFirstPartyTypeKind.ZodObject
      });
      return merged;
    }
    // merge<
    //   Incoming extends AnyZodObject,
    //   Augmentation extends Incoming["shape"],
    //   NewOutput extends {
    //     [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
    //       ? Augmentation[k]["_output"]
    //       : k extends keyof Output
    //       ? Output[k]
    //       : never;
    //   },
    //   NewInput extends {
    //     [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
    //       ? Augmentation[k]["_input"]
    //       : k extends keyof Input
    //       ? Input[k]
    //       : never;
    //   }
    // >(
    //   merging: Incoming
    // ): ZodObject<
    //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
    //   Incoming["_def"]["unknownKeys"],
    //   Incoming["_def"]["catchall"],
    //   NewOutput,
    //   NewInput
    // > {
    //   const merged: any = new ZodObject({
    //     unknownKeys: merging._def.unknownKeys,
    //     catchall: merging._def.catchall,
    //     shape: () =>
    //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
    //     typeName: ZodFirstPartyTypeKind.ZodObject,
    //   }) as any;
    //   return merged;
    // }
    setKey(key, schema) {
      return this.augment({ [key]: schema });
    }
    // merge<Incoming extends AnyZodObject>(
    //   merging: Incoming
    // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
    // ZodObject<
    //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
    //   Incoming["_def"]["unknownKeys"],
    //   Incoming["_def"]["catchall"]
    // > {
    //   // const mergedShape = objectUtil.mergeShapes(
    //   //   this._def.shape(),
    //   //   merging._def.shape()
    //   // );
    //   const merged: any = new ZodObject({
    //     unknownKeys: merging._def.unknownKeys,
    //     catchall: merging._def.catchall,
    //     shape: () =>
    //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
    //     typeName: ZodFirstPartyTypeKind.ZodObject,
    //   }) as any;
    //   return merged;
    // }
    catchall(index2) {
      return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
        catchall: index2
      }));
    }
    pick(mask) {
      const shape = {};
      for (const key of util.objectKeys(mask)) {
        if (mask[key] && this.shape[key]) {
          shape[key] = this.shape[key];
        }
      }
      return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
        shape: /* @__PURE__ */ __name(() => shape, "shape")
      }));
    }
    omit(mask) {
      const shape = {};
      for (const key of util.objectKeys(this.shape)) {
        if (!mask[key]) {
          shape[key] = this.shape[key];
        }
      }
      return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
        shape: /* @__PURE__ */ __name(() => shape, "shape")
      }));
    }
    /**
     * @deprecated
     */
    deepPartial() {
      return deepPartialify(this);
    }
    partial(mask) {
      const newShape = {};
      for (const key of util.objectKeys(this.shape)) {
        const fieldSchema = this.shape[key];
        if (mask && !mask[key]) {
          newShape[key] = fieldSchema;
        } else {
          newShape[key] = fieldSchema.optional();
        }
      }
      return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
        shape: /* @__PURE__ */ __name(() => newShape, "shape")
      }));
    }
    required(mask) {
      const newShape = {};
      for (const key of util.objectKeys(this.shape)) {
        if (mask && !mask[key]) {
          newShape[key] = this.shape[key];
        } else {
          const fieldSchema = this.shape[key];
          let newField = fieldSchema;
          while (newField instanceof ZodOptional) {
            newField = newField._def.innerType;
          }
          newShape[key] = newField;
        }
      }
      return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
        shape: /* @__PURE__ */ __name(() => newShape, "shape")
      }));
    }
    keyof() {
      return createZodEnum(util.objectKeys(this.shape));
    }
  };
  __name(_ZodObject, "ZodObject");
  let ZodObject = _ZodObject;
  ZodObject.create = (shape, params) => {
    return new ZodObject(__spreadValues({
      shape: /* @__PURE__ */ __name(() => shape, "shape"),
      unknownKeys: "strip",
      catchall: ZodNever.create(),
      typeName: ZodFirstPartyTypeKind.ZodObject
    }, processCreateParams(params)));
  };
  ZodObject.strictCreate = (shape, params) => {
    return new ZodObject(__spreadValues({
      shape: /* @__PURE__ */ __name(() => shape, "shape"),
      unknownKeys: "strict",
      catchall: ZodNever.create(),
      typeName: ZodFirstPartyTypeKind.ZodObject
    }, processCreateParams(params)));
  };
  ZodObject.lazycreate = (shape, params) => {
    return new ZodObject(__spreadValues({
      shape,
      unknownKeys: "strip",
      catchall: ZodNever.create(),
      typeName: ZodFirstPartyTypeKind.ZodObject
    }, processCreateParams(params)));
  };
  const _ZodUnion = class _ZodUnion extends ZodType {
    _parse(input) {
      const { ctx: ctx2 } = this._processInputParams(input);
      const options2 = this._def.options;
      function handleResults(results) {
        for (const result of results) {
          if (result.result.status === "valid") {
            return result.result;
          }
        }
        for (const result of results) {
          if (result.result.status === "dirty") {
            ctx2.common.issues.push(...result.ctx.common.issues);
            return result.result;
          }
        }
        const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));
        addIssueToContext(ctx2, {
          code: ZodIssueCode.invalid_union,
          unionErrors
        });
        return INVALID;
      }
      __name(handleResults, "handleResults");
      if (ctx2.common.async) {
        return Promise.all(options2.map((option) => __async(this, null, function* () {
          const childCtx = __spreadProps(__spreadValues({}, ctx2), {
            common: __spreadProps(__spreadValues({}, ctx2.common), {
              issues: []
            }),
            parent: null
          });
          return {
            result: yield option._parseAsync({
              data: ctx2.data,
              path: ctx2.path,
              parent: childCtx
            }),
            ctx: childCtx
          };
        }))).then(handleResults);
      } else {
        let dirty = void 0;
        const issues = [];
        for (const option of options2) {
          const childCtx = __spreadProps(__spreadValues({}, ctx2), {
            common: __spreadProps(__spreadValues({}, ctx2.common), {
              issues: []
            }),
            parent: null
          });
          const result = option._parseSync({
            data: ctx2.data,
            path: ctx2.path,
            parent: childCtx
          });
          if (result.status === "valid") {
            return result;
          } else if (result.status === "dirty" && !dirty) {
            dirty = { result, ctx: childCtx };
          }
          if (childCtx.common.issues.length) {
            issues.push(childCtx.common.issues);
          }
        }
        if (dirty) {
          ctx2.common.issues.push(...dirty.ctx.common.issues);
          return dirty.result;
        }
        const unionErrors = issues.map((issues2) => new ZodError(issues2));
        addIssueToContext(ctx2, {
          code: ZodIssueCode.invalid_union,
          unionErrors
        });
        return INVALID;
      }
    }
    get options() {
      return this._def.options;
    }
  };
  __name(_ZodUnion, "ZodUnion");
  let ZodUnion = _ZodUnion;
  ZodUnion.create = (types, params) => {
    return new ZodUnion(__spreadValues({
      options: types,
      typeName: ZodFirstPartyTypeKind.ZodUnion
    }, processCreateParams(params)));
  };
  function mergeValues(a2, b) {
    const aType = getParsedType(a2);
    const bType = getParsedType(b);
    if (a2 === b) {
      return { valid: true, data: a2 };
    } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
      const bKeys = util.objectKeys(b);
      const sharedKeys = util.objectKeys(a2).filter((key) => bKeys.indexOf(key) !== -1);
      const newObj = __spreadValues(__spreadValues({}, a2), b);
      for (const key of sharedKeys) {
        const sharedValue = mergeValues(a2[key], b[key]);
        if (!sharedValue.valid) {
          return { valid: false };
        }
        newObj[key] = sharedValue.data;
      }
      return { valid: true, data: newObj };
    } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
      if (a2.length !== b.length) {
        return { valid: false };
      }
      const newArray = [];
      for (let index2 = 0; index2 < a2.length; index2++) {
        const itemA = a2[index2];
        const itemB = b[index2];
        const sharedValue = mergeValues(itemA, itemB);
        if (!sharedValue.valid) {
          return { valid: false };
        }
        newArray.push(sharedValue.data);
      }
      return { valid: true, data: newArray };
    } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a2 === +b) {
      return { valid: true, data: a2 };
    } else {
      return { valid: false };
    }
  }
  __name(mergeValues, "mergeValues");
  const _ZodIntersection = class _ZodIntersection extends ZodType {
    _parse(input) {
      const { status, ctx: ctx2 } = this._processInputParams(input);
      const handleParsed = /* @__PURE__ */ __name((parsedLeft, parsedRight) => {
        if (isAborted(parsedLeft) || isAborted(parsedRight)) {
          return INVALID;
        }
        const merged = mergeValues(parsedLeft.value, parsedRight.value);
        if (!merged.valid) {
          addIssueToContext(ctx2, {
            code: ZodIssueCode.invalid_intersection_types
          });
          return INVALID;
        }
        if (isDirty(parsedLeft) || isDirty(parsedRight)) {
          status.dirty();
        }
        return { status: status.value, value: merged.data };
      }, "handleParsed");
      if (ctx2.common.async) {
        return Promise.all([
          this._def.left._parseAsync({
            data: ctx2.data,
            path: ctx2.path,
            parent: ctx2
          }),
          this._def.right._parseAsync({
            data: ctx2.data,
            path: ctx2.path,
            parent: ctx2
          })
        ]).then(([left, right]) => handleParsed(left, right));
      } else {
        return handleParsed(this._def.left._parseSync({
          data: ctx2.data,
          path: ctx2.path,
          parent: ctx2
        }), this._def.right._parseSync({
          data: ctx2.data,
          path: ctx2.path,
          parent: ctx2
        }));
      }
    }
  };
  __name(_ZodIntersection, "ZodIntersection");
  let ZodIntersection = _ZodIntersection;
  ZodIntersection.create = (left, right, params) => {
    return new ZodIntersection(__spreadValues({
      left,
      right,
      typeName: ZodFirstPartyTypeKind.ZodIntersection
    }, processCreateParams(params)));
  };
  const _ZodTuple = class _ZodTuple extends ZodType {
    _parse(input) {
      const { status, ctx: ctx2 } = this._processInputParams(input);
      if (ctx2.parsedType !== ZodParsedType.array) {
        addIssueToContext(ctx2, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.array,
          received: ctx2.parsedType
        });
        return INVALID;
      }
      if (ctx2.data.length < this._def.items.length) {
        addIssueToContext(ctx2, {
          code: ZodIssueCode.too_small,
          minimum: this._def.items.length,
          inclusive: true,
          exact: false,
          type: "array"
        });
        return INVALID;
      }
      const rest = this._def.rest;
      if (!rest && ctx2.data.length > this._def.items.length) {
        addIssueToContext(ctx2, {
          code: ZodIssueCode.too_big,
          maximum: this._def.items.length,
          inclusive: true,
          exact: false,
          type: "array"
        });
        status.dirty();
      }
      const items = [...ctx2.data].map((item, itemIndex) => {
        const schema = this._def.items[itemIndex] || this._def.rest;
        if (!schema)
          return null;
        return schema._parse(new ParseInputLazyPath(ctx2, item, ctx2.path, itemIndex));
      }).filter((x2) => !!x2);
      if (ctx2.common.async) {
        return Promise.all(items).then((results) => {
          return ParseStatus.mergeArray(status, results);
        });
      } else {
        return ParseStatus.mergeArray(status, items);
      }
    }
    get items() {
      return this._def.items;
    }
    rest(rest) {
      return new _ZodTuple(__spreadProps(__spreadValues({}, this._def), {
        rest
      }));
    }
  };
  __name(_ZodTuple, "ZodTuple");
  let ZodTuple = _ZodTuple;
  ZodTuple.create = (schemas, params) => {
    if (!Array.isArray(schemas)) {
      throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
    }
    return new ZodTuple(__spreadValues({
      items: schemas,
      typeName: ZodFirstPartyTypeKind.ZodTuple,
      rest: null
    }, processCreateParams(params)));
  };
  const _ZodMap = class _ZodMap extends ZodType {
    get keySchema() {
      return this._def.keyType;
    }
    get valueSchema() {
      return this._def.valueType;
    }
    _parse(input) {
      const { status, ctx: ctx2 } = this._processInputParams(input);
      if (ctx2.parsedType !== ZodParsedType.map) {
        addIssueToContext(ctx2, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.map,
          received: ctx2.parsedType
        });
        return INVALID;
      }
      const keyType = this._def.keyType;
      const valueType = this._def.valueType;
      const pairs = [...ctx2.data.entries()].map(([key, value], index2) => {
        return {
          key: keyType._parse(new ParseInputLazyPath(ctx2, key, ctx2.path, [index2, "key"])),
          value: valueType._parse(new ParseInputLazyPath(ctx2, value, ctx2.path, [index2, "value"]))
        };
      });
      if (ctx2.common.async) {
        const finalMap = /* @__PURE__ */ new Map();
        return Promise.resolve().then(() => __async(this, null, function* () {
          for (const pair of pairs) {
            const key = yield pair.key;
            const value = yield pair.value;
            if (key.status === "aborted" || value.status === "aborted") {
              return INVALID;
            }
            if (key.status === "dirty" || value.status === "dirty") {
              status.dirty();
            }
            finalMap.set(key.value, value.value);
          }
          return { status: status.value, value: finalMap };
        }));
      } else {
        const finalMap = /* @__PURE__ */ new Map();
        for (const pair of pairs) {
          const key = pair.key;
          const value = pair.value;
          if (key.status === "aborted" || value.status === "aborted") {
            return INVALID;
          }
          if (key.status === "dirty" || value.status === "dirty") {
            status.dirty();
          }
          finalMap.set(key.value, value.value);
        }
        return { status: status.value, value: finalMap };
      }
    }
  };
  __name(_ZodMap, "ZodMap");
  let ZodMap = _ZodMap;
  ZodMap.create = (keyType, valueType, params) => {
    return new ZodMap(__spreadValues({
      valueType,
      keyType,
      typeName: ZodFirstPartyTypeKind.ZodMap
    }, processCreateParams(params)));
  };
  const _ZodSet = class _ZodSet extends ZodType {
    _parse(input) {
      const { status, ctx: ctx2 } = this._processInputParams(input);
      if (ctx2.parsedType !== ZodParsedType.set) {
        addIssueToContext(ctx2, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.set,
          received: ctx2.parsedType
        });
        return INVALID;
      }
      const def = this._def;
      if (def.minSize !== null) {
        if (ctx2.data.size < def.minSize.value) {
          addIssueToContext(ctx2, {
            code: ZodIssueCode.too_small,
            minimum: def.minSize.value,
            type: "set",
            inclusive: true,
            exact: false,
            message: def.minSize.message
          });
          status.dirty();
        }
      }
      if (def.maxSize !== null) {
        if (ctx2.data.size > def.maxSize.value) {
          addIssueToContext(ctx2, {
            code: ZodIssueCode.too_big,
            maximum: def.maxSize.value,
            type: "set",
            inclusive: true,
            exact: false,
            message: def.maxSize.message
          });
          status.dirty();
        }
      }
      const valueType = this._def.valueType;
      function finalizeSet(elements2) {
        const parsedSet = /* @__PURE__ */ new Set();
        for (const element of elements2) {
          if (element.status === "aborted")
            return INVALID;
          if (element.status === "dirty")
            status.dirty();
          parsedSet.add(element.value);
        }
        return { status: status.value, value: parsedSet };
      }
      __name(finalizeSet, "finalizeSet");
      const elements = [...ctx2.data.values()].map((item, i2) => valueType._parse(new ParseInputLazyPath(ctx2, item, ctx2.path, i2)));
      if (ctx2.common.async) {
        return Promise.all(elements).then((elements2) => finalizeSet(elements2));
      } else {
        return finalizeSet(elements);
      }
    }
    min(minSize, message) {
      return new _ZodSet(__spreadProps(__spreadValues({}, this._def), {
        minSize: { value: minSize, message: errorUtil.toString(message) }
      }));
    }
    max(maxSize, message) {
      return new _ZodSet(__spreadProps(__spreadValues({}, this._def), {
        maxSize: { value: maxSize, message: errorUtil.toString(message) }
      }));
    }
    size(size2, message) {
      return this.min(size2, message).max(size2, message);
    }
    nonempty(message) {
      return this.min(1, message);
    }
  };
  __name(_ZodSet, "ZodSet");
  let ZodSet = _ZodSet;
  ZodSet.create = (valueType, params) => {
    return new ZodSet(__spreadValues({
      valueType,
      minSize: null,
      maxSize: null,
      typeName: ZodFirstPartyTypeKind.ZodSet
    }, processCreateParams(params)));
  };
  const _ZodLazy = class _ZodLazy extends ZodType {
    get schema() {
      return this._def.getter();
    }
    _parse(input) {
      const { ctx: ctx2 } = this._processInputParams(input);
      const lazySchema = this._def.getter();
      return lazySchema._parse({ data: ctx2.data, path: ctx2.path, parent: ctx2 });
    }
  };
  __name(_ZodLazy, "ZodLazy");
  let ZodLazy = _ZodLazy;
  ZodLazy.create = (getter, params) => {
    return new ZodLazy(__spreadValues({
      getter,
      typeName: ZodFirstPartyTypeKind.ZodLazy
    }, processCreateParams(params)));
  };
  const _ZodLiteral = class _ZodLiteral extends ZodType {
    _parse(input) {
      if (input.data !== this._def.value) {
        const ctx2 = this._getOrReturnCtx(input);
        addIssueToContext(ctx2, {
          received: ctx2.data,
          code: ZodIssueCode.invalid_literal,
          expected: this._def.value
        });
        return INVALID;
      }
      return { status: "valid", value: input.data };
    }
    get value() {
      return this._def.value;
    }
  };
  __name(_ZodLiteral, "ZodLiteral");
  let ZodLiteral = _ZodLiteral;
  ZodLiteral.create = (value, params) => {
    return new ZodLiteral(__spreadValues({
      value,
      typeName: ZodFirstPartyTypeKind.ZodLiteral
    }, processCreateParams(params)));
  };
  function createZodEnum(values, params) {
    return new ZodEnum(__spreadValues({
      values,
      typeName: ZodFirstPartyTypeKind.ZodEnum
    }, processCreateParams(params)));
  }
  __name(createZodEnum, "createZodEnum");
  const _ZodEnum = class _ZodEnum extends ZodType {
    _parse(input) {
      if (typeof input.data !== "string") {
        const ctx2 = this._getOrReturnCtx(input);
        const expectedValues = this._def.values;
        addIssueToContext(ctx2, {
          expected: util.joinValues(expectedValues),
          received: ctx2.parsedType,
          code: ZodIssueCode.invalid_type
        });
        return INVALID;
      }
      if (!this._cache) {
        this._cache = new Set(this._def.values);
      }
      if (!this._cache.has(input.data)) {
        const ctx2 = this._getOrReturnCtx(input);
        const expectedValues = this._def.values;
        addIssueToContext(ctx2, {
          received: ctx2.data,
          code: ZodIssueCode.invalid_enum_value,
          options: expectedValues
        });
        return INVALID;
      }
      return OK(input.data);
    }
    get options() {
      return this._def.values;
    }
    get enum() {
      const enumValues = {};
      for (const val of this._def.values) {
        enumValues[val] = val;
      }
      return enumValues;
    }
    get Values() {
      const enumValues = {};
      for (const val of this._def.values) {
        enumValues[val] = val;
      }
      return enumValues;
    }
    get Enum() {
      const enumValues = {};
      for (const val of this._def.values) {
        enumValues[val] = val;
      }
      return enumValues;
    }
    extract(values, newDef = this._def) {
      return _ZodEnum.create(values, __spreadValues(__spreadValues({}, this._def), newDef));
    }
    exclude(values, newDef = this._def) {
      return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), __spreadValues(__spreadValues({}, this._def), newDef));
    }
  };
  __name(_ZodEnum, "ZodEnum");
  let ZodEnum = _ZodEnum;
  ZodEnum.create = createZodEnum;
  const _ZodNativeEnum = class _ZodNativeEnum extends ZodType {
    _parse(input) {
      const nativeEnumValues = util.getValidEnumValues(this._def.values);
      const ctx2 = this._getOrReturnCtx(input);
      if (ctx2.parsedType !== ZodParsedType.string && ctx2.parsedType !== ZodParsedType.number) {
        const expectedValues = util.objectValues(nativeEnumValues);
        addIssueToContext(ctx2, {
          expected: util.joinValues(expectedValues),
          received: ctx2.parsedType,
          code: ZodIssueCode.invalid_type
        });
        return INVALID;
      }
      if (!this._cache) {
        this._cache = new Set(util.getValidEnumValues(this._def.values));
      }
      if (!this._cache.has(input.data)) {
        const expectedValues = util.objectValues(nativeEnumValues);
        addIssueToContext(ctx2, {
          received: ctx2.data,
          code: ZodIssueCode.invalid_enum_value,
          options: expectedValues
        });
        return INVALID;
      }
      return OK(input.data);
    }
    get enum() {
      return this._def.values;
    }
  };
  __name(_ZodNativeEnum, "ZodNativeEnum");
  let ZodNativeEnum = _ZodNativeEnum;
  ZodNativeEnum.create = (values, params) => {
    return new ZodNativeEnum(__spreadValues({
      values,
      typeName: ZodFirstPartyTypeKind.ZodNativeEnum
    }, processCreateParams(params)));
  };
  const _ZodPromise = class _ZodPromise extends ZodType {
    unwrap() {
      return this._def.type;
    }
    _parse(input) {
      const { ctx: ctx2 } = this._processInputParams(input);
      if (ctx2.parsedType !== ZodParsedType.promise && ctx2.common.async === false) {
        addIssueToContext(ctx2, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.promise,
          received: ctx2.parsedType
        });
        return INVALID;
      }
      const promisified = ctx2.parsedType === ZodParsedType.promise ? ctx2.data : Promise.resolve(ctx2.data);
      return OK(promisified.then((data) => {
        return this._def.type.parseAsync(data, {
          path: ctx2.path,
          errorMap: ctx2.common.contextualErrorMap
        });
      }));
    }
  };
  __name(_ZodPromise, "ZodPromise");
  let ZodPromise = _ZodPromise;
  ZodPromise.create = (schema, params) => {
    return new ZodPromise(__spreadValues({
      type: schema,
      typeName: ZodFirstPartyTypeKind.ZodPromise
    }, processCreateParams(params)));
  };
  const _ZodEffects = class _ZodEffects extends ZodType {
    innerType() {
      return this._def.schema;
    }
    sourceType() {
      return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
    }
    _parse(input) {
      const { status, ctx: ctx2 } = this._processInputParams(input);
      const effect = this._def.effect || null;
      const checkCtx = {
        addIssue: /* @__PURE__ */ __name((arg) => {
          addIssueToContext(ctx2, arg);
          if (arg.fatal) {
            status.abort();
          } else {
            status.dirty();
          }
        }, "addIssue"),
        get path() {
          return ctx2.path;
        }
      };
      checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
      if (effect.type === "preprocess") {
        const processed = effect.transform(ctx2.data, checkCtx);
        if (ctx2.common.async) {
          return Promise.resolve(processed).then((processed2) => __async(this, null, function* () {
            if (status.value === "aborted")
              return INVALID;
            const result = yield this._def.schema._parseAsync({
              data: processed2,
              path: ctx2.path,
              parent: ctx2
            });
            if (result.status === "aborted")
              return INVALID;
            if (result.status === "dirty")
              return DIRTY(result.value);
            if (status.value === "dirty")
              return DIRTY(result.value);
            return result;
          }));
        } else {
          if (status.value === "aborted")
            return INVALID;
          const result = this._def.schema._parseSync({
            data: processed,
            path: ctx2.path,
            parent: ctx2
          });
          if (result.status === "aborted")
            return INVALID;
          if (result.status === "dirty")
            return DIRTY(result.value);
          if (status.value === "dirty")
            return DIRTY(result.value);
          return result;
        }
      }
      if (effect.type === "refinement") {
        const executeRefinement = /* @__PURE__ */ __name((acc) => {
          const result = effect.refinement(acc, checkCtx);
          if (ctx2.common.async) {
            return Promise.resolve(result);
          }
          if (result instanceof Promise) {
            throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
          }
          return acc;
        }, "executeRefinement");
        if (ctx2.common.async === false) {
          const inner = this._def.schema._parseSync({
            data: ctx2.data,
            path: ctx2.path,
            parent: ctx2
          });
          if (inner.status === "aborted")
            return INVALID;
          if (inner.status === "dirty")
            status.dirty();
          executeRefinement(inner.value);
          return { status: status.value, value: inner.value };
        } else {
          return this._def.schema._parseAsync({ data: ctx2.data, path: ctx2.path, parent: ctx2 }).then((inner) => {
            if (inner.status === "aborted")
              return INVALID;
            if (inner.status === "dirty")
              status.dirty();
            return executeRefinement(inner.value).then(() => {
              return { status: status.value, value: inner.value };
            });
          });
        }
      }
      if (effect.type === "transform") {
        if (ctx2.common.async === false) {
          const base = this._def.schema._parseSync({
            data: ctx2.data,
            path: ctx2.path,
            parent: ctx2
          });
          if (!isValid(base))
            return INVALID;
          const result = effect.transform(base.value, checkCtx);
          if (result instanceof Promise) {
            throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
          }
          return { status: status.value, value: result };
        } else {
          return this._def.schema._parseAsync({ data: ctx2.data, path: ctx2.path, parent: ctx2 }).then((base) => {
            if (!isValid(base))
              return INVALID;
            return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
              status: status.value,
              value: result
            }));
          });
        }
      }
      util.assertNever(effect);
    }
  };
  __name(_ZodEffects, "ZodEffects");
  let ZodEffects = _ZodEffects;
  ZodEffects.create = (schema, effect, params) => {
    return new ZodEffects(__spreadValues({
      schema,
      typeName: ZodFirstPartyTypeKind.ZodEffects,
      effect
    }, processCreateParams(params)));
  };
  ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
    return new ZodEffects(__spreadValues({
      schema,
      effect: { type: "preprocess", transform: preprocess },
      typeName: ZodFirstPartyTypeKind.ZodEffects
    }, processCreateParams(params)));
  };
  const _ZodOptional = class _ZodOptional extends ZodType {
    _parse(input) {
      const parsedType = this._getType(input);
      if (parsedType === ZodParsedType.undefined) {
        return OK(void 0);
      }
      return this._def.innerType._parse(input);
    }
    unwrap() {
      return this._def.innerType;
    }
  };
  __name(_ZodOptional, "ZodOptional");
  let ZodOptional = _ZodOptional;
  ZodOptional.create = (type, params) => {
    return new ZodOptional(__spreadValues({
      innerType: type,
      typeName: ZodFirstPartyTypeKind.ZodOptional
    }, processCreateParams(params)));
  };
  const _ZodNullable = class _ZodNullable extends ZodType {
    _parse(input) {
      const parsedType = this._getType(input);
      if (parsedType === ZodParsedType.null) {
        return OK(null);
      }
      return this._def.innerType._parse(input);
    }
    unwrap() {
      return this._def.innerType;
    }
  };
  __name(_ZodNullable, "ZodNullable");
  let ZodNullable = _ZodNullable;
  ZodNullable.create = (type, params) => {
    return new ZodNullable(__spreadValues({
      innerType: type,
      typeName: ZodFirstPartyTypeKind.ZodNullable
    }, processCreateParams(params)));
  };
  const _ZodDefault = class _ZodDefault extends ZodType {
    _parse(input) {
      const { ctx: ctx2 } = this._processInputParams(input);
      let data = ctx2.data;
      if (ctx2.parsedType === ZodParsedType.undefined) {
        data = this._def.defaultValue();
      }
      return this._def.innerType._parse({
        data,
        path: ctx2.path,
        parent: ctx2
      });
    }
    removeDefault() {
      return this._def.innerType;
    }
  };
  __name(_ZodDefault, "ZodDefault");
  let ZodDefault = _ZodDefault;
  ZodDefault.create = (type, params) => {
    return new ZodDefault(__spreadValues({
      innerType: type,
      typeName: ZodFirstPartyTypeKind.ZodDefault,
      defaultValue: typeof params.default === "function" ? params.default : () => params.default
    }, processCreateParams(params)));
  };
  const _ZodCatch = class _ZodCatch extends ZodType {
    _parse(input) {
      const { ctx: ctx2 } = this._processInputParams(input);
      const newCtx = __spreadProps(__spreadValues({}, ctx2), {
        common: __spreadProps(__spreadValues({}, ctx2.common), {
          issues: []
        })
      });
      const result = this._def.innerType._parse({
        data: newCtx.data,
        path: newCtx.path,
        parent: __spreadValues({}, newCtx)
      });
      if (isAsync(result)) {
        return result.then((result2) => {
          return {
            status: "valid",
            value: result2.status === "valid" ? result2.value : this._def.catchValue({
              get error() {
                return new ZodError(newCtx.common.issues);
              },
              input: newCtx.data
            })
          };
        });
      } else {
        return {
          status: "valid",
          value: result.status === "valid" ? result.value : this._def.catchValue({
            get error() {
              return new ZodError(newCtx.common.issues);
            },
            input: newCtx.data
          })
        };
      }
    }
    removeCatch() {
      return this._def.innerType;
    }
  };
  __name(_ZodCatch, "ZodCatch");
  let ZodCatch = _ZodCatch;
  ZodCatch.create = (type, params) => {
    return new ZodCatch(__spreadValues({
      innerType: type,
      typeName: ZodFirstPartyTypeKind.ZodCatch,
      catchValue: typeof params.catch === "function" ? params.catch : () => params.catch
    }, processCreateParams(params)));
  };
  const _ZodNaN = class _ZodNaN extends ZodType {
    _parse(input) {
      const parsedType = this._getType(input);
      if (parsedType !== ZodParsedType.nan) {
        const ctx2 = this._getOrReturnCtx(input);
        addIssueToContext(ctx2, {
          code: ZodIssueCode.invalid_type,
          expected: ZodParsedType.nan,
          received: ctx2.parsedType
        });
        return INVALID;
      }
      return { status: "valid", value: input.data };
    }
  };
  __name(_ZodNaN, "ZodNaN");
  let ZodNaN = _ZodNaN;
  ZodNaN.create = (params) => {
    return new ZodNaN(__spreadValues({
      typeName: ZodFirstPartyTypeKind.ZodNaN
    }, processCreateParams(params)));
  };
  const _ZodBranded = class _ZodBranded extends ZodType {
    _parse(input) {
      const { ctx: ctx2 } = this._processInputParams(input);
      const data = ctx2.data;
      return this._def.type._parse({
        data,
        path: ctx2.path,
        parent: ctx2
      });
    }
    unwrap() {
      return this._def.type;
    }
  };
  __name(_ZodBranded, "ZodBranded");
  let ZodBranded = _ZodBranded;
  const _ZodPipeline = class _ZodPipeline extends ZodType {
    _parse(input) {
      const { status, ctx: ctx2 } = this._processInputParams(input);
      if (ctx2.common.async) {
        const handleAsync = /* @__PURE__ */ __name(() => __async(this, null, function* () {
          const inResult = yield this._def.in._parseAsync({
            data: ctx2.data,
            path: ctx2.path,
            parent: ctx2
          });
          if (inResult.status === "aborted")
            return INVALID;
          if (inResult.status === "dirty") {
            status.dirty();
            return DIRTY(inResult.value);
          } else {
            return this._def.out._parseAsync({
              data: inResult.value,
              path: ctx2.path,
              parent: ctx2
            });
          }
        }), "handleAsync");
        return handleAsync();
      } else {
        const inResult = this._def.in._parseSync({
          data: ctx2.data,
          path: ctx2.path,
          parent: ctx2
        });
        if (inResult.status === "aborted")
          return INVALID;
        if (inResult.status === "dirty") {
          status.dirty();
          return {
            status: "dirty",
            value: inResult.value
          };
        } else {
          return this._def.out._parseSync({
            data: inResult.value,
            path: ctx2.path,
            parent: ctx2
          });
        }
      }
    }
    static create(a2, b) {
      return new _ZodPipeline({
        in: a2,
        out: b,
        typeName: ZodFirstPartyTypeKind.ZodPipeline
      });
    }
  };
  __name(_ZodPipeline, "ZodPipeline");
  let ZodPipeline = _ZodPipeline;
  const _ZodReadonly = class _ZodReadonly extends ZodType {
    _parse(input) {
      const result = this._def.innerType._parse(input);
      const freeze = /* @__PURE__ */ __name((data) => {
        if (isValid(data)) {
          data.value = Object.freeze(data.value);
        }
        return data;
      }, "freeze");
      return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
    }
    unwrap() {
      return this._def.innerType;
    }
  };
  __name(_ZodReadonly, "ZodReadonly");
  let ZodReadonly = _ZodReadonly;
  ZodReadonly.create = (type, params) => {
    return new ZodReadonly(__spreadValues({
      innerType: type,
      typeName: ZodFirstPartyTypeKind.ZodReadonly
    }, processCreateParams(params)));
  };
  var ZodFirstPartyTypeKind;
  (function(ZodFirstPartyTypeKind2) {
    ZodFirstPartyTypeKind2["ZodString"] = "ZodString";
    ZodFirstPartyTypeKind2["ZodNumber"] = "ZodNumber";
    ZodFirstPartyTypeKind2["ZodNaN"] = "ZodNaN";
    ZodFirstPartyTypeKind2["ZodBigInt"] = "ZodBigInt";
    ZodFirstPartyTypeKind2["ZodBoolean"] = "ZodBoolean";
    ZodFirstPartyTypeKind2["ZodDate"] = "ZodDate";
    ZodFirstPartyTypeKind2["ZodSymbol"] = "ZodSymbol";
    ZodFirstPartyTypeKind2["ZodUndefined"] = "ZodUndefined";
    ZodFirstPartyTypeKind2["ZodNull"] = "ZodNull";
    ZodFirstPartyTypeKind2["ZodAny"] = "ZodAny";
    ZodFirstPartyTypeKind2["ZodUnknown"] = "ZodUnknown";
    ZodFirstPartyTypeKind2["ZodNever"] = "ZodNever";
    ZodFirstPartyTypeKind2["ZodVoid"] = "ZodVoid";
    ZodFirstPartyTypeKind2["ZodArray"] = "ZodArray";
    ZodFirstPartyTypeKind2["ZodObject"] = "ZodObject";
    ZodFirstPartyTypeKind2["ZodUnion"] = "ZodUnion";
    ZodFirstPartyTypeKind2["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
    ZodFirstPartyTypeKind2["ZodIntersection"] = "ZodIntersection";
    ZodFirstPartyTypeKind2["ZodTuple"] = "ZodTuple";
    ZodFirstPartyTypeKind2["ZodRecord"] = "ZodRecord";
    ZodFirstPartyTypeKind2["ZodMap"] = "ZodMap";
    ZodFirstPartyTypeKind2["ZodSet"] = "ZodSet";
    ZodFirstPartyTypeKind2["ZodFunction"] = "ZodFunction";
    ZodFirstPartyTypeKind2["ZodLazy"] = "ZodLazy";
    ZodFirstPartyTypeKind2["ZodLiteral"] = "ZodLiteral";
    ZodFirstPartyTypeKind2["ZodEnum"] = "ZodEnum";
    ZodFirstPartyTypeKind2["ZodEffects"] = "ZodEffects";
    ZodFirstPartyTypeKind2["ZodNativeEnum"] = "ZodNativeEnum";
    ZodFirstPartyTypeKind2["ZodOptional"] = "ZodOptional";
    ZodFirstPartyTypeKind2["ZodNullable"] = "ZodNullable";
    ZodFirstPartyTypeKind2["ZodDefault"] = "ZodDefault";
    ZodFirstPartyTypeKind2["ZodCatch"] = "ZodCatch";
    ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
    ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
    ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
    ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
  })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
  const stringType = ZodString.create;
  ZodNever.create;
  ZodArray.create;
  const objectType = ZodObject.create;
  ZodUnion.create;
  ZodIntersection.create;
  ZodTuple.create;
  const enumType = ZodEnum.create;
  ZodPromise.create;
  ZodOptional.create;
  ZodNullable.create;
  const cookieListFormSchema = objectType({
    headerId: stringType(),
    headerDuration: stringType(),
    headerDescription: stringType(),
    alwaysEnabled: stringType(),
    noCookiesMessage: stringType()
  });
  const preferenceFormSchema = objectType({
    title: stringType(),
    description: stringType(),
    showMore: stringType(),
    showLess: stringType(),
    saveLabel: stringType()
  });
  const noticeFormSchema = objectType({
    title: stringType(),
    description: stringType(),
    privacyLink: stringType(),
    accept: stringType(),
    reject: stringType(),
    settings: stringType(),
    readMore: stringType(),
    donotSell: stringType()
  });
  const blockedLabelSchema = objectType({
    blockedLabel: stringType().max(500)
  });
  function buildOptOutFormSchema(requireOptSuccessMessage) {
    const base = objectType({
      title: stringType(),
      description: stringType(),
      showMore: stringType(),
      showLess: stringType(),
      cancel: stringType(),
      confirm: stringType(),
      optSuccessText: stringType()
    });
    if (!requireOptSuccessMessage) return base;
    return base.superRefine((data, ctx2) => {
      if (data.optSuccessText.trim() === "") {
        ctx2.addIssue({
          code: ZodIssueCode.custom,
          message: __$2(
            "A message is required to show upon opt-out.",
            "cookie-law-info"
          ),
          path: ["optSuccessText"]
        });
      }
    });
  }
  __name(buildOptOutFormSchema, "buildOptOutFormSchema");
  const bannerFormSectionBorder = "cky:[&:not(:first-child)]:border-t cky:[&:not(:first-child)]:border-solid cky:[&:not(:first-child)]:border-[#d9d9d9] cky:[&:not(:first-child)]:pt-[15px]";
  const bannerFormSectionClass = cn$1("cky-form-section", bannerFormSectionBorder);
  const bannerFormSectionGroupClass = cn$1(
    "cky-form-section cky-form-section-group",
    bannerFormSectionBorder
  );
  const premiumColourPickerColClass = "cky:relative cky:min-h-[1px] cky:box-border cky:w-1/4 cky:max-w-[25%] cky:basis-1/4 cky:px-[15px] max-[700px]:cky:w-full max-[700px]:cky:max-w-full max-[700px]:cky:basis-full";
  const rowClass = "cky:-mx-[15px] cky:mb-5 cky:flex cky:flex-wrap cky:items-center";
  const labelColClass = "cky-label-col cky:relative cky:min-h-[1px] cky:box-border cky:w-[25%] cky:max-w-[25%] cky:basis-[25%] cky:px-[15px]";
  const valueColClass = "cky-value-col cky:relative cky:min-h-[1px] cky:box-border cky:w-[75%] cky:max-w-[75%] cky:basis-[75%] cky:px-[15px]";
  function stringFromLabelish(v) {
    if (typeof v === "string") return v;
    if (v && typeof v === "object" && typeof v.label === "string") {
      return v.label;
    }
    return "";
  }
  __name(stringFromLabelish, "stringFromLabelish");
  function setDeep(root2, path, value) {
    let cur = root2;
    for (let i2 = 0; i2 < path.length - 1; i2++) {
      const key = path[i2];
      const next = cur[key];
      if (next === void 0 || typeof next !== "object" || next === null) {
        cur[key] = {};
      }
      cur = cur[key];
    }
    cur[path[path.length - 1]] = value;
  }
  __name(setDeep, "setDeep");
  function useBannerPatch(language, disabled) {
    const current = useBannerStore((state) => state.current);
    const setCurrentBanner = useBannerStore((state) => state.setCurrentBanner);
    const patchContent = /* @__PURE__ */ __name((path, value) => {
      if (disabled || !current) return;
      const newBanner = structuredClone(current);
      if (!newBanner.contents[language]) newBanner.contents[language] = {};
      setDeep(
        newBanner.contents[language],
        path,
        value
      );
      setCurrentBanner(newBanner);
    }, "patchContent");
    const patchConfigPath = /* @__PURE__ */ __name((path, value) => {
      if (disabled || !current) return;
      const newBanner = structuredClone(current);
      if (!newBanner.properties.config) newBanner.properties.config = {};
      setDeep(
        newBanner.properties.config,
        path,
        value
      );
      setCurrentBanner(newBanner);
    }, "patchConfigPath");
    return { current, patchContent, patchConfigPath };
  }
  __name(useBannerPatch, "useBannerPatch");
  function readString(v) {
    return typeof v === "string" ? v : v == null ? "" : typeof v === "object" ? JSON.stringify(v) : String(v);
  }
  __name(readString, "readString");
  const CONTENT_PANEL_ACCORDION_CLASSNAME = "cky-app-accordion cky-app-accordion-boxed cky:m-0 cky:list-none cky:w-full cky:p-0";
  const SECTION_RULE = cn$1(
    "cky-form-section cky:mb-0 cky:flex cky:flex-col cky:gap-5",
    "cky:[&:not(:first-child)]:border-t cky:[&:not(:first-child)]:border-solid cky:[&:not(:first-child)]:border-[#d9d9d9] cky:[&:not(:first-child)]:pt-[15px] cky:pb-[15px] last:cky:pb-0"
  );
  const FORM_SECTION_TOP = cn$1(
    "cky-form-section cky-form-section-group cky:mb-0 cky:flex cky:flex-col cky:gap-5",
    "cky:[&:not(:first-child)]:border-t cky:[&:not(:first-child)]:border-solid cky:[&:not(:first-child)]:border-[#d9d9d9] cky:[&:not(:first-child)]:pt-[15px] cky:pb-[15px] last:cky:pb-0"
  );
  const COLOUR_SCHEME_ROW = "cky:mb-5 cky:mt-[10px] cky:flex cky:min-w-0 cky:flex-nowrap cky:items-center";
  const FORM_ROW_COL_5 = "cky:relative cky:min-h-[1px] cky:box-border cky:min-w-0 cky:w-[41.666667%] cky:max-w-[41.666667%] cky:basis-[41.666667%] cky:px-[15px] max-[700px]:cky:mt-2 max-[700px]:cky:max-w-full max-[700px]:cky:w-full max-[700px]:cky:basis-full";
  const SUBSECTION_TITLE = "cky:mb-0 cky:text-sm cky:font-medium cky:leading-[1.43] cky:text-[#23282d]";
  function FormRow({
    label,
    children,
    labelClassName,
    valueClassName,
    alignStart,
    labelTypography = "heading",
    className
  }) {
    const labelTypoCls = labelTypography === "plain" ? "cky:text-[14px] cky:!font-normal cky:leading-[18px] cky:text-[#23282d]" : "cky:text-[14px] cky:font-semibold cky:leading-[18px] cky:text-[#23282d]";
    const valueColDefault = "cky:relative cky:min-h-[1px] cky:box-border cky:min-w-0 cky:w-[75%] cky:max-w-[75%] cky:basis-[75%] cky:px-[15px] max-[700px]:cky:mt-2 max-[700px]:cky:max-w-full max-[700px]:cky:w-full max-[700px]:cky:basis-full";
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        className: cn$1(
          "cky:-mx-[15px] cky:mb-0 cky:flex cky:flex-wrap",
          alignStart ? "cky:items-start" : "cky:items-center",
          className
        ),
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: labelClassName != null ? labelClassName : "cky-label-col cky:relative cky:min-h-[1px] cky:box-border cky:w-[25%] cky:max-w-[25%] cky:basis-[25%] cky:px-[15px] max-[700px]:cky:max-w-full max-[700px]:cky:w-full max-[700px]:cky:basis-full",
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: alignStart ? cn$1("cky:pt-2", labelTypoCls) : labelTypoCls,
                  children: label
                }
              )
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: cn$1(
                "cky-value-col",
                valueClassName != null ? valueClassName : valueColDefault
              ),
              children
            }
          )
        ]
      }
    );
  }
  __name(FormRow, "FormRow");
  function CrownInline() {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Badge,
      {
        variant: "premium",
        className: "cky:!p-0 cky:shrink-0 cky:inline-flex cky:h-[18px] cky:w-[18px] cky:min-h-[18px] cky:min-w-[18px] cky:items-center cky:justify-center cky:leading-none",
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          CkyIcon,
          {
            icon: "crown",
            width: "10px",
            height: "8px",
            "aria-hidden": true,
            style: { display: "block" }
          }
        )
      }
    );
  }
  __name(CrownInline, "CrownInline");
  function CustomThemeLimitedNotice() {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        role: "alert",
        className: "cky:mb-2.5 cky:flex cky:w-full cky:justify-between cky:rounded-[4px] cky:border cky:border-[#d7e1f2] cky:bg-[#C4DDFD] cky:shadow-[0_5px_15px_rgba(0,0,0,0.02)]",
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:w-full cky:flex-wrap cky:items-center cky:gap-4 cky:p-3 max-[600px]:cky:flex-col max-[600px]:cky:items-stretch", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:min-w-0 cky:flex-1 cky:items-center cky:gap-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "img",
              {
                src: assets.themeIllustration,
                alt: "",
                className: "cky:block cky:max-w-fit cky:shrink-0"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:min-w-0 cky:flex-1", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  role: "heading",
                  "aria-level": 6,
                  className: "cky:m-0 cky:mb-1 cky:text-sm cky:font-semibold cky:leading-4 cky:text-[#4E4B66]",
                  children: __$2(
                    "Colour customisation is now limited on Free plan",
                    "cookie-law-info"
                  )
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: "cky:m-0 cky:text-[13px] cky:font-normal cky:leading-[18px] cky:text-[#4E4B66]",
                  dangerouslySetInnerHTML: {
                    __html: __$2(
                      "You can continue using your existing customised banner as is. However, <b>further edits or new colour customisations are no longer available in your Free plan.</b>",
                      "cookie-law-info"
                    )
                  }
                }
              )
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:shrink-0 cky:items-center max-[600px]:cky:w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Button,
            {
              type: "button",
              variant: "default",
              className: "cky:min-h-[32px] cky:w-full cky:rounded-[4px] cky:px-3 cky:py-1.5 cky:text-sm cky:font-semibold sm:cky:w-auto",
              onClick: /* @__PURE__ */ __name(() => {
                globalThis.location.href = "#/dashboard/plans?available=premium";
              }, "onClick"),
              children: __$2("Connect to Web App to Access", "cookie-law-info")
            }
          ) })
        ] })
      }
    );
  }
  __name(CustomThemeLimitedNotice, "CustomThemeLimitedNotice");
  function ColourPickerField({
    fieldLabel,
    value,
    onChange,
    disabled,
    labelClassName
  }) {
    const display = value && String(value).trim() !== "" ? String(value).trim() : "#000000";
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        className: cn$1(
          "cky:flex cky:w-full cky:min-w-0 cky:flex-1 cky:basis-0 cky:flex-col cky:items-start",
          disabled && "cky:opacity-50"
        ),
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: cn$1(
                "cky:mb-2.5 cky:block cky:w-full cky:text-left cky:text-[14px] cky:font-normal cky:leading-[18px] cky:text-[#50575e]",
                labelClassName
              ),
              children: fieldLabel
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:h-[30px] cky:w-full cky:max-w-[130px] cky:items-center cky:overflow-hidden cky:rounded-[3px] cky:border cky:border-[#d9d9d9]", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: "cky:block cky:h-full cky:w-10 cky:shrink-0",
                style: { backgroundColor: display },
                "aria-hidden": true
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:h-full cky:min-w-0 cky:flex-1 cky:items-center cky:bg-[#f6f7f7]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              "input",
              {
                type: "text",
                disabled,
                readOnly: disabled,
                className: cn$1(
                  "cky:box-border cky:min-w-0 cky:flex-1 cky:appearance-none",
                  "cky:!m-0 cky:!h-full cky:!w-full cky:!rounded-none cky:!border-0 cky:!bg-transparent",
                  "cky:!px-2 cky:!py-0 cky:!shadow-none cky:!ring-0 cky:!outline-none",
                  "cky:text-xs cky:font-normal cky:uppercase cky:leading-none cky:text-[#555d66]",
                  "focus-visible:cky:z-10 focus-visible:cky:!ring-2 focus-visible:cky:ring-inset focus-visible:cky:ring-[var(--cky-primary)]",
                  "disabled:cky:cursor-not-allowed disabled:cky:text-[#787c82]"
                ),
                value: display,
                onChange: /* @__PURE__ */ __name((e) => onChange(e.target.value), "onChange"),
                spellCheck: false
              }
            ) })
          ] })
        ]
      }
    );
  }
  __name(ColourPickerField, "ColourPickerField");
  function PremiumColourBlock({
    label,
    onPremiumClick,
    children,
    className,
    /** `'colours'` uses the action-link style; `'heading'` uses the h6 weight. */
    labelVariant = "colours"
  }) {
    const labelCls = labelVariant === "heading" ? "cky:text-[14px] cky:font-semibold cky:leading-[18px] cky:text-[#23282d]" : "cky:text-[14px] cky:!font-normal cky:leading-[18px] cky:text-[#23282d]";
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "button",
      {
        type: "button",
        className: cn$1(
          "cky:relative cky:mb-0 cky:block cky:w-full cky:border-0 cky:bg-transparent cky:p-0 cky:text-left cky:outline-none",
          "focus-visible:cky:ring-2 focus-visible:cky:ring-[var(--cky-primary)] focus-visible:cky:ring-offset-2",
          className
        ),
        onClick: onPremiumClick,
        "aria-label": __$2(
          "Premium colour customisation — open upgrade options",
          "cookie-law-info"
        ),
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:pointer-events-none cky:relative cky:z-0 cky:-mx-[15px] cky:flex cky:flex-wrap cky:items-center max-[700px]:cky:items-start", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:min-h-[1px] cky:box-border cky:w-[25%] cky:max-w-[25%] cky:basis-[25%] cky:self-center cky:px-[15px] max-[700px]:cky:max-w-full max-[700px]:cky:w-full max-[700px]:cky:basis-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:inline-flex cky:items-center cky:gap-2 cky:leading-[18px]", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: labelCls, children: label }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:inline-flex cky:shrink-0", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CrownInline, {}) })
          ] }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: cn$1(
                "cky:relative cky:min-h-[1px] cky:opacity-30 cky:flex cky:w-[75%] cky:max-w-[75%] cky:basis-[75%] cky:flex-wrap cky:items-center cky:gap-x-[30px] cky:gap-y-5 cky:px-[15px] max-[700px]:cky:mt-3 max-[700px]:cky:items-start max-[700px]:cky:max-w-full max-[700px]:cky:w-full max-[700px]:cky:basis-full",
                "[&>*]:cky:min-w-0 [&>*]:cky:flex-1 [&>*]:cky:basis-0"
              ),
              children
            }
          )
        ] })
      }
    );
  }
  __name(PremiumColourBlock, "PremiumColourBlock");
  function BtnColours({
    cfgBtn,
    bg,
    border,
    text,
    onStyleChange,
    onOpenPremium
  }) {
    var _a2;
    const st = (_a2 = cfgBtn.styles) != null ? _a2 : {};
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      PremiumColourBlock,
      {
        label: __$2("Colours", "cookie-law-info"),
        onPremiumClick: onOpenPremium,
        children: [
          bg && st["background-color"] != null ? /* @__PURE__ */ jsxRuntimeExports.jsx(
            ColourPickerField,
            {
              fieldLabel: __$2("Background", "cookie-law-info"),
              value: readString(st["background-color"]),
              onChange: /* @__PURE__ */ __name((hex2) => onStyleChange("background-color", hex2), "onChange")
            }
          ) : null,
          border && st["border-color"] != null ? /* @__PURE__ */ jsxRuntimeExports.jsx(
            ColourPickerField,
            {
              fieldLabel: __$2("Border", "cookie-law-info"),
              value: readString(st["border-color"]),
              onChange: /* @__PURE__ */ __name((hex2) => onStyleChange("border-color", hex2), "onChange")
            }
          ) : null,
          text && st.color != null ? /* @__PURE__ */ jsxRuntimeExports.jsx(
            ColourPickerField,
            {
              fieldLabel: __$2("Text", "cookie-law-info"),
              value: readString(st.color),
              onChange: /* @__PURE__ */ __name((hex2) => onStyleChange("color", hex2), "onChange")
            }
          ) : null
        ]
      }
    );
  }
  __name(BtnColours, "BtnColours");
  function TemplateLawBanner({
    consentLaw
  }) {
    const text = consentLaw === "gdpr" ? __$2(
      "The selected template (opt-in banner) supports GDPR (EU & UK), LGPD (Brazil), PIPEDA (Canada), Law 25 (Quebec), POPIA (South Africa), nFADP (Switzerland), Privacy Act (Australia), PDPL (Saudi Arabia), PDPL (Argentina), PDPL (Andorra), DPA (Faroe Island)",
      "cookie-law-info"
    ) : __$2(
      "The selected template (opt-out banner) supports CCPA/CPRA (California), VCDPA (Virginia), CPA (Colorado), CTDPA (Connecticut), & UCPA (Utah)",
      "cookie-law-info"
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-template-law-banner", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-template-law-banner__text", children: text }) });
  }
  __name(TemplateLawBanner, "TemplateLawBanner");
  function BannerHexColorField({
    label,
    value,
    onChange,
    disabled,
    pickerFallback = "#000000"
  }) {
    const pickerVal = typeof value === "string" && value.startsWith("#") ? value : pickerFallback;
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-1", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-xs cky:text-muted-foreground", children: label }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:gap-2", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          CkyInput,
          {
            type: "color",
            className: "cky:h-9 cky:w-14 cky:cursor-pointer cky:p-1",
            value: pickerVal,
            onChange: /* @__PURE__ */ __name((e) => onChange(e.target.value), "onChange"),
            disabled
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          CkyInput,
          {
            className: "cky:w-28",
            value,
            onChange: /* @__PURE__ */ __name((e) => onChange(e.target.value), "onChange"),
            disabled
          }
        )
      ] })
    ] });
  }
  __name(BannerHexColorField, "BannerHexColorField");
  function BannerPatchWpEditorRow({
    control,
    name,
    label,
    inputId,
    disabled,
    patchContent,
    patchPath,
    language,
    editorKey,
    valueColExtraClass,
    height
  }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Controller,
      {
        control,
        name,
        render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
          Field,
          {
            "data-invalid": fieldState.invalid,
            className: "cky:gap-0 cky:space-y-0",
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              FormRow,
              {
                className: "cky:mb-5",
                label: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  FieldLabel,
                  {
                    htmlFor: inputId,
                    className: "cky:!font-normal cky:text-[#23282d]",
                    children: label
                  }
                ),
                labelTypography: "plain",
                valueClassName: cn$1(
                  valueColClass,
                  "cky:min-w-0 max-[700px]:cky:mt-2 max-[700px]:cky:max-w-full max-[700px]:cky:w-full max-[700px]:cky:basis-full",
                  valueColExtraClass
                ),
                children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:w-full cky:flex-col cky:gap-1", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    WpEditor,
                    {
                      id: inputId,
                      value: typeof field.value === "string" ? field.value : "",
                      onChange: /* @__PURE__ */ __name((html) => {
                        field.onChange(html);
                        patchContent([...patchPath], html);
                      }, "onChange"),
                      disabled,
                      language,
                      height
                    },
                    editorKey
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
                ] })
              }
            )
          }
        ), "render")
      }
    );
  }
  __name(BannerPatchWpEditorRow, "BannerPatchWpEditorRow");
  function BannerPatchTextRow({
    control,
    name,
    label,
    inputId,
    disabled,
    patchContent,
    patchPath,
    placeholder
  }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Controller,
      {
        control,
        name,
        render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
          Field,
          {
            "data-invalid": fieldState.invalid,
            className: "cky:gap-0 cky:space-y-0",
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              FormRow,
              {
                className: "cky:mb-5",
                label: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  FieldLabel,
                  {
                    htmlFor: inputId,
                    className: "cky:!font-normal cky:text-[#23282d]",
                    children: label
                  }
                ),
                labelTypography: "plain",
                children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-1", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    CkyInput,
                    __spreadProps(__spreadValues({
                      id: inputId,
                      type: "text",
                      className: "cky:w-full",
                      disabled,
                      "aria-invalid": fieldState.invalid,
                      placeholder
                    }, field), {
                      value: typeof field.value === "string" ? field.value : "",
                      onChange: /* @__PURE__ */ __name((e) => {
                        field.onChange(e.target.value);
                        patchContent([...patchPath], e.target.value);
                      }, "onChange")
                    })
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
                ] })
              }
            )
          }
        ), "render")
      }
    );
  }
  __name(BannerPatchTextRow, "BannerPatchTextRow");
  function CustomizeFormRowTextRow({
    control,
    name,
    uid,
    inputSuffix,
    inputIdOverride,
    label,
    onCommit,
    placeholder,
    inputWrapClassName = "cky:flex cky:flex-col cky:gap-1"
  }) {
    const inputId = inputIdOverride != null ? inputIdOverride : `${uid}-${inputSuffix}`;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Controller,
      {
        control,
        name,
        render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { "data-invalid": fieldState.invalid, className: "cky:space-y-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          FormRow,
          {
            label: /* @__PURE__ */ jsxRuntimeExports.jsx(
              FieldLabel,
              {
                htmlFor: inputId,
                className: "cky:!font-normal cky:text-[#23282d]",
                children: label
              }
            ),
            labelTypography: "plain",
            children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: inputWrapClassName, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                CkyInput,
                __spreadProps(__spreadValues({
                  id: inputId,
                  type: "text",
                  className: "cky:w-full",
                  "aria-invalid": fieldState.invalid,
                  placeholder
                }, field), {
                  value: typeof field.value === "string" ? field.value : "",
                  onChange: /* @__PURE__ */ __name((e) => {
                    field.onChange(e.target.value);
                    onCommit(e.target.value);
                  }, "onChange")
                })
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
            ] })
          }
        ) }), "render")
      }
    );
  }
  __name(CustomizeFormRowTextRow, "CustomizeFormRowTextRow");
  const CustomizeAccordionCtx = reactExports.createContext(false);
  function useCustomizeAccordion() {
    return reactExports.useContext(CustomizeAccordionCtx);
  }
  __name(useCustomizeAccordion, "useCustomizeAccordion");
  function CustomizeAccordion({ children }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(CustomizeAccordionCtx.Provider, { value: true, children });
  }
  __name(CustomizeAccordion, "CustomizeAccordion");
  function BannerSection({
    value,
    title,
    children,
    contentClassName
  }) {
    const customize2 = useCustomizeAccordion();
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      AccordionItem,
      {
        value,
        className: cn$1(
          /* tab-content-accordion.vue: item border + mb 10px, last mb 12px */
          "cky-lang-accordion-item cky:mb-2.5 cky:overflow-hidden cky:rounded-[4px] cky:border cky:border-solid cky:border-[#e6eaf0] cky:bg-white last:cky:mb-3",
          customize2 && "cky:!border-b-0 cky:shadow-none"
        ),
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            AccordionTrigger,
            {
              iconPosition: "left",
              hideChevron: true,
              className: cn$1(
                "cky-lang-accordion-trigger cky:w-full cky:cursor-pointer cky:!no-underline cky:bg-white cky:p-0 cky:hover:no-underline"
              ),
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                "span",
                {
                  className: cn$1(
                    "cky-app-accordion-title cky:m-0 cky:block cky:w-full cky:cursor-pointer",
                    customize2 && "cky:!bg-white cky:!text-[#23282d] rtl:before:!ml-[10px] rtl:before:!mr-0"
                  ),
                  children: title
                }
              )
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            AccordionContent,
            {
              className: cn$1(
                "cky:px-[20px] cky:pt-[15px]",
                customize2 ? "cky:!pb-3" : "cky:!pb-[15px]",
                contentClassName
              ),
              children
            }
          )
        ]
      }
    );
  }
  __name(BannerSection, "BannerSection");
  function BannerButtonTranslateSection({
    control,
    name,
    heading,
    onLabelCommit,
    disabled,
    children
  }) {
    const inputId = reactExports.useId();
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: bannerFormSectionClass, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-form-header", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:-mx-[15px] cky:flex cky:flex-wrap", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:min-h-[1px] cky:box-border cky:w-full cky:max-w-full cky:basis-full cky:px-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h5", { className: "cky-form-heading", children: heading }) }) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-form-content", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Controller,
          {
            control,
            name,
            render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
              Field,
              {
                "data-invalid": fieldState.invalid,
                className: "cky:gap-0 cky:space-y-0",
                children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  FormRow,
                  {
                    className: "cky:mb-5",
                    label: /* @__PURE__ */ jsxRuntimeExports.jsx(
                      FieldLabel,
                      {
                        htmlFor: inputId,
                        className: "cky:!font-normal cky:text-[#23282d]",
                        children: __$2("Label", "cookie-law-info")
                      }
                    ),
                    labelTypography: "plain",
                    children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-1", children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx(
                        CkyInput,
                        __spreadProps(__spreadValues({
                          id: inputId,
                          type: "text",
                          "aria-invalid": fieldState.invalid
                        }, field), {
                          value: typeof field.value === "string" ? field.value : "",
                          onChange: /* @__PURE__ */ __name((e) => {
                            const v = e.target.value;
                            field.onChange(v);
                            onLabelCommit(v);
                          }, "onChange"),
                          disabled,
                          className: "cky:w-full"
                        })
                      ),
                      /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
                    ] })
                  }
                )
              }
            ), "render")
          }
        ),
        children
      ] })
    ] });
  }
  __name(BannerButtonTranslateSection, "BannerButtonTranslateSection");
  const Notice = /* @__PURE__ */ __name(({
    content,
    disabled = false,
    language = "en"
  }) => {
    var _a2, _b2, _c2, _d, _e2, _f, _g, _h;
    const { current, patchContent } = useBannerPatch(language, disabled);
    const noticeElements = ((_a2 = content == null ? void 0 : content.notice) == null ? void 0 : _a2.elements) || {};
    const buttonElements = ((_b2 = noticeElements.buttons) == null ? void 0 : _b2.elements) || {};
    const descriptionHtml = typeof noticeElements.description === "string" ? noticeElements.description : "";
    const bannerId = current && typeof current.id === "number" ? current.id : 0;
    const editorKey = `${bannerId}-${language}-notice-desc`;
    const form = useForm({
      resolver: t(noticeFormSchema),
      values: {
        title: noticeElements.title || "",
        description: descriptionHtml,
        privacyLink: noticeElements.privacyLink || "",
        accept: buttonElements.accept || "",
        reject: buttonElements.reject || "",
        settings: buttonElements.settings || "",
        readMore: buttonElements.readMore || "",
        donotSell: buttonElements.donotSell || ""
      },
      mode: "onChange"
    });
    if (!current) return null;
    if (((_e2 = (_d = (_c2 = current.properties) == null ? void 0 : _c2.config) == null ? void 0 : _d.notice) == null ? void 0 : _e2.status) === false) return null;
    const applicableLaw = (_h = (_g = (_f = current.properties) == null ? void 0 : _f.settings) == null ? void 0 : _g.applicableLaw) != null ? _h : "";
    const gdprButtons = [
      ["accept", __$2('"Accept All" button', "cookie-law-info")],
      ["reject", __$2('"Reject All" button', "cookie-law-info")],
      ["settings", __$2('"Customise" button', "cookie-law-info")]
    ].map(([name, heading]) => ({
      name,
      heading,
      path: [
        "notice",
        "elements",
        "buttons",
        "elements",
        name
      ]
    }));
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      BannerSection,
      {
        value: "notice",
        title: __$2("Cookie Notice", "cookie-law-info"),
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: bannerFormSectionGroupClass, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-form-header" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-form-content", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                BannerPatchTextRow,
                {
                  control: form.control,
                  name: "title",
                  label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2("Title", "cookie-law-info") }),
                  inputId: "cky-notice-title",
                  disabled,
                  patchContent,
                  patchPath: ["notice", "elements", "title"]
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                BannerPatchWpEditorRow,
                {
                  control: form.control,
                  name: "description",
                  label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2("Message", "cookie-law-info") }),
                  inputId: "cky-notice-message",
                  disabled,
                  patchContent,
                  patchPath: ["notice", "elements", "description"],
                  language,
                  editorKey,
                  valueColExtraClass: "cky-wp-editor-notice",
                  height: "200"
                }
              )
            ] })
          ] }),
          applicableLaw === "gdpr" ? gdprButtons.map(({ name, heading, path }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
            BannerButtonTranslateSection,
            {
              control: form.control,
              name,
              heading,
              onLabelCommit: /* @__PURE__ */ __name((v) => patchContent([...path], v), "onLabelCommit"),
              disabled
            },
            name
          )) : null,
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            BannerButtonTranslateSection,
            {
              control: form.control,
              name: "readMore",
              heading: __$2('"Cookie Policy" link', "cookie-law-info"),
              onLabelCommit: /* @__PURE__ */ __name((v) => patchContent(
                ["notice", "elements", "buttons", "elements", "readMore"],
                v
              ), "onLabelCommit"),
              disabled,
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                BannerPatchTextRow,
                {
                  control: form.control,
                  name: "privacyLink",
                  label: __$2("URL", "cookie-law-info"),
                  inputId: "cky-notice-privacy-link",
                  disabled,
                  patchContent,
                  patchPath: ["notice", "elements", "privacyLink"],
                  placeholder: __$2(
                    "Enter the URL to your cookie policy or privacy page",
                    "cookie-law-info"
                  )
                }
              )
            }
          ),
          applicableLaw === "ccpa" && /* @__PURE__ */ jsxRuntimeExports.jsx(
            BannerButtonTranslateSection,
            {
              control: form.control,
              name: "donotSell",
              heading: __$2('"Do Not Sell" link', "cookie-law-info"),
              onLabelCommit: /* @__PURE__ */ __name((v) => patchContent(
                ["notice", "elements", "buttons", "elements", "donotSell"],
                v
              ), "onLabelCommit"),
              disabled
            }
          )
        ]
      }
    );
  }, "Notice");
  const Preference = /* @__PURE__ */ __name(({
    content,
    disabled = false,
    language = "en"
  }) => {
    var _a2, _b2, _c2, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m;
    const { current, patchContent } = useBannerPatch(language, disabled);
    const prefElements = ((_a2 = content == null ? void 0 : content.preferenceCenter) == null ? void 0 : _a2.elements) || {};
    const saveStatus = current ? (_h = (_g = (_f = (_e2 = (_d = (_c2 = (_b2 = current.properties) == null ? void 0 : _b2.config) == null ? void 0 : _c2.preferenceCenter) == null ? void 0 : _d.elements) == null ? void 0 : _e2.buttons) == null ? void 0 : _f.elements) == null ? void 0 : _g.save) == null ? void 0 : _h.status : void 0;
    const usePrefCenterSave = Boolean(saveStatus);
    const saveLabelPath = usePrefCenterSave ? ["preferenceCenter", "elements", "buttons", "elements", "save"] : ["categoryPreview", "elements", "buttons", "elements", "save"];
    const categorySave = (_j = (_i = content == null ? void 0 : content.categoryPreview) == null ? void 0 : _i.elements) == null ? void 0 : _j.buttons;
    const categorySaveEl = (_k = categorySave == null ? void 0 : categorySave.elements) == null ? void 0 : _k.save;
    const prefSave = (_m = (_l = prefElements.buttons) == null ? void 0 : _l.elements) == null ? void 0 : _m.save;
    const saveLabelValue = usePrefCenterSave ? stringFromLabelish(prefSave) : stringFromLabelish(categorySaveEl);
    const descriptionHtml = typeof prefElements.description === "string" ? prefElements.description : "";
    const bannerId = current && typeof current.id === "number" ? current.id : 0;
    const editorKey = `${bannerId}-${language}-pref-desc`;
    const patchSaveLabel = /* @__PURE__ */ __name((value) => {
      if (!current) return;
      patchContent([...saveLabelPath], value);
    }, "patchSaveLabel");
    const form = useForm({
      resolver: t(preferenceFormSchema),
      values: {
        title: prefElements.title || "",
        description: descriptionHtml,
        showMore: prefElements.showMore || "",
        showLess: prefElements.showLess || "",
        saveLabel: saveLabelValue
      },
      mode: "onChange"
    });
    if (!current) return null;
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      BannerSection,
      {
        value: "preference",
        title: __$2("Preference Centre", "cookie-law-info"),
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: bannerFormSectionGroupClass, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-form-header" }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-form-content", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                BannerPatchTextRow,
                {
                  control: form.control,
                  name: "title",
                  label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2("Title", "cookie-law-info") }),
                  inputId: "cky-pref-title",
                  disabled,
                  patchContent,
                  patchPath: ["preferenceCenter", "elements", "title"]
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                BannerPatchWpEditorRow,
                {
                  control: form.control,
                  name: "description",
                  label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2("Privacy overview", "cookie-law-info") }),
                  inputId: "cky-preference-privacy",
                  disabled,
                  patchContent,
                  patchPath: ["preferenceCenter", "elements", "description"],
                  language,
                  editorKey,
                  valueColExtraClass: "cky-wp-editor-pref",
                  height: "200"
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                BannerPatchTextRow,
                {
                  control: form.control,
                  name: "showMore",
                  label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2('"Show more" button', "cookie-law-info") }),
                  inputId: "cky-pref-show-more",
                  disabled,
                  patchContent,
                  patchPath: ["preferenceCenter", "elements", "showMore"]
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                BannerPatchTextRow,
                {
                  control: form.control,
                  name: "showLess",
                  label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2('"Show less" button', "cookie-law-info") }),
                  inputId: "cky-pref-show-less",
                  disabled,
                  patchContent,
                  patchPath: ["preferenceCenter", "elements", "showLess"]
                }
              )
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            BannerButtonTranslateSection,
            {
              control: form.control,
              name: "saveLabel",
              heading: __$2('"Save My Preferences" button', "cookie-law-info"),
              onLabelCommit: patchSaveLabel,
              disabled
            }
          )
        ]
      }
    );
  }, "Preference");
  const CookieList = /* @__PURE__ */ __name(({
    content,
    translate = false,
    disabled = false,
    language = "en"
  }) => {
    var _a2, _b2, _c2, _d, _e2, _f;
    const { current, patchContent, patchConfigPath } = useBannerPatch(
      language,
      disabled
    );
    const applicableLaw = current ? (_c2 = (_b2 = (_a2 = current.properties) == null ? void 0 : _a2.settings) == null ? void 0 : _b2.applicableLaw) != null ? _c2 : "" : "";
    const auditTable = (content == null ? void 0 : content.auditTable) || {};
    const auditElements = auditTable.elements || {};
    const headersBlock = auditElements.headers || {};
    const headerLabels = headersBlock.elements || {};
    const preferenceCenter = (content == null ? void 0 : content.preferenceCenter) || {};
    const prefElements = preferenceCenter.elements || {};
    const categoryBlock = prefElements.category || {};
    const categoryElements = categoryBlock.elements || {};
    const auditTableStatus = current ? ((_f = (_e2 = (_d = current.properties) == null ? void 0 : _d.config) == null ? void 0 : _e2.auditTable) == null ? void 0 : _f.status) !== false : false;
    const setAuditTableStatus = /* @__PURE__ */ __name((checked) => {
      patchConfigPath(["auditTable", "status"], checked);
    }, "setAuditTableStatus");
    const form = useForm({
      resolver: t(cookieListFormSchema),
      values: {
        headerId: headerLabels.id || "",
        headerDuration: headerLabels.duration || "",
        headerDescription: headerLabels.description || "",
        alwaysEnabled: categoryElements.alwaysEnabled || "",
        noCookiesMessage: auditElements.message || ""
      },
      mode: "onChange"
    });
    if (!current) return null;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      BannerSection,
      {
        value: "cookie-list",
        title: __$2("Cookie List", "cookie-law-info"),
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: bannerFormSectionClass, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-form-header" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-form-content", children: [
            !translate && applicableLaw !== "ccpa" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: rowClass, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: labelColClass, htmlFor: "cky-show-cookie-declaration", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2("Show cookie list", "cookie-law-info") }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: valueColClass, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                Switch,
                {
                  id: "cky-show-cookie-declaration",
                  checked: auditTableStatus,
                  onCheckedChange: setAuditTableStatus,
                  disabled
                }
              ) })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              BannerPatchTextRow,
              {
                control: form.control,
                name: "headerId",
                label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2('"Cookie" label', "cookie-law-info") }),
                inputId: "cky-cookie-label-id",
                disabled,
                patchContent,
                patchPath: [
                  "auditTable",
                  "elements",
                  "headers",
                  "elements",
                  "id"
                ]
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              BannerPatchTextRow,
              {
                control: form.control,
                name: "headerDuration",
                label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2('"Duration" label', "cookie-law-info") }),
                inputId: "cky-cookie-label-duration",
                disabled,
                patchContent,
                patchPath: [
                  "auditTable",
                  "elements",
                  "headers",
                  "elements",
                  "duration"
                ]
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              BannerPatchTextRow,
              {
                control: form.control,
                name: "headerDescription",
                label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2('"Description" label', "cookie-law-info") }),
                inputId: "cky-cookie-label-description",
                disabled,
                patchContent,
                patchPath: [
                  "auditTable",
                  "elements",
                  "headers",
                  "elements",
                  "description"
                ]
              }
            ),
            applicableLaw === "ccpa" ? null : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                BannerPatchTextRow,
                {
                  control: form.control,
                  name: "alwaysEnabled",
                  label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2('"Always Active" label', "cookie-law-info") }),
                  inputId: "cky-cookie-always-enabled",
                  disabled,
                  patchContent,
                  patchPath: [
                    "preferenceCenter",
                    "elements",
                    "category",
                    "elements",
                    "alwaysEnabled"
                  ]
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                BannerPatchTextRow,
                {
                  control: form.control,
                  name: "noCookiesMessage",
                  label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2('"No cookies to display" label', "cookie-law-info") }),
                  inputId: "cky-cookie-no-cookies-msg",
                  disabled,
                  patchContent,
                  patchPath: ["auditTable", "elements", "message"]
                }
              )
            ] })
          ] })
        ] })
      }
    );
  }, "CookieList");
  const revisitFormSchema$1 = objectType({
    hoverTitle: stringType(),
    position: enumType(["bottom-left", "bottom-right"])
  });
  const RevisitConsent = /* @__PURE__ */ __name(({
    content,
    translate = false,
    disabled = false,
    language = "en"
  }) => {
    var _a2, _b2, _c2, _d;
    const { current, patchContent, patchConfigPath } = useBannerPatch(
      language,
      disabled
    );
    const revisit = (content == null ? void 0 : content.revisitConsent) || {};
    const revisitElements = revisit.elements || {};
    const rc = current ? ((_b2 = (_a2 = current.properties) == null ? void 0 : _a2.config) == null ? void 0 : _b2.revisitConsent) || {} : {};
    const revisitStatus = rc.status !== false;
    const positionRaw = rc.position || "bottom-right";
    const position = positionRaw === "bottom-left" ? "bottom-left" : "bottom-right";
    const bgColor = (_d = (_c2 = rc.styles) == null ? void 0 : _c2["background-color"]) != null ? _d : "#0056A7";
    const form = useForm({
      resolver: t(revisitFormSchema$1),
      values: {
        hoverTitle: revisitElements.title || "",
        position
      },
      mode: "onChange"
    });
    if (!current) return null;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      BannerSection,
      {
        value: "revisit-consent",
        title: __$2("Revisit Consent Button", "cookie-law-info"),
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: bannerFormSectionClass, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-form-header" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-form-content", children: [
            !translate && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: rowClass, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: labelColClass, htmlFor: "cky-revisit-consent-button", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2("Revisit consent button", "cookie-law-info") }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: valueColClass, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                Switch,
                {
                  id: "cky-revisit-consent-button",
                  checked: revisitStatus,
                  onCheckedChange: /* @__PURE__ */ __name((checked) => patchConfigPath(["revisitConsent", "status"], checked), "onCheckedChange"),
                  disabled
                }
              ) })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              BannerPatchTextRow,
              {
                control: form.control,
                name: "hoverTitle",
                label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2("Text on hover", "cookie-law-info") }),
                inputId: "cky-revisit-hover-text",
                disabled,
                patchContent,
                patchPath: ["revisitConsent", "elements", "title"]
              }
            ),
            !translate && /* @__PURE__ */ jsxRuntimeExports.jsx(
              Controller,
              {
                control: form.control,
                name: "position",
                render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
                  Field,
                  {
                    "data-invalid": fieldState.invalid,
                    className: "cky:space-y-0",
                    children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: rowClass, children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: labelColClass, children: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2("Position", "cookie-law-info") }) }),
                      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: valueColClass, children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsxs(
                          RadioGroup,
                          {
                            value: field.value,
                            onValueChange: /* @__PURE__ */ __name((value) => {
                              const v = value;
                              field.onChange(v);
                              patchConfigPath(["revisitConsent", "position"], v);
                            }, "onValueChange"),
                            disabled,
                            className: "cky:flex cky:flex-wrap cky:items-center cky:gap-6",
                            "aria-invalid": fieldState.invalid,
                            children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                                Label$1,
                                {
                                  htmlFor: "cky-revisit-consent-position-bl",
                                  className: "cky:flex cky:cursor-pointer cky:items-center cky:gap-2",
                                  children: [
                                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                                      RadioGroupItem,
                                      {
                                        value: "bottom-left",
                                        id: "cky-revisit-consent-position-bl"
                                      }
                                    ),
                                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: __$2("Left", "cookie-law-info") })
                                  ]
                                }
                              ),
                              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                                Label$1,
                                {
                                  htmlFor: "cky-revisit-consent-position-br",
                                  className: "cky:flex cky:cursor-pointer cky:items-center cky:gap-2",
                                  children: [
                                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                                      RadioGroupItem,
                                      {
                                        value: "bottom-right",
                                        id: "cky-revisit-consent-position-br"
                                      }
                                    ),
                                    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: __$2("Right", "cookie-law-info") })
                                  ]
                                }
                              )
                            ]
                          }
                        ),
                        /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
                      ] })
                    ] })
                  }
                ), "render")
              }
            ),
            !translate && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: rowClass, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: labelColClass, children: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2("Colours", "cookie-law-info") }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: valueColClass, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:flex-wrap cky:items-end cky:gap-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                BannerHexColorField,
                {
                  label: __$2("Background", "cookie-law-info"),
                  value: String(bgColor),
                  pickerFallback: "#0056A7",
                  onChange: /* @__PURE__ */ __name((v) => patchConfigPath(
                    ["revisitConsent", "styles", "background-color"],
                    v
                  ), "onChange"),
                  disabled
                }
              ) }) })
            ] })
          ] })
        ] })
      }
    );
  }, "RevisitConsent");
  const BlockedContent = /* @__PURE__ */ __name(({
    content,
    translate = false,
    disabled = false,
    language = "en"
  }) => {
    var _a2, _b2, _c2, _d, _e2, _f;
    const { current, patchContent, patchConfigPath } = useBannerPatch(
      language,
      disabled
    );
    const labelInputId = reactExports.useId();
    const vp = (content == null ? void 0 : content.videoPlaceholder) || {};
    const vpElements = vp.elements || {};
    const cfgVp = current ? ((_b2 = (_a2 = current.properties) == null ? void 0 : _a2.config) == null ? void 0 : _b2.videoPlaceholder) || {} : {};
    const styles = cfgVp.styles || {};
    const titleCfg = (((_c2 = cfgVp.elements) == null ? void 0 : _c2.title) || {}).styles;
    const bgColor = (_d = styles["background-color"]) != null ? _d : "#000000";
    const borderColor = (_e2 = styles["border-color"]) != null ? _e2 : "#000000";
    const textColor = (_f = titleCfg == null ? void 0 : titleCfg.color) != null ? _f : "#ffffff";
    const labelFromPack = readString(vpElements.title);
    const form = useForm({
      resolver: t(blockedLabelSchema),
      values: { blockedLabel: labelFromPack },
      mode: "onChange"
    });
    if (!current) return null;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      BannerSection,
      {
        value: "blocked-content",
        title: __$2("Blocked Content", "cookie-law-info"),
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: bannerFormSectionClass, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-form-header" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-form-content", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              BannerPatchTextRow,
              {
                control: form.control,
                name: "blockedLabel",
                label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2("Label", "cookie-law-info") }),
                inputId: labelInputId,
                disabled,
                patchContent,
                patchPath: ["videoPlaceholder", "elements", "title"]
              }
            ),
            !translate && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: rowClass, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: labelColClass, children: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$2("Colours", "cookie-law-info") }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: valueColClass, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-wrap cky:items-end cky:gap-6", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  BannerHexColorField,
                  {
                    label: __$2("Background", "cookie-law-info"),
                    value: String(bgColor),
                    onChange: /* @__PURE__ */ __name((v) => patchConfigPath(
                      ["videoPlaceholder", "styles", "background-color"],
                      v
                    ), "onChange"),
                    disabled
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  BannerHexColorField,
                  {
                    label: __$2("Border", "cookie-law-info"),
                    value: String(borderColor),
                    onChange: /* @__PURE__ */ __name((v) => patchConfigPath(
                      ["videoPlaceholder", "styles", "border-color"],
                      v
                    ), "onChange"),
                    disabled
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  BannerHexColorField,
                  {
                    label: __$2("Text", "cookie-law-info"),
                    value: String(textColor),
                    onChange: /* @__PURE__ */ __name((v) => patchConfigPath(
                      [
                        "videoPlaceholder",
                        "elements",
                        "title",
                        "styles",
                        "color"
                      ],
                      v
                    ), "onChange"),
                    disabled
                  }
                )
              ] }) })
            ] })
          ] })
        ] })
      }
    );
  }, "BlockedContent");
  const DEFAULT_CONSENT_EXPIRY_DAYS = 365;
  const CONSENT_EXPIRY_MIN = 1;
  const CONSENT_EXPIRY_MAX = 9999;
  function consentExpiryInputHasError(value, min2 = CONSENT_EXPIRY_MIN, limit = CONSENT_EXPIRY_MAX) {
    if (value === "") return true;
    const n2 = Number(value);
    return n2 > limit || n2 < min2;
  }
  __name(consentExpiryInputHasError, "consentExpiryInputHasError");
  function consentExpiryRangeMessage(min2 = CONSENT_EXPIRY_MIN, limit = CONSENT_EXPIRY_MAX) {
    return `Please enter a value between ${min2} and ${limit}`;
  }
  __name(consentExpiryRangeMessage, "consentExpiryRangeMessage");
  function consentExpiryStoredValueToInputString(raw) {
    if (raw === "") return "";
    if (typeof raw === "number" && !Number.isNaN(raw)) return String(raw);
    if (typeof raw === "string") return raw;
    return String(DEFAULT_CONSENT_EXPIRY_DAYS);
  }
  __name(consentExpiryStoredValueToInputString, "consentExpiryStoredValueToInputString");
  function consentExpiryInputToStoredValue(rawInput) {
    if (!consentExpiryInputHasError(rawInput)) {
      return Number(rawInput);
    }
    return rawInput;
  }
  __name(consentExpiryInputToStoredValue, "consentExpiryInputToStoredValue");
  function getBannerApplicableLaw$1(b) {
    var _a2;
    const props = b.properties;
    return (_a2 = props == null ? void 0 : props.settings) == null ? void 0 : _a2.applicableLaw;
  }
  __name(getBannerApplicableLaw$1, "getBannerApplicableLaw$1");
  function isBannerStatusActive(status) {
    return status == true;
  }
  __name(isBannerStatusActive, "isBannerStatusActive");
  function getActiveConsentLawFromBanners(banners) {
    if (!Array.isArray(banners) || banners.length === 0) return "gdpr";
    const active = banners.find((b) => isBannerStatusActive(b.status));
    const banner2 = active != null ? active : banners[0];
    const law = getBannerApplicableLaw$1(banner2);
    return law === "ccpa" ? "ccpa" : "gdpr";
  }
  __name(getActiveConsentLawFromBanners, "getActiveConsentLawFromBanners");
  function deepClone(value) {
    return JSON.parse(JSON.stringify(value));
  }
  __name(deepClone, "deepClone");
  function ensureNested$1(obj, key) {
    if (!obj[key] || typeof obj[key] !== "object") {
      obj[key] = {};
    }
    return obj[key];
  }
  __name(ensureNested$1, "ensureNested$1");
  function mergeGeneralStateIntoBanner(banner2, law, state) {
    const b = deepClone(banner2);
    if (typeof b.properties === "string") {
      try {
        b.properties = JSON.parse(b.properties);
      } catch (e) {
        b.properties = {};
      }
    }
    const properties = ensureNested$1(b, "properties");
    const settings2 = ensureNested$1(properties, "settings");
    const behaviours = ensureNested$1(properties, "behaviours");
    const config2 = ensureNested$1(properties, "config");
    const notice = ensureNested$1(config2, "notice");
    settings2.ruleSet = [{ code: state.region, regions: [] }];
    const consentExpiry = ensureNested$1(settings2, "consentExpiry");
    consentExpiry.status = true;
    consentExpiry.value = consentExpiryInputToStoredValue(state.consentExpiration);
    const reload = ensureNested$1(behaviours, "reloadBannerOnAccept");
    reload.status = state.reloadOnConsent;
    if (law === "ccpa") {
      notice.status = state.showBanner;
    }
    return b;
  }
  __name(mergeGeneralStateIntoBanner, "mergeGeneralStateIntoBanner");
  function readCustomCssFromBanner(banner2) {
    var _a2;
    if (!banner2) return "";
    const props = banner2.properties;
    const v = (_a2 = props == null ? void 0 : props.meta) == null ? void 0 : _a2.customCSS;
    return typeof v === "string" ? v : "";
  }
  __name(readCustomCssFromBanner, "readCustomCssFromBanner");
  function mergeCustomCssIntoBanner(banner2, law, customCss) {
    if (getBannerApplicableLaw$1(banner2) !== law) {
      return deepClone(banner2);
    }
    const b = deepClone(banner2);
    const properties = ensureNested$1(b, "properties");
    const meta = ensureNested$1(properties, "meta");
    meta.customCSS = customCss;
    return b;
  }
  __name(mergeCustomCssIntoBanner, "mergeCustomCssIntoBanner");
  function mergeGdprCookieMapsIntoCategories(categories, priorConsent, hideCategoryFromBanner) {
    return categories.map((cat) => {
      const slug = cat.slug;
      if (!slug || String(slug).toLowerCase() === "necessary") {
        return deepClone(cat);
      }
      const c2 = deepClone(cat);
      if (Object.prototype.hasOwnProperty.call(priorConsent, slug)) {
        c2.prior_consent = !!priorConsent[slug];
      }
      if (Object.prototype.hasOwnProperty.call(hideCategoryFromBanner, slug)) {
        c2.visibility = hideCategoryFromBanner[slug] ? false : true;
      }
      return c2;
    });
  }
  __name(mergeGdprCookieMapsIntoCategories, "mergeGdprCookieMapsIntoCategories");
  function bulkSaveBanners(banners, clear = false) {
    return __async(this, null, function* () {
      return ckyRest.post({
        path: "/banners/bulk",
        params: { clear: String(clear) },
        data: { banners }
      });
    });
  }
  __name(bulkSaveBanners, "bulkSaveBanners");
  function setBannerStatusByLaw(banners, activeLaw) {
    return banners.map((b) => {
      const cloned = deepClone(b);
      cloned.status = getBannerApplicableLaw$1(cloned) === activeLaw;
      return cloned;
    });
  }
  __name(setBannerStatusByLaw, "setBannerStatusByLaw");
  function fetchBannerPresets(versionID) {
    return __async(this, null, function* () {
      try {
        const res = yield ckyRest.get({
          path: "/banners/presets",
          params: { ver: versionID }
        });
        return Array.isArray(res) ? res : [];
      } catch (e) {
        console.error(e);
        return [];
      }
    });
  }
  __name(fetchBannerPresets, "fetchBannerPresets");
  function arrayReplaceRecursive(target, source) {
    const out = __spreadValues({}, target);
    for (const key in source) {
      const src = source[key];
      const tgt = out[key];
      if (tgt && typeof tgt === "object" && src && typeof src === "object") {
        out[key] = arrayReplaceRecursive(
          tgt,
          src
        );
      } else {
        out[key] = src;
      }
    }
    return out;
  }
  __name(arrayReplaceRecursive, "arrayReplaceRecursive");
  function defaultOptoutSuccessText() {
    return __$2("Your opt-out preference has been honored.", "cookie-law-info");
  }
  __name(defaultOptoutSuccessText, "defaultOptoutSuccessText");
  function defaultOptoutSuccessSubtext() {
    return __$2(
      'Banner closes automatically in <span id="ckyCountdownTimer"></span> s...',
      "cookie-law-info"
    );
  }
  __name(defaultOptoutSuccessSubtext, "defaultOptoutSuccessSubtext");
  function ensureCcpaOptoutSuccessContent(draft, lang) {
    mutateContentLang(draft, lang, (pack) => {
      var _a2, _b2, _c2;
      const optoutPopup = (_a2 = pack.optoutPopup) != null ? _a2 : {};
      pack.optoutPopup = optoutPopup;
      const els = (_b2 = optoutPopup.elements) != null ? _b2 : {};
      optoutPopup.elements = els;
      const existing = els.optoutSuccess;
      if (existing && typeof existing === "object") {
        const success = existing;
        const sEls = (_c2 = success.elements) != null ? _c2 : {};
        success.elements = sEls;
        if (typeof sEls.text !== "string" || sEls.text.trim() === "") {
          sEls.text = defaultOptoutSuccessText();
        }
        if (typeof sEls.subtext !== "string" || sEls.subtext.trim() === "") {
          sEls.subtext = defaultOptoutSuccessSubtext();
        }
        return;
      }
      els.optoutSuccess = {
        elements: {
          text: defaultOptoutSuccessText(),
          subtext: defaultOptoutSuccessSubtext()
        }
      };
    });
  }
  __name(ensureCcpaOptoutSuccessContent, "ensureCcpaOptoutSuccessContent");
  function isCcpaOptoutSuccessTextInvalid(draft, lang) {
    if (!draft) return false;
    const contents = draft.contents;
    const pack = getContentPackForLanguage(contents, lang);
    const op = pack.optoutPopup;
    const opEl = op == null ? void 0 : op.elements;
    const os = opEl == null ? void 0 : opEl.optoutSuccess;
    if (!os || typeof os !== "object") return false;
    const els = os.elements;
    if (!els) return true;
    const text = els.text;
    if (text === void 0 || text === null) return true;
    if (typeof text !== "string") return true;
    return text.trim() === "";
  }
  __name(isCcpaOptoutSuccessTextInvalid, "isCcpaOptoutSuccessTextInvalid");
  function syncPreferenceCenterButtons(content, nBe) {
    const preferenceCenter = content.preferenceCenter;
    const pcEls = preferenceCenter == null ? void 0 : preferenceCenter.elements;
    const pcBtns = pcEls == null ? void 0 : pcEls.buttons;
    const pcBe = pcBtns == null ? void 0 : pcBtns.elements;
    if (pcBe) {
      if (Object.prototype.hasOwnProperty.call(nBe, "accept")) {
        pcBe.accept = deepClone(nBe.accept);
      }
      if (Object.prototype.hasOwnProperty.call(nBe, "reject")) {
        pcBe.reject = deepClone(nBe.reject);
      }
    }
  }
  __name(syncPreferenceCenterButtons, "syncPreferenceCenterButtons");
  function syncOptoutPopup(content, nBe) {
    const optoutPopup = content.optoutPopup;
    const ooEls = optoutPopup == null ? void 0 : optoutPopup.elements;
    const optOpt = ooEls == null ? void 0 : ooEls.optOption;
    const optOptEls = optOpt == null ? void 0 : optOpt.elements;
    if (optOptEls && Object.prototype.hasOwnProperty.call(nBe, "donotSell")) {
      optOptEls.title = deepClone(nBe.donotSell);
    }
  }
  __name(syncOptoutPopup, "syncOptoutPopup");
  function syncPreferenceCenterStyles(config2) {
    const noticeCfg = config2.notice;
    const ncfgEls = noticeCfg == null ? void 0 : noticeCfg.elements;
    const ncfgBtns = ncfgEls == null ? void 0 : ncfgEls.buttons;
    const ncfgBe = ncfgBtns == null ? void 0 : ncfgBtns.elements;
    if (!ncfgBe) return;
    const prefCfg = config2.preferenceCenter;
    const pE = prefCfg == null ? void 0 : prefCfg.elements;
    const pB = pE == null ? void 0 : pE.buttons;
    const pBe = pB == null ? void 0 : pB.elements;
    if (!pBe) return;
    const na = ncfgBe.accept;
    const nr = ncfgBe.reject;
    if (pBe.accept && (na == null ? void 0 : na.styles)) {
      pBe.accept.styles = deepClone(na.styles);
    }
    if (pBe.reject && nr) {
      pBe.reject.styles = deepClone(nr.styles);
      pBe.reject.status = nr.status;
    }
  }
  __name(syncPreferenceCenterStyles, "syncPreferenceCenterStyles");
  function syncNoticeDerivedFields(draft, lang) {
    const props = draft.properties;
    if (!props) return;
    const contents = draft.contents;
    const content = getContentPackForLanguage(contents, lang);
    const notice = content.notice;
    if (!notice) return;
    const ne = notice.elements;
    const nBtns = ne == null ? void 0 : ne.buttons;
    const nBe = nBtns == null ? void 0 : nBtns.elements;
    if (!nBe) return;
    syncPreferenceCenterButtons(content, nBe);
    syncOptoutPopup(content, nBe);
    const config2 = props.config;
    if (!config2) return;
    syncPreferenceCenterStyles(config2);
  }
  __name(syncNoticeDerivedFields, "syncNoticeDerivedFields");
  function applyPreferenceSaveButtonVisibility(draft) {
    const props = draft.properties;
    if (!props) return;
    const settings2 = props.settings;
    const config2 = props.config;
    if (!settings2 || !config2) return;
    const pref = config2.preferenceCenter;
    const pE = pref == null ? void 0 : pref.elements;
    const pB = pE == null ? void 0 : pE.buttons;
    const pBe = pB == null ? void 0 : pB.elements;
    const save = pBe == null ? void 0 : pBe.save;
    if (!save) return;
    const cat = config2.categoryPreview;
    const catOn = !!(cat == null ? void 0 : cat.status);
    const type = settings2.type;
    let nextStatus = true;
    if (type === "classic" && catOn) {
      nextStatus = false;
    }
    save.status = nextStatus;
  }
  __name(applyPreferenceSaveButtonVisibility, "applyPreferenceSaveButtonVisibility");
  function contentSettingsFingerprint(draft) {
    var _a2;
    const props = draft.properties;
    if (!props) return "";
    return JSON.stringify({
      theme: (_a2 = props.settings) == null ? void 0 : _a2.theme,
      contents: draft.contents,
      config: props.config
    });
  }
  __name(contentSettingsFingerprint, "contentSettingsFingerprint");
  function setPreferenceCenterPackField(pack, field, value) {
    var _a2, _b2;
    const p2 = (_a2 = pack.preferenceCenter) != null ? _a2 : {};
    pack.preferenceCenter = p2;
    const els = (_b2 = p2.elements) != null ? _b2 : {};
    p2.elements = els;
    els[field] = value;
  }
  __name(setPreferenceCenterPackField, "setPreferenceCenterPackField");
  function setOptoutPopupPackField(pack, field, value) {
    var _a2, _b2;
    const o2 = (_a2 = pack.optoutPopup) != null ? _a2 : {};
    pack.optoutPopup = o2;
    const els = (_b2 = o2.elements) != null ? _b2 : {};
    o2.elements = els;
    els[field] = value;
  }
  __name(setOptoutPopupPackField, "setOptoutPopupPackField");
  function setOptoutSuccessPackText(pack, value) {
    var _a2, _b2, _c2, _d;
    const o2 = (_a2 = pack.optoutPopup) != null ? _a2 : {};
    pack.optoutPopup = o2;
    const els = (_b2 = o2.elements) != null ? _b2 : {};
    o2.elements = els;
    const success = (_c2 = els.optoutSuccess) != null ? _c2 : {};
    els.optoutSuccess = success;
    const se = (_d = success.elements) != null ? _d : {};
    success.elements = se;
    se.text = value;
  }
  __name(setOptoutSuccessPackText, "setOptoutSuccessPackText");
  function setVideoPlaceholderTitleInPack(pack, value) {
    var _a2, _b2;
    const v = (_a2 = pack.videoPlaceholder) != null ? _a2 : {};
    pack.videoPlaceholder = v;
    const els = (_b2 = v.elements) != null ? _b2 : {};
    v.elements = els;
    els.title = value;
  }
  __name(setVideoPlaceholderTitleInPack, "setVideoPlaceholderTitleInPack");
  function mutateContentLang(draft, lang, fn) {
    const contents = ensureObjectPath(draft, ["contents"]);
    let pack = contents[lang];
    if (!pack || typeof pack !== "object") {
      const fb = contents.en;
      pack = fb && typeof fb === "object" ? deepClone(fb) : {};
      contents[lang] = pack;
    }
    fn(pack);
  }
  __name(mutateContentLang, "mutateContentLang");
  function ensureObjectPath(root2, segments) {
    let cur = root2;
    for (const seg of segments) {
      const next = cur[seg];
      if (!next || typeof next !== "object") {
        const n2 = {};
        cur[seg] = n2;
        cur = n2;
      } else {
        cur = next;
      }
    }
    return cur;
  }
  __name(ensureObjectPath, "ensureObjectPath");
  const OptOutCenter = /* @__PURE__ */ __name(({
    content,
    translate = false,
    disabled = false,
    language = "en"
  }) => {
    var _a2, _b2, _c2, _d, _e2, _f, _g, _h, _i, _j, _k;
    const { current, patchContent, patchConfigPath } = useBannerPatch(
      language,
      disabled
    );
    const optoutInitialisedRef = reactExports.useRef(false);
    const applicableLaw = current ? (_c2 = (_b2 = (_a2 = current.properties) == null ? void 0 : _a2.settings) == null ? void 0 : _b2.applicableLaw) != null ? _c2 : "" : "";
    const root2 = (content == null ? void 0 : content.optoutPopup) || {};
    const elements = root2.elements || {};
    const buttons = elements.buttons || {};
    const buttonElements = buttons.elements || {};
    const descriptionHtml = readString(elements.description);
    const bannerId = current && typeof current.id === "number" ? current.id : 0;
    const editorKey = `${bannerId}-${language}-optout-desc`;
    const optSuccessContent = elements.optoutSuccess;
    const optSuccessEls = optSuccessContent == null ? void 0 : optSuccessContent.elements;
    reactExports.useEffect(() => {
      var _a3;
      if (applicableLaw !== "ccpa" || disabled || !current) return;
      const pack = (_a3 = current.contents) == null ? void 0 : _a3[language];
      if (!pack || typeof pack !== "object") return;
      const op = pack.optoutPopup;
      const els = op == null ? void 0 : op.elements;
      if ((els == null ? void 0 : els.optoutSuccess) != null && typeof els.optoutSuccess === "object") {
        return;
      }
      if (optoutInitialisedRef.current) return;
      optoutInitialisedRef.current = true;
      const next = structuredClone(current);
      ensureCcpaOptoutSuccessContent(
        next,
        language
      );
      useBannerStore.getState().setCurrentBanner(next);
    }, [applicableLaw, disabled, language, bannerId, current]);
    const cfg = current ? (_d = current.properties) == null ? void 0 : _d.config : void 0;
    const opCfg = cfg == null ? void 0 : cfg.optoutPopup;
    const opCfgEls = opCfg == null ? void 0 : opCfg.elements;
    const optSuccessCfg = opCfgEls == null ? void 0 : opCfgEls.optoutSuccess;
    const optSuccessSt = optSuccessCfg == null ? void 0 : optSuccessCfg.styles;
    const optSuccessCfgEls = optSuccessCfg == null ? void 0 : optSuccessCfg.elements;
    const optSuccessIconSt = (_e2 = optSuccessCfgEls == null ? void 0 : optSuccessCfgEls.icon) == null ? void 0 : _e2.styles;
    const optSuccessTextSt = (_f = optSuccessCfgEls == null ? void 0 : optSuccessCfgEls.text) == null ? void 0 : _f.styles;
    const optSuccessSubtextSt = (_g = optSuccessCfgEls == null ? void 0 : optSuccessCfgEls.subtext) == null ? void 0 : _g.styles;
    const optOptionCfg = opCfgEls == null ? void 0 : opCfgEls.optOption;
    const optToggleCfg = (_h = optOptionCfg == null ? void 0 : optOptionCfg.elements) == null ? void 0 : _h.toggle;
    const optToggleStates = (_i = optToggleCfg == null ? void 0 : optToggleCfg.states) != null ? _i : {};
    const optActiveSt = (_j = optToggleStates.active) == null ? void 0 : _j.styles;
    const optInactiveSt = (_k = optToggleStates.inactive) == null ? void 0 : _k.styles;
    const requireOptSuccessMessage = Boolean(optSuccessContent);
    const schema = reactExports.useMemo(
      () => buildOptOutFormSchema(requireOptSuccessMessage),
      [requireOptSuccessMessage]
    );
    const form = useForm({
      resolver: t(schema),
      values: {
        title: elements.title || "",
        description: descriptionHtml,
        showMore: elements.showMore || "",
        showLess: elements.showLess || "",
        cancel: buttonElements.cancel || "",
        confirm: buttonElements.confirm || "",
        optSuccessText: readString(optSuccessEls == null ? void 0 : optSuccessEls.text)
      },
      mode: "onChange"
    });
    if (!current) return null;
    if (applicableLaw !== "ccpa") {
      return null;
    }
    const patchOptToggleBg = /* @__PURE__ */ __name((state, hex2) => {
      patchConfigPath(
        [
          "optoutPopup",
          "elements",
          "optOption",
          "elements",
          "toggle",
          "states",
          state,
          "styles",
          "background-color"
        ],
        hex2
      );
    }, "patchOptToggleBg");
    const patchOptSuccessStyle = /* @__PURE__ */ __name((target, hex2) => {
      const base = ["optoutPopup", "elements", "optoutSuccess"];
      const path = target === "bg" ? [...base, "styles", "background-color"] : [...base, "elements", target, "styles", "color"];
      patchConfigPath(path, hex2);
    }, "patchOptSuccessStyle");
    const openConnectOrPremium = /* @__PURE__ */ __name(() => {
      const loc = globalThis.location;
      if (!loc) return;
      loc.hash = "#/dashboard/plans?available=premium";
    }, "openConnectOrPremium");
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      BannerSection,
      {
        value: "opt-out-center",
        title: __$1("Opt-out center", "cookie-law-info"),
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: bannerFormSectionGroupClass, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-form-content", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              BannerPatchTextRow,
              {
                control: form.control,
                name: "title",
                label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$1("Title", "cookie-law-info") }),
                inputId: "cky-optout-title",
                disabled,
                patchContent,
                patchPath: ["optoutPopup", "elements", "title"]
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              BannerPatchWpEditorRow,
              {
                control: form.control,
                name: "description",
                label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$1("Privacy overview", "cookie-law-info") }),
                inputId: "cky-optout-privacy",
                disabled,
                patchContent,
                patchPath: ["optoutPopup", "elements", "description"],
                language,
                editorKey,
                valueColExtraClass: "cky-wp-editor-optout",
                height: "180"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              BannerPatchTextRow,
              {
                control: form.control,
                name: "showMore",
                label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$1("“Show more” button", "cookie-law-info") }),
                inputId: "cky-optout-show-more",
                disabled,
                patchContent,
                patchPath: ["optoutPopup", "elements", "showMore"]
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              BannerPatchTextRow,
              {
                control: form.control,
                name: "showLess",
                label: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { children: __$1("“Show less” button", "cookie-law-info") }),
                inputId: "cky-optout-show-less",
                disabled,
                patchContent,
                patchPath: ["optoutPopup", "elements", "showLess"]
              }
            )
          ] }) }),
          !translate && optToggleCfg ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: bannerFormSectionClass, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-form-content", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            PremiumColourBlock,
            {
              label: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "cky-action-link cky:inline-flex cky:items-center cky:gap-1.5", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { className: "cky:m-0 cky:inline", children: __$1("Checkbox", "cookie-law-info") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "crown", width: "10px", height: "8px", "aria-hidden": true })
              ] }),
              labelVariant: "heading",
              onPremiumClick: openConnectOrPremium,
              children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:-mx-[15px] cky:flex cky:flex-wrap", children: [
                ["active", __$1("Enabled state", "cookie-law-info"), optActiveSt],
                ["inactive", __$1("Disabled state", "cookie-law-info"), optInactiveSt]
              ].map(([state, fieldLabel, st]) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: premiumColourPickerColClass, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                ColourPickerField,
                {
                  fieldLabel,
                  value: readString(st == null ? void 0 : st["background-color"]),
                  onChange: /* @__PURE__ */ __name((hex2) => patchOptToggleBg(state, hex2), "onChange"),
                  disabled
                }
              ) }, state)) })
            }
          ) }) }) : null,
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            BannerButtonTranslateSection,
            {
              control: form.control,
              name: "cancel",
              heading: __$1("“Cancel” button", "cookie-law-info"),
              onLabelCommit: /* @__PURE__ */ __name((v) => patchContent(
                ["optoutPopup", "elements", "buttons", "elements", "cancel"],
                v
              ), "onLabelCommit"),
              disabled
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            BannerButtonTranslateSection,
            {
              control: form.control,
              name: "confirm",
              heading: __$1(
                "“Save My Preferences” button",
                "cookie-law-info"
              ),
              onLabelCommit: /* @__PURE__ */ __name((v) => patchContent(
                ["optoutPopup", "elements", "buttons", "elements", "confirm"],
                v
              ), "onLabelCommit"),
              disabled
            }
          ),
          optSuccessContent ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: bannerFormSectionClass, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h5", { className: "cky-form-heading", children: __$1("Opt-out confirmation message", "cookie-law-info") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              BannerPatchTextRow,
              {
                control: form.control,
                name: "optSuccessText",
                label: __$1("Label", "cookie-law-info"),
                inputId: "cky-optout-success-message",
                disabled,
                patchContent,
                patchPath: [
                  "optoutPopup",
                  "elements",
                  "optoutSuccess",
                  "elements",
                  "text"
                ],
                placeholder: __$1(
                  "Your opt-out preference has been honored.",
                  "cookie-law-info"
                )
              }
            ),
            translate ? null : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-form-content", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              PremiumColourBlock,
              {
                label: __$1("Colours", "cookie-law-info"),
                onPremiumClick: openConnectOrPremium,
                children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:-mx-[15px] cky:flex cky:flex-wrap", children: [
                  ["bg", __$1("Background", "cookie-law-info"), () => readString(optSuccessSt == null ? void 0 : optSuccessSt["background-color"])],
                  ["icon", __$1("Icon", "cookie-law-info"), () => readString(optSuccessIconSt == null ? void 0 : optSuccessIconSt.color)],
                  ["text", __$1("Text", "cookie-law-info"), () => readString(optSuccessTextSt == null ? void 0 : optSuccessTextSt.color)],
                  ["subtext", __$1("Subtext", "cookie-law-info"), () => readString(optSuccessSubtextSt == null ? void 0 : optSuccessSubtextSt.color)]
                ].map(([target, fieldLabel, readVal]) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: premiumColourPickerColClass, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  ColourPickerField,
                  {
                    fieldLabel,
                    value: readVal(),
                    onChange: /* @__PURE__ */ __name((hex2) => patchOptSuccessStyle(target, hex2), "onChange"),
                    disabled
                  }
                ) }, target)) })
              }
            ) })
          ] }) : null,
          translate ? null : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: bannerFormSectionClass, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-form-content", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: rowClass, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:min-h-[1px] cky:box-border cky:w-1/3 cky:max-w-[33.33333333%] cky:basis-1/3 cky:px-[15px] max-[700px]:cky:w-full max-[700px]:cky:max-w-full max-[700px]:cky:basis-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
              Button,
              {
                type: "button",
                variant: "ghost",
                className: "cky-action-link cky:m-0 cky:inline-flex cky:items-center cky:gap-1.5 cky:border-0 cky:bg-transparent cky:p-0 cky:text-left",
                onClick: openConnectOrPremium,
                children: [
                  __$1(
                    "Respect “Global Privacy control”",
                    "cookie-law-info"
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "crown", width: "10px", height: "8px", "aria-hidden": true })
                ]
              }
            ) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:min-h-[1px] cky:box-border cky:w-[41.66666667%] cky:max-w-[41.66666667%] cky:basis-[41.66666667%] cky:px-[15px] max-[700px]:cky:w-full max-[700px]:cky:max-w-full max-[700px]:cky:basis-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              Switch,
              {
                id: "cky-toggle-gpc-react",
                checked: false,
                onCheckedChange: openConnectOrPremium,
                disabled
              }
            ) })
          ] }) }) })
        ]
      }
    );
  }, "OptOutCenter");
  const sectionComponents = {
    notice: Notice,
    preference: Preference,
    "cookie-list": CookieList,
    "revisit-consent": RevisitConsent,
    "blocked-content": BlockedContent,
    "opt-out-center": OptOutCenter
  };
  const TabContentAccordion = /* @__PURE__ */ __name(({
    language,
    translate = false,
    disabled = false,
    accordionValue,
    onAccordionValueChange
  }) => {
    var _a2, _b2, _c2, _d, _e2;
    const current = useBannerStore((state) => state.current);
    if (current === false || !current) {
      return null;
    }
    const applicableLaw = ((_b2 = (_a2 = current.properties) == null ? void 0 : _a2.settings) == null ? void 0 : _b2.applicableLaw) || "";
    const contentSections = getContentSectionsForLaw(applicableLaw);
    const noticeVisible = ((_e2 = (_d = (_c2 = current.properties) == null ? void 0 : _c2.config) == null ? void 0 : _d.notice) == null ? void 0 : _e2.status) !== false;
    const defaultOpenValue = translate && noticeVisible ? "notice" : void 0;
    const isAccordionControlled = onAccordionValueChange !== void 0;
    const content = getContentPackForLanguage(
      current.contents,
      language,
      getDefaultLanguage()
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        className: cn$1(
          "cky-tab-content-accordion cky:mt-[10px] cky:w-full",
          isRTLLanguage(language) && "cky-app-rtl"
        ),
        children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Accordion,
          {
            type: "single",
            collapsible: true,
            value: isAccordionControlled ? accordionValue != null ? accordionValue : "" : void 0,
            defaultValue: isAccordionControlled ? void 0 : defaultOpenValue,
            onValueChange: /* @__PURE__ */ __name((next) => {
              if (isAccordionControlled) {
                onAccordionValueChange(next);
              }
            }, "onValueChange"),
            className: "cky-app-accordion cky-app-accordion-boxed cky:m-0 cky:list-none cky:p-0 cky:w-full",
            children: contentSections.map(({ id }) => {
              const Section = sectionComponents[id];
              return /* @__PURE__ */ jsxRuntimeExports.jsx(
                Section,
                {
                  content,
                  translate,
                  disabled,
                  language
                },
                id
              );
            })
          }
        )
      }
    );
  }, "TabContentAccordion");
  function App({ hideNav = false }) {
    reactExports.useEffect(() => {
      const { loadInfo, reInit } = useAppStore.getState();
      void (() => __async(null, null, function* () {
        try {
          yield loadInfo(true);
          yield reInit();
        } catch (e) {
        }
      }))();
    }, []);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-app-nav-bar", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(CkyHeader, {}),
      !hideNav ? /* @__PURE__ */ jsxRuntimeExports.jsx(CkyNavMenu, {}) : null
    ] }) });
  }
  __name(App, "App");
  const APP_BODY_CLASS = "cky-app-body";
  const APP_BODY_WITHOUT_NAV_CLASS = "cky-app-body-without-nav";
  const APP_BODY_INNER_CLASS = "cky:p-0! cky:m-0!";
  function useAffiliateBannerRoute() {
    var _a2, _b2;
    const matches = useMatches();
    return Boolean((_b2 = (_a2 = matches.at(-1)) == null ? void 0 : _a2.staticData) == null ? void 0 : _b2.showAffiliateBanner);
  }
  __name(useAffiliateBannerRoute, "useAffiliateBannerRoute");
  function useHideNav() {
    var _a2, _b2;
    const matches = useMatches();
    return Boolean((_b2 = (_a2 = matches.at(-1)) == null ? void 0 : _a2.staticData) == null ? void 0 : _b2.hideNav);
  }
  __name(useHideNav, "useHideNav");
  function useIsAgencyPlan() {
    var _a2;
    const info = useAppStore((s2) => s2.info);
    return Boolean(info) && typeof info === "object" && ((_a2 = info.plan) == null ? void 0 : _a2.name) === "Agency";
  }
  __name(useIsAgencyPlan, "useIsAgencyPlan");
  const NotFound = /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:container cky:py-8", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:text-center", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "cky:text-2xl cky:font-bold cky:mb-4", children: __$2("Page Not Found", "cookie-law-info") }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:text-gray-600", children: __$2("The page you're looking for doesn't exist.", "cookie-law-info") })
  ] }) }), "NotFound");
  function RootLayout() {
    const infoLoaded = useAppStore((s2) => s2.info_loaded);
    const connected = useAppStore((s2) => {
      var _a2, _b2;
      return !!((_b2 = (_a2 = s2.options) == null ? void 0 : _a2.account) == null ? void 0 : _b2.connected);
    });
    const isAgencyPlan = useIsAgencyPlan();
    const affiliateBannerRoute = useAffiliateBannerRoute();
    const hideNav = useHideNav();
    const showAffiliateBanner = infoLoaded && connected && !isAgencyPlan && affiliateBannerRoute;
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(App, { hideNav }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: hideNav ? APP_BODY_WITHOUT_NAV_CLASS : APP_BODY_CLASS, children: [
        showAffiliateBanner ? /* @__PURE__ */ jsxRuntimeExports.jsx(CkyAffiliateNotice, {}) : null,
        /* @__PURE__ */ jsxRuntimeExports.jsx(CkyTableMissingNotice, {}),
        /* @__PURE__ */ jsxRuntimeExports.jsx(CkyReviewNotice, {}),
        /* @__PURE__ */ jsxRuntimeExports.jsx(CkyApiErrorNotice, {}),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {})
      ] })
    ] });
  }
  __name(RootLayout, "RootLayout");
  const Route$c = createRootRoute({
    component: /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(NotificationProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(ConnectProvider, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(RootLayout, {}),
      /* @__PURE__ */ jsxRuntimeExports.jsx(CkyToaster, { position: "top-right" }),
      null
    ] }) }) }), "component"),
    notFoundComponent: NotFound
  });
  const $$splitComponentImporter$a = /* @__PURE__ */ __name(() => __vitePreload(() => Promise.resolve().then(() => settings), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href), "$$splitComponentImporter$a");
  const Route$b = createFileRoute("/settings")({
    component: lazyRouteComponent($$splitComponentImporter$a, "component")
  });
  const $$splitComponentImporter$9 = /* @__PURE__ */ __name(() => __vitePreload(() => Promise.resolve().then(() => policies), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href), "$$splitComponentImporter$9");
  const Route$a = createFileRoute("/policies")({
    component: lazyRouteComponent($$splitComponentImporter$9, "component")
  });
  const $$splitComponentImporter$8 = /* @__PURE__ */ __name(() => __vitePreload(() => Promise.resolve().then(() => languages), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href), "$$splitComponentImporter$8");
  const Route$9 = createFileRoute("/languages")({
    component: lazyRouteComponent($$splitComponentImporter$8, "component")
  });
  const $$splitComponentImporter$7 = /* @__PURE__ */ __name(() => __vitePreload(() => Promise.resolve().then(() => gcm), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href), "$$splitComponentImporter$7");
  const Route$8 = createFileRoute("/gcm")({
    component: lazyRouteComponent($$splitComponentImporter$7, "component")
  });
  const $$splitComponentImporter$6 = /* @__PURE__ */ __name(() => __vitePreload(() => Promise.resolve().then(() => dashboard), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href), "$$splitComponentImporter$6");
  const Route$7 = createFileRoute("/dashboard")({
    component: lazyRouteComponent($$splitComponentImporter$6, "component")
  });
  const $$splitComponentImporter$5 = /* @__PURE__ */ __name(() => __vitePreload(() => Promise.resolve().then(() => customize), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href), "$$splitComponentImporter$5");
  const Route$6 = createFileRoute("/customize")({
    component: lazyRouteComponent($$splitComponentImporter$5, "component")
  });
  const $$splitComponentImporter$4 = /* @__PURE__ */ __name(() => __vitePreload(() => Promise.resolve().then(() => cookies), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href), "$$splitComponentImporter$4");
  const Route$5 = createFileRoute("/cookies")({
    component: lazyRouteComponent($$splitComponentImporter$4, "component")
  });
  const Route$4 = createFileRoute("/")({
    beforeLoad: /* @__PURE__ */ __name(() => {
      throw redirect({
        to: "/dashboard",
        replace: true
      });
    }, "beforeLoad")
  });
  const $$splitComponentImporter$3 = /* @__PURE__ */ __name(() => __vitePreload(() => Promise.resolve().then(() => languages_index), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href), "$$splitComponentImporter$3");
  const Route$3 = createFileRoute("/languages/")({
    component: lazyRouteComponent($$splitComponentImporter$3, "component")
  });
  const $$splitComponentImporter$2 = /* @__PURE__ */ __name(() => __vitePreload(() => Promise.resolve().then(() => dashboard_index), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href), "$$splitComponentImporter$2");
  const Route$2 = createFileRoute("/dashboard/")({
    staticData: {
      showAffiliateBanner: true
    },
    component: lazyRouteComponent($$splitComponentImporter$2, "component")
  });
  const $$splitComponentImporter$1 = /* @__PURE__ */ __name(() => __vitePreload(() => Promise.resolve().then(() => dashboard_plans), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href), "$$splitComponentImporter$1");
  const Route$1 = createFileRoute("/dashboard/plans")({
    /** `hideNav`: tab menu hidden, shorter body padding */
    staticData: {
      hideNav: true
    },
    component: lazyRouteComponent($$splitComponentImporter$1, "component"),
    validateSearch: /* @__PURE__ */ __name((search) => ({
      available: search.available || "all"
    }), "validateSearch")
  });
  let ctx = {
    banner: null,
    language: "en",
    cookies: []
  };
  function setBannerPreviewContext(banner2, language, cookies2) {
    ctx = { banner: banner2, language, cookies: cookies2 };
  }
  __name(setBannerPreviewContext, "setBannerPreviewContext");
  function clearBannerPreviewContext() {
    ctx = { banner: null, language: "en", cookies: [] };
  }
  __name(clearBannerPreviewContext, "clearBannerPreviewContext");
  function previewCurrentBanner() {
    if (!ctx.banner) {
      throw new Error("Banner preview context is not set");
    }
    return ctx.banner;
  }
  __name(previewCurrentBanner, "previewCurrentBanner");
  function previewLanguage() {
    return ctx.language;
  }
  __name(previewLanguage, "previewLanguage");
  function hasBannerPreviewContext() {
    return ctx.banner !== null;
  }
  __name(hasBannerPreviewContext, "hasBannerPreviewContext");
  function previewCookies() {
    return ctx.cookies;
  }
  __name(previewCookies, "previewCookies");
  const CKY_PREVIEW_OPTOUT_SUCCESS_MS = 15e3;
  const CKY_PREVIEW_OPTOUT_SUCCESS_SEC = 15;
  function bannerCloseCountdownText(seconds) {
    return sprintf$2(
      /* translators: %d: Seconds remaining before the banner preview closes. */
      __$2("Banner closes automatically in %d s...", "cookie-law-info"),
      seconds
    );
  }
  __name(bannerCloseCountdownText, "bannerCloseCountdownText");
  const previewOptoutSuccess = {
    intervalId: null,
    timeoutId: null,
    subtextTemplate: ""
  };
  function getToggleBackgroundColors(toggle) {
    var _a2, _b2, _c2, _d, _e2, _f;
    const active = (_c2 = (_b2 = (_a2 = toggle == null ? void 0 : toggle.states) == null ? void 0 : _a2.active) == null ? void 0 : _b2.styles) == null ? void 0 : _c2["background-color"];
    const inactive = (_f = (_e2 = (_d = toggle == null ? void 0 : toggle.states) == null ? void 0 : _d.inactive) == null ? void 0 : _e2.styles) == null ? void 0 : _f["background-color"];
    if (typeof active !== "string" || typeof inactive !== "string") return null;
    return { active, inactive };
  }
  __name(getToggleBackgroundColors, "getToggleBackgroundColors");
  function banner() {
    return previewCurrentBanner();
  }
  __name(banner, "banner");
  function _isNecessaryCategory(category) {
    var _a2;
    return String((_a2 = category == null ? void 0 : category.slug) != null ? _a2 : "").toLowerCase() === "necessary";
  }
  __name(_isNecessaryCategory, "_isNecessaryCategory");
  function getShortCodes() {
    var _a2, _b2;
    return (_b2 = (_a2 = window.ckyBannerConfig) == null ? void 0 : _a2._shortCodes) != null ? _b2 : [];
  }
  __name(getShortCodes, "getShortCodes");
  function queryByCkyTag(tag) {
    return `[data-cky-tag="${tag.replace(/"/g, '\\"')}"]`;
  }
  __name(queryByCkyTag, "queryByCkyTag");
  function bindPreviewClickOnce(el, fn) {
    const h = el;
    if (h.dataset.ckyAdminPreviewClick) return;
    h.dataset.ckyAdminPreviewClick = "1";
    el.addEventListener("click", fn);
  }
  __name(bindPreviewClickOnce, "bindPreviewClickOnce");
  function bindPreviewChangeOnce(el, fn) {
    if (el.dataset.ckyAdminPreviewChange) return;
    el.dataset.ckyAdminPreviewChange = "1";
    el.addEventListener("change", fn);
  }
  __name(bindPreviewChangeOnce, "bindPreviewChangeOnce");
  function _ckyGetElementByTag(tag) {
    return document.querySelector(queryByCkyTag(tag));
  }
  __name(_ckyGetElementByTag, "_ckyGetElementByTag");
  function _ckyGetLaw() {
    return banner().properties.settings.applicableLaw;
  }
  __name(_ckyGetLaw, "_ckyGetLaw");
  function _ckyGetType() {
    return banner().properties.settings.type;
  }
  __name(_ckyGetType, "_ckyGetType");
  function _ckyGetPtype() {
    if (_ckyGetType() === "classic") {
      return "pushdown";
    }
    return banner().properties.settings.preferenceCenterType;
  }
  __name(_ckyGetPtype, "_ckyGetPtype");
  function _ckyGetBanner() {
    var _a2;
    const notice = _ckyGetElementByTag("notice");
    return (_a2 = notice == null ? void 0 : notice.closest(".cky-consent-container")) != null ? _a2 : null;
  }
  __name(_ckyGetBanner, "_ckyGetBanner");
  function _ckyHideBanner() {
    const notice = _ckyGetBanner();
    if (notice) notice.classList.add("cky-hide");
  }
  __name(_ckyHideBanner, "_ckyHideBanner");
  function _ckyShowBanner() {
    const notice = _ckyGetBanner();
    if (notice) notice.classList.remove("cky-hide");
  }
  __name(_ckyShowBanner, "_ckyShowBanner");
  function _ckyHideOverLay() {
    const overlay = document.querySelector(".cky-overlay");
    if (overlay) overlay.classList.add("cky-hide");
  }
  __name(_ckyHideOverLay, "_ckyHideOverLay");
  function _ckyShowOverLay() {
    const overlay = document.querySelector(".cky-overlay");
    if (overlay) overlay.classList.remove("cky-hide");
  }
  __name(_ckyShowOverLay, "_ckyShowOverLay");
  function _ckyToggleOverLay() {
    const overlay = document.querySelector(".cky-overlay");
    if (overlay) overlay.classList.toggle("cky-hide");
  }
  __name(_ckyToggleOverLay, "_ckyToggleOverLay");
  function _ckyGetPreferenceCenter() {
    var _a2;
    if (_ckyGetType() === "classic") {
      return _ckyGetBanner();
    }
    _ckyHideBanner();
    const element = _ckyGetLaw() === "ccpa" ? _ckyGetElementByTag("optout-popup") : _ckyGetElementByTag("detail");
    return (_a2 = element == null ? void 0 : element.closest(".cky-modal")) != null ? _a2 : null;
  }
  __name(_ckyGetPreferenceCenter, "_ckyGetPreferenceCenter");
  function _ckyHidePreferenceCenter() {
    _ckyResetPreviewOptoutSuccessMessage();
    const element = _ckyGetPreferenceCenter();
    if (element) element.classList.remove(_ckyGetPreferenceClass());
    if (_ckyGetType() !== "classic") {
      _ckyHideOverLay();
      _ckyShowBanner();
    }
  }
  __name(_ckyHidePreferenceCenter, "_ckyHidePreferenceCenter");
  function _ckyShowPreferenceCenter() {
    const element = _ckyGetPreferenceCenter();
    if (element) element.classList.add(_ckyGetPreferenceClass());
    if (element) {
      const preferenceCenter = element.querySelector(".cky-preference-center");
      if (preferenceCenter) {
        const preferenceCenterId = _ckyGetLaw() === "ccpa" ? "ckyOptoutPreferenceCenter" : "ckyPreferenceCenter";
        preferenceCenter.setAttribute("id", preferenceCenterId);
        preferenceCenter.setAttribute("role", "dialog");
        preferenceCenter.setAttribute("aria-modal", "true");
        const ariaLabel = _ckyGetLaw() === "ccpa" ? "Opt-out Preferences" : "Customise Consent Preferences";
        preferenceCenter.setAttribute("aria-label", ariaLabel);
      }
    }
    if (_ckyGetType() !== "classic") _ckyShowOverLay();
  }
  __name(_ckyShowPreferenceCenter, "_ckyShowPreferenceCenter");
  function _ckyTogglePreferenceCenter() {
    const element = _ckyGetPreferenceCenter();
    if (!element) return;
    element.classList.toggle(_ckyGetPreferenceClass());
    if (_ckyGetType() === "classic") {
      const preferenceCenter = element.querySelector(".cky-preference-center");
      if (preferenceCenter) {
        const preferenceCenterId = _ckyGetLaw() === "ccpa" ? "ckyOptoutPreferenceCenter" : "ckyPreferenceCenter";
        preferenceCenter.setAttribute("id", preferenceCenterId);
        preferenceCenter.setAttribute("role", "dialog");
        preferenceCenter.setAttribute("aria-modal", "true");
        const ariaLabel = _ckyGetLaw() === "ccpa" ? "Opt-out Preferences" : "Customise Consent Preferences";
        preferenceCenter.setAttribute("aria-label", ariaLabel);
      }
    }
    if (_ckyGetPtype() !== "pushdown") _ckyToggleOverLay();
  }
  __name(_ckyTogglePreferenceCenter, "_ckyTogglePreferenceCenter");
  function _ckyGetPreferenceClass() {
    return _ckyGetPtype() === "pushdown" ? "cky-consent-bar-expand" : "cky-modal-open";
  }
  __name(_ckyGetPreferenceClass, "_ckyGetPreferenceClass");
  function _ckyAddPositionClass() {
    var _a2;
    const notice = _ckyGetElementByTag("notice");
    if (!notice) return false;
    const container = notice.closest(".cky-consent-container");
    if (!container) return false;
    container.setAttribute("aria-label", "We value your privacy");
    container.setAttribute("role", "region");
    const b = banner();
    const type = b.properties.settings.type;
    let position = b.properties.settings.position;
    let bannerType = type;
    if (bannerType === "popup") {
      position = "center";
    }
    bannerType = _ckyGetPtype() === "pushdown" ? "classic" : bannerType;
    const noticeClass = `cky-${bannerType}-${position}`;
    container.classList.add(noticeClass);
    const revisitConsent = _ckyGetElementByTag("revisit-consent");
    if (!revisitConsent) return false;
    const revisitPosition = "cky-revisit-" + ((_a2 = b.properties.config.revisitConsent) == null ? void 0 : _a2.position);
    revisitConsent.classList.add(revisitPosition);
    return true;
  }
  __name(_ckyAddPositionClass, "_ckyAddPositionClass");
  function _ckyAddPreferenceCenterClass() {
    const detail = _ckyGetLaw() === "ccpa" ? _ckyGetElementByTag("optout-popup") : _ckyGetElementByTag("detail");
    if (!detail) return false;
    const modal = detail.closest(".cky-modal");
    if (!modal) return false;
    if (_ckyGetPtype() !== "pushdown" && _ckyGetPtype() !== "popup") {
      const pType = banner().properties.settings.preferenceCenterType;
      const modalClass = `cky-${pType}`;
      modal.classList.add(modalClass);
    }
    const preferenceCenter = modal.querySelector(".cky-preference-center");
    if (preferenceCenter) {
      const preferenceCenterId = _ckyGetLaw() === "ccpa" ? "ckyOptoutPreferenceCenter" : "ckyPreferenceCenter";
      preferenceCenter.setAttribute("id", preferenceCenterId);
      preferenceCenter.setAttribute("role", "dialog");
      preferenceCenter.setAttribute("aria-modal", "true");
      const ariaLabel = _ckyGetLaw() === "ccpa" ? "Opt-out Preferences" : "Customise Consent Preferences";
      preferenceCenter.setAttribute("aria-label", ariaLabel);
    }
    return true;
  }
  __name(_ckyAddPreferenceCenterClass, "_ckyAddPreferenceCenterClass");
  function _ckyPreviewCcpaOptOutChecked() {
    const el = document.getElementById(
      "ckyCCPAOptOut"
    );
    return !!(el == null ? void 0 : el.checked);
  }
  __name(_ckyPreviewCcpaOptOutChecked, "_ckyPreviewCcpaOptOutChecked");
  function _ckyIsCcpaApplicableLaw() {
    const law = _ckyGetLaw();
    return law === "ccpa" || typeof law === "string" && law.includes("ccpa");
  }
  __name(_ckyIsCcpaApplicableLaw, "_ckyIsCcpaApplicableLaw");
  function _ckyRestorePreviewOptoutSuccessDom(options2 = {}) {
    var _a2, _b2, _c2, _d, _e2, _f, _g, _h;
    const buttonWrapper = _ckyGetElementByTag(
      "optout-buttons"
    );
    const successMessage = _ckyGetElementByTag("optout-success");
    const countdownElement = _ckyGetElementByTag("optout-success-subtext");
    const ccpaCheckbox = document.getElementById(
      "ckyCCPAOptOut"
    );
    if (buttonWrapper) {
      buttonWrapper.style.display = "";
    }
    if (successMessage) {
      successMessage.classList.add("cky-hide");
      successMessage.removeAttribute("aria-live");
    }
    if (ccpaCheckbox) {
      ccpaCheckbox.disabled = false;
    }
    const optOption = _ckyGetElementByTag("optout-option");
    if (optOption) {
      optOption.classList.remove("cky-disabled");
    }
    if (!countdownElement || !options2.countdown) {
      return;
    }
    if (options2.countdown === "template") {
      const timerEl = (_a2 = countdownElement.querySelector("#ckyCountdownTimer")) != null ? _a2 : document.getElementById("ckyCountdownTimer");
      if (timerEl) {
        timerEl.textContent = "";
        return;
      }
      if (previewOptoutSuccess.subtextTemplate) {
        countdownElement.textContent = previewOptoutSuccess.subtextTemplate;
      }
      return;
    }
    if (options2.countdown === "store") {
      const lang = previewLanguage();
      const b = banner();
      const sub = (_h = (_g = (_f = (_e2 = (_d = (_c2 = (_b2 = b.contents) == null ? void 0 : _b2[lang]) == null ? void 0 : _c2.optoutPopup) == null ? void 0 : _d.elements) == null ? void 0 : _e2.optoutSuccess) == null ? void 0 : _f.elements) == null ? void 0 : _g.subtext) != null ? _h : "";
      if (sub) {
        countdownElement.innerHTML = sub;
      }
    }
  }
  __name(_ckyRestorePreviewOptoutSuccessDom, "_ckyRestorePreviewOptoutSuccessDom");
  function _ckyClearPreviewOptoutSuccessTimers() {
    if (previewOptoutSuccess.intervalId) {
      clearInterval(previewOptoutSuccess.intervalId);
      previewOptoutSuccess.intervalId = null;
    }
    if (previewOptoutSuccess.timeoutId) {
      clearTimeout(previewOptoutSuccess.timeoutId);
      previewOptoutSuccess.timeoutId = null;
    }
  }
  __name(_ckyClearPreviewOptoutSuccessTimers, "_ckyClearPreviewOptoutSuccessTimers");
  function _ckyResetPreviewOptoutSuccessMessage() {
    _ckyClearPreviewOptoutSuccessTimers();
    _ckyRestorePreviewOptoutSuccessDom({ countdown: "template" });
    previewOptoutSuccess.subtextTemplate = "";
  }
  __name(_ckyResetPreviewOptoutSuccessMessage, "_ckyResetPreviewOptoutSuccessMessage");
  function _ckyPreviewDismissAfterOptoutSuccess() {
    var _a2;
    _ckyClearPreviewOptoutSuccessTimers();
    previewOptoutSuccess.subtextTemplate = "";
    _ckyRestorePreviewOptoutSuccessDom({ countdown: "store" });
    const isClassic = _ckyGetType() === "classic";
    if (isClassic) {
      const bannerEl = _ckyGetBanner();
      if (bannerEl) {
        bannerEl.classList.remove(_ckyGetPreferenceClass());
      }
      const notice = _ckyGetElementByTag("notice");
      if (notice) {
        notice.classList.remove("cky-consent-bar-expand");
      }
    } else {
      const optoutRoot = _ckyGetElementByTag("optout-popup");
      const modal = (_a2 = optoutRoot == null ? void 0 : optoutRoot.closest(".cky-modal")) != null ? _a2 : null;
      if (modal) {
        modal.classList.remove(_ckyGetPreferenceClass());
      }
      _ckyHideOverLay();
    }
    _ckyShowBanner();
  }
  __name(_ckyPreviewDismissAfterOptoutSuccess, "_ckyPreviewDismissAfterOptoutSuccess");
  function _ckyShowPreviewOptoutSuccessMessage() {
    var _a2, _b2;
    if (!_ckyIsCcpaApplicableLaw()) {
      return;
    }
    _ckyClearPreviewOptoutSuccessTimers();
    const buttonWrapper = _ckyGetElementByTag(
      "optout-buttons"
    );
    const successMessage = _ckyGetElementByTag("optout-success");
    const countdownElement = _ckyGetElementByTag("optout-success-subtext");
    const ccpaCheckbox = document.getElementById(
      "ckyCCPAOptOut"
    );
    if (!buttonWrapper || !successMessage) {
      _ckyPreviewDismissAfterOptoutSuccess();
      return;
    }
    buttonWrapper.style.display = "none";
    successMessage.classList.remove("cky-hide");
    successMessage.setAttribute("aria-live", "polite");
    (_a2 = successMessage.focus) == null ? void 0 : _a2.call(successMessage);
    if (ccpaCheckbox) {
      ccpaCheckbox.disabled = true;
    }
    const optOption = _ckyGetElementByTag("optout-option");
    if (optOption) {
      optOption.classList.add("cky-disabled");
    }
    const countdownTimerEl = (countdownElement == null ? void 0 : countdownElement.querySelector("#ckyCountdownTimer")) || document.getElementById("ckyCountdownTimer");
    let timeRemaining = CKY_PREVIEW_OPTOUT_SUCCESS_SEC;
    if (countdownElement && !countdownTimerEl && !previewOptoutSuccess.subtextTemplate) {
      const fromDom = ((_b2 = countdownElement.textContent) != null ? _b2 : "").trim();
      previewOptoutSuccess.subtextTemplate = fromDom || bannerCloseCountdownText(CKY_PREVIEW_OPTOUT_SUCCESS_SEC);
    }
    const template = previewOptoutSuccess.subtextTemplate;
    const hasDigit = !!(template && /\d+/.test(template));
    const updateSubtext = /* @__PURE__ */ __name(() => {
      if (!countdownElement) {
        return;
      }
      if (countdownTimerEl) {
        countdownTimerEl.textContent = String(timeRemaining);
        return;
      }
      countdownElement.textContent = hasDigit ? template.replace(/\d+/, String(timeRemaining)) : bannerCloseCountdownText(timeRemaining);
    }, "updateSubtext");
    updateSubtext();
    previewOptoutSuccess.intervalId = setInterval(() => {
      timeRemaining -= 1;
      if (timeRemaining >= 0) {
        updateSubtext();
      }
    }, 1e3);
    previewOptoutSuccess.timeoutId = setTimeout(() => {
      _ckyPreviewDismissAfterOptoutSuccess();
    }, CKY_PREVIEW_OPTOUT_SUCCESS_MS);
  }
  __name(_ckyShowPreviewOptoutSuccessMessage, "_ckyShowPreviewOptoutSuccessMessage");
  function _ckyHandlePreviewOptoutConfirm() {
    return () => {
      if (_ckyIsCcpaApplicableLaw() && _ckyPreviewCcpaOptOutChecked()) {
        _ckyShowPreviewOptoutSuccessMessage();
        return;
      }
      _ckyHidePreferenceCenter();
    };
  }
  __name(_ckyHandlePreviewOptoutConfirm, "_ckyHandlePreviewOptoutConfirm");
  function _ckyRegisterListeners() {
    _ckyAttachListener("settings-button", () => _ckyTogglePreferenceCenter());
    _ckyAttachListener("detail-close", () => _ckyHidePreferenceCenter());
    _ckyAttachListener("detail-save-button", () => _ckyHidePreferenceCenter());
    _ckyAttachListener("optout-cancel-button", () => _ckyHidePreferenceCenter());
    _ckyAttachListener("optout-confirm-button", _ckyHandlePreviewOptoutConfirm());
    _ckyAttachListener(
      "detail-category-preview-save-button",
      () => _ckyHidePreferenceCenter()
    );
    _ckyAttachListener("donotsell-button", () => _ckyShowPreferenceCenter());
    _ckyAttachListener("optout-close", () => _ckyHidePreferenceCenter());
    _ckyInitAccordionTabs();
  }
  __name(_ckyRegisterListeners, "_ckyRegisterListeners");
  function _ckyAttachListener(tag, fn) {
    document.querySelectorAll(queryByCkyTag(tag)).forEach((item) => {
      bindPreviewClickOnce(item, fn);
    });
  }
  __name(_ckyAttachListener, "_ckyAttachListener");
  function _ckyInitAccordionTabs() {
    var _a2;
    const b = banner();
    if (!((_a2 = b.properties.config.auditTable) == null ? void 0 : _a2.status)) return;
    document.querySelectorAll(".cky-accordion").forEach((item) => {
      const h = item;
      if (h.dataset.ckyAdminPreviewAccordion) return;
      h.dataset.ckyAdminPreviewAccordion = "1";
      item.addEventListener("click", function(event) {
        const t2 = event.target;
        if (t2.tagName === "INPUT" && t2.type === "checkbox")
          return;
        this.classList.toggle("cky-accordion-active");
      });
    });
  }
  __name(_ckyInitAccordionTabs, "_ckyInitAccordionTabs");
  function _ckySetShowMoreLess() {
    var _a2, _b2, _c2, _d, _e2, _f;
    const activeLaw = _ckyGetLaw();
    const b = banner();
    const language = previewLanguage();
    const key = activeLaw === "ccpa" ? "optoutPopup" : "preferenceCenter";
    const showCode = getShortCodes().find((code) => code.key === "cky_show_desc");
    const hideCode = getShortCodes().find((code) => code.key === "cky_hide_desc");
    if (!showCode || !hideCode) return;
    const hideButtonContent = hideCode.content;
    const showButtonContent = showCode.content;
    const hideDoc = new DOMParser().parseFromString(
      hideButtonContent,
      "text/html"
    );
    const hideButtonElement = hideDoc.querySelector(
      '[data-cky-tag="hide-desc-button"]'
    );
    const showDoc = new DOMParser().parseFromString(
      showButtonContent,
      "text/html"
    );
    const showButtonElement = showDoc.querySelector(
      '[data-cky-tag="show-desc-button"]'
    );
    if (!hideButtonElement || !showButtonElement) return;
    const block = (_a2 = b.contents[language]) == null ? void 0 : _a2[key];
    hideButtonElement.innerHTML = String((_c2 = (_b2 = block == null ? void 0 : block.elements) == null ? void 0 : _b2.showLess) != null ? _c2 : "");
    showButtonElement.innerHTML = String((_e2 = (_d = block == null ? void 0 : block.elements) == null ? void 0 : _d.showMore) != null ? _e2 : "");
    const contentLimit = window.innerWidth < 376 ? 150 : 300;
    const el = document.querySelector(
      `[data-cky-tag="${activeLaw === "gdpr" ? "detail" : "optout"}-description"]`
    );
    if (!el) return;
    const element = el;
    const content = (_f = element.textContent) != null ? _f : "";
    if (content.length < contentLimit) return;
    const contentHTML = element.innerHTML;
    const htmlDoc = new DOMParser().parseFromString(contentHTML, "text/html");
    const innerElements = htmlDoc.querySelectorAll("body > p");
    if (innerElements.length <= 1) return;
    let strippedContent2 = "";
    for (let index2 = 0; index2 < innerElements.length; index2++) {
      if (index2 === innerElements.length - 1) continue;
      const p2 = innerElements[index2];
      if (`${strippedContent2}${p2.outerHTML}`.length > contentLimit) {
        p2.insertAdjacentHTML("beforeend", `...&nbsp;${showDoc.body.innerHTML}`);
      }
      strippedContent2 = `${strippedContent2}${p2.outerHTML}`;
      if (strippedContent2.length > contentLimit) break;
    }
    function showMoreHandler() {
      element.innerHTML = `${contentHTML}${hideDoc.body.innerHTML}`;
      _ckyAttachListener("hide-desc-button", showLessHandler);
      _ckyAttachShowMoreLessStyles(document);
    }
    __name(showMoreHandler, "showMoreHandler");
    function showLessHandler() {
      element.innerHTML = strippedContent2;
      _ckyAttachListener("show-desc-button", showMoreHandler);
      _ckyAttachShowMoreLessStyles(document);
    }
    __name(showLessHandler, "showLessHandler");
    showLessHandler();
  }
  __name(_ckySetShowMoreLess, "_ckySetShowMoreLess");
  function _ckyReplaceSrcAttribute($doc, $tag) {
    var _a2, _b2;
    const element = $doc.querySelector(queryByCkyTag($tag));
    if (!element) return false;
    let target = element;
    if (!element.getAttribute("src")) {
      target = element.querySelector("img");
    }
    if (!target) return false;
    const assetsBase = (_b2 = (_a2 = window.ckyGlobals) == null ? void 0 : _a2.assetsURL) != null ? _b2 : "";
    const src = target.src;
    const lastIndex = src.lastIndexOf("/");
    const icon = src.substring(lastIndex + 1);
    target.src = assetsBase + icon;
    return true;
  }
  __name(_ckyReplaceSrcAttribute, "_ckyReplaceSrcAttribute");
  function _ckySetFooterShadow($doc) {
    const footer = $doc.querySelector(
      '[data-cky-tag="detail"] .cky-footer-shadow'
    );
    const preference = $doc.querySelector('[data-cky-tag="detail"]');
    if (!footer) return;
    const background = preference && preference.style.backgroundColor || "#ffffff";
    footer.style.background = `linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, ${background} 100%)`;
  }
  __name(_ckySetFooterShadow, "_ckySetFooterShadow");
  function _ckySetPreferenceCheckBoxStates(revisit = false) {
    var _a2, _b2, _c2, _d, _e2, _f;
    const categories = previewCookies();
    const b = banner();
    const preferenceToggle = (_d = (_c2 = (_b2 = (_a2 = b.properties.config.preferenceCenter) == null ? void 0 : _a2.elements) == null ? void 0 : _b2.categories) == null ? void 0 : _c2.elements) == null ? void 0 : _d.toggle;
    if (preferenceToggle) {
      _ckySetToggleColor("ckySwitch", preferenceToggle);
    }
    const categoryPreviewToggle = (_f = (_e2 = b.properties.config.categoryPreview) == null ? void 0 : _e2.elements) == null ? void 0 : _f.toggle;
    if (categoryPreviewToggle) {
      _ckySetToggleColor("ckyCategoryDirect", categoryPreviewToggle);
    }
    if (!preferenceToggle) return;
    for (const category of categories) {
      const checked = !!category.prior_consent || _isNecessaryCategory(category);
      const disabled = _isNecessaryCategory(category);
      _ckySetCheckboxes(category, checked, disabled, revisit);
      _ckySetPreferenceState(category);
    }
  }
  __name(_ckySetPreferenceCheckBoxStates, "_ckySetPreferenceCheckBoxStates");
  function _ckySetCheckboxes(category, checked, disabled, revisit = false) {
    var _a2, _b2, _c2, _d;
    const b = banner();
    const toggle = (_d = (_c2 = (_b2 = (_a2 = b.properties.config.preferenceCenter) == null ? void 0 : _a2.elements) == null ? void 0 : _b2.categories) == null ? void 0 : _c2.elements) == null ? void 0 : _d.toggle;
    const colors = getToggleBackgroundColors(toggle);
    if (!colors) return;
    const { active: activeColor, inactive: inactiveColor } = colors;
    ["ckyCategoryDirect", "ckySwitch"].forEach((key) => {
      var _a3;
      const slug = String((_a3 = category.slug) != null ? _a3 : "");
      const boxElem = document.getElementById(
        `${key}${slug}`
      );
      if (!boxElem) return;
      _ckySetCategoryToggle(boxElem, category);
      boxElem.checked = checked;
      boxElem.disabled = disabled;
      boxElem.style.backgroundColor = checked ? activeColor : inactiveColor;
      if (revisit) return;
      bindPreviewChangeOnce(boxElem, ({ currentTarget: elem }) => {
        const input = elem;
        const isChecked = input.checked;
        input.style.backgroundColor = isChecked ? activeColor : inactiveColor;
      });
    });
  }
  __name(_ckySetCheckboxes, "_ckySetCheckboxes");
  function _ckySetToggleColor(element, toggle) {
    const colors = getToggleBackgroundColors(toggle);
    if (!colors) return;
    const { active: activeColor, inactive: inactiveColor } = colors;
    document.querySelectorAll(`[id^="${element}"]`).forEach((item) => {
      const input = item;
      const checked = input.checked;
      bindPreviewChangeOnce(input, ({ currentTarget: elem }) => {
        const el = elem;
        const isChecked = el.checked;
        el.style.backgroundColor = isChecked ? activeColor : inactiveColor;
      });
      input.style.backgroundColor = checked ? activeColor : inactiveColor;
    });
  }
  __name(_ckySetToggleColor, "_ckySetToggleColor");
  function _ckySetCategoryToggle(element, category = {}) {
    if (element.closest('[data-cky-tag="detail-category-toggle"]')) {
      _ckySetCategoryPreferenceToggle(element, category);
    } else if (element.closest('[data-cky-tag="detail-category-preview-toggle"]')) {
      _ckySetCategoryPreview(element, category);
    }
  }
  __name(_ckySetCategoryToggle, "_ckySetCategoryToggle");
  function _ckySetCategoryPreferenceToggle(element, category) {
    var _a2, _b2;
    const b = banner();
    const toggleContainer = element.closest(".cky-accordion-item");
    if (!toggleContainer) return;
    const toggleSwitch = toggleContainer.querySelector(".cky-switch");
    const necessaryText = toggleContainer.querySelector(".cky-always-active");
    if (_isNecessaryCategory(category)) {
      toggleSwitch == null ? void 0 : toggleSwitch.remove();
    } else {
      necessaryText == null ? void 0 : necessaryText.remove();
      const removeToggle = _ckyGetType() === "classic" && ((_a2 = b.properties.config.categoryPreview) == null ? void 0 : _a2.status) || !!(((_b2 = category.cookie_list) == null ? void 0 : _b2.length) === 0);
      if (removeToggle) {
        toggleSwitch == null ? void 0 : toggleSwitch.remove();
      }
    }
  }
  __name(_ckySetCategoryPreferenceToggle, "_ckySetCategoryPreferenceToggle");
  function _ckySetPreferenceState(category) {
    var _a2, _b2;
    const b = banner();
    if (((_a2 = b.properties.config.auditTable) == null ? void 0 : _a2.status) === false) {
      const slug = String((_b2 = category.slug) != null ? _b2 : "");
      const tableElement = document.querySelector(
        `#ckyDetailCategory${slug} [data-cky-tag="audit-table"]`
      );
      tableElement == null ? void 0 : tableElement.remove();
      const chevronElement = document.querySelector(
        `#ckyDetailCategory${slug} .cky-accordion-chevron`
      );
      chevronElement == null ? void 0 : chevronElement.classList.add("cky-accordion-chevron-hide");
    }
  }
  __name(_ckySetPreferenceState, "_ckySetPreferenceState");
  function _ckySetCategoryPreview(element, category) {
    var _a2, _b2;
    if (category.cookie_list && category.cookie_list.length === 0 && !_isNecessaryCategory(category)) {
      (_b2 = (_a2 = element.parentElement) == null ? void 0 : _a2.parentElement) == null ? void 0 : _b2.remove();
    }
  }
  __name(_ckySetCategoryPreview, "_ckySetCategoryPreview");
  function _ckyAttachReadMore(parent) {
    var _a2, _b2, _c2, _d, _e2, _f, _g, _h, _i, _j, _k;
    const b = banner();
    const language = previewLanguage();
    const readMoreButton = getShortCodes().find(
      (code) => code.key === "cky_readmore"
    );
    if (parent.querySelector('[data-cky-tag="readmore-button"]')) return;
    if (((_e2 = (_d = (_c2 = (_b2 = (_a2 = b.properties.config.notice) == null ? void 0 : _a2.elements) == null ? void 0 : _b2.buttons) == null ? void 0 : _c2.elements) == null ? void 0 : _d.readMore) == null ? void 0 : _e2.status) === false)
      return;
    if (!readMoreButton) return;
    const content = readMoreButton.content;
    const readMoreElement = parent.querySelector('[data-cky-tag="description"]');
    if (!readMoreElement) return;
    const doc = new DOMParser().parseFromString(content, "text/html");
    const el = doc.querySelector('[data-cky-tag="readmore-button"]');
    if (!el) return;
    const readMoreCopy = (_k = (_j = (_i = (_h = (_g = (_f = b.contents[language]) == null ? void 0 : _f.notice) == null ? void 0 : _g.elements) == null ? void 0 : _h.buttons) == null ? void 0 : _i.elements) == null ? void 0 : _j.readMore) != null ? _k : "";
    el.innerHTML = readMoreCopy;
    if (readMoreElement.childNodes.length > 1) {
      const innerElement = parent.querySelector(
        '[data-cky-tag="description"] p:last-child'
      );
      innerElement == null ? void 0 : innerElement.insertAdjacentHTML(
        "beforeend",
        `&nbsp;${doc.body.innerHTML}`
      );
    } else {
      readMoreElement.insertAdjacentHTML(
        "beforeend",
        `&nbsp;${doc.body.innerHTML}`
      );
    }
  }
  __name(_ckyAttachReadMore, "_ckyAttachReadMore");
  function applyStyleBlock(elements, styles) {
    Array.from(elements).forEach((node) => {
      const button = node;
      for (const key in styles) {
        if (!styles[key]) continue;
        button.style[key] = styles[key];
      }
    });
  }
  __name(applyStyleBlock, "applyStyleBlock");
  function _ckyAttachShowMoreLessStyles(parent = document) {
    var _a2, _b2, _c2, _d;
    const b = banner();
    const accessibilityOverrides = b.properties.config.accessibilityOverrides;
    if (!(accessibilityOverrides == null ? void 0 : accessibilityOverrides.elements)) return;
    const preferenceCenter = accessibilityOverrides.elements.preferenceCenter;
    if (!(preferenceCenter == null ? void 0 : preferenceCenter.elements)) return;
    const showMoreStyles = (_a2 = preferenceCenter.elements.showMore) == null ? void 0 : _a2.styles;
    const showLessStyles = (_b2 = preferenceCenter.elements.showLess) == null ? void 0 : _b2.styles;
    if (showMoreStyles) {
      applyStyleBlock(
        parent.querySelectorAll('[data-cky-tag="show-desc-button"]'),
        showMoreStyles
      );
    }
    if (showLessStyles) {
      applyStyleBlock(
        parent.querySelectorAll('[data-cky-tag="hide-desc-button"]'),
        showLessStyles
      );
    }
    const optoutPopup = accessibilityOverrides.elements.optoutPopup;
    if (optoutPopup == null ? void 0 : optoutPopup.elements) {
      const optoutShowMoreStyles = (_c2 = optoutPopup.elements.showMore) == null ? void 0 : _c2.styles;
      const optoutShowLessStyles = (_d = optoutPopup.elements.showLess) == null ? void 0 : _d.styles;
      if (optoutShowMoreStyles) {
        applyStyleBlock(
          parent.querySelectorAll('[data-cky-tag="optout-show-desc-button"]'),
          optoutShowMoreStyles
        );
      }
      if (optoutShowLessStyles) {
        applyStyleBlock(
          parent.querySelectorAll('[data-cky-tag="optout-hide-desc-button"]'),
          optoutShowLessStyles
        );
      }
    }
  }
  __name(_ckyAttachShowMoreLessStyles, "_ckyAttachShowMoreLessStyles");
  function _ckyAttachAlwaysActiveStyles(parent = document) {
    var _a2;
    const b = banner();
    const overrides = b.properties.config.accessibilityOverrides;
    if (!(overrides == null ? void 0 : overrides.elements)) return;
    const preferenceCenter = overrides.elements.preferenceCenter;
    if (!(preferenceCenter == null ? void 0 : preferenceCenter.elements)) return;
    const alwaysActiveStyles = (_a2 = preferenceCenter.elements.alwaysActive) == null ? void 0 : _a2.styles;
    if (!alwaysActiveStyles) return;
    applyStyleBlock(
      parent.querySelectorAll(".cky-always-active"),
      alwaysActiveStyles
    );
  }
  __name(_ckyAttachAlwaysActiveStyles, "_ckyAttachAlwaysActiveStyles");
  function _ckyAttachManualLinksStyles(parent = document) {
    var _a2;
    const b = banner();
    const overrides = b.properties.config.accessibilityOverrides;
    if (!(overrides == null ? void 0 : overrides.elements)) return;
    const manualLinksStyles = (_a2 = overrides.elements.manualLinks) == null ? void 0 : _a2.styles;
    if (!manualLinksStyles) return;
    const manualLinks = parent.querySelectorAll(
      '[data-cky-tag="detail"] a, [data-cky-tag="optout-popup"] a, [data-cky-tag="notice"] a'
    );
    Array.from(manualLinks).forEach((link) => {
      const el = link;
      if (el.dataset.ckyTag === "readmore-button") return;
      for (const style in manualLinksStyles) {
        if (!manualLinksStyles[style]) continue;
        el.style[style] = manualLinksStyles[style];
      }
      if (manualLinksStyles.color) {
        el.style.textDecorationColor = manualLinksStyles.color;
      }
    });
  }
  __name(_ckyAttachManualLinksStyles, "_ckyAttachManualLinksStyles");
  function _ckySetPoweredBy() {
    const position = "flex-end";
    ["detail-powered-by", "optout-powered-by"].forEach((key) => {
      const el = document.querySelector(
        `[data-cky-tag="${key}"]`
      );
      if (!el) return;
      el.style.display = "flex";
      el.style.justifyContent = position;
      el.style.alignItems = "center";
    });
  }
  __name(_ckySetPoweredBy, "_ckySetPoweredBy");
  function _ckySetCCPAOptions() {
    var _a2, _b2, _c2, _d;
    const item = _ckyGetElementByTag("optout-option");
    if (!item) return;
    item.classList.remove("cky-disabled");
    const b = banner();
    const toggle = (_d = (_c2 = (_b2 = (_a2 = b.properties.config.optoutPopup) == null ? void 0 : _a2.elements) == null ? void 0 : _b2.optOption) == null ? void 0 : _c2.elements) == null ? void 0 : _d.toggle;
    const colors = getToggleBackgroundColors(toggle);
    if (!colors) return;
    const { active: activeColor, inactive: inactiveColor } = colors;
    const boxElem = document.getElementById(
      "ckyCCPAOptOut"
    );
    if (!boxElem) return;
    _ckyAttachListener("optout-option-title", () => boxElem.click());
    boxElem.style.backgroundColor = inactiveColor;
    bindPreviewChangeOnce(boxElem, ({ currentTarget: elem }) => {
      const input = elem;
      const isChecked = input.checked;
      input.style.backgroundColor = isChecked ? activeColor : inactiveColor;
    });
  }
  __name(_ckySetCCPAOptions, "_ckySetCCPAOptions");
  function getBannerApplicableLaw(b) {
    var _a2;
    const props = b.properties;
    return (_a2 = props == null ? void 0 : props.settings) == null ? void 0 : _a2.applicableLaw;
  }
  __name(getBannerApplicableLaw, "getBannerApplicableLaw");
  let templateCache = {};
  let previewRefreshOverlayPending = false;
  const PREVIEW_CONTAINER_BASE_CLASS = "cky-banner-preview";
  const PREVIEW_PARTIAL_REFRESH_CLASS = "cky-preview-partial-refreshing";
  function ensurePreviewContainerBaseClass(container) {
    container.classList.add(PREVIEW_CONTAINER_BASE_CLASS);
  }
  __name(ensurePreviewContainerBaseClass, "ensurePreviewContainerBaseClass");
  function syncPreviewRefreshOverlayDom() {
    const container = document.getElementById("cky-banner-preview-container");
    if (!container) return;
    if (previewRefreshOverlayPending) {
      container.classList.add(PREVIEW_PARTIAL_REFRESH_CLASS);
    } else {
      container.classList.remove(PREVIEW_PARTIAL_REFRESH_CLASS);
    }
  }
  __name(syncPreviewRefreshOverlayDom, "syncPreviewRefreshOverlayDom");
  function getAdminBannerLanguage() {
    var _a2, _b2;
    const w = window;
    return ((_b2 = (_a2 = w.ckyConfig) == null ? void 0 : _a2.languages) == null ? void 0 : _b2.current) || getDefaultLanguage();
  }
  __name(getAdminBannerLanguage, "getAdminBannerLanguage");
  function addStylesToElement(element, config2) {
    if (config2 === null || element === null) return;
    let styles = "";
    if (config2.styles) {
      for (const key in config2.styles) {
        styles += `${key}: ${config2.styles[key]};`;
      }
    }
    element.style.cssText += styles;
  }
  __name(addStylesToElement, "addStylesToElement");
  function updateCategoryPreview(doc) {
    const categories = previewCookies();
    if (!categories) return;
    categories.forEach((item) => {
      var _a2, _b2, _c2;
      if (String((_a2 = item.slug) != null ? _a2 : "").toLowerCase() === "necessary") return;
      const element = doc.getElementById(`ckyDetailCategory${item.slug}`);
      const categoryDirectElement = doc.getElementById(
        `ckyCategoryDirect${item.slug}`
      );
      if (item.visibility === false) {
        (_b2 = element == null ? void 0 : element.parentNode) == null ? void 0 : _b2.removeChild(element);
        const directWrap = categoryDirectElement == null ? void 0 : categoryDirectElement.closest(".cky-category-direct-item");
        (_c2 = directWrap == null ? void 0 : directWrap.parentNode) == null ? void 0 : _c2.removeChild(directWrap);
      }
    });
  }
  __name(updateCategoryPreview, "updateCategoryPreview");
  function fetchBannerForPreview(law) {
    return __async(this, null, function* () {
      const list = yield ckyRest.get({ path: "/banners" });
      if (!Array.isArray(list) || list.length === 0) return null;
      const byLaw = list.find((b) => getBannerApplicableLaw(b) === law);
      if (byLaw) return byLaw;
      const active = list.find(
        (b) => b.status === true || b.status === 1 || b.status === "1"
      );
      if (active && getBannerApplicableLaw(active) === law) {
        return active;
      }
      return null;
    });
  }
  __name(fetchBannerForPreview, "fetchBannerForPreview");
  function toPreviewCookieCategories(raw) {
    return (raw || []).map((cat) => {
      const cookies2 = cat.cookies || cat.cookie_list || [];
      return __spreadProps(__spreadValues({}, cat), {
        cookie_list: cookies2
      });
    });
  }
  __name(toPreviewCookieCategories, "toPreviewCookieCategories");
  function fetchCookieCategoriesForPreview() {
    return __async(this, null, function* () {
      const raw = yield cookieApi.getCookieCategories();
      return toPreviewCookieCategories(raw);
    });
  }
  __name(fetchCookieCategoriesForPreview, "fetchCookieCategoriesForPreview");
  const bannerPreview = {
    startLoading() {
      previewRefreshOverlayPending = true;
      syncPreviewRefreshOverlayDom();
    },
    stopLoading() {
      previewRefreshOverlayPending = false;
      syncPreviewRefreshOverlayDom();
    },
    resetTemplateCache() {
      templateCache = {};
    },
    generate(force = false, shouldRender = true) {
      return __async(this, null, function* () {
        const banner2 = previewCurrentBanner();
        const template = yield this.getTemplate(force);
        if (!(banner2 == null ? void 0 : banner2.properties) || !(template == null ? void 0 : template.styles)) return;
        yield this.renderBannerStyles(template.styles);
        const html = this.refreshBannerStyles(banner2.properties);
        yield this.renderBannerHtml(html, shouldRender);
      });
    },
    getTemplate(force) {
      return __async(this, null, function* () {
        var _a2;
        const banner2 = previewCurrentBanner();
        if (!(banner2 == null ? void 0 : banner2.properties)) return void 0;
        const type = banner2.properties.settings.type;
        const law = banner2.properties.settings.applicableLaw;
        const lawBucket = templateCache[law] || {};
        if (!force && Object.prototype.hasOwnProperty.call(lawBucket, type) && ((_a2 = lawBucket[type]) == null ? void 0 : _a2.html)) {
          return lawBucket[type];
        }
        const template = yield this.getPreviewHtml(banner2);
        if (template == null ? void 0 : template.html) {
          if (!templateCache[law]) templateCache[law] = {};
          templateCache[law][type] = template;
          return templateCache[law][type];
        }
        return void 0;
      });
    },
    showPreview(force = false) {
      return __async(this, null, function* () {
        const { useBannerStore: useBannerStore2 } = yield __vitePreload(() => __async(null, null, function* () {
          const { useBannerStore: useBannerStore3 } = yield Promise.resolve().then(() => bannerStore);
          return { useBannerStore: useBannerStore3 };
        }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href);
        if (!useBannerStore2.getState().preview) {
          this.hidePreview();
          return;
        }
        const ready = yield ensureBannerPreviewContextFromStores();
        if (!ready) return;
        yield this.generate(force, true);
      });
    },
    hidePreview() {
      _ckyClearPreviewOptoutSuccessTimers();
      previewRefreshOverlayPending = false;
      const container = document.getElementById("cky-banner-preview-container");
      if (container !== null) {
        document.body.removeChild(container);
      }
      const style = document.getElementById("cky-banner-style");
      if (style == null ? void 0 : style.parentNode) {
        style.parentNode.removeChild(style);
      }
    },
    closePreview(clear = true) {
      if (clear) {
        this.resetTemplateCache();
      }
      clearBannerPreviewContext();
      this.hidePreview();
    },
    renderBannerStyles(styles) {
      return __async(this, null, function* () {
        var _a2;
        const bannerStyle = document.getElementById("cky-banner-style");
        if (bannerStyle !== null) {
          (_a2 = bannerStyle.parentNode) == null ? void 0 : _a2.removeChild(bannerStyle);
        }
        const style = document.createElement("style");
        style.id = "cky-banner-style";
        style.innerHTML = styles;
        document.getElementsByTagName("head")[0].appendChild(style);
      });
    },
    refreshBannerStyles(properties) {
      var _a2;
      const type = properties.settings.type;
      const law = properties.settings.applicableLaw;
      const template = (_a2 = templateCache[law]) == null ? void 0 : _a2[type];
      const html = template == null ? void 0 : template.html;
      if (!html) return void 0;
      const doc = new DOMParser().parseFromString(html, "text/html");
      _ckyAttachReadMore(doc);
      _ckyAttachShowMoreLessStyles(doc);
      _ckyAttachAlwaysActiveStyles(doc);
      _ckyAttachManualLinksStyles(doc);
      const obj = properties.config;
      const keyExists = /* @__PURE__ */ __name((o2) => {
        Object.keys(o2).forEach((key) => {
          const val = o2[key];
          if (typeof val === "object" && val !== null) {
            const config2 = val;
            if (Object.prototype.hasOwnProperty.call(config2, "tag")) {
              const tag = config2.tag || "";
              if (tag !== "") {
                doc.querySelectorAll(`[data-cky-tag^="${tag}"]`).forEach((item) => {
                  var _a3;
                  const status = config2.status && config2.status === true ? true : false;
                  if (status === false && tag !== "detail-category-toggle") {
                    (_a3 = item.parentNode) == null ? void 0 : _a3.removeChild(item);
                  }
                  if (!(item.getAttribute("data-cky-tag") === "detail-category-preview-save-button" && tag === "detail")) {
                    addStylesToElement(item, config2);
                  }
                });
              }
            }
            keyExists(val);
          }
        });
      }, "keyExists");
      keyExists(obj);
      updateCategoryPreview(doc);
      this.resetTemplateCache();
      return doc.body.innerHTML;
    },
    renderBannerHtml(html, shouldRender = true) {
      return __async(this, null, function* () {
        if (!html || !shouldRender) return;
        let container = document.getElementById("cky-banner-preview-container");
        if (container === null) {
          container = document.createElement("div");
          container.id = "cky-banner-preview-container";
          document.body.insertBefore(container, document.body.firstChild);
        } else {
          const banner2 = document.querySelector(".cky-consent-container");
          if (banner2) {
            container.innerHTML = "";
          }
        }
        ensurePreviewContainerBaseClass(container);
        syncPreviewRefreshOverlayDom();
        const doc = new DOMParser().parseFromString(html, "text/html");
        updateCategoryPreview(doc);
        _ckyReplaceSrcAttribute(doc, "detail-close");
        _ckyReplaceSrcAttribute(doc, "close-button");
        _ckyReplaceSrcAttribute(doc, "detail-powered-by");
        _ckyReplaceSrcAttribute(doc, "revisit-consent");
        _ckyReplaceSrcAttribute(doc, "optout-powered-by");
        _ckyReplaceSrcAttribute(doc, "optout-success-icon");
        _ckySetFooterShadow(doc);
        container.insertAdjacentHTML("afterbegin", doc.body.innerHTML);
        _ckyRegisterListeners();
        this.attachPreviewCloseBtn();
        _ckyAddPositionClass();
        _ckyShowBanner();
        _ckySetShowMoreLess();
        _ckySetPreferenceCheckBoxStates();
        _ckyAttachReadMore(document);
        _ckyAttachShowMoreLessStyles(document);
        _ckyAttachAlwaysActiveStyles(document);
        _ckyAttachManualLinksStyles(document);
        _ckySetPoweredBy();
        _ckySetCCPAOptions();
        _ckyAddPreferenceCenterClass();
      });
    },
    attachPreviewCloseBtn() {
      const banner2 = previewCurrentBanner();
      if (!banner2) return;
      const type = banner2.properties.settings.type;
      const container = document.getElementById("cky-banner-preview-container");
      if (container && type === "popup") {
        container.insertAdjacentHTML(
          "beforeend",
          '<button type="button" id="cky-preview-close-btn" data-cky-tag="preview-close" class="cky:fixed cky:right-[50px] cky:top-[50px] cky:z-[999999999] cky:flex cky:cursor-pointer cky:items-center cky:border-0 cky:bg-transparent cky:text-lg cky:font-semibold cky:text-white">Close Preview</button>'
        );
      }
    },
    getPreviewHtml(data) {
      return __async(this, null, function* () {
        try {
          const language = hasBannerPreviewContext() ? previewLanguage() : getAdminBannerLanguage();
          return yield ckyRest.post({
            path: "/banners/preview",
            params: { language },
            data
          });
        } catch (error) {
          console.error(error);
          return {};
        }
      });
    }
  };
  function ensureBannerPreviewContextFromStores() {
    return __async(this, null, function* () {
      var _a2;
      const { useBannerStore: useBannerStore2 } = yield __vitePreload(() => __async(null, null, function* () {
        const { useBannerStore: useBannerStore3 } = yield Promise.resolve().then(() => bannerStore);
        return { useBannerStore: useBannerStore3 };
      }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href);
      const { useLanguageStore: useLanguageStore2 } = yield __vitePreload(() => __async(null, null, function* () {
        const { useLanguageStore: useLanguageStore3 } = yield Promise.resolve().then(() => languageStore);
        return { useLanguageStore: useLanguageStore3 };
      }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href);
      const banner2 = useBannerStore2.getState().current;
      if (banner2 === false || !banner2) return false;
      const lang = (_a2 = useLanguageStore2.getState().current) != null ? _a2 : "en";
      let cookies2 = previewCookies();
      try {
        cookies2 = yield fetchCookieCategoriesForPreview();
      } catch (error) {
        console.error(error);
      }
      setBannerPreviewContext(
        banner2,
        lang,
        cookies2
      );
      return true;
    });
  }
  __name(ensureBannerPreviewContextFromStores, "ensureBannerPreviewContextFromStores");
  function updateContentPreview() {
    return __async(this, null, function* () {
      const { useBannerStore: useBannerStore2 } = yield __vitePreload(() => __async(null, null, function* () {
        const { useBannerStore: useBannerStore3 } = yield Promise.resolve().then(() => bannerStore);
        return { useBannerStore: useBannerStore3 };
      }), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href);
      const store2 = useBannerStore2.getState();
      if (store2.current === false || !store2.current) return;
      if (store2.preview) {
        bannerPreview.startLoading();
        try {
          yield ensureBannerPreviewContextFromStores();
          bannerPreview.resetTemplateCache();
          yield bannerPreview.showPreview(true);
        } finally {
          bannerPreview.stopLoading();
        }
        return;
      }
      store2.setTemplate({});
      yield store2.loadTemplate(true);
    });
  }
  __name(updateContentPreview, "updateContentPreview");
  const $$splitComponentImporter = /* @__PURE__ */ __name(() => __vitePreload(() => Promise.resolve().then(() => languages_edit_$language), false ? __VITE_PRELOAD__ : void 0, _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("js/index.js", document.baseURI).href), "$$splitComponentImporter");
  function syncEditLanguageFromRoute(code) {
    const lang = code || "en";
    useLanguageStore.getState().setCurrent(lang);
  }
  __name(syncEditLanguageFromRoute, "syncEditLanguageFromRoute");
  function resetLanguagesEditRouteSession() {
    const {
      default: defaultLang,
      setCurrent
    } = useLanguageStore.getState();
    setCurrent(defaultLang);
    useBannerStore.getState().setPreview(false);
    bannerPreview.closePreview(false);
  }
  __name(resetLanguagesEditRouteSession, "resetLanguagesEditRouteSession");
  const Route = createFileRoute("/languages/edit/$language")({
    beforeLoad: /* @__PURE__ */ __name(({
      params
    }) => {
      syncEditLanguageFromRoute(params.language);
    }, "beforeLoad"),
    onLeave: resetLanguagesEditRouteSession,
    component: lazyRouteComponent($$splitComponentImporter, "component")
  });
  const SettingsRoute = Route$b.update({
    id: "/settings",
    path: "/settings",
    getParentRoute: /* @__PURE__ */ __name(() => Route$c, "getParentRoute")
  });
  const PoliciesRoute = Route$a.update({
    id: "/policies",
    path: "/policies",
    getParentRoute: /* @__PURE__ */ __name(() => Route$c, "getParentRoute")
  });
  const LanguagesRoute = Route$9.update({
    id: "/languages",
    path: "/languages",
    getParentRoute: /* @__PURE__ */ __name(() => Route$c, "getParentRoute")
  });
  const GcmRoute = Route$8.update({
    id: "/gcm",
    path: "/gcm",
    getParentRoute: /* @__PURE__ */ __name(() => Route$c, "getParentRoute")
  });
  const DashboardRoute = Route$7.update({
    id: "/dashboard",
    path: "/dashboard",
    getParentRoute: /* @__PURE__ */ __name(() => Route$c, "getParentRoute")
  });
  const CustomizeRoute = Route$6.update({
    id: "/customize",
    path: "/customize",
    getParentRoute: /* @__PURE__ */ __name(() => Route$c, "getParentRoute")
  });
  const CookiesRoute = Route$5.update({
    id: "/cookies",
    path: "/cookies",
    getParentRoute: /* @__PURE__ */ __name(() => Route$c, "getParentRoute")
  });
  const IndexRoute = Route$4.update({
    id: "/",
    path: "/",
    getParentRoute: /* @__PURE__ */ __name(() => Route$c, "getParentRoute")
  });
  const LanguagesIndexRoute = Route$3.update({
    id: "/",
    path: "/",
    getParentRoute: /* @__PURE__ */ __name(() => LanguagesRoute, "getParentRoute")
  });
  const DashboardIndexRoute = Route$2.update({
    id: "/",
    path: "/",
    getParentRoute: /* @__PURE__ */ __name(() => DashboardRoute, "getParentRoute")
  });
  const DashboardPlansRoute = Route$1.update({
    id: "/plans",
    path: "/plans",
    getParentRoute: /* @__PURE__ */ __name(() => DashboardRoute, "getParentRoute")
  });
  const LanguagesEditLanguageRoute = Route.update({
    id: "/edit/$language",
    path: "/edit/$language",
    getParentRoute: /* @__PURE__ */ __name(() => LanguagesRoute, "getParentRoute")
  });
  const DashboardRouteChildren = {
    DashboardPlansRoute,
    DashboardIndexRoute
  };
  const DashboardRouteWithChildren = DashboardRoute._addFileChildren(
    DashboardRouteChildren
  );
  const LanguagesRouteChildren = {
    LanguagesIndexRoute,
    LanguagesEditLanguageRoute
  };
  const LanguagesRouteWithChildren = LanguagesRoute._addFileChildren(
    LanguagesRouteChildren
  );
  const rootRouteChildren = {
    IndexRoute,
    CookiesRoute,
    CustomizeRoute,
    DashboardRoute: DashboardRouteWithChildren,
    GcmRoute,
    LanguagesRoute: LanguagesRouteWithChildren,
    PoliciesRoute,
    SettingsRoute
  };
  const routeTree = Route$c._addFileChildren(rootRouteChildren)._addFileTypes();
  const router = createRouter({
    routeTree,
    defaultPreload: "intent",
    defaultPreloadStaleTime: 0,
    history: createHashHistory(),
    context: {}
  });
  router.subscribe("onBeforeNavigate", () => {
    ckyRest.cancelAll();
  });
  const AppRouter = /* @__PURE__ */ __name(() => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(RouterProvider, { router });
  }, "AppRouter");
  const rootElement = document.getElementById("cky-app");
  if (rootElement && !rootElement.hasChildNodes()) {
    const root2 = clientExports.createRoot(rootElement);
    root2.render(
      /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.StrictMode, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppRouter, {}) })
    );
  }
  function shouldShowSuspendedNoticeStrip(website, isTrial) {
    var _a2;
    const status = String((_a2 = website.status) != null ? _a2 : "");
    const isSuspended = status === "suspended";
    const isTrialSubscriptionCancelled = status === "subscriptionCancelled" && isTrial;
    const isPaidSubscriptionCancelled = status === "subscriptionCancelled" && !isTrial && !!website.payment_status;
    const isPaymentMethodMissing = status === "paymentMethodMissingPaid" && !isTrial && !website.payment_status;
    return isSuspended || isTrialSubscriptionCancelled || isPaidSubscriptionCancelled || !!isPaymentMethodMissing;
  }
  __name(shouldShowSuspendedNoticeStrip, "shouldShowSuspendedNoticeStrip");
  function Dashboard() {
    var _a2, _b2, _c2;
    const connected = useAppStore((s2) => {
      var _a3, _b3;
      return !!((_b3 = (_a3 = s2.options) == null ? void 0 : _a3.account) == null ? void 0 : _b3.connected);
    });
    const { session_status: sessionStatus, info } = useAppStore(
      useShallow((s2) => ({
        session_status: s2.session_status,
        info: s2.info
      }))
    );
    const { sessionExpiredLogin } = useConnectFlow();
    const [loading, setLoading] = reactExports.useState(true);
    const [syncing, setSyncing] = reactExports.useState(false);
    reactExports.useEffect(() => {
      let cancelled = false;
      const onBefore = /* @__PURE__ */ __name(() => setSyncing(true), "onBefore");
      const onAfter = /* @__PURE__ */ __name(() => setSyncing(false), "onAfter");
      (() => __async(null, null, function* () {
        try {
          yield useBannerStore.getState().getActiveBanner();
        } catch (error) {
          console.error(error);
        } finally {
          if (!cancelled) {
            setLoading(false);
            window.addEventListener("beforeConnection", onBefore);
            window.addEventListener("afterSyncing", onAfter);
          }
        }
      }))();
      return () => {
        cancelled = true;
        window.removeEventListener("beforeConnection", onBefore);
        window.removeEventListener("afterSyncing", onAfter);
      };
    }, []);
    const website = info ? (_a2 = info == null ? void 0 : info.website) != null ? _a2 : {} : {};
    const isTrial = !!website.is_trial;
    const isInReverseTrial = !!website.isInReverseTrial;
    const isInOptinTrial = !!website.isInOptinTrial;
    const hasPaymentMethod = !!website.hasPaymentMethod;
    const showTrialStatusNotice = !hasPaymentMethod && (isInReverseTrial || isInOptinTrial);
    const isSuspended = website.status === "suspended";
    const isPaymentMethodMissing = website.status === "paymentMethodMissingPaid" && !isTrial && !website.payment_status;
    const showSuspendedNotice = shouldShowSuspendedNoticeStrip(website, isTrial);
    const plan = String(info ? (_c2 = (_b2 = info == null ? void 0 : info.plan) == null ? void 0 : _b2.name) != null ? _c2 : "free" : "free").toLowerCase();
    const freePlan = plan === "free";
    const sessionExpired = !sessionStatus && connected;
    const showChartsSection = connected && !loading && !syncing;
    const showAside = connected && !loading;
    const showUpgradeWidget = freePlan && !syncing && !isPaymentMethodMissing && !isSuspended;
    const showFaqWidget = !!sessionStatus;
    if (sessionExpired) {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mt-[30px] cky:mx-20 cky:py-[48px] cky:px-[65px] cky:bg-white cky:rounded-xl cky:border cky:border-[#d9d9d9] cky:flex cky:flex-col cky:items-center cky:justify-center cky:min-h-[610px] cky:gap-[26px] cky:text-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.sessionExpired, alt: "", "aria-hidden": "true" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { children: __$2("Your session has ended", "cookie-law-info") }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "cky:text-center", children: [
          __$2("Sorry, your session has expired. Sign in again to pick up where you left off.", "cookie-law-info"),
          /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
          __$2("If you don't have an account, try disconnecting and reconnecting to the web app.", "cookie-law-info")
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { external: true, onClick: sessionExpiredLogin, className: "cky:py-3! cky:px-4!", children: __$2("Log in to CookieYes", "cookie-law-info") })
      ] });
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(CkyMigrationBackNotice, {}),
      showSuspendedNotice ? /* @__PURE__ */ jsxRuntimeExports.jsx(CkySuspendedNotice, {}) : null,
      showTrialStatusNotice ? /* @__PURE__ */ jsxRuntimeExports.jsx(CkyTrialStatusNotice, {}) : null,
      /* @__PURE__ */ jsxRuntimeExports.jsx(CkyConnectSuccess, {}),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: APP_BODY_INNER_CLASS, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "div",
        {
          className: connected ? "cky:grid cky:w-full cky:grid-cols-12 cky:gap-x-5" : "cky:flex cky:w-full cky:flex-col cky:items-center",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "div",
              {
                className: connected ? "cky:col-span-9 cky:min-w-0" : "cky:w-10/12 cky:max-w-full",
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(CkyConnectNotice, {}),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(CkyDashboardOverview, {}),
                  showChartsSection && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-section-content cky-dashboard-section-content", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-section-row", children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-dashboard-col-7", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyScanSummary, {}) }),
                      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-dashboard-col-5", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyConsentChart, {}) })
                    ] }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-section-row", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-full cky:min-w-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyPageviewChart, {}) }) })
                  ] })
                ]
              }
            ),
            showAside && /* @__PURE__ */ jsxRuntimeExports.jsxs("aside", { className: "cky:col-span-3 cky:shrink-0 cky:section-upgrade", children: [
              showUpgradeWidget && /* @__PURE__ */ jsxRuntimeExports.jsx(CkyUpgradeWidget, {}),
              showFaqWidget && /* @__PURE__ */ jsxRuntimeExports.jsx(CkyFaqWidget, {})
            ] })
          ]
        }
      ) })
    ] });
  }
  __name(Dashboard, "Dashboard");
  const TAB_TRIGGER_CLASS = cn$1(
    "cky:relative cky:flex cky:items-center cky:justify-center cky:px-5 cky:py-3 cky:text-sm cky:font-[500]! cky:rounded-none cky:border-transparent",
    "cky:transition-colors cky:duration-200 cky:ease-in-out cky:bg-transparent cky:text-text-primary cky:cursor-pointer",
    "cky:data-[state=active]:text-text-primary cky:data-[state=active]:bg-white cky:data-[state=active]:border-t-4 cky:data-[state=active]:border-[var(--cky-primary)] cky:data-[state=active]:shadow-none"
  );
  const TAB_INNER_CLASS = "cky:w-full cky:h-full cky:flex cky:items-center cky:justify-center";
  function getTabFromHash() {
    const hash = window.location.hash;
    const [, query] = hash.split("?");
    if (query && query.startsWith("tab=")) {
      return query.split("=")[1] || "cookies";
    }
    return "cookies";
  }
  __name(getTabFromHash, "getTabFromHash");
  function ScanSummaryPanel({
    className,
    iconSrc,
    iconAlt,
    iconClassName,
    title,
    subtitle,
    action
  }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        className: cn$1(
          "cky:w-[414px] cky:h-[93px] cky:p-6 cky:bg-white cky:rounded-lg cky:border cky:border-[#C7CADE] cky:flex cky:justify-between cky:items-center cky:my-[30px]",
          className
        ),
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:justify-start cky:items-start cky:gap-2", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-5 cky:h-5 cky:relative", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: iconSrc, alt: iconAlt, className: iconClassName }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-[10px]", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:text-[#4D4B66] cky:text-base cky:font-medium cky:leading-[1.2]", children: title }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:text-[#6E7191] cky:text-[13px] cky:font-normal", children: subtitle })
            ] })
          ] }),
          action
        ]
      }
    );
  }
  __name(ScanSummaryPanel, "ScanSummaryPanel");
  function Cookies() {
    const [currentTab, setCurrentTab] = reactExports.useState(() => getTabFromHash());
    const scanNowModalRef = reactExports.useRef(null);
    const scheduleModalRef = reactExports.useRef(null);
    reactExports.useEffect(() => {
      const newHash = currentTab === "cookies" ? "#/cookies" : `#/cookies?tab=${currentTab}`;
      if (window.location.hash !== newHash) {
        window.location.hash = newHash;
      }
    }, [currentTab]);
    const showScanNowModal = reactExports.useCallback(() => {
      var _a2;
      (_a2 = scanNowModalRef.current) == null ? void 0 : _a2.show();
    }, []);
    const showScheduleModal = reactExports.useCallback(() => {
      var _a2;
      (_a2 = scheduleModalRef.current) == null ? void 0 : _a2.show();
    }, []);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: APP_BODY_INNER_CLASS, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          ScanSummaryPanel,
          {
            className: "cky:mr-6",
            iconSrc: assets.search,
            iconAlt: "search",
            iconClassName: "cky-search-icon",
            title: __$1("Last successful scan", "cookie-law-info"),
            subtitle: __$1("Scan not initiated", "cookie-law-info"),
            action: /* @__PURE__ */ jsxRuntimeExports.jsx(
              Button,
              {
                variant: "primary",
                size: "sm",
                onClick: showScanNowModal,
                children: __$1("Scan now", "cookie-law-info")
              }
            )
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          ScanSummaryPanel,
          {
            iconSrc: assets.timeSchedule,
            iconAlt: "schedule",
            iconClassName: "cky-time-schedule-icon",
            title: __$1("Next Scan", "cookie-law-info"),
            subtitle: __$1("Not scheduled", "cookie-law-info"),
            action: /* @__PURE__ */ jsxRuntimeExports.jsxs(
              Button,
              {
                variant: "primary",
                onClick: showScheduleModal,
                className: "cky:min-w-[80px]! cky:py-2! cky:px-[15px]! cky:leading-4! cky:font-[500]!",
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    Badge,
                    {
                      variant: "premium",
                      className: "cky:mr-1 cky:w-[18px] cky:h-[18px] cky:p-0 cky:flex cky:items-center cky:justify-center",
                      children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "crown", width: "10px", height: "8px" })
                    }
                  ),
                  __$1("Schedule scan", "cookie-law-info")
                ]
              }
            )
          }
        )
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyConnectModal,
        {
          ref: scanNowModalRef,
          feature: "scan_behind_login",
          title: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.scanNow, alt: "scanner" }),
          featureText: __$1("Scan your site to generate a detailed cookie list", "cookie-law-info"),
          availabilityText: __$1("Available in: <b>All plans</b>", "cookie-law-info")
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyConnectModal,
        {
          ref: scheduleModalRef,
          availablePlan: "premium",
          feature: "schedule_scan",
          title: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.scheduleScan, alt: "schedule" }),
          featureText: __$1(
            "Run automated scans and get an up-to-date cookie list every time",
            "cookie-law-info"
          ),
          availabilityText: __$1(
            "Available in: <b>All premium plans</b>",
            "cookie-law-info"
          )
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:mt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { role: "navigation", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Tabs, { value: currentTab, onValueChange: setCurrentTab, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs(TabsList, { className: "cky:flex cky:justify-start cky:space-x-4 cky:p-0 cky:bg-transparent cky:text-text-primary", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "cookies", className: cn$1(TAB_TRIGGER_CLASS, "cky:mr-0"), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: TAB_INNER_CLASS, children: __$1("Cookie List", "cookie-law-info") }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTrigger, { value: "scanner", className: TAB_TRIGGER_CLASS, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: TAB_INNER_CLASS, children: __$1("Scan History", "cookie-law-info") }) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "cookies", className: "cky:mt-0 cky:bg-white", children: currentTab === "cookies" ? /* @__PURE__ */ jsxRuntimeExports.jsx(TabCookies, {}) : null }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "scanner", className: "cky:mt-0 cky:bg-white", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TabScanner, {}) })
      ] }) }) }) })
    ] }) });
  }
  __name(Cookies, "Cookies");
  function CkyExitIntentPopup({
    ref,
    onStayOnPage,
    onDiscardChanges
  }) {
    const [isOpen, setIsOpen] = reactExports.useState(false);
    const [portalContainer, setPortalContainer] = reactExports.useState(null);
    reactExports.useLayoutEffect(() => {
      setPortalContainer(document.getElementById("cky-app"));
    }, []);
    const stayOnPageAndCloseModal = reactExports.useCallback(() => {
      onStayOnPage == null ? void 0 : onStayOnPage();
      setIsOpen(false);
    }, [onStayOnPage]);
    reactExports.useImperativeHandle(
      ref,
      () => ({
        show: /* @__PURE__ */ __name(() => setIsOpen(true), "show"),
        close: /* @__PURE__ */ __name(() => {
          stayOnPageAndCloseModal();
        }, "close")
      }),
      [stayOnPageAndCloseModal]
    );
    reactExports.useEffect(() => {
      if (isOpen) {
        document.body.classList.add("cky-app-modal-open");
      } else {
        document.body.classList.remove("cky-app-modal-open");
      }
      return () => {
        document.body.classList.remove("cky-app-modal-open");
      };
    }, [isOpen]);
    const handleDiscardClick = /* @__PURE__ */ __name(() => {
      onDiscardChanges == null ? void 0 : onDiscardChanges();
      setIsOpen(false);
    }, "handleDiscardClick");
    const handleStayClick = /* @__PURE__ */ __name(() => {
      stayOnPageAndCloseModal();
    }, "handleStayClick");
    return /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: isOpen, onOpenChange: setIsOpen, children: portalContainer ? /* @__PURE__ */ jsxRuntimeExports.jsx(DialogPortal, { container: portalContainer, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DialogOverlay, { className: "cky-app-modal-backdrop cky-exit-popup cky:!z-[99999999]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      Content$1,
      {
        asChild: true,
        onInteractOutside: /* @__PURE__ */ __name((e) => e.preventDefault(), "onInteractOutside"),
        onEscapeKeyDown: /* @__PURE__ */ __name((e) => {
          e.preventDefault();
          stayOnPageAndCloseModal();
        }, "onEscapeKeyDown"),
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-app-modal cky:flex cky:w-full cky:max-w-[500px] cky:flex-col cky:bg-white cky:rounded-[2px] cky:shadow-none cky:py-[15px] cky:px-0 cky:transition-all cky:duration-[400ms] cky:ease-in-out cky:max-h-[calc(100%-3.5rem)]", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-app-modal-header cky:relative cky:flex cky:items-center cky:justify-between cky:text-left cky:border-b-0 cky:px-5 cky:py-0", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              DialogTitle,
              {
                className: "cky:m-0! cky:text-[16px]! cky:font-semibold! cky:leading-[18px]! cky:flex! cky:justify-start!",
                asChild: true,
                children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { role: "heading", "aria-level": 4, children: __$2("Leave page?", "cookie-law-info") })
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Button,
              {
                type: "button",
                variant: "ghost",
                size: "icon",
                className: "cky-button-close cky:absolute cky:right-[15px] cky:!h-8 cky:!w-8 cky:!min-w-0 cky:rounded-sm cky:border-0 cky:bg-transparent! cky:p-0! cky:shadow-none cky:hover:bg-black/[0.06]!",
                "aria-label": __$2("Close cky-modal", "cookie-law-info"),
                onClick: handleStayClick,
                children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "close", width: "15px", height: "15px", color: "#8893a1" })
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-app-modal-body cky:relative cky:max-h-[calc(100vh-3.5rem)] cky:overflow-y-auto cky:px-5 cky:py-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            DialogDescription,
            {
              asChild: true,
              className: "cky:m-0! cky:text-[13px]! cky:font-normal! cky:leading-[18px]! cky:text-[#4E4B66]!",
              children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: __$2(
                "You’ve made changes that haven’t been published yet.",
                "cookie-law-info"
              ) })
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(DialogFooter, { className: "cky-app-modal-footer cky:flex cky:flex-col cky:gap-0 cky:border-0 cky:px-5 cky:py-0 cky:pt-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-app-modal-actions cky:flex cky:justify-end cky:gap-[10px]", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Button,
              {
                type: "button",
                variant: "outline",
                className: "cky:relative cky:inline-flex cky:w-auto cky:min-w-[80px] cky:rounded-[3px]! cky:border-[#c9d0d6]! cky:bg-transparent! cky:px-[15px]! cky:py-2! cky:!text-[14px] cky:!font-[500] cky:leading-4 cky:!text-[#555d66] cky:hover:bg-[#fafafb]! cky:focus:bg-[#fafafb]!",
                onClick: handleDiscardClick,
                children: __$2("Discard changes & leave this page", "cookie-law-info")
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Button,
              {
                type: "button",
                variant: "default",
                className: "cky:relative cky:inline-flex cky:w-auto cky:min-w-[80px] cky:rounded-[3px]! cky:border-[#1578f7]! cky:bg-[#1578f7]! cky:px-[15px]! cky:py-2! cky:!text-[14px] cky:!font-[500] cky:leading-4 cky:!text-white cky:hover:border-[#0760d2]! cky:hover:bg-[#0760d2]! cky:focus:border-[#0760d2]! cky:focus:bg-[#0760d2]!",
                onClick: handleStayClick,
                children: __$2("Stay on page", "cookie-law-info")
              }
            )
          ] }) })
        ] })
      }
    ) }) }) : null });
  }
  __name(CkyExitIntentPopup, "CkyExitIntentPopup");
  const gcmApi = {
    createGcm(data) {
      return __async(this, null, function* () {
        return callRest(
          () => ckyRest.post({
            path: "gcm/",
            data
          })
        );
      });
    }
  };
  function listCacheClear() {
    this.__data__ = [];
    this.size = 0;
  }
  __name(listCacheClear, "listCacheClear");
  function eq(value, other) {
    return value === other || value !== value && other !== other;
  }
  __name(eq, "eq");
  function assocIndexOf(array2, key) {
    var length = array2.length;
    while (length--) {
      if (eq(array2[length][0], key)) {
        return length;
      }
    }
    return -1;
  }
  __name(assocIndexOf, "assocIndexOf");
  var arrayProto = Array.prototype;
  var splice = arrayProto.splice;
  function listCacheDelete(key) {
    var data = this.__data__, index2 = assocIndexOf(data, key);
    if (index2 < 0) {
      return false;
    }
    var lastIndex = data.length - 1;
    if (index2 == lastIndex) {
      data.pop();
    } else {
      splice.call(data, index2, 1);
    }
    --this.size;
    return true;
  }
  __name(listCacheDelete, "listCacheDelete");
  function listCacheGet(key) {
    var data = this.__data__, index2 = assocIndexOf(data, key);
    return index2 < 0 ? void 0 : data[index2][1];
  }
  __name(listCacheGet, "listCacheGet");
  function listCacheHas(key) {
    return assocIndexOf(this.__data__, key) > -1;
  }
  __name(listCacheHas, "listCacheHas");
  function listCacheSet(key, value) {
    var data = this.__data__, index2 = assocIndexOf(data, key);
    if (index2 < 0) {
      ++this.size;
      data.push([key, value]);
    } else {
      data[index2][1] = value;
    }
    return this;
  }
  __name(listCacheSet, "listCacheSet");
  function ListCache(entries) {
    var index2 = -1, length = entries == null ? 0 : entries.length;
    this.clear();
    while (++index2 < length) {
      var entry = entries[index2];
      this.set(entry[0], entry[1]);
    }
  }
  __name(ListCache, "ListCache");
  ListCache.prototype.clear = listCacheClear;
  ListCache.prototype["delete"] = listCacheDelete;
  ListCache.prototype.get = listCacheGet;
  ListCache.prototype.has = listCacheHas;
  ListCache.prototype.set = listCacheSet;
  function stackClear() {
    this.__data__ = new ListCache();
    this.size = 0;
  }
  __name(stackClear, "stackClear");
  function stackDelete(key) {
    var data = this.__data__, result = data["delete"](key);
    this.size = data.size;
    return result;
  }
  __name(stackDelete, "stackDelete");
  function stackGet(key) {
    return this.__data__.get(key);
  }
  __name(stackGet, "stackGet");
  function stackHas(key) {
    return this.__data__.has(key);
  }
  __name(stackHas, "stackHas");
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  var root = freeGlobal || freeSelf || Function("return this")();
  var Symbol$1 = root.Symbol;
  var objectProto$b = Object.prototype;
  var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
  var nativeObjectToString$1 = objectProto$b.toString;
  var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
  function getRawTag(value) {
    var isOwn = hasOwnProperty$8.call(value, symToStringTag$1), tag = value[symToStringTag$1];
    try {
      value[symToStringTag$1] = void 0;
      var unmasked = true;
    } catch (e) {
    }
    var result = nativeObjectToString$1.call(value);
    if (unmasked) {
      if (isOwn) {
        value[symToStringTag$1] = tag;
      } else {
        delete value[symToStringTag$1];
      }
    }
    return result;
  }
  __name(getRawTag, "getRawTag");
  var objectProto$a = Object.prototype;
  var nativeObjectToString = objectProto$a.toString;
  function objectToString(value) {
    return nativeObjectToString.call(value);
  }
  __name(objectToString, "objectToString");
  var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
  var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
  function baseGetTag(value) {
    if (value == null) {
      return value === void 0 ? undefinedTag : nullTag;
    }
    return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
  }
  __name(baseGetTag, "baseGetTag");
  function isObject(value) {
    var type = typeof value;
    return value != null && (type == "object" || type == "function");
  }
  __name(isObject, "isObject");
  var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
  function isFunction(value) {
    if (!isObject(value)) {
      return false;
    }
    var tag = baseGetTag(value);
    return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
  }
  __name(isFunction, "isFunction");
  var coreJsData = root["__core-js_shared__"];
  var maskSrcKey = (function() {
    var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
    return uid ? "Symbol(src)_1." + uid : "";
  })();
  function isMasked(func) {
    return !!maskSrcKey && maskSrcKey in func;
  }
  __name(isMasked, "isMasked");
  var funcProto$1 = Function.prototype;
  var funcToString$1 = funcProto$1.toString;
  function toSource(func) {
    if (func != null) {
      try {
        return funcToString$1.call(func);
      } catch (e) {
      }
      try {
        return func + "";
      } catch (e) {
      }
    }
    return "";
  }
  __name(toSource, "toSource");
  var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  var reIsHostCtor = /^\[object .+?Constructor\]$/;
  var funcProto = Function.prototype, objectProto$9 = Object.prototype;
  var funcToString = funcProto.toString;
  var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
  var reIsNative = RegExp(
    "^" + funcToString.call(hasOwnProperty$7).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
  );
  function baseIsNative(value) {
    if (!isObject(value) || isMasked(value)) {
      return false;
    }
    var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
    return pattern.test(toSource(value));
  }
  __name(baseIsNative, "baseIsNative");
  function getValue(object2, key) {
    return object2 == null ? void 0 : object2[key];
  }
  __name(getValue, "getValue");
  function getNative(object2, key) {
    var value = getValue(object2, key);
    return baseIsNative(value) ? value : void 0;
  }
  __name(getNative, "getNative");
  var Map$1 = getNative(root, "Map");
  var nativeCreate = getNative(Object, "create");
  function hashClear() {
    this.__data__ = nativeCreate ? nativeCreate(null) : {};
    this.size = 0;
  }
  __name(hashClear, "hashClear");
  function hashDelete(key) {
    var result = this.has(key) && delete this.__data__[key];
    this.size -= result ? 1 : 0;
    return result;
  }
  __name(hashDelete, "hashDelete");
  var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
  var objectProto$8 = Object.prototype;
  var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
  function hashGet(key) {
    var data = this.__data__;
    if (nativeCreate) {
      var result = data[key];
      return result === HASH_UNDEFINED$2 ? void 0 : result;
    }
    return hasOwnProperty$6.call(data, key) ? data[key] : void 0;
  }
  __name(hashGet, "hashGet");
  var objectProto$7 = Object.prototype;
  var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
  function hashHas(key) {
    var data = this.__data__;
    return nativeCreate ? data[key] !== void 0 : hasOwnProperty$5.call(data, key);
  }
  __name(hashHas, "hashHas");
  var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
  function hashSet(key, value) {
    var data = this.__data__;
    this.size += this.has(key) ? 0 : 1;
    data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value;
    return this;
  }
  __name(hashSet, "hashSet");
  function Hash(entries) {
    var index2 = -1, length = entries == null ? 0 : entries.length;
    this.clear();
    while (++index2 < length) {
      var entry = entries[index2];
      this.set(entry[0], entry[1]);
    }
  }
  __name(Hash, "Hash");
  Hash.prototype.clear = hashClear;
  Hash.prototype["delete"] = hashDelete;
  Hash.prototype.get = hashGet;
  Hash.prototype.has = hashHas;
  Hash.prototype.set = hashSet;
  function mapCacheClear() {
    this.size = 0;
    this.__data__ = {
      "hash": new Hash(),
      "map": new (Map$1 || ListCache)(),
      "string": new Hash()
    };
  }
  __name(mapCacheClear, "mapCacheClear");
  function isKeyable(value) {
    var type = typeof value;
    return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
  }
  __name(isKeyable, "isKeyable");
  function getMapData(map2, key) {
    var data = map2.__data__;
    return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  }
  __name(getMapData, "getMapData");
  function mapCacheDelete(key) {
    var result = getMapData(this, key)["delete"](key);
    this.size -= result ? 1 : 0;
    return result;
  }
  __name(mapCacheDelete, "mapCacheDelete");
  function mapCacheGet(key) {
    return getMapData(this, key).get(key);
  }
  __name(mapCacheGet, "mapCacheGet");
  function mapCacheHas(key) {
    return getMapData(this, key).has(key);
  }
  __name(mapCacheHas, "mapCacheHas");
  function mapCacheSet(key, value) {
    var data = getMapData(this, key), size2 = data.size;
    data.set(key, value);
    this.size += data.size == size2 ? 0 : 1;
    return this;
  }
  __name(mapCacheSet, "mapCacheSet");
  function MapCache(entries) {
    var index2 = -1, length = entries == null ? 0 : entries.length;
    this.clear();
    while (++index2 < length) {
      var entry = entries[index2];
      this.set(entry[0], entry[1]);
    }
  }
  __name(MapCache, "MapCache");
  MapCache.prototype.clear = mapCacheClear;
  MapCache.prototype["delete"] = mapCacheDelete;
  MapCache.prototype.get = mapCacheGet;
  MapCache.prototype.has = mapCacheHas;
  MapCache.prototype.set = mapCacheSet;
  var LARGE_ARRAY_SIZE = 200;
  function stackSet(key, value) {
    var data = this.__data__;
    if (data instanceof ListCache) {
      var pairs = data.__data__;
      if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE - 1) {
        pairs.push([key, value]);
        this.size = ++data.size;
        return this;
      }
      data = this.__data__ = new MapCache(pairs);
    }
    data.set(key, value);
    this.size = data.size;
    return this;
  }
  __name(stackSet, "stackSet");
  function Stack(entries) {
    var data = this.__data__ = new ListCache(entries);
    this.size = data.size;
  }
  __name(Stack, "Stack");
  Stack.prototype.clear = stackClear;
  Stack.prototype["delete"] = stackDelete;
  Stack.prototype.get = stackGet;
  Stack.prototype.has = stackHas;
  Stack.prototype.set = stackSet;
  var HASH_UNDEFINED = "__lodash_hash_undefined__";
  function setCacheAdd(value) {
    this.__data__.set(value, HASH_UNDEFINED);
    return this;
  }
  __name(setCacheAdd, "setCacheAdd");
  function setCacheHas(value) {
    return this.__data__.has(value);
  }
  __name(setCacheHas, "setCacheHas");
  function SetCache(values) {
    var index2 = -1, length = values == null ? 0 : values.length;
    this.__data__ = new MapCache();
    while (++index2 < length) {
      this.add(values[index2]);
    }
  }
  __name(SetCache, "SetCache");
  SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  SetCache.prototype.has = setCacheHas;
  function arraySome(array2, predicate) {
    var index2 = -1, length = array2 == null ? 0 : array2.length;
    while (++index2 < length) {
      if (predicate(array2[index2], index2, array2)) {
        return true;
      }
    }
    return false;
  }
  __name(arraySome, "arraySome");
  function cacheHas(cache, key) {
    return cache.has(key);
  }
  __name(cacheHas, "cacheHas");
  var COMPARE_PARTIAL_FLAG$3 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
  function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) {
    var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, arrLength = array2.length, othLength = other.length;
    if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
      return false;
    }
    var arrStacked = stack.get(array2);
    var othStacked = stack.get(other);
    if (arrStacked && othStacked) {
      return arrStacked == other && othStacked == array2;
    }
    var index2 = -1, result = true, seen2 = bitmask & COMPARE_UNORDERED_FLAG$1 ? new SetCache() : void 0;
    stack.set(array2, other);
    stack.set(other, array2);
    while (++index2 < arrLength) {
      var arrValue = array2[index2], othValue = other[index2];
      if (customizer) {
        var compared = isPartial ? customizer(othValue, arrValue, index2, other, array2, stack) : customizer(arrValue, othValue, index2, array2, other, stack);
      }
      if (compared !== void 0) {
        if (compared) {
          continue;
        }
        result = false;
        break;
      }
      if (seen2) {
        if (!arraySome(other, function(othValue2, othIndex) {
          if (!cacheHas(seen2, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
            return seen2.push(othIndex);
          }
        })) {
          result = false;
          break;
        }
      } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
        result = false;
        break;
      }
    }
    stack["delete"](array2);
    stack["delete"](other);
    return result;
  }
  __name(equalArrays, "equalArrays");
  var Uint8Array$1 = root.Uint8Array;
  function mapToArray(map2) {
    var index2 = -1, result = Array(map2.size);
    map2.forEach(function(value, key) {
      result[++index2] = [key, value];
    });
    return result;
  }
  __name(mapToArray, "mapToArray");
  function setToArray(set2) {
    var index2 = -1, result = Array(set2.size);
    set2.forEach(function(value) {
      result[++index2] = value;
    });
    return result;
  }
  __name(setToArray, "setToArray");
  var COMPARE_PARTIAL_FLAG$2 = 1, COMPARE_UNORDERED_FLAG = 2;
  var boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", symbolTag = "[object Symbol]";
  var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]";
  var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
  function equalByTag(object2, other, tag, bitmask, customizer, equalFunc, stack) {
    switch (tag) {
      case dataViewTag$2:
        if (object2.byteLength != other.byteLength || object2.byteOffset != other.byteOffset) {
          return false;
        }
        object2 = object2.buffer;
        other = other.buffer;
      case arrayBufferTag$1:
        if (object2.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object2), new Uint8Array$1(other))) {
          return false;
        }
        return true;
      case boolTag$1:
      case dateTag$1:
      case numberTag$1:
        return eq(+object2, +other);
      case errorTag$1:
        return object2.name == other.name && object2.message == other.message;
      case regexpTag$1:
      case stringTag$1:
        return object2 == other + "";
      case mapTag$2:
        var convert = mapToArray;
      case setTag$2:
        var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
        convert || (convert = setToArray);
        if (object2.size != other.size && !isPartial) {
          return false;
        }
        var stacked = stack.get(object2);
        if (stacked) {
          return stacked == other;
        }
        bitmask |= COMPARE_UNORDERED_FLAG;
        stack.set(object2, other);
        var result = equalArrays(convert(object2), convert(other), bitmask, customizer, equalFunc, stack);
        stack["delete"](object2);
        return result;
      case symbolTag:
        if (symbolValueOf) {
          return symbolValueOf.call(object2) == symbolValueOf.call(other);
        }
    }
    return false;
  }
  __name(equalByTag, "equalByTag");
  function arrayPush(array2, values) {
    var index2 = -1, length = values.length, offset2 = array2.length;
    while (++index2 < length) {
      array2[offset2 + index2] = values[index2];
    }
    return array2;
  }
  __name(arrayPush, "arrayPush");
  var isArray = Array.isArray;
  function baseGetAllKeys(object2, keysFunc, symbolsFunc) {
    var result = keysFunc(object2);
    return isArray(object2) ? result : arrayPush(result, symbolsFunc(object2));
  }
  __name(baseGetAllKeys, "baseGetAllKeys");
  function arrayFilter(array2, predicate) {
    var index2 = -1, length = array2 == null ? 0 : array2.length, resIndex = 0, result = [];
    while (++index2 < length) {
      var value = array2[index2];
      if (predicate(value, index2, array2)) {
        result[resIndex++] = value;
      }
    }
    return result;
  }
  __name(arrayFilter, "arrayFilter");
  function stubArray() {
    return [];
  }
  __name(stubArray, "stubArray");
  var objectProto$6 = Object.prototype;
  var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
  var nativeGetSymbols = Object.getOwnPropertySymbols;
  var getSymbols = !nativeGetSymbols ? stubArray : function(object2) {
    if (object2 == null) {
      return [];
    }
    object2 = Object(object2);
    return arrayFilter(nativeGetSymbols(object2), function(symbol) {
      return propertyIsEnumerable$1.call(object2, symbol);
    });
  };
  function baseTimes(n2, iteratee) {
    var index2 = -1, result = Array(n2);
    while (++index2 < n2) {
      result[index2] = iteratee(index2);
    }
    return result;
  }
  __name(baseTimes, "baseTimes");
  function isObjectLike(value) {
    return value != null && typeof value == "object";
  }
  __name(isObjectLike, "isObjectLike");
  var argsTag$2 = "[object Arguments]";
  function baseIsArguments(value) {
    return isObjectLike(value) && baseGetTag(value) == argsTag$2;
  }
  __name(baseIsArguments, "baseIsArguments");
  var objectProto$5 = Object.prototype;
  var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
  var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
  var isArguments = baseIsArguments(/* @__PURE__ */ (function() {
    return arguments;
  })()) ? baseIsArguments : function(value) {
    return isObjectLike(value) && hasOwnProperty$4.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
  };
  function stubFalse() {
    return false;
  }
  __name(stubFalse, "stubFalse");
  var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
  var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
  var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
  var Buffer2 = moduleExports$1 ? root.Buffer : void 0;
  var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
  var isBuffer = nativeIsBuffer || stubFalse;
  var MAX_SAFE_INTEGER$1 = 9007199254740991;
  var reIsUint = /^(?:0|[1-9]\d*)$/;
  function isIndex(value, length) {
    var type = typeof value;
    length = length == null ? MAX_SAFE_INTEGER$1 : length;
    return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
  }
  __name(isIndex, "isIndex");
  var MAX_SAFE_INTEGER = 9007199254740991;
  function isLength(value) {
    return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  }
  __name(isLength, "isLength");
  var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", mapTag$1 = "[object Map]", numberTag = "[object Number]", objectTag$2 = "[object Object]", regexpTag = "[object RegExp]", setTag$1 = "[object Set]", stringTag = "[object String]", weakMapTag$1 = "[object WeakMap]";
  var arrayBufferTag = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
  var typedArrayTags = {};
  typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag$1] = typedArrayTags[numberTag] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag] = typedArrayTags[setTag$1] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag$1] = false;
  function baseIsTypedArray(value) {
    return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  }
  __name(baseIsTypedArray, "baseIsTypedArray");
  function baseUnary(func) {
    return function(value) {
      return func(value);
    };
  }
  __name(baseUnary, "baseUnary");
  var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
  var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
  var moduleExports = freeModule && freeModule.exports === freeExports;
  var freeProcess = moduleExports && freeGlobal.process;
  var nodeUtil = (function() {
    try {
      var types = freeModule && freeModule.require && freeModule.require("util").types;
      if (types) {
        return types;
      }
      return freeProcess && freeProcess.binding && freeProcess.binding("util");
    } catch (e) {
    }
  })();
  var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  var objectProto$4 = Object.prototype;
  var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
  function arrayLikeKeys(value, inherited) {
    var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
    for (var key in value) {
      if (hasOwnProperty$3.call(value, key) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
      (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
      isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
      isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
      isIndex(key, length)))) {
        result.push(key);
      }
    }
    return result;
  }
  __name(arrayLikeKeys, "arrayLikeKeys");
  var objectProto$3 = Object.prototype;
  function isPrototype(value) {
    var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$3;
    return value === proto;
  }
  __name(isPrototype, "isPrototype");
  function overArg(func, transform) {
    return function(arg) {
      return func(transform(arg));
    };
  }
  __name(overArg, "overArg");
  var nativeKeys = overArg(Object.keys, Object);
  var objectProto$2 = Object.prototype;
  var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
  function baseKeys(object2) {
    if (!isPrototype(object2)) {
      return nativeKeys(object2);
    }
    var result = [];
    for (var key in Object(object2)) {
      if (hasOwnProperty$2.call(object2, key) && key != "constructor") {
        result.push(key);
      }
    }
    return result;
  }
  __name(baseKeys, "baseKeys");
  function isArrayLike(value) {
    return value != null && isLength(value.length) && !isFunction(value);
  }
  __name(isArrayLike, "isArrayLike");
  function keys(object2) {
    return isArrayLike(object2) ? arrayLikeKeys(object2) : baseKeys(object2);
  }
  __name(keys, "keys");
  function getAllKeys(object2) {
    return baseGetAllKeys(object2, keys, getSymbols);
  }
  __name(getAllKeys, "getAllKeys");
  var COMPARE_PARTIAL_FLAG$1 = 1;
  var objectProto$1 = Object.prototype;
  var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
  function equalObjects(object2, other, bitmask, customizer, equalFunc, stack) {
    var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps = getAllKeys(object2), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
    if (objLength != othLength && !isPartial) {
      return false;
    }
    var index2 = objLength;
    while (index2--) {
      var key = objProps[index2];
      if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
        return false;
      }
    }
    var objStacked = stack.get(object2);
    var othStacked = stack.get(other);
    if (objStacked && othStacked) {
      return objStacked == other && othStacked == object2;
    }
    var result = true;
    stack.set(object2, other);
    stack.set(other, object2);
    var skipCtor = isPartial;
    while (++index2 < objLength) {
      key = objProps[index2];
      var objValue = object2[key], othValue = other[key];
      if (customizer) {
        var compared = isPartial ? customizer(othValue, objValue, key, other, object2, stack) : customizer(objValue, othValue, key, object2, other, stack);
      }
      if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
        result = false;
        break;
      }
      skipCtor || (skipCtor = key == "constructor");
    }
    if (result && !skipCtor) {
      var objCtor = object2.constructor, othCtor = other.constructor;
      if (objCtor != othCtor && ("constructor" in object2 && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
        result = false;
      }
    }
    stack["delete"](object2);
    stack["delete"](other);
    return result;
  }
  __name(equalObjects, "equalObjects");
  var DataView$1 = getNative(root, "DataView");
  var Promise$1 = getNative(root, "Promise");
  var Set$1 = getNative(root, "Set");
  var WeakMap$1 = getNative(root, "WeakMap");
  var mapTag = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag = "[object Set]", weakMapTag = "[object WeakMap]";
  var dataViewTag = "[object DataView]";
  var dataViewCtorString = toSource(DataView$1), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
  var getTag = baseGetTag;
  if (DataView$1 && getTag(new DataView$1(new ArrayBuffer(1))) != dataViewTag || Map$1 && getTag(new Map$1()) != mapTag || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag) {
    getTag = /* @__PURE__ */ __name(function(value) {
      var result = baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
      if (ctorString) {
        switch (ctorString) {
          case dataViewCtorString:
            return dataViewTag;
          case mapCtorString:
            return mapTag;
          case promiseCtorString:
            return promiseTag;
          case setCtorString:
            return setTag;
          case weakMapCtorString:
            return weakMapTag;
        }
      }
      return result;
    }, "getTag");
  }
  var COMPARE_PARTIAL_FLAG = 1;
  var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
  var objectProto = Object.prototype;
  var hasOwnProperty = objectProto.hasOwnProperty;
  function baseIsEqualDeep(object2, other, bitmask, customizer, equalFunc, stack) {
    var objIsArr = isArray(object2), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object2), othTag = othIsArr ? arrayTag : getTag(other);
    objTag = objTag == argsTag ? objectTag : objTag;
    othTag = othTag == argsTag ? objectTag : othTag;
    var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
    if (isSameTag && isBuffer(object2)) {
      if (!isBuffer(other)) {
        return false;
      }
      objIsArr = true;
      objIsObj = false;
    }
    if (isSameTag && !objIsObj) {
      stack || (stack = new Stack());
      return objIsArr || isTypedArray(object2) ? equalArrays(object2, other, bitmask, customizer, equalFunc, stack) : equalByTag(object2, other, objTag, bitmask, customizer, equalFunc, stack);
    }
    if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
      var objIsWrapped = objIsObj && hasOwnProperty.call(object2, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
      if (objIsWrapped || othIsWrapped) {
        var objUnwrapped = objIsWrapped ? object2.value() : object2, othUnwrapped = othIsWrapped ? other.value() : other;
        stack || (stack = new Stack());
        return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
      }
    }
    if (!isSameTag) {
      return false;
    }
    stack || (stack = new Stack());
    return equalObjects(object2, other, bitmask, customizer, equalFunc, stack);
  }
  __name(baseIsEqualDeep, "baseIsEqualDeep");
  function baseIsEqual(value, other, bitmask, customizer, stack) {
    if (value === other) {
      return true;
    }
    if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
      return value !== value && other !== other;
    }
    return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  }
  __name(baseIsEqual, "baseIsEqual");
  function isEqual(value, other) {
    return baseIsEqual(value, other);
  }
  __name(isEqual, "isEqual");
  function previewDisabledNotice(__2) {
    return __2(
      "The banner has been disabled. You can enable it from ‘General’, if needed.",
      "cookie-law-info"
    );
  }
  __name(previewDisabledNotice, "previewDisabledNotice");
  function noBannerFoundMessage(__2) {
    return __2("No banner found for this template.", "cookie-law-info");
  }
  __name(noBannerFoundMessage, "noBannerFoundMessage");
  function saveSuccessMessage(__2) {
    return __2("Update was successful!", "cookie-law-info");
  }
  __name(saveSuccessMessage, "saveSuccessMessage");
  function saveErrorMessage(__2) {
    return __2(
      "Problem occurred while saving your settings. Please try again later!",
      "cookie-law-info"
    );
  }
  __name(saveErrorMessage, "saveErrorMessage");
  const GCM_TABLE_HEAD_CLASS = "cky:h-auto cky:py-3 cky:px-[10px] cky:font-medium cky:text-left cky:text-text-primary cky:text-sm cky:border-b-0";
  const GCM_TABLE_CELL_CLASS = "cky:p-[8px_10px] cky:align-middle cky:text-text-primary cky:text-sm";
  const GCM_ICON_BUTTON_CLASS = "cky:bg-transparent cky:border-none cky:p-0 cky:h-auto cky:w-auto";
  const TABLE_LAYOUT_STYLE = {
    borderSpacing: 0,
    clear: "both",
    margin: 0
  };
  const GCM_CONSENT_COLUMNS = [
    { key: "analytics", label: __$1("Analytics", "cookie-law-info") },
    { key: "advertisement", label: __$1("Advertisement", "cookie-law-info") },
    { key: "functional", label: __$1("Functional", "cookie-law-info") },
    { key: "necessary", label: __$1("Necessary", "cookie-law-info") },
    { key: "ad_user_data", label: __$1("Share user data with Google", "cookie-law-info") },
    { key: "ad_personalization", label: __$1("Use data for ads personalisation", "cookie-law-info") },
    { key: "regions", label: __$1("Region", "cookie-law-info") }
  ];
  const DEFAULT_REGION_SETTING = {
    analytics: "denied",
    advertisement: "denied",
    functional: "denied",
    necessary: "granted",
    ad_user_data: "denied",
    ad_personalization: "denied",
    regions: "All"
  };
  const OTHER_SETTINGS_ROW = "cky:flex cky:flex-wrap cky:items-center";
  const OTHER_SETTINGS_LABEL = "cky:w-1/4 cky:flex cky:items-center cky:pr-4 cky:mb-2 cky:md:mb-0";
  function noopConsentModalClear() {
  }
  __name(noopConsentModalClear, "noopConsentModalClear");
  const mappedValue = /* @__PURE__ */ __name((value) => value === "granted" ? "Granted" : "Denied", "mappedValue");
  const regionMappedVal = /* @__PURE__ */ __name((value) => {
    const parts = value.split(",");
    return parts.length > 3 ? `${parts.slice(0, 3).join(", ")} & more` : value;
  }, "regionMappedVal");
  const cloneState = /* @__PURE__ */ __name((value) => JSON.parse(JSON.stringify(value)), "cloneState");
  const GcmRegionTableRow = reactExports.memo(/* @__PURE__ */ __name(function GcmRegionTableRow2({
    item,
    rowIndex,
    isDeleteDisabled,
    onEditRow,
    onDeleteRow
  }) {
    const handleEdit = reactExports.useCallback(() => {
      onEditRow(item, rowIndex);
    }, [onEditRow, item, rowIndex]);
    const handleDelete = reactExports.useCallback(() => {
      onDeleteRow(rowIndex);
    }, [onDeleteRow, rowIndex]);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow, { className: "cky:border-t cky:border-gray-300 cky:align-middle", children: [
      GCM_CONSENT_COLUMNS.map(({ key }) => /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: GCM_TABLE_CELL_CLASS, children: key === "regions" ? regionMappedVal(item.regions) : mappedValue(item[key]) }, key)),
      /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: `cky:!pl-0 ${GCM_TABLE_CELL_CLASS}`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-row cky:items-center cky:w-full", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex-1 cky:flex cky:justify-center cky:min-w-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipWithContent, { content: __$1("Edit", "cookie-law-info"), className: CKY_TOOLTIP_CONSENT_ACTIONS_CLASS, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Button,
          {
            variant: "ghost",
            size: "icon",
            className: GCM_ICON_BUTTON_CLASS,
            onClick: handleEdit,
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "edit", width: "14px", height: "14px", color: "#505B66" })
          }
        ) }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex-1 cky:flex cky:justify-center cky:min-w-0", children: isDeleteDisabled ? /* @__PURE__ */ jsxRuntimeExports.jsx(
          TooltipWithContent,
          {
            content: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:block cky:whitespace-pre-line cky:text-center", children: __$1(
              "This row can’t be\ndeleted as it specifies\nthe default values.",
              "cookie-law-info"
            ) }),
            className: CKY_TOOLTIP_CONSENT_ACTIONS_CLASS,
            children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:inline-flex cky:cursor-default", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "trash", width: "14px", height: "14px", color: "#DE443780" }) })
          }
        ) : /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipWithContent, { content: __$1("Delete", "cookie-law-info"), className: CKY_TOOLTIP_CONSENT_ACTIONS_CLASS, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Button,
          {
            variant: "ghost",
            size: "icon",
            className: GCM_ICON_BUTTON_CLASS,
            onClick: handleDelete,
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "trash", width: "14px", height: "14px", color: "#DE4437" })
          }
        ) }) })
      ] }) })
    ] });
  }, "GcmRegionTableRow2"));
  function Gcm() {
    var _a2, _b2;
    const [saving, setSaving] = reactExports.useState(false);
    const [hasChanges, setHasChanges] = reactExports.useState(false);
    const [initialStoreState, setInitialStoreState] = reactExports.useState(null);
    const gcm2 = useAppStore((s2) => s2.gcm);
    const { triggerNotification } = useGlobalUtilities();
    const headsUpModalRef = reactExports.useRef(null);
    const consentModalRef = reactExports.useRef(null);
    const exitIntentRef = reactExports.useRef(null);
    const navigate = useNavigate();
    reactExports.useEffect(() => {
      setInitialStoreState(cloneState(gcm2));
    }, []);
    reactExports.useEffect(() => {
      if (initialStoreState != null && gcm2 != null) {
        setHasChanges(!isEqual(initialStoreState, gcm2));
      }
    }, [gcm2, initialStoreState]);
    const blocker = useBlocker({
      shouldBlockFn: reactExports.useCallback(() => hasChanges, [hasChanges]),
      enableBeforeUnload: hasChanges,
      withResolver: true
    });
    reactExports.useEffect(() => {
      var _a3;
      if (blocker.status === "blocked") {
        (_a3 = exitIntentRef.current) == null ? void 0 : _a3.show();
      }
    }, [blocker.status]);
    const handleStatusChange = reactExports.useCallback((status) => {
      var _a3;
      const { gcm: current, updateGcm: patch } = useAppStore.getState();
      patch(__spreadProps(__spreadValues({}, current), { status }));
      if (status) (_a3 = headsUpModalRef.current) == null ? void 0 : _a3.show();
    }, []);
    const openConsentModal = reactExports.useCallback((item, index2) => {
      var _a3;
      (_a3 = consentModalRef.current) == null ? void 0 : _a3.show(item, index2);
    }, []);
    const handleNewRegion = reactExports.useCallback(() => {
      openConsentModal();
    }, [openConsentModal]);
    const deleteRegion = reactExports.useCallback((index2) => {
      const { gcm: current, updateGcm: patch } = useAppStore.getState();
      if (!(current == null ? void 0 : current.default_settings) || current.default_settings.length <= 1) return;
      if (window.confirm(__$1("Are you sure you want to delete this region?", "cookie-law-info"))) {
        const regions = [...current.default_settings];
        regions.splice(index2, 1);
        patch(__spreadProps(__spreadValues({}, current), { default_settings: regions }));
      }
    }, []);
    const saveConfig = reactExports.useCallback(() => __async(null, null, function* () {
      if (!gcm2) return;
      setSaving(true);
      try {
        const response = yield gcmApi.createGcm(gcm2);
        if (response) {
          triggerNotification({
            type: "success",
            message: saveSuccessMessage(__$1)
          });
          setInitialStoreState(cloneState(gcm2));
          setHasChanges(false);
        }
      } catch (e) {
        triggerNotification({
          type: "error",
          message: saveErrorMessage(__$1)
        });
      } finally {
        setSaving(false);
      }
    }), [gcm2, triggerNotification]);
    const defaultSettings = reactExports.useMemo(
      () => {
        var _a3;
        return ((_a3 = gcm2 == null ? void 0 : gcm2.default_settings) == null ? void 0 : _a3.length) ? gcm2.default_settings : [DEFAULT_REGION_SETTING];
      },
      [gcm2 == null ? void 0 : gcm2.default_settings]
    );
    const isDeleteDisabled = ((_b2 = (_a2 = gcm2 == null ? void 0 : gcm2.default_settings) == null ? void 0 : _a2.length) != null ? _b2 : 0) <= 1;
    const handleUrlPassthroughChange = reactExports.useCallback((checked) => {
      const { gcm: current, updateGcm: patch } = useAppStore.getState();
      patch(__spreadProps(__spreadValues({}, current), { url_passthrough: checked }));
    }, []);
    const handleAdsDataRedactionChange = reactExports.useCallback((checked) => {
      const { gcm: current, updateGcm: patch } = useAppStore.getState();
      patch(__spreadProps(__spreadValues({}, current), { ads_data_redaction: checked }));
    }, []);
    const handleDiscardNavigation = reactExports.useCallback(() => {
      var _a3;
      if (initialStoreState != null) {
        useAppStore.getState().updateGcm(cloneState(initialStoreState));
      }
      setHasChanges(false);
      if (blocker.status !== "blocked") return;
      const { pathname, search } = blocker.next;
      (_a3 = blocker.reset) == null ? void 0 : _a3.call(blocker);
      navigate({ to: pathname, search, ignoreBlocker: true });
    }, [blocker, initialStoreState, navigate]);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(TooltipProvider, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyExitIntentPopup,
        {
          ref: exitIntentRef,
          onStayOnPage: /* @__PURE__ */ __name(() => {
            var _a3;
            return (_a3 = blocker.reset) == null ? void 0 : _a3.call(blocker);
          }, "onStayOnPage"),
          onDiscardChanges: handleDiscardNavigation
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:justify-between cky:p-[15px]", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "cky:text-lg cky:font-medium cky:m-0!", children: __$1("Google Consent Mode Settings", "cookie-law-info") }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              Button,
              {
                onClick: saveConfig,
                disabled: saving,
                variant: "green",
                className: "cky:ml-[15px]",
                children: saving ? __$1("Saving...", "cookie-law-info") : __$1("Publish Changes", "cookie-law-info")
              }
            ) })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-full cky:px-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:bg-white cky:py-[12px] cky:px-[20px] cky:rounded-[3px] cky:shadow-sm cky:border cky:border-gray-200", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:pb-[15px] cky:border-b cky:border-gray-200 cky:flex cky:flex-wrap", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-1/4 cky:pr-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: "cky:p-0 cky:m-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { className: "cky:text-sm! cky:my-2!", children: __$1("Enable Google Consent Mode (GCM)", "cookie-law-info") }) }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-3/4 cky:flex cky:items-center cky:px-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                Switch,
                {
                  id: "cky-toggle-gcm",
                  checked: (gcm2 == null ? void 0 : gcm2.status) || false,
                  onCheckedChange: handleStatusChange
                }
              ) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-1/4" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-3/4 cky:text-sm cky:px-[15px] cky:pt-[5px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:m-0!", children: __$1(
                "When enabled, GCM will be implemented on your website.",
                "cookie-law-info"
              ) }) })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-wrap cky:py-4", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-full cky:mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { className: "cky:text-sm! cky:m-0!", children: __$1("Default consent settings", "cookie-law-info") }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-full cky:text-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:m-0!", children: __$1(
                "The default consent state, 'Denied', will apply to non-necessary categories until consent is received. You can customise the default consent states for users in different geographical regions.",
                "cookie-law-info"
              ) }) })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:pb-4 cky:border-b cky:border-gray-200 cky:flex cky:flex-wrap", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:overflow-x-auto cky:mb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
                Table,
                {
                  className: "cky:w-full cky:border-collapse cky:bg-white cky:min-h-[100px] cky:border cky:border-gray-300",
                  style: TABLE_LAYOUT_STYLE,
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(TableHeader, { className: "cky:bg-[#E1E0E1] cky:[&_tr]:border-b-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow, { className: "cky:border-b-0", children: [
                      GCM_CONSENT_COLUMNS.map(({ key, label }) => /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { className: GCM_TABLE_HEAD_CLASS, children: label }, key)),
                      /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { className: GCM_TABLE_HEAD_CLASS, children: __$1("Actions", "cookie-law-info") })
                    ] }) }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(TableBody, { className: "cky:relative", children: defaultSettings.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
                      GcmRegionTableRow,
                      {
                        item,
                        rowIndex: index2,
                        isDeleteDisabled,
                        onEditRow: openConsentModal,
                        onDeleteRow: deleteRegion
                      },
                      index2
                    )) })
                  ]
                }
              ) }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-full cky:md:w-1/6", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
                Button,
                {
                  id: "cky-add-new-region-btn",
                  onClick: handleNewRegion,
                  size: "sm",
                  children: [
                    "+ ",
                    __$1("New Region", "cookie-law-info")
                  ]
                }
              ) })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:py-4 cky:space-y-4", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h6", { className: "cky:text-sm! cky:font-medium cky:m-0!", children: __$1("Other settings", "cookie-law-info") }) }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: OTHER_SETTINGS_ROW, children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  Label$1,
                  {
                    className: OTHER_SETTINGS_LABEL,
                    htmlFor: "cky-wait-update",
                    children: __$1("Wait for update", "cookie-law-info")
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:w-3/4 cky:flex cky:items-center", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(CkyWaitUpdate, {}),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:ml-2 cky:text-sm", children: __$1("milliseconds", "cookie-law-info") })
                ] }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-1/4" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-3/4 cky:text-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: __$1(
                  "Number of milliseconds to wait before firing tags that are waiting for consent.",
                  "cookie-law-info"
                ) }) })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: OTHER_SETTINGS_ROW, children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: OTHER_SETTINGS_LABEL, children: __$1("Pass ad click information through URLs", "cookie-law-info") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-3/4 cky:flex cky:items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  Switch,
                  {
                    id: "cky-toggle-url-passthrough",
                    checked: (gcm2 == null ? void 0 : gcm2.url_passthrough) || false,
                    onCheckedChange: handleUrlPassthroughChange
                  }
                ) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-1/4" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-3/4 cky:text-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: __$1(
                  "When enabled, internal links will include advertising identifiers (such as gclid, dclid, gclsrc, and _gl) in their URLs while awaiting consent.",
                  "cookie-law-info"
                ) }) })
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: OTHER_SETTINGS_ROW, children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, { className: OTHER_SETTINGS_LABEL, children: __$1("Redact ads data", "cookie-law-info") }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-3/4 cky:flex cky:items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  Switch,
                  {
                    id: "cky-toggle-ads-redact",
                    checked: (gcm2 == null ? void 0 : gcm2.ads_data_redaction) || false,
                    onCheckedChange: handleAdsDataRedactionChange
                  }
                ) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-1/4" }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-3/4 cky:text-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: __$1(
                  `When enabled and the default consent state of "Advertisement Cookies" is disabled, Google's advertising tags will remove all advertising identifiers from the requests, and route the traffic through domains that do not use cookies.`,
                  "cookie-law-info"
                ) }) })
              ] })
            ] })
          ] }) }) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(GcmHeadsUpModal, { ref: headsUpModalRef }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(ConsentSettingModal, { ref: consentModalRef, onClear: noopConsentModalClear })
      ] })
    ] });
  }
  __name(Gcm, "Gcm");
  const MENU_DELETE = __$1("Delete", "cookie-law-info");
  const DELETE_CONFIRM_TEMPLATE = __$1(
    /* translators: %1$s: Language name. */
    "The <b>%1$s</b> language and any translations you've added in this language will be permanently deleted.",
    "cookie-law-info"
  );
  const DROPDOWN_ITEM_CLASS = "cky:p-2.5";
  const HOVER_MENU_CLOSE_MS = 200;
  const LanguageRowMenu = reactExports.memo(/* @__PURE__ */ __name(function LanguageRowMenu2({
    language,
    defaultLanguage,
    selectedCount,
    onOpenLanguageModal,
    onDeleteConfirmation,
    onSetDefault
  }) {
    const isDefault = defaultLanguage === language.code;
    const [menuOpen, setMenuOpen] = reactExports.useState(false);
    const closeTimerRef = reactExports.useRef(null);
    const cancelScheduledClose = reactExports.useCallback(() => {
      if (closeTimerRef.current !== null) {
        clearTimeout(closeTimerRef.current);
        closeTimerRef.current = null;
      }
    }, []);
    const openMenu = reactExports.useCallback(() => {
      cancelScheduledClose();
      setMenuOpen(true);
    }, [cancelScheduledClose]);
    const scheduleMenuClose = reactExports.useCallback(() => {
      cancelScheduledClose();
      closeTimerRef.current = window.setTimeout(() => {
        closeTimerRef.current = null;
        setMenuOpen(false);
      }, HOVER_MENU_CLOSE_MS);
    }, [cancelScheduledClose]);
    reactExports.useEffect(() => () => cancelScheduledClose(), [cancelScheduledClose]);
    const onMenuOpenChange = reactExports.useCallback(
      (next) => {
        cancelScheduledClose();
        setMenuOpen(next);
      },
      [cancelScheduledClose]
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DropdownMenu, { open: menuOpen, onOpenChange: onMenuOpenChange, modal: false, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        Button,
        {
          variant: "outline",
          size: "sm",
          className: "cky:px-1.5! cky:hover:bg-secondary/80 cky:hover:text-secondary-foreground",
          onPointerEnter: openMenu,
          onPointerLeave: scheduleMenuClose,
          children: "..."
        }
      ) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        DropdownMenuContent$1,
        {
          align: "end",
          className: "cky:min-w-[130px] cky:text-[#3c434a] cky:font-medium cky:border cky:border-[#c9d0d6] cky:p-0",
          onPointerEnter: openMenu,
          onPointerLeave: scheduleMenuClose,
          children: [
            isDefault && selectedCount === 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuItem$1, { onClick: onOpenLanguageModal, className: DROPDOWN_ITEM_CLASS, children: __$1("Change default language", "cookie-law-info") }) : isDefault && selectedCount > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              DropdownMenuItem$1,
              {
                "aria-disabled": true,
                className: cn$1(
                  "cky:cursor-not-allowed cky:p-2.5",
                  "focus:cky:bg-transparent data-[highlighted]:cky:bg-transparent"
                ),
                onSelect: /* @__PURE__ */ __name((e) => e.preventDefault(), "onSelect"),
                children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip$1, { children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:block cky:w-full cky:text-[#8893a1] cky:opacity-50", children: MENU_DELETE }) }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    TooltipContentWithArrow,
                    {
                      side: "top",
                      className: "cky:!max-w-[150px] cky:box-border",
                      children: __$1("You can't delete the default language.", "cookie-law-info")
                    }
                  )
                ] })
              }
            ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
              DropdownMenuItem$1,
              {
                onClick: /* @__PURE__ */ __name(() => onDeleteConfirmation(language), "onClick"),
                className: DROPDOWN_ITEM_CLASS,
                children: MENU_DELETE
              }
            ),
            !isDefault && /* @__PURE__ */ jsxRuntimeExports.jsx(
              DropdownMenuItem$1,
              {
                onClick: /* @__PURE__ */ __name(() => onSetDefault(language), "onClick"),
                className: DROPDOWN_ITEM_CLASS,
                children: __$1("Set as default", "cookie-law-info")
              }
            )
          ]
        }
      )
    ] }) });
  }, "LanguageRowMenu2"));
  function Languages() {
    const navigate = useNavigate();
    const [loading, setLoading] = reactExports.useState(true);
    const [languageName, setLanguageName] = reactExports.useState(false);
    const [languageCode, setLanguageCode] = reactExports.useState(false);
    const ckyLanguageModalRef = reactExports.useRef(null);
    const ckyLanguageSelectorRef = reactExports.useRef(null);
    const ckyHeadsUpPopupRef = reactExports.useRef(null);
    const {
      available,
      selected,
      default: defaultLanguage,
      setDefault,
      setCurrent,
      setSelected,
      saveSelected,
      saveDefault,
      init
    } = useLanguageStore();
    reactExports.useEffect(() => {
      let cancelled = false;
      void (() => __async(null, null, function* () {
        setLoading(true);
        yield init();
        if (!cancelled) setLoading(false);
      }))();
      return () => {
        cancelled = true;
      };
    }, [init]);
    const showConnectModal = reactExports.useCallback(() => {
      var _a2;
      (_a2 = ckyLanguageModalRef.current) == null ? void 0 : _a2.show();
    }, []);
    const handleNavigate = reactExports.useCallback(
      (path, query) => {
        navigate(query ? { to: `/${path}`, search: query } : { to: `/${path}` });
      },
      [navigate]
    );
    const openLanguageModal = reactExports.useCallback(() => {
      var _a2;
      (_a2 = ckyLanguageSelectorRef.current) == null ? void 0 : _a2.open();
    }, []);
    const deleteLanguageConfirmation = reactExports.useCallback((language) => {
      var _a2;
      const currentDefault = useLanguageStore.getState().default;
      if (language.code === currentDefault) return;
      setLanguageName(language.name);
      setLanguageCode(language.code);
      (_a2 = ckyHeadsUpPopupRef.current) == null ? void 0 : _a2.show();
    }, []);
    const deleteLanguage = reactExports.useCallback(() => __async(null, null, function* () {
      var _a2, _b2;
      if (!languageCode) return;
      const { default: currentDefault, selected: currentSelected } = useLanguageStore.getState();
      if (languageCode === currentDefault) {
        console.warn("Cannot delete the default language");
        (_a2 = ckyHeadsUpPopupRef.current) == null ? void 0 : _a2.closePopup();
        return;
      }
      try {
        const updatedSelected = currentSelected.filter((code) => code !== languageCode);
        setSelected(updatedSelected);
        const saveResult = yield saveSelected({
          remove: true,
          clear: false,
          selected: updatedSelected
        });
        if (!saveResult || !saveResult.success) {
          throw new Error("Failed to save language deletion");
        }
        yield new Promise((resolve) => setTimeout(resolve, 100));
        yield purgeCache();
        yield init();
      } catch (error) {
        console.error("Error deleting language:", error);
        console.error("Failed to delete language");
        yield init();
      }
      (_b2 = ckyHeadsUpPopupRef.current) == null ? void 0 : _b2.closePopup();
    }), [languageCode, setSelected, saveSelected, init]);
    const setDefaultLanguage2 = reactExports.useCallback(
      (language) => __async(null, null, function* () {
        try {
          if (selected.length === 1) {
            setSelected([language.code]);
            setDefault(language.code);
            setCurrent(language.code);
            yield saveSelected({ clear: false });
            yield saveDefault({ clear: false });
          } else {
            setDefault(language.code);
            setCurrent(language.code);
            yield saveDefault({ clear: false });
          }
          if (typeof window !== "undefined") {
            window.dispatchEvent(new CustomEvent("cky:language-changed"));
          }
          console.log("Default language updated successfully");
        } catch (error) {
          console.error("Error setting default language:", error);
          console.error("Failed to update default language");
        }
      }),
      [selected.length, setSelected, setDefault, setCurrent, saveSelected, saveDefault]
    );
    const clearHeadsUpPopup = reactExports.useCallback(() => {
      setLanguageName(false);
      setLanguageCode(false);
    }, []);
    const handleEditContent = reactExports.useCallback(
      (code) => {
        navigate({
          to: "/languages/edit/$language",
          params: { language: code }
        });
      },
      [navigate]
    );
    const selectedLanguages = reactExports.useMemo(
      () => languages$1.getLanguageDetails(available, selected),
      [available, selected]
    );
    const selectedLanguagesCount = selectedLanguages.length;
    const bodyContent = reactExports.useMemo(
      () => sprintf(DELETE_CONFIRM_TEMPLATE, languageName || ""),
      [languageName]
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:p-[15px]", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "cky:m-0! cky:mr-3.5! cky:text-lg cky:font-semibold cky:text-primary", children: __$1("Languages", "cookie-law-info") }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:gap-3 cky:items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
          Button,
          {
            id: "cky-add-language-btn",
            className: "cky:inline-flex cky:gap-2 cky:items-center",
            onClick: showConnectModal,
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                Badge,
                {
                  variant: "premium",
                  className: "cky:w-[18px] cky:h-[18px] cky:p-0 cky:flex cky:items-center cky:justify-center",
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "crown", width: "10px", height: "8px" })
                }
              ),
              __$1("Add Language", "cookie-law-info")
            ]
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:border cky:border-gray-300 cky:bg-white cky:p-2.5", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Table, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(TableHeader, { className: "cky:bg-gray-100 cky:text-text-primary", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { className: "cky:text-text-primary", children: __$1("Language List", "cookie-law-info") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, { className: "cky:w-[15%] cky:text-text-primary", children: __$1("Language Code", "cookie-law-info") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, {}),
          /* @__PURE__ */ jsxRuntimeExports.jsx(TableHead, {})
        ] }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(TableBody, { children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(TableRow, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { colSpan: 4, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:items-center cky:gap-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { className: "cky:w-full cky:h-8" }) }) }) }) : selectedLanguages.map((language) => /* @__PURE__ */ jsxRuntimeExports.jsxs(TableRow, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "cky:text-sm cky:text-text-primary", children: language.name }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "cky:text-sm cky:text-text-primary cky:uppercase cky:w-[15%]", children: language.code }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { children: defaultLanguage === language.code && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Badge,
            {
              variant: "default",
              className: "cky:rounded-full cky:bg-[rgba(0,86,167,0.05)] cky:text-[#2170f9] cky:px-3 cky:py-1 cky:text-xs cky:transition-none cky:hover:bg-[rgba(0,86,167,0.05)] cky:hover:text-[#2170f9]",
              children: __$1("Default", "cookie-law-info")
            }
          ) }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(TableCell, { className: "cky:text-right cky:text-text-primary", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:justify-end cky:gap-2", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              Button,
              {
                variant: "secondary",
                size: "sm",
                className: "cky:inline-flex cky:items-center cky:gap-1",
                onClick: /* @__PURE__ */ __name(() => handleEditContent(language.code), "onClick"),
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "editAlt", width: "13px" }),
                  __$1("Edit Content", "cookie-law-info")
                ]
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              LanguageRowMenu,
              {
                language,
                defaultLanguage,
                selectedCount: selectedLanguagesCount,
                onOpenLanguageModal: openLanguageModal,
                onDeleteConfirmation: deleteLanguageConfirmation,
                onSetDefault: setDefaultLanguage2
              }
            )
          ] }) })
        ] }, language.code)) })
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(CkyLanguageSelector, { ref: ckyLanguageSelectorRef }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyHeadsUpPopup,
        {
          ref: ckyHeadsUpPopupRef,
          header: __$1("Delete language?", "cookie-law-info"),
          body: bodyContent,
          cancelBtn: __$1("Cancel", "cookie-law-info"),
          confirmBtn: __$1("Delete language", "cookie-law-info"),
          onDeleteItem: deleteLanguage,
          onClear: clearHeadsUpPopup
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyConnectModal,
        {
          ref: ckyLanguageModalRef,
          availablePlan: "premium",
          feature: "language_limit",
          onNavigate: handleNavigate,
          title: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.addLanguage, alt: "languages" }),
          featureText: __$1(
            "Display your banner in multiple languages tailored for your audience",
            "cookie-law-info"
          ),
          availabilityText: __$1(
            "Available in: <b>All premium plans</b>",
            "cookie-law-info"
          )
        }
      )
    ] });
  }
  __name(Languages, "Languages");
  function useBannerCustomizePreview(consentLaw, preview, setPreview, options2) {
    var _a2, _b2;
    const clearPreviewOnUnmount = (_a2 = options2 == null ? void 0 : options2.closePreviewOnUnmount) != null ? _a2 : true;
    const clearTemplateOnPreviewOff = (_b2 = options2 == null ? void 0 : options2.clearTemplateOnPreviewOff) != null ? _b2 : true;
    const onAfterPublish = reactExports.useCallback(() => __async(null, null, function* () {
      if (!preview) return;
      bannerPreview.startLoading();
      try {
        const b = yield fetchBannerForPreview(consentLaw);
        const cats = yield fetchCookieCategoriesForPreview();
        if (!b) return;
        setBannerPreviewContext(
          b,
          getAdminBannerLanguage(),
          cats
        );
        bannerPreview.resetTemplateCache();
        yield bannerPreview.generate(false, true);
      } catch (e) {
        console.error(e);
      } finally {
        bannerPreview.stopLoading();
      }
    }), [preview, consentLaw]);
    reactExports.useEffect(() => {
      if (!preview) {
        bannerPreview.closePreview(clearTemplateOnPreviewOff);
      }
    }, [preview, clearTemplateOnPreviewOff]);
    reactExports.useEffect(() => {
      if (!preview) return void 0;
      const onDocClick = /* @__PURE__ */ __name((e) => {
        const el = e.target.closest(
          '[data-cky-tag="preview-close"]'
        );
        if (el) {
          setPreview(false);
        }
      }, "onDocClick");
      document.addEventListener("click", onDocClick);
      return () => document.removeEventListener("click", onDocClick);
    }, [preview, setPreview]);
    reactExports.useEffect(
      () => () => {
        bannerPreview.closePreview(clearPreviewOnUnmount);
      },
      [clearPreviewOnUnmount]
    );
    return { onAfterPublish };
  }
  __name(useBannerCustomizePreview, "useBannerCustomizePreview");
  function useDirtyExitIntentBlocker(shouldBlockOrWarnOnUnload) {
    const exitIntentRef = reactExports.useRef(null);
    const navigate = useNavigate();
    const shouldBlock = reactExports.useCallback(
      () => shouldBlockOrWarnOnUnload(),
      [shouldBlockOrWarnOnUnload]
    );
    const blocker = useBlocker({
      shouldBlockFn: shouldBlock,
      enableBeforeUnload: shouldBlock,
      withResolver: true
    });
    reactExports.useEffect(() => {
      var _a2;
      if (blocker.status === "blocked") {
        (_a2 = exitIntentRef.current) == null ? void 0 : _a2.show();
      }
    }, [blocker.status]);
    const handleDiscardNavigation = reactExports.useCallback(() => {
      var _a2;
      if (blocker.status !== "blocked") return;
      const { pathname, search } = blocker.next;
      (_a2 = blocker.reset) == null ? void 0 : _a2.call(blocker);
      navigate({ to: pathname, search, ignoreBlocker: true });
    }, [blocker, navigate]);
    const handleStayOnPage = reactExports.useCallback(() => {
      var _a2;
      (_a2 = blocker.reset) == null ? void 0 : _a2.call(blocker);
    }, [blocker]);
    return {
      exitIntentRef,
      handleDiscardNavigation,
      handleStayOnPage
    };
  }
  __name(useDirtyExitIntentBlocker, "useDirtyExitIntentBlocker");
  function LanguagesEdit() {
    var _a2, _b2, _c2;
    const { triggerNotification } = useGlobalUtilities();
    const settingsRevision = useAppStore((s2) => s2.options);
    const { language: routeLanguage } = useParams({
      from: "/languages/edit/$language"
    });
    const [loading, setLoading] = reactExports.useState(true);
    const [saving, setSaving] = reactExports.useState(false);
    const baselinesByLanguageRef = reactExports.useRef(
      {}
    );
    const {
      current: currentBanner,
      setCurrentBanner,
      preview,
      setPreview,
      errors
    } = useBannerStore();
    const publishDisabled = Object.keys(errors).length > 0;
    const consentLaw = reactExports.useMemo(() => {
      if (currentBanner === false || !currentBanner) return "gdpr";
      const law = getBannerApplicableLaw$1(
        currentBanner
      );
      return law === "ccpa" ? "ccpa" : "gdpr";
    }, [currentBanner]);
    const { onAfterPublish } = useBannerCustomizePreview(
      consentLaw,
      preview,
      setPreview,
      {
        closePreviewOnUnmount: false,
        clearTemplateOnPreviewOff: false
      }
    );
    const {
      selected: selectedLanguages,
      current: currentLanguage,
      setCurrent: setCurrentLanguage,
      available: availableLanguages,
      default: defaultLanguage
    } = useLanguageStore();
    const editLang = currentLanguage || "en";
    const skipLanguagePreviewRef = reactExports.useRef(true);
    const skipContentsPreviewRef = reactExports.useRef(true);
    const initialLoadDoneRef = reactExports.useRef(false);
    const bannerId = currentBanner !== false && currentBanner ? currentBanner.id : null;
    const noticeAccordionEnabled = currentBanner !== false && currentBanner != null && ((_c2 = (_b2 = (_a2 = currentBanner.properties) == null ? void 0 : _a2.config) == null ? void 0 : _b2.notice) == null ? void 0 : _c2.status) !== false;
    const [openAccordionSection, setOpenAccordionSection] = reactExports.useState("");
    const [languageSelectOpen, setLanguageSelectOpen] = reactExports.useState(false);
    const resetAccordionToNotice = reactExports.useCallback(() => {
      setOpenAccordionSection(noticeAccordionEnabled ? "notice" : "");
    }, [noticeAccordionEnabled]);
    reactExports.useLayoutEffect(() => {
      if (loading || bannerId == null) return;
      resetAccordionToNotice();
    }, [loading, bannerId, resetAccordionToNotice]);
    const handleAccordionValueChange = reactExports.useCallback((value) => {
      setOpenAccordionSection(value);
      setLanguageSelectOpen(false);
    }, []);
    const optOutConfirmationPublishBlocked = reactExports.useMemo(() => {
      if (currentBanner === false || !currentBanner) return false;
      if (consentLaw !== "ccpa") return false;
      return isCcpaOptoutSuccessTextInvalid(
        currentBanner,
        editLang
      );
    }, [currentBanner, consentLaw, editLang]);
    const computeDirty = reactExports.useCallback(() => {
      var _a3, _b3;
      const banner2 = useBannerStore.getState().current;
      if (banner2 === false || !banner2) return false;
      const contents = (_a3 = banner2.contents) != null ? _a3 : {};
      const baselines = baselinesByLanguageRef.current;
      for (const lang of Object.keys(baselines)) {
        if (!isEqual(baselines[lang], (_b3 = contents[lang]) != null ? _b3 : {})) return true;
      }
      return false;
    }, []);
    const { exitIntentRef, handleDiscardNavigation, handleStayOnPage } = useDirtyExitIntentBlocker(computeDirty);
    const debouncedUpdateContentPreview = reactExports.useCallback(
      debouncePromise(() => updateContentPreview(), 500),
      []
    );
    const captureBaselineForLanguage = reactExports.useCallback(
      (banner2, targetLang, fallbackToEnglish) => {
        var _a3, _b3;
        const contents = (_a3 = banner2.contents) != null ? _a3 : {};
        const pack = contents[targetLang];
        const baseline = pack && typeof pack === "object" && !Array.isArray(pack) && Object.keys(pack).length > 0 ? pack : fallbackToEnglish ? (_b3 = contents.en) != null ? _b3 : {} : {};
        baselinesByLanguageRef.current[targetLang] = structuredClone(
          baseline
        );
      },
      []
    );
    const handleEditLanguageChange = reactExports.useCallback(
      (code) => {
        if (code === currentLanguage) return;
        const banner2 = useBannerStore.getState().current;
        if (banner2 !== false && banner2 && !baselinesByLanguageRef.current[code]) {
          captureBaselineForLanguage(
            banner2,
            code,
            false
          );
        }
        setCurrentLanguage(code);
      },
      [captureBaselineForLanguage, currentLanguage, setCurrentLanguage]
    );
    const resetLanguagesEditSession = reactExports.useCallback(() => {
      baselinesByLanguageRef.current = {};
      setPreview(false);
      bannerPreview.closePreview(false);
    }, [setPreview]);
    reactExports.useEffect(() => () => resetLanguagesEditSession(), [resetLanguagesEditSession]);
    const loadInitialBannerData = reactExports.useCallback(() => __async(null, null, function* () {
      var _a3, _b3, _c3, _d;
      const langCode = (_a3 = useLanguageStore.getState().current) != null ? _a3 : "en";
      setLoading(true);
      skipLanguagePreviewRef.current = true;
      skipContentsPreviewRef.current = true;
      try {
        const bannerStore2 = useBannerStore.getState();
        const banner2 = yield bannerStore2.getActiveBanner();
        if (banner2) {
          setCurrentBanner(banner2);
        }
        yield bannerStore2.loadTemplate();
        if (banner2 !== false && banner2.contents) {
          captureBaselineForLanguage(
            banner2,
            langCode,
            true
          );
        }
        try {
          yield fetchCookieCategoriesForPreview();
        } catch (cookieError) {
          console.error(cookieError);
        }
      } catch (error) {
        console.error("Error loading data:", error);
      } finally {
        const banner2 = useBannerStore.getState().current;
        const noticeOn = banner2 !== false && banner2 != null && ((_d = (_c3 = (_b3 = banner2.properties) == null ? void 0 : _b3.config) == null ? void 0 : _c3.notice) == null ? void 0 : _d.status) !== false;
        setOpenAccordionSection(noticeOn ? "notice" : "");
        setLoading(false);
      }
    }), [captureBaselineForLanguage, setCurrentBanner]);
    const saveCurrentLanguageBanner = reactExports.useCallback(() => __async(null, null, function* () {
      var _a3;
      const bannerStore2 = useBannerStore.getState();
      const languageStore2 = useLanguageStore.getState();
      const langToSave = (_a3 = languageStore2.current) != null ? _a3 : "en";
      const banner2 = yield bannerStore2.getCurrentBanner();
      if (banner2 === false || !banner2.id) return false;
      return bannerStore2.saveBanner(banner2, langToSave);
    }), []);
    reactExports.useLayoutEffect(() => {
      if (!routeLanguage) return;
      setCurrentLanguage(routeLanguage);
    }, [routeLanguage, setCurrentLanguage, settingsRevision]);
    reactExports.useEffect(() => {
      if (initialLoadDoneRef.current) return;
      initialLoadDoneRef.current = true;
      loadInitialBannerData();
    }, [loadInitialBannerData]);
    const bannerContents = currentBanner !== false && currentBanner ? currentBanner.contents : void 0;
    reactExports.useEffect(() => {
      if (loading || currentBanner === false) return;
      if (skipContentsPreviewRef.current) {
        skipContentsPreviewRef.current = false;
        return;
      }
      debouncedUpdateContentPreview();
    }, [
      bannerContents,
      loading,
      currentBanner,
      debouncedUpdateContentPreview
    ]);
    reactExports.useEffect(() => {
      if (loading) return;
      if (skipLanguagePreviewRef.current) {
        skipLanguagePreviewRef.current = false;
        return;
      }
      void debouncedUpdateContentPreview();
    }, [currentLanguage, loading, debouncedUpdateContentPreview]);
    reactExports.useEffect(() => {
      if (loading) return;
      void bannerPreview.showPreview();
    }, [preview, loading]);
    const handleSave = /* @__PURE__ */ __name(() => __async(null, null, function* () {
      if (consentLaw === "ccpa" && currentBanner !== false && currentBanner && isCcpaOptoutSuccessTextInvalid(
        currentBanner,
        editLang
      )) {
        triggerNotification({
          type: "error",
          message: __$1(
            "A message is required to show upon opt-out.",
            "cookie-law-info"
          )
        });
        return;
      }
      setSaving(true);
      try {
        const success = yield saveCurrentLanguageBanner();
        if (success) {
          triggerNotification({
            type: "success",
            message: saveSuccessMessage(__$1)
          });
          const banner2 = useBannerStore.getState().current;
          if (banner2 !== false && banner2.contents) {
            captureBaselineForLanguage(
              banner2,
              editLang,
              false
            );
          }
          yield onAfterPublish();
        } else {
          triggerNotification({
            type: "error",
            message: saveErrorMessage(__$1)
          });
        }
      } catch (error) {
        console.error("Error saving:", error);
        triggerNotification({
          type: "error",
          message: saveErrorMessage(__$1)
        });
      } finally {
        setSaving(false);
      }
    }), "handleSave");
    const getLanguageName = /* @__PURE__ */ __name((code) => {
      return languages$1.getName(code, availableLanguages);
    }, "getLanguageName");
    const showDefaultColumn = Boolean(defaultLanguage) && defaultLanguage !== currentLanguage;
    const renderLanguagesEditContent = /* @__PURE__ */ __name(() => {
      if (loading) {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-button-section cky:-mx-[15px] cky:flex cky:flex-wrap cky:justify-between", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:min-h-[1px] cky:box-border cky:w-1/2 cky:max-w-[50%] cky:basis-1/2 cky:px-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-loader-languages", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:p-3" }) }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:min-h-[1px] cky:box-border cky:w-1/2 cky:max-w-[50%] cky:basis-1/2 cky:px-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-loader-languages", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:p-3" }) }) })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:-mx-[15px] cky:flex cky:flex-wrap", children: [
            showDefaultColumn && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:min-h-[1px] cky:box-border cky:min-w-0 cky:flex-1 cky:px-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-loader-languages", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:p-3" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:p-3" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:p-3" })
            ] }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:min-h-[1px] cky:box-border cky:min-w-0 cky:flex-1 cky:px-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-loader-languages", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:p-3" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:p-3" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:p-3" })
            ] }) })
          ] })
        ] });
      }
      const bannerMissing = currentBanner === false || !currentBanner;
      if (bannerMissing) {
        return /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:text-sm cky:text-muted-foreground", children: __$1("No banner found", "cookie-law-info") });
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:-mx-[15px] cky:flex cky:flex-wrap", children: [
        showDefaultColumn && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:min-h-[1px] cky:box-border cky:min-w-0 cky:flex-1 cky:px-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: cn$1(
              "cky-edit-content-lists",
              "cky:mt-[10px] cky:list-none cky:border cky:border-solid cky:border-[#d9d9d9] cky:bg-white cky:p-[15px]"
            ),
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: cn$1(
                    "cky-lang-edit-column-header cky:flex cky:min-h-[35px] cky:items-center cky:mb-5"
                  ),
                  children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
                    "h5",
                    {
                      className: cn$1(
                        "cky-lang-edit-lists-heading cky:!m-0 cky:!text-[15px] cky:font-semibold cky:leading-[1.3] cky:text-[#23282d]"
                      ),
                      children: [
                        __$1("Default language:", "cookie-law-info"),
                        " ",
                        /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: getLanguageName(defaultLanguage) })
                      ]
                    }
                  )
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                TabContentAccordion,
                {
                  language: defaultLanguage,
                  translate: true,
                  disabled: true,
                  accordionValue: openAccordionSection,
                  onAccordionValueChange: handleAccordionValueChange
                },
                `lang-default-${defaultLanguage}-${currentBanner.id}`
              )
            ]
          }
        ) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:min-h-[1px] cky:box-border cky:min-w-0 cky:flex-1 cky:px-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: cn$1(
              "cky-edit-content-lists",
              "cky:mt-[10px] cky:list-none cky:border cky:border-solid cky:border-[#d9d9d9] cky:bg-white cky:p-[15px]"
            ),
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                "div",
                {
                  className: cn$1(
                    "cky-lang-edit-column-header cky-lang-edit-heading-row cky:flex cky:min-h-[35px] cky:items-center cky:mb-5"
                  ),
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "h5",
                      {
                        className: cn$1(
                          "cky:!m-0 cky:shrink-0 cky:!text-[15px] cky:font-semibold cky:leading-[1.3] cky:text-[#23282d]"
                        ),
                        children: __$1("Edit content in:", "cookie-law-info")
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs(
                      Select,
                      {
                        value: editLang,
                        open: languageSelectOpen,
                        onOpenChange: setLanguageSelectOpen,
                        onValueChange: /* @__PURE__ */ __name((code) => {
                          setLanguageSelectOpen(false);
                          handleEditLanguageChange(code);
                        }, "onValueChange"),
                        children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx(
                            SelectTrigger,
                            {
                              id: "cky-edit-language-select",
                              className: "cky:min-w-[180px] cky:w-auto cky:h-[35px]! cky:min-h-[35px]! cky:max-h-[35px]!",
                              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                                SelectValue,
                                {
                                  placeholder: __$1(
                                    "Select language…",
                                    "cookie-law-info"
                                  )
                                }
                              )
                            }
                          ),
                          /* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { children: selectedLanguages.map((langCode) => /* @__PURE__ */ jsxRuntimeExports.jsx(
                            SelectItem,
                            {
                              value: langCode,
                              variant: "modal",
                              children: getLanguageName(langCode)
                            },
                            langCode
                          )) })
                        ]
                      }
                    )
                  ]
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                TabContentAccordion,
                {
                  language: editLang,
                  translate: true,
                  accordionValue: openAccordionSection,
                  onAccordionValueChange: handleAccordionValueChange
                },
                `lang-edit-${editLang}-${currentBanner.id}`
              )
            ]
          }
        ) })
      ] });
    }, "renderLanguagesEditContent");
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        className: cn$1(
          "cky-section cky-lang-edit-page cky:!p-0 cky:!m-0"
        ),
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            CkyExitIntentPopup,
            {
              ref: exitIntentRef,
              onStayOnPage: handleStayOnPage,
              onDiscardChanges: handleDiscardNavigation
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-section-header cky:flex cky:items-center cky:justify-between", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-section-title", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: "/languages", className: "cky-breadcrumbs-title", children: __$1("Back to Language List", "cookie-law-info") }) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-section-header-actions cky:ml-auto cky:flex cky:items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center cky:justify-end", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:inline-flex cky:cursor-pointer cky:items-center cky:gap-2", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  Label$1,
                  {
                    htmlFor: "cky-banner-preview",
                    className: "cky:m-0 cky:cursor-pointer cky:text-sm cky:font-medium cky:text-[#23282d]",
                    children: __$1("Banner Preview", "cookie-law-info")
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  Switch,
                  {
                    id: "cky-banner-preview",
                    checked: preview,
                    onCheckedChange: setPreview
                  }
                )
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                Button,
                {
                  variant: "green",
                  className: "cky:ml-[15px]",
                  onClick: handleSave,
                  loading: saving,
                  loadingText: __$1("Saving...", "cookie-law-info"),
                  disabled: publishDisabled || optOutConfirmationPublishBlocked || loading,
                  children: __$1("Publish Changes", "cookie-law-info")
                }
              )
            ] }) })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-section-content", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: cn$1(
                "cky-edit-content",
                "cky:border cky:border-solid cky:border-[#d9d9d9] cky:bg-white cky:p-[15px]",
                "cky:[&_.cky-app-accordion_.cky-form-section:not(.cky-form-section-group)_.cky-label-col]:hidden",
                "cky:[&_.cky-app-accordion_.cky-form-section:not(.cky-form-section-group)_.cky-value-col]:w-full",
                "cky:[&_.cky-app-accordion_.cky-form-section:not(.cky-form-section-group)_.cky-value-col]:max-w-full",
                "cky:[&_.cky-app-accordion_.cky-form-section:not(.cky-form-section-group)_.cky-value-col]:basis-full"
              ),
              children: renderLanguagesEditContent()
            }
          ) })
        ]
      }
    );
  }
  __name(LanguagesEdit, "LanguagesEdit");
  const arrowBackSvg = '<svg width="32" height="32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.667 16h18.666M6.667 16l8 8m-8-8 8-8" stroke="#4E4B66" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>\n';
  const PAGE_LIMIT_LONG = __$2(
    "A pageview is every instance that a page on a website with CookieYes code is loaded or reloaded.<br>If Extra Pageviews are enabled for your account, you'll be charged [OVERAGE_PRICE] for every 1,000 additional pageviews per site, beyond your monthly plan limit.",
    "cookie-law-info"
  );
  const USAGE_KEYS = ["scans_per_month", "pages_per_scan", "page_view_limit"];
  const OVERAGE_RELEASE = /* @__PURE__ */ new Date("2025-12-23T00:00:00Z");
  const OVERAGE_RELEASE_FORMATTED = OVERAGE_RELEASE.toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric"
  });
  function shouldShowOverageText(planSlug, featureKey) {
    return featureKey === "page_view_limit" && (planSlug === "basic" || planSlug === "pro");
  }
  __name(shouldShowOverageText, "shouldShowOverageText");
  function planGridColsClass(count2) {
    switch (count2) {
      case 1:
        return "cky:grid-cols-1";
      case 2:
        return "cky:grid-cols-1 cky:md:grid-cols-2";
      case 3:
        return "cky:grid-cols-1 cky:md:grid-cols-3";
      case 4:
      default:
        return "cky:grid-cols-1 cky:sm:grid-cols-2 cky:xl:grid-cols-4";
    }
  }
  __name(planGridColsClass, "planGridColsClass");
  function normalizeAvailable(value) {
    const v = (value || "").trim().toLowerCase();
    if (v === "premium" || v === "pro" || v === "ultimate") return v;
    return "all";
  }
  __name(normalizeAvailable, "normalizeAvailable");
  function getAvailableFromLocation() {
    if (typeof window === "undefined") return null;
    const hash = window.location.hash || "";
    const [, query = ""] = hash.split("?");
    const hashParams = new URLSearchParams(query);
    const fromHash = hashParams.get("available");
    if (fromHash) return fromHash;
    const searchParams = new URLSearchParams(window.location.search || "");
    return searchParams.get("available");
  }
  __name(getAvailableFromLocation, "getAvailableFromLocation");
  function FeatureLineContent({
    content,
    feature,
    renderHtml
  }) {
    const withPopper = typeof feature === "object" && feature !== null && feature.showPopper;
    const popper = withPopper ? /* @__PURE__ */ jsxRuntimeExports.jsx(CkyPopper, { content: feature.popperContent, isHtml: true }) : null;
    if (renderHtml) {
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "cky:inline-flex cky:flex-wrap cky:items-start cky:gap-1", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { dangerouslySetInnerHTML: { __html: content } }),
        popper
      ] });
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "cky:inline-flex cky:flex-wrap cky:items-start cky:gap-1", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: content }),
      popper
    ] });
  }
  __name(FeatureLineContent, "FeatureLineContent");
  function Plans() {
    const navigate = useNavigate();
    const { available: availableParam } = useSearch({ from: "/dashboard/plans" });
    const { updateStatus } = useSettingsStore();
    const info = useAppStore((s2) => s2.info);
    const { connectToApp, connectToPaidPlan } = useConnectFlow();
    const [loading, setLoading] = reactExports.useState(false);
    const [loaded, setLoaded] = reactExports.useState(false);
    const [toggleSettings, setToggleSettings] = reactExports.useState(false);
    const [showMonthly, setShowMonthly] = reactExports.useState(true);
    const [currencies, setCurrencies] = reactExports.useState([]);
    const [planDetails, setPlanDetails] = reactExports.useState(null);
    const [selected, setSelected] = reactExports.useState("USD");
    const [symbol, setSymbol] = reactExports.useState("$");
    const [available, setAvailable] = reactExports.useState("all");
    const contents = reactExports.useMemo(
      () => ({
        showMonthly: __$2("/month/domain", "cookie-law-info"),
        showYearly: __$2("/year/domain", "cookie-law-info"),
        custom_css: __$2("Custom CSS", "cookie-law-info"),
        custom_branding: __$2("Option to add custom logo on banner", "cookie-law-info"),
        schedule_scan: __$2("Scheduled scan", "cookie-law-info"),
        static_ip_scan: __$2("Static IP scan", "cookie-law-info"),
        config_geo_rules: __$2("Geo-target banner", "cookie-law-info"),
        popup_layout: __$2("Pop-up banner layout", "cookie-law-info"),
        respect_gpc: __$2("Support for Global Privacy Control (GPC)", "cookie-law-info"),
        hide_banner_on_specific_pages: __$2("Disable banner on specific pages", "cookie-law-info"),
        iab: __$2("IAB TCF Support", "cookie-law-info"),
        gacm_support: __$2("Google's Additional Consent Mode", "cookie-law-info"),
        revisit_custom_branding: __$2("Custom revisit consent button", "cookie-law-info"),
        scan_behind_login: __$2("Scan behind login", "cookie-law-info"),
        remove_powered_by: __$2('Disable "Powered by" branding', "cookie-law-info"),
        pages_per_scan: __$2("&nbsp;pages per scan", "cookie-law-info"),
        pageview_per_month: __$2("&nbsp;pageviews / month", "cookie-law-info"),
        unlimited_pageviews: __$2("<b>Unlimited</b>&nbsp;pageviews", "cookie-law-info"),
        staging_mode: __$2("Staging mode", "cookie-law-info"),
        subdomain_consent_sharing: __$2("Subdomain consent sharing", "cookie-law-info"),
        multi_user_management: __$2("Multi-user management", "cookie-law-info"),
        gcm_support: __$2("Support for Google Consent Mode (GCM) v2", "cookie-law-info"),
        policy_generators: __$2("Cookie/Privacy Policy Generators", "cookie-law-info"),
        renew_user_consent: __$2("Renew user consents", "cookie-law-info"),
        do_not_track_support: __$2("Do Not Track (DNT) support", "cookie-law-info"),
        "2fa": __$2("Two-factor authentication (2FA)", "cookie-law-info"),
        automatic_cookie_blocking: __$2("Automatic cookie blocking", "cookie-law-info"),
        language_limit: __$2("Multilingual banner", "cookie-law-info"),
        unlimited_scans: __$2("<b>Unlimited</b>&nbsp;cookie scans", "cookie-law-info"),
        scans_per_month: __$2("&nbsp;cookie scans / month", "cookie-law-info"),
        chat_support: __$2("Chat support", "cookie-law-info"),
        opt_in_banner_for_gdpr: __$2("Opt-in consent banner for GDPR", "cookie-law-info"),
        opt_out_banner_for_us_state_laws: __$2("Opt-out banner for US State laws", "cookie-law-info"),
        per_category_consent: __$2("Per-category consent", "cookie-law-info"),
        revisit_consent: __$2("Revisit consent button", "cookie-law-info"),
        advanced_customisation: __$2("Advanced customisation", "cookie-law-info"),
        basic_customisation: __$2("Basic customisation", "cookie-law-info")
      }),
      []
    );
    const formattedOveragePrice = reactExports.useMemo(() => {
      if (!(planDetails == null ? void 0 : planDetails.overage_price)) return "0.30";
      return (planDetails.overage_price[selected.toLowerCase()] / 100).toFixed(2);
    }, [planDetails, selected]);
    const formattedOverageText = reactExports.useMemo(
      () => sprintf$2(
        __$2(
          /* translators: %1$s: Currency symbol. %2$s: Price per 1,000 extra pageviews. */
          "+ %1$s%2$s per 1,000 extra pageviews*",
          "cookie-law-info"
        ),
        symbol,
        formattedOveragePrice
      ),
      [symbol, formattedOveragePrice]
    );
    const formattedOverageNote = reactExports.useMemo(
      () => sprintf$2(
        __$2(
          /* translators: %s: Release date when extra pageviews became automatically enabled. */
          "*Extra pageviews are automatically enabled for users who created their CookieYes account on or after %s. Users who created their account before this date can enable it anytime from Billing & Invoices. ",
          "cookie-law-info"
        ),
        OVERAGE_RELEASE_FORMATTED
      ),
      []
    );
    const goBack = reactExports.useCallback(() => {
      if (typeof window !== "undefined" && window.history.length > 1) {
        window.history.back();
      } else {
        navigate({ to: "/dashboard" });
      }
    }, [navigate]);
    const getCurrencyData = /* @__PURE__ */ __name(() => __async(null, null, function* () {
      try {
        const response = yield ckyRest.get({
          path: "dashboard/currencies"
        });
        if (response && Array.isArray(response) && response.length > 0) {
          setCurrencies(response);
        } else {
          updateStatus(false);
        }
      } catch (e) {
        console.error(e);
      }
      setLoaded(true);
    }), "getCurrencyData");
    const getPlanData = /* @__PURE__ */ __name(() => __async(null, null, function* () {
      setLoading(true);
      try {
        const response = yield ckyRest.get({
          path: "dashboard/plans"
        });
        if (response && Object.keys(response).length > 0) {
          setPlanDetails(response);
        } else {
          updateStatus(false);
          setLoading(false);
          return;
        }
      } catch (e) {
        console.error(e);
      }
      setLoading(false);
    }), "getPlanData");
    reactExports.useEffect(() => {
      void getPlanData();
      void getCurrencyData();
    }, []);
    reactExports.useEffect(() => {
      return () => updateStatus();
    }, [updateStatus]);
    reactExports.useEffect(() => {
      const syncAvailable = /* @__PURE__ */ __name(() => {
        const fromLocation = normalizeAvailable(getAvailableFromLocation());
        const fromRouter = normalizeAvailable(
          typeof availableParam === "string" ? availableParam : null
        );
        setAvailable(fromLocation !== "all" ? fromLocation : fromRouter);
      }, "syncAvailable");
      syncAvailable();
      if (typeof window === "undefined") return;
      window.addEventListener("hashchange", syncAvailable);
      window.addEventListener("popstate", syncAvailable);
      return () => {
        window.removeEventListener("hashchange", syncAvailable);
        window.removeEventListener("popstate", syncAvailable);
      };
    }, [availableParam]);
    reactExports.useEffect(() => {
      const currency = currencies.find((item) => item.code === selected);
      if (currency) {
        setSymbol(currency.symbol);
      }
    }, [selected, currencies]);
    const getPopperFeatures = reactExports.useCallback(
      (planSlug) => {
        const pricePart = (planDetails == null ? void 0 : planDetails.overage_price) ? (planDetails.overage_price[selected.toLowerCase()] / 100).toFixed(2) : "0.30";
        const pageViewPopper = planSlug === "basic" || planSlug === "pro" ? PAGE_LIMIT_LONG.replace("[OVERAGE_PRICE]", symbol + pricePart) : __$2(
          "A pageview is every instance that a page on a website with CookieYes code is loaded or reloaded.",
          "cookie-law-info"
        );
        return {
          staging_mode: __$2(
            "Allows you to add your staging site URL to the main site, enabling you to set up and test the cookie banner in your staging environment.",
            "cookie-law-info"
          ),
          automatic_cookie_blocking: __$2(
            "Automatically scan, detect and block third-party cookie scripts until your site visitors give consent.",
            "cookie-law-info"
          ),
          scan_behind_login: __$2(
            `To scan your web page behind a login or a cookie wall, <a href="https://www.cookieyes.com/support" target="_blank">contact us</a> and provide your <b>login URL</b> along with the <b>test login credentials</b>. This will enable us to configure our scanner to scan behind your login pages.`,
            "cookie-law-info"
          ),
          gacm_support: __$2(
            `Google's Additional Consent (AC) Mode allows the collection of consents for Google's Ad Technology Providers (ATPs) that are not yet registered on the IAB Europe Global Vendor List (GVL). <b>AC Mode is intended only for use alongside IAB TCF.</b>`,
            "cookie-law-info"
          ),
          remove_powered_by: __$2("Remove CookieYes logo from your cookie banner.", "cookie-law-info"),
          custom_css: __$2("Add CSS code and customise the way your cookie banner looks.", "cookie-law-info"),
          config_geo_rules: __$2(
            "Geo-target your cookie banner and display it as per your visitor's location.",
            "cookie-law-info"
          ),
          static_ip_scan: __$2(
            `If your website's firewall or configuration restricts external access, enable static IP scan for your site, ensuring that the scan requests consistently originate from the same IP. Additionally, <a href="https://www.cookieyes.com/documentation/whitelisting-cookieyes-scanner/" target="_blank">whitelist the static IP addresses</a> of the CookieYes scanner.`,
            "cookie-law-info"
          ),
          revisit_custom_branding: __$2(
            "Replace the default icon of the revisit consent button with your custom icon.",
            "cookie-law-info"
          ),
          revisit_consent: __$2(
            "Displays a floating button on your website allowing your visitors to withdraw or change their consent at any time.",
            "cookie-law-info"
          ),
          respect_gpc: __$2(
            "Global Privacy Control (GPC) is a web standard (necessary for CCPA/CPRA compliance) that allows users to signal to websites that they do not want their data to be collected or shared. If enabled, CookieYes will respect your user's GPC setting.",
            "cookie-law-info"
          ),
          renew_user_consent: __$2(
            "This action will trigger the cookie banner to reappear for all existing users who have already given consent.",
            "cookie-law-info"
          ),
          subdomain_consent_sharing: __$2(
            "Allows you to share your visitor consent information among different subdomains of your website.",
            "cookie-law-info"
          ),
          do_not_track_support: __$2(
            "DNT is a web browser setting that enables you to opt-out of tracking by websites. CookieYes will respect your visitor's DNT setting.",
            "cookie-law-info"
          ),
          page_view_limit: pageViewPopper,
          pages_per_scan: __$2(
            "The number of pages of your website that will be scanned.",
            "cookie-law-info"
          )
        };
      },
      [planDetails, selected, symbol]
    );
    const getContent = reactExports.useCallback(
      (key, value) => {
        let v = value;
        if (typeof v === "object" && v !== null && "value" in v) {
          v = v.value;
        }
        if (key === "pages_per_scan") {
          return `<b>${v}</b>${contents.pages_per_scan}`;
        }
        if (key === "page_view_limit") {
          if (v === 0) {
            return contents.unlimited_pageviews;
          }
          return `<b>${Number(v).toLocaleString("en-US")}</b>${contents.pageview_per_month}`;
        }
        if (key === "language_limit") {
          if (v !== 1) {
            return contents.language_limit;
          }
          return void 0;
        }
        if (key === "scans_per_month") {
          if (Number(v) > 0) {
            return `<b>${String(v)}</b>${contents.scans_per_month}`;
          }
          return contents.unlimited_scans;
        }
        return contents[key];
      },
      [contents]
    );
    const getFeatures = reactExports.useCallback(
      (planSlug) => {
        if (!planDetails) return {};
        const features = __spreadValues({}, planDetails.plan[planSlug].features);
        const popperFeaturesRecord = getPopperFeatures(planSlug);
        const modifiedFeatures = {};
        for (const [key, value] of Object.entries(features)) {
          if (typeof value === "object" && value !== null && value.value === false || value === false || getContent(key, value) === void 0) {
            if (key !== "advanced_customisation") {
              continue;
            }
          }
          if (key === "advanced_customisation" && value === false) {
            modifiedFeatures.basic_customisation = { value: true };
            continue;
          }
          if (key in popperFeaturesRecord) {
            modifiedFeatures[key] = {
              value,
              showPopper: true,
              popperContent: popperFeaturesRecord[key]
            };
            continue;
          }
          modifiedFeatures[key] = value;
        }
        return modifiedFeatures;
      },
      [planDetails, getContent, getPopperFeatures]
    );
    const allFeatures = reactExports.useCallback(
      (plan) => {
        const features = getFeatures(plan);
        return Object.fromEntries(
          Object.entries(features).filter(([key]) => !USAGE_KEYS.includes(key))
        );
      },
      [getFeatures]
    );
    const getHeading = /* @__PURE__ */ __name((plan) => {
      switch (plan) {
        case "free":
          return __$2("Key features in Free", "cookie-law-info");
        case "basic":
          if (!plans.some((p2) => p2.slug === "free")) {
            return __$2("Key features in Basic", "cookie-law-info");
          }
          return __$2("Everything in Free, plus", "cookie-law-info");
        case "pro":
          if (!plans.some((p2) => p2.slug === "basic")) {
            return __$2("Key features in Pro", "cookie-law-info");
          }
          return __$2("Everything in Basic, plus", "cookie-law-info");
        case "ultimate":
          if (!plans.some((p2) => p2.slug === "pro")) {
            return __$2("Key features in Ultimate", "cookie-law-info");
          }
          return __$2("Everything in Pro, plus", "cookie-law-info");
        default:
          return "";
      }
    }, "getHeading");
    const getPrice = /* @__PURE__ */ __name((plan) => {
      if (!planDetails) return "0";
      if (!showMonthly) {
        return planDetails.plan[plan].yearly[selected].toString();
      }
      return planDetails.plan[plan].monthly[selected].toString();
    }, "getPrice");
    const connectToWebapp = /* @__PURE__ */ __name((plan) => {
      const paidPlans = ["basic", "pro", "ultimate"];
      if (plan === "free") {
        connectToApp();
      } else if (paidPlans.includes(plan)) {
        const planSlug = showMonthly ? `${plan}-monthly` : `${plan}-yearly`;
        connectToPaidPlan(planSlug, selected);
      }
    }, "connectToWebapp");
    const usageFeatures = /* @__PURE__ */ __name((plan) => {
      return Object.fromEntries(
        Object.entries(getFeatures(plan)).filter(([key]) => USAGE_KEYS.includes(key))
      );
    }, "usageFeatures");
    const allPlans = reactExports.useMemo(
      () => [
        {
          slug: "free",
          name: "Free",
          description: __$2("For blogs and personal websites", "cookie-law-info")
        },
        {
          slug: "basic",
          name: "Basic",
          description: __$2("For small business and startups", "cookie-law-info")
        },
        {
          slug: "pro",
          name: "Pro",
          description: __$2("For medium business with growing traffic", "cookie-law-info")
        },
        {
          slug: "ultimate",
          name: "Ultimate",
          description: __$2("For large business with high traffic", "cookie-law-info")
        }
      ],
      []
    );
    const plans = reactExports.useMemo(() => {
      switch (available) {
        case "premium":
          return allPlans.slice(1);
        case "pro":
          return allPlans.slice(2);
        case "ultimate":
          return allPlans.slice(3);
        case "all":
        default:
          return allPlans;
      }
    }, [available, allPlans]);
    const planFeatures = reactExports.useMemo(() => {
      const featuresByPlan = {};
      let cumulativeFeatures = {};
      plans.forEach((plan) => {
        const pf = allFeatures(plan.slug);
        const uniqueFeatures = Object.fromEntries(
          Object.entries(pf).filter(([key]) => !(key in cumulativeFeatures))
        );
        featuresByPlan[plan.slug] = uniqueFeatures;
        cumulativeFeatures = __spreadValues(__spreadValues({}, cumulativeFeatures), pf);
      });
      return featuresByPlan;
    }, [plans, allFeatures]);
    const planFeatureArrays = reactExports.useMemo(
      () => Object.fromEntries(
        Object.keys(planFeatures).map((planSlug) => [planSlug, Object.entries(planFeatures[planSlug])])
      ),
      [planFeatures]
    );
    const planCount = plans.length;
    const cardLoader = Boolean(!info || loading);
    const showPlanGrid = Boolean(planDetails && !cardLoader);
    const gridCols = planGridColsClass(planCount);
    const featureRow = "cky:flex cky:items-start cky:gap-2 cky:text-[13px] cky:font-normal cky:leading-[18px] cky:text-[#4E4B66]";
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:box-border cky:mt-[30px] cky:!p-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mx-auto cky:w-full", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:-mx-[15px] cky:flex cky:flex-wrap", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:box-border cky:min-h-px cky:flex-[0_0_100%] cky:max-w-full cky:px-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyConnectSuccess, {}) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:-mx-[15px] cky:flex cky:flex-wrap", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:box-border cky:min-h-px cky:flex cky:flex-[0_0_8.333333%] cky:max-w-[8.333333%] cky:shrink-0 cky:justify-end cky:!p-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Button,
          {
            type: "button",
            variant: "ghost",
            className: "cky:fixed cky:w-10 cky:rounded-[12px] cky:border cky:border-[#D9DBE9] cky:bg-[#F4F5FA] cky:p-1 cky:text-[#4E4B66] cky:hover:bg-[#F4F5FA]",
            onClick: goBack,
            "aria-label": "Go back",
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              "span",
              {
                className: "cky:inline-flex cky:shrink-0 cky:leading-none cky:text-[#4E4B66] cky:[&>svg]:block cky:[&>svg]:h-8 cky:[&>svg]:w-8",
                dangerouslySetInnerHTML: { __html: arrowBackSvg },
                "aria-hidden": true
              }
            )
          }
        ) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:box-border cky:min-h-px cky:min-w-0 cky:flex-[0_0_83.333333%] cky:max-w-[83.333333%] cky:shrink-0 cky:px-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:min-w-0 cky:w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { className: "cky:rounded-[9px]!", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardContent, { className: "cky:min-h-0! cky:p-7!", children: cardLoader ? /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:pt-6" }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-section-plans cky-section-row cky:flex cky:w-full cky:flex-col cky:items-start cky:gap-4 cky:md:flex-row! cky:md:flex-nowrap! cky:md:gap-x-0", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "cky-plans-heading cky:m-0! cky:min-w-0 cky:shrink cky:text-xl! cky:font-semibold cky:leading-[30px] cky:text-[#14142a] cky:md:min-w-0", children: __$2("Create a new account and connect to web app", "cookie-law-info") }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky-button-group cky:inline-flex cky:min-h-[34px] cky:min-w-[170px] cky:shrink-0 cky:self-end cky:rounded-lg cky:border cky:border-[#BEBFC5] cky:bg-white cky:md:ml-auto! cky:md:self-end cky:md:mr-[26px]", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                Button,
                {
                  type: "button",
                  variant: showMonthly ? "toggleActive" : "toggle",
                  size: "toggle",
                  className: "cky:!rounded-l-lg cky:!rounded-r-none",
                  onClick: /* @__PURE__ */ __name(() => setShowMonthly(true), "onClick"),
                  children: __$2("Monthly", "cookie-law-info")
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                Button,
                {
                  type: "button",
                  variant: !showMonthly ? "toggleActive" : "toggle",
                  size: "toggle",
                  className: "cky:relative cky:!rounded-r-lg cky:!rounded-l-none",
                  onClick: /* @__PURE__ */ __name(() => setShowMonthly(false), "onClick"),
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "div",
                      {
                        className: cn$1(
                          "cky:pointer-events-none cky:absolute cky:bottom-10 cky:left-1/2 cky:z-[1] cky:box-border cky:flex cky:w-full cky:max-h-5 cky:min-w-0 cky:-translate-x-1/2 cky:items-center cky:justify-center cky:rounded cky:bg-[#2DAD70] cky:text-[11px] cky:font-medium cky:leading-4 cky:text-white",
                          "cky:after:absolute cky:after:left-1/2 cky:after:top-[12px] cky:after:z-0 cky:after:w-0 cky:after:-translate-x-1/2 cky:after:border-l-8 cky:after:border-r-8 cky:after:border-t-[10px] cky:after:border-l-transparent cky:after:border-r-transparent cky:after:border-t-[#2DAD70] cky:after:content-['']"
                        ),
                        children: __$2("2 months free", "cookie-law-info")
                      }
                    ),
                    __$2("Annually", "cookie-law-info")
                  ]
                }
              )
            ] }),
            loaded && currencies.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky-currency cky:min-w-[82px] cky:shrink-0 cky:self-end", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: selected, onValueChange: setSelected, children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                SelectTrigger,
                {
                  variant: "currency",
                  className: "cky:w-auto! cky:min-w-[82px]! cky:shrink-0! cky:bg-white! cky:text-sm! cky:text-[#14142a]!",
                  "aria-label": __$2("Currency", "cookie-law-info"),
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: selected })
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(SelectContent, { children: currencies.map((c2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectItem, { value: c2.code, children: [
                c2.symbol,
                " ",
                c2.code
              ] }, c2.code)) })
            ] }) }) : null
          ] }),
          showPlanGrid ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn$1("cky:grid! cky:gap-[15px]! cky:pt-4!", gridCols), children: plans.map((plan) => {
            const usageFeats = usageFeatures(plan.slug);
            const planFeats = planFeatureArrays[plan.slug] || [];
            return /* @__PURE__ */ jsxRuntimeExports.jsxs(
              "div",
              {
                className: cn$1(
                  "cky:flex! cky:rounded-[6px]! cky:border! cky:border-[#D9DBE9]! cky:bg-[#F4F5FA]!",
                  planCount === 1 ? "cky:flex-col! cky:gap-6! cky:p-6!" : "cky:flex-col! cky:py-5! cky:px-[15px]!",
                  planCount === 2 && "cky:md:p-6!"
                ),
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:w-full cky:flex-col cky:min-w-0", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:w-full cky:items-baseline", children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "cky:m-0! cky:text-[18px] cky:font-bold cky:leading-[27px] cky:text-[#14142a]", children: plan.name }),
                      plan.slug === "pro" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
                        "div",
                        {
                          className: cn$1(
                            "cky:inline-flex cky:items-center cky:gap-1 cky:rounded cky:bg-[#1578F7] cky:px-[6px] cky:py-[2px]",
                            planCount === 2 ? "cky:ml-[17px]" : "cky:ml-auto"
                          ),
                          children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.starPopular, alt: "", className: "cky:h-[17px] cky:w-4" }),
                            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:m-0! cky:text-[13px] cky:font-bold cky:leading-[18px] cky:text-white", children: __$2("POPULAR", "cookie-law-info") })
                          ]
                        }
                      ) : null
                    ] }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      "p",
                      {
                        className: cn$1(
                          "cky:m-0! cky:text-[13px] cky:font-normal cky:leading-[18px] cky:text-[#4e4b66]",
                          planCount === 4 && "cky:max-w-[17ch] cky:pb-5",
                          planCount === 3 && "cky:max-w-none cky:pb-5",
                          planCount === 2 && "cky:max-w-none cky:pb-5",
                          planCount === 1 && "cky:max-w-none cky:pb-6"
                        ),
                        children: plan.description
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:w-full cky:items-baseline", children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx(
                        "h1",
                        {
                          className: "cky:m-0! cky:pr-[6px] cky:font-bold cky:leading-[30px] cky:text-[#14142A]",
                          style: { fontSize: "32px" },
                          children: plan.slug === "free" ? symbol + "0" : symbol + getPrice(plan.slug)
                        }
                      ),
                      plan.slug === "free" ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:m-0! cky:text-[13px] cky:font-normal cky:leading-[18px] cky:text-[#6E7191]", children: __$2("Free forever", "cookie-law-info") }) : showMonthly ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:m-0! cky:text-[13px] cky:font-normal cky:leading-[18px] cky:text-[#6E7191]", children: contents.showMonthly }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:m-0! cky:text-[13px] cky:font-normal cky:leading-[18px] cky:text-[#6E7191]", children: contents.showYearly })
                    ] }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      Button,
                      {
                        type: "button",
                        variant: "default",
                        className: cn$1(
                          "cky:mt-4! cky:w-full! cky:border-none! cky:text-center!",
                          // Vue .cky-info-items-1 / .cky-info-items-2 .cky-button: max-width 140px
                          (planCount === 1 || planCount === 2) && "cky:max-w-[140px]!"
                        ),
                        onClick: /* @__PURE__ */ __name(() => connectToWebapp(plan.slug), "onClick"),
                        children: plan.slug === "free" ? __$2("Get started", "cookie-law-info") : __$2("Start free trial", "cookie-law-info")
                      }
                    )
                  ] }),
                  /* @__PURE__ */ jsxRuntimeExports.jsxs(
                    "div",
                    {
                      className: cn$1(
                        "cky:w-full cky:min-w-0 cky:text-[13px] cky:text-[#4E4B66]",
                        planCount === 1 ? "cky:mt-0" : "cky:mt-2",
                        planCount === 2 && "cky:md:max-w-none"
                      ),
                      children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:mb-2 cky:m-0 cky:text-[13px] cky:font-bold cky:leading-[18px]", children: __$2("Usage", "cookie-law-info") }),
                        /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "cky:m-0! cky:mb-5! cky:flex cky:list-none! cky:flex-col cky:gap-2 cky:p-0! cky:pl-0!", children: Object.entries(usageFeats).map(([key, feature]) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: featureRow, children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "cky:mt-0.5 cky:h-4 cky:w-4 cky:flex-shrink-0 cky:text-[#1578F7]", strokeWidth: 2, "aria-hidden": true }),
                          /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "cky:min-w-0 cky:flex-1", children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsx(
                              FeatureLineContent,
                              {
                                content: getContent(key, feature) || "",
                                feature,
                                renderHtml: true
                              }
                            ),
                            shouldShowOverageText(plan.slug, key) ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
                              /* @__PURE__ */ jsxRuntimeExports.jsx("small", { className: "cky:-ml-5 cky:block cky:text-xs cky:italic cky:text-[#4E4B66]", children: formattedOverageText })
                            ] }) : null
                          ] })
                        ] }, key)) }),
                        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:mb-2 cky:m-0 cky:text-[13px] cky:font-bold cky:leading-[18px]", children: getHeading(plan.slug) }),
                        /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "cky:m-0! cky:flex cky:list-none! cky:flex-col cky:gap-2 cky:p-0! cky:pl-0!", children: [
                          planFeats.slice(0, 4).map(([key, feature]) => {
                            var _a2;
                            return /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: featureRow, children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "cky:mt-0.5 cky:h-4 cky:w-4 cky:flex-shrink-0 cky:text-[#1578F7]", strokeWidth: 2, "aria-hidden": true }),
                              /* @__PURE__ */ jsxRuntimeExports.jsx(
                                FeatureLineContent,
                                {
                                  content: String((_a2 = getContent(key, feature)) != null ? _a2 : ""),
                                  feature,
                                  renderHtml: false
                                }
                              )
                            ] }, key);
                          }),
                          planFeats.slice(4).map(([key, feature]) => {
                            var _a2;
                            return /* @__PURE__ */ jsxRuntimeExports.jsxs(
                              "li",
                              {
                                className: cn$1(featureRow, !toggleSettings && "cky:hidden"),
                                children: [
                                  /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "cky:mt-0.5 cky:h-4 cky:w-4 cky:flex-shrink-0 cky:text-[#1578F7]", strokeWidth: 2, "aria-hidden": true }),
                                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                                    FeatureLineContent,
                                    {
                                      content: String((_a2 = getContent(key, feature)) != null ? _a2 : ""),
                                      feature,
                                      renderHtml: false
                                    }
                                  )
                                ]
                              },
                              key
                            );
                          })
                        ] })
                      ]
                    }
                  )
                ]
              },
              plan.slug
            );
          }) }) : null,
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mb-[15px] cky:pt-[15px] cky:text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
            Button,
            {
              type: "button",
              variant: "link",
              className: "cky:inline-flex cky:h-auto cky:items-center cky:gap-2.5 cky:border-none! cky:hover:border-transparent! cky:p-0 cky:text-base cky:leading-6 cky:font-normal cky:text-[#136fe8] cky:hover:text-[#136fe8]",
              onClick: /* @__PURE__ */ __name(() => setToggleSettings(!toggleSettings), "onClick"),
              children: [
                toggleSettings ? __$2("See less", "cookie-law-info") : __$2("See all benefits", "cookie-law-info"),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  ChevronDown,
                  {
                    className: cn$1(
                      "cky:h-5 cky:w-5 cky:shrink-0 cky:text-[#136fe8] cky:transition-transform cky:duration-300",
                      toggleSettings && "cky:rotate-180"
                    ),
                    strokeWidth: 2.25
                  }
                )
              ]
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("hr", { className: "cky:my-[15px] cky:border-[#E9E9EB]" }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:w-full cky:items-center cky:justify-center cky:gap-1", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.checkFill, alt: "", className: "cky:h-5 cky:w-5" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:m-0 cky:text-[13px] cky:font-semibold cky:leading-[18px] cky:text-[#4e4b66]", children: __$2("15-day money-back guarantee", "cookie-law-info") })
          ] })
        ] }) }) }) }) }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:-mx-[15px] cky:flex cky:flex-wrap", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:box-border cky:min-h-px cky:flex-[0_0_100%] cky:max-w-full cky:px-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "cky:mt-[12px] cky:block cky:ml-[86px] cky:mr-[120px] cky:text-[13px] cky:leading-[18px] cky:!text-[#4e4b66]", children: [
        formattedOverageNote,
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "a",
          {
            className: "cky-external-link",
            href: "https://www.cookieyes.com/documentation/pageview-pricing/#:~:text=includes%20unlimited%20pageviews.-,Who%20gets%20extra%20pageviews%20enabled%20by%20default%3F,-Extra%20pageviews%20lets",
            target: "_blank",
            rel: "noreferrer",
            children: __$2("Learn more", "cookie-law-info")
          }
        )
      ] }) }) })
    ] }) });
  }
  __name(Plans, "Plans");
  const CkyPolicyCard = /* @__PURE__ */ __name(({ card, onButtonClick }) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: "cky:flex cky:w-[400px] cky:flex-col cky:gap-8 cky:rounded-lg cky:border-gray-200 cky:bg-white cky:pt-8 cky:px-8 cky:pb-10 cky:shadow-sm", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-3 cky:w-[336px]", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:items-start cky:gap-5 cky:w-[336px]", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:items-center cky:justify-start cky:w-14 cky:h-14 cky:overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: card.icon, width: "56px", height: "56px", className: "cky:block cky:flex-shrink-0" }) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:flex-col cky:items-start cky:gap-3 cky:w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "cky:font-semibold cky:text-[18px] cky:leading-6 cky:text-primary cky:text-left cky:w-fit cky:m-0! cky:p-0! cky:border-0 cky:tracking-normal", children: card.title }) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-6 cky:w-[336px]", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:m-0! cky:my-0! cky:text-[14px]! cky:leading-5 cky:text-[#14142A] cky:w-[336px]", children: card.description }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "cky:list-none cky:p-0 cky:m-0 cky:flex cky:flex-col cky:gap-2 cky:w-[336px] cky:h-fit", children: card.features.map((feature) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { className: "cky:flex cky:items-center cky:w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-row cky:items-center cky:gap-2", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:flex-shrink-0 cky:w-4 cky:h-4 cky:flex cky:items-center cky:justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              "img",
              {
                src: assets.check,
                alt: "",
                className: "cky:w-4 cky:h-4 cky:block",
                "aria-hidden": "true"
              }
            ) }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:text-sm cky:leading-5 cky:text-[#14142A] cky:tracking-normal", children: feature })
          ] }) }, `${card.id}-${feature}`)) })
        ] })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(CardFooter, { className: "cky:w-full cky:px-0 cky:pt-0 cky:pb-0 cky:border-none cky:bg-transparent", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:flex-row cky:items-center cky:gap-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: onButtonClick, className: "cky:w-[248px] cky:text-[14px]!", children: card.buttonText }) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyConnectModal,
        {
          ref: card.modalRef,
          availablePlan: "all",
          title: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: card.modalTitleImage, alt: card.modalTitleAlt }),
          featureText: card.modalDescription,
          availabilityText: __$2("Available in: <b>All plans</b>", "cookie-law-info")
        }
      )
    ] });
  }, "CkyPolicyCard");
  const PolicyGenerator = /* @__PURE__ */ __name(() => {
    const ckyPrivacyPolicyModalRef = reactExports.useRef(null);
    const ckyCookiePolicyModalRef = reactExports.useRef(null);
    const ckyPrivacyPolicyFeatures = [
      __$2("Answer a simple questionnaire", "cookie-law-info"),
      __$2("Generate policy in minutes", "cookie-law-info"),
      __$2("Copy as text/HTML", "cookie-law-info"),
      __$2("Customise as required", "cookie-law-info")
    ];
    const ckyCookiePolicyFeatures = [
      __$2("Instantly generate custom policy", "cookie-law-info"),
      __$2("Auto-updating cookie list", "cookie-law-info"),
      __$2("Copy as text/HTML", "cookie-law-info"),
      __$2("Customise as required", "cookie-law-info")
    ];
    const ckyShowPrivacyPolicy = /* @__PURE__ */ __name(() => {
      if (ckyPrivacyPolicyModalRef.current) {
        ckyPrivacyPolicyModalRef.current.show();
      }
    }, "ckyShowPrivacyPolicy");
    const ckyShowCookiePolicy = /* @__PURE__ */ __name(() => {
      if (ckyCookiePolicyModalRef.current) {
        ckyCookiePolicyModalRef.current.show();
      }
    }, "ckyShowCookiePolicy");
    const ckyPolicyCards = [
      {
        id: "privacy-policy",
        icon: "privacy-policy",
        title: __$2("Privacy Policy Generator", "cookie-law-info"),
        description: __$2(
          "Create a privacy policy to inform users about the data collection practices of your website.",
          "cookie-law-info"
        ),
        features: ckyPrivacyPolicyFeatures,
        modalRef: ckyPrivacyPolicyModalRef,
        modalTitleImage: assets.privacyPolicy,
        modalTitleAlt: __$2("Privacy Policy Generator", "cookie-law-info"),
        modalDescription: __$2("Generate a custom privacy policy for your site in just minutes", "cookie-law-info"),
        buttonText: __$2("Connect to Web App to Generate", "cookie-law-info")
      },
      {
        id: "cookie-policy",
        icon: "cookie-policy",
        title: __$2("Cookie Policy Generator", "cookie-law-info"),
        description: __$2(
          "Generate a custom cookie policy and inform users about your site's use of cookies.",
          "cookie-law-info"
        ),
        features: ckyCookiePolicyFeatures,
        modalRef: ckyCookiePolicyModalRef,
        modalTitleImage: assets.cookiePolicy,
        modalTitleAlt: __$2("Cookie Policy Generator", "cookie-law-info"),
        modalDescription: __$2("Generate an auto-updating cookie policy for your website", "cookie-law-info"),
        buttonText: __$2("Connect to Web App to Generate", "cookie-law-info")
      }
    ];
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:p-0! cky:m-0!", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:flex-col cky:items-start", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:w-full cky:px-[8px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:flex-row cky:pt-[30px] cky:gap-10", children: ckyPolicyCards.map((card) => /* @__PURE__ */ jsxRuntimeExports.jsx(
      CkyPolicyCard,
      {
        card,
        onButtonClick: card.id === "privacy-policy" ? ckyShowPrivacyPolicy : ckyShowCookiePolicy
      },
      card.id
    )) }) }) }) });
  }, "PolicyGenerator");
  const BTN_DISCONNECT = __$1("Disconnect", "cookie-law-info");
  function openUrlInNewTabViaAnchor(url) {
    try {
      const a2 = document.createElement("a");
      a2.target = "_blank";
      a2.href = url;
      a2.rel = "noopener noreferrer";
      document.body.appendChild(a2);
      a2.click();
      document.body.removeChild(a2);
    } catch (error) {
      console.error("Error redirecting to app:", error);
    }
  }
  __name(openUrlInNewTabViaAnchor, "openUrlInNewTabViaAnchor");
  function SiteSettings() {
    const [isDisconnectModalOpen, setIsDisconnectModalOpen] = reactExports.useState(false);
    const [isDisconnecting, setIsDisconnecting] = reactExports.useState(false);
    const [showDisconnectSuccess, setShowDisconnectSuccess] = reactExports.useState(false);
    const { options: options2, info, session_status, updateSettings, updateSessionStatus } = useAppStore(
      useShallow((s2) => ({
        options: s2.options,
        info: s2.info,
        session_status: s2.session_status,
        updateSettings: s2.updateSettings,
        updateSessionStatus: s2.updateSessionStatus
      }))
    );
    const setDisconnectSuccessOverlay = useAppStore((s2) => s2.setDisconnectSuccessOverlay);
    const { triggerNotification } = useGlobalUtilities();
    const account = reactExports.useMemo(
      () => (options2 == null ? void 0 : options2.account) || getOption("account") || { connected: false },
      [options2 == null ? void 0 : options2.account]
    );
    const { userInfo, plan, website } = reactExports.useMemo(() => {
      const slice = info && typeof info === "object" ? info : void 0;
      return {
        userInfo: getInfo("user") || (slice == null ? void 0 : slice.user),
        plan: getInfo("plan") || (slice == null ? void 0 : slice.plan) || { name: "Free" },
        website: getInfo("website") || (slice == null ? void 0 : slice.website) || {}
      };
    }, [info]);
    const user = reactExports.useMemo(
      () => userInfo || { email: (account == null ? void 0 : account.email) || "" },
      [userInfo, account == null ? void 0 : account.email]
    );
    const isTrial = (website == null ? void 0 : website.is_trial) || false;
    const connected = (account == null ? void 0 : account.connected) || false;
    const sessionStatus = session_status;
    const openModal = reactExports.useCallback(() => setIsDisconnectModalOpen(true), []);
    const closeModal = reactExports.useCallback(() => setIsDisconnectModalOpen(false), []);
    const disconnectApp = reactExports.useCallback(() => __async(null, null, function* () {
      setIsDisconnecting(true);
      try {
        yield ckyRest.post({ path: "/settings/disconnect" });
        const current = getOption("account") || {};
        const accountData = __spreadProps(__spreadValues({}, current), {
          connected: false,
          email: "",
          plan: "free",
          website_id: "",
          website_key: ""
        });
        setOption("account", accountData);
        setDisconnectSuccessOverlay(true);
        closeModal();
        setIsDisconnecting(false);
        setShowDisconnectSuccess(true);
        yield saveOptions();
        useAppStore.getState().checkURLMismatch();
        updateSessionStatus(true);
        const latestOptions = useAppStore.getState().options;
        updateSettings(__spreadProps(__spreadValues({}, latestOptions), { account: accountData }));
      } catch (error) {
        console.error("Error disconnecting:", error);
        triggerNotification({
          type: "error",
          message: __$1("Failed to disconnect. Please try again.", "cookie-law-info")
        });
        setIsDisconnecting(false);
      }
    }), [closeModal, updateSessionStatus, updateSettings, triggerNotification, setDisconnectSuccessOverlay]);
    const handleDisconnectComplete = reactExports.useCallback(() => {
      useAppStore.getState().setDisconnectSuccessOverlay(false);
      window.location.hash = "#/dashboard";
      window.location.reload();
    }, []);
    const redirectToApp2 = reactExports.useCallback((path = "dashboard") => {
      var _a2, _b2, _c2;
      const acc = (_a2 = useAppStore.getState().options) == null ? void 0 : _a2.account;
      if (!(acc == null ? void 0 : acc.connected)) return false;
      const webAppUrl = ((_c2 = (_b2 = window.ckyGlobals) == null ? void 0 : _b2.webApp) == null ? void 0 : _c2.url) || "";
      if (!webAppUrl) return false;
      const base = `${webAppUrl}/${path}`;
      const url = `${base}?${new URLSearchParams({
        website: acc.website_id || ""
      }).toString()}`;
      openUrlInNewTabViaAnchor(url);
    }, []);
    const handleGoToWebApp = reactExports.useCallback(() => {
      redirectToApp2("dashboard");
    }, [redirectToApp2]);
    const sessionExpiredLogin = reactExports.useCallback(() => {
      var _a2, _b2, _c2, _d, _e2, _f;
      const webAppUrl = ((_b2 = (_a2 = window.ckyGlobals) == null ? void 0 : _a2.webApp) == null ? void 0 : _b2.loginUrl) || "";
      if (!webAppUrl) return;
      const url = new URL(webAppUrl);
      url.searchParams.append("platform", "wordpress");
      url.searchParams.append("mode", "reconnect");
      url.searchParams.append("website", ((_d = (_c2 = window.ckyGlobals) == null ? void 0 : _c2.site) == null ? void 0 : _d.url) || "");
      const websiteId = (_f = (_e2 = useAppStore.getState().options) == null ? void 0 : _e2.account) == null ? void 0 : _f.website_id;
      if (websiteId) {
        url.searchParams.append("website_id", websiteId);
      }
      try {
        window.open(url.toString(), "_blank", "noopener,noreferrer");
      } catch (e) {
        alert(
          __$1(
            "Your browser blocked the authorization window from opening. Please check your popup settings.",
            "cookie-law-info"
          )
        );
      }
    }, []);
    if (showDisconnectSuccess) {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyDisconnectSuccess, { show: true, onComplete: handleDisconnectComplete }) });
    }
    if (!connected) {
      return null;
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:pt-[30px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:bg-white cky:py-3 cky:px-5 cky:rounded-[3px] cky:border cky:border-gray-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:w-full cky:flex cky:flex-wrap cky:flex-col", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:w-full cky:items-center cky:justify-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:items-center", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "img",
              {
                src: assets.success,
                alt: "Success",
                className: "cky:w-4 cky:h-4 cky:mr-2 cky:inline-block"
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "cky:my-[0.5em]! cky:ml-1 cky:text-base!", children: __$1("Your website is connected to CookieYes", "cookie-law-info") })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:w-full cky:m-0! cky:text-sm!", children: __$1(
            "You can access all the plugin settings (Cookie Banner, Cookie Manager, Languages & Policy Generators) on the web app and unlock new features like Cookie Scan and Consent Log.",
            "cookie-law-info"
          ) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mt-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs(Label$1, { className: "cky:block cky:font-medium cky:mb-2", children: [
            __$1("Email", "cookie-law-info"),
            ":",
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:font-normal cky:ml-2", children: (user == null ? void 0 : user.email) || "" })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(Label$1, { className: "cky:block cky:font-medium cky:mb-2", children: [
            __$1("Site Key", "cookie-law-info"),
            ":",
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:font-normal cky:ml-2", children: (account == null ? void 0 : account.website_key) || "" })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(Label$1, { className: "cky:block cky:font-medium", children: [
            __$1("Plan", "cookie-law-info"),
            ":",
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:font-normal cky:ml-2", children: (plan == null ? void 0 : plan.name) || "Free" }),
            isTrial && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:ml-1", children: __$1("(Trial)", "cookie-law-info") })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:items-center cky-account-actions cky:mt-4", children: [
          sessionStatus ? /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { className: "cky-external-link", onClick: handleGoToWebApp, children: __$1("Go to Web App", "cookie-law-info") }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { className: "cky-external-link", onClick: sessionExpiredLogin, children: __$1("Log in to CookieYes", "cookie-law-info") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "dangerOutline", className: "cky:ml-4", onClick: openModal, children: BTN_DISCONNECT })
        ] })
      ] }) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: isDisconnectModalOpen, onOpenChange: setIsDisconnectModalOpen, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogContent, { className: "cky:max-w-[500px] cky:text-center cky:gap-0 cky:!rounded-[2px]", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:px-[30px] cky:py-5 cky:max-h-[calc(100vh-3.5rem)] cky:overflow-y-auto", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { className: "cky:m-0 cky:!text-lg cky:leading-[22px] cky:font-semibold cky:text-text-primary", children: __$1("Disconnect from CookieYes web app?", "cookie-law-info") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(DialogDescription, { className: "cky:mt-2 cky:!mb-0 cky:!text-sm cky:text-text-primary", children: __$1(
            "When you disconnect, your website will no longer be synced to your CookieYes account. You will be able to manage all your settings within WordPress. You can connect to your CookieYes account anytime later.",
            "cookie-law-info"
          ) })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogFooter, { className: "cky:flex cky:flex-row cky:!justify-center cky:gap-[10px] cky:pt-0 cky:px-[30px] cky:pb-5 cky:border-none", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "outline", onClick: closeModal, disabled: isDisconnecting, children: __$1("Cancel", "cookie-law-info") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "danger", onClick: disconnectApp, disabled: isDisconnecting, children: isDisconnecting ? __$1("Disconnecting...", "cookie-law-info") : BTN_DISCONNECT })
        ] })
      ] }) })
    ] });
  }
  __name(SiteSettings, "SiteSettings");
  const BANNER_CUSTOMIZE_TABS = [
    { id: "general", titleKey: "General", icon: "general" },
    { id: "layout", titleKey: "Layout", icon: "layout" },
    { id: "content", titleKey: "Content & Colours", icon: "note" },
    { id: "css", titleKey: "Custom CSS", icon: "css" }
  ];
  const BannerPanelDirtyContext = reactExports.createContext(
    null
  );
  function BannerCustomizeDirtyProvider({
    children,
    onPanelsDirtyChange
  }) {
    const [dirtyByPanel, setDirtyByPanel] = reactExports.useState({});
    const setPanelDirty = reactExports.useCallback((panelId, dirty) => {
      setDirtyByPanel((prev) => {
        if (prev[panelId] === dirty) return prev;
        return __spreadProps(__spreadValues({}, prev), { [panelId]: dirty });
      });
    }, []);
    const panelsDirty = reactExports.useMemo(
      () => Object.values(dirtyByPanel).some(Boolean),
      [dirtyByPanel]
    );
    reactExports.useEffect(() => {
      onPanelsDirtyChange(panelsDirty);
    }, [panelsDirty, onPanelsDirtyChange]);
    return /* @__PURE__ */ jsxRuntimeExports.jsx(BannerPanelDirtyContext.Provider, { value: setPanelDirty, children });
  }
  __name(BannerCustomizeDirtyProvider, "BannerCustomizeDirtyProvider");
  function useSetBannerCustomizePanelDirty() {
    const ctx2 = reactExports.useContext(BannerPanelDirtyContext);
    return reactExports.useCallback(
      (panelId, dirty) => {
        ctx2 == null ? void 0 : ctx2(panelId, dirty);
      },
      [ctx2]
    );
  }
  __name(useSetBannerCustomizePanelDirty, "useSetBannerCustomizePanelDirty");
  function useSyncBannerPanelDirty(panelId, dirty) {
    const setPanelDirty = useSetBannerCustomizePanelDirty();
    reactExports.useEffect(() => {
      setPanelDirty(panelId, dirty);
      return () => setPanelDirty(panelId, false);
    }, [panelId, dirty, setPanelDirty]);
  }
  __name(useSyncBannerPanelDirty, "useSyncBannerPanelDirty");
  const EMPTY_LAYOUT_PANEL_STATE = {
    bannerType: "box",
    position: "bottom-left",
    preferenceCenterType: "popup",
    sidebarPosition: "left",
    categoriesOnFirstLayer: false
  };
  function getBannerLayouts(law) {
    const all = [
      {
        type: "box",
        title: "Box",
        positions: ["bottom-left", "bottom-right", "top-left", "top-right"],
        default: "bottom-left",
        isPremium: false
      },
      {
        type: "classic",
        title: "Classic",
        positions: ["bottom", "top"],
        default: "bottom",
        isPremium: false
      },
      {
        type: "banner",
        title: "Banner",
        positions: ["bottom", "top"],
        default: "bottom",
        isPremium: false
      },
      {
        type: "popup",
        title: "Popup",
        positions: ["center"],
        default: "center",
        isPremium: true
      }
    ];
    return all.filter(
      (l) => (!["popup", "classic"].includes(l.type) || law !== "ccpa") && (l.type !== "classic" || law !== "gdpr")
    );
  }
  __name(getBannerLayouts, "getBannerLayouts");
  function getNoticeLayoutRowSelectedCardKey(bannerType) {
    return bannerType === "classic" ? "banner" : bannerType;
  }
  __name(getNoticeLayoutRowSelectedCardKey, "getNoticeLayoutRowSelectedCardKey");
  function getPositionLayoutKeyForFields(bannerType) {
    if (bannerType === "classic") return "banner";
    if (bannerType === "popup") return "popup";
    if (bannerType === "box") return "box";
    return "banner";
  }
  __name(getPositionLayoutKeyForFields, "getPositionLayoutKeyForFields");
  function getBannerLayoutPositionMeta(type) {
    switch (type) {
      case "box":
        return {
          positions: ["bottom-left", "bottom-right", "top-left", "top-right"],
          defaultPosition: "bottom-left"
        };
      case "classic":
      case "banner":
        return { positions: ["bottom", "top"], defaultPosition: "bottom" };
      case "popup":
        return { positions: ["center"], defaultPosition: "center" };
      default:
        return { positions: [], defaultPosition: "bottom-left" };
    }
  }
  __name(getBannerLayoutPositionMeta, "getBannerLayoutPositionMeta");
  function normalizeNoticeTypeForPushdownGate(type) {
    let t2 = type;
    if (t2.includes("-sidebar")) {
      t2 = t2.replace("-sidebar", "");
    }
    return t2;
  }
  __name(normalizeNoticeTypeForPushdownGate, "normalizeNoticeTypeForPushdownGate");
  function getEffectiveNoticeTypeForPushdownGate(state) {
    if (state.preferenceCenterType === "pushdown") return "classic";
    return String(state.bannerType);
  }
  __name(getEffectiveNoticeTypeForPushdownGate, "getEffectiveNoticeTypeForPushdownGate");
  function isPushdownPreferenceLayoutDisabled(state, persistedSettingsType) {
    if (persistedSettingsType == null ? void 0 : persistedSettingsType.includes("-sidebar")) {
      const n22 = normalizeNoticeTypeForPushdownGate(persistedSettingsType);
      return n22 !== "banner" && n22 !== "classic";
    }
    const n2 = normalizeNoticeTypeForPushdownGate(
      getEffectiveNoticeTypeForPushdownGate(state)
    );
    return n2 !== "banner" && n2 !== "classic";
  }
  __name(isPushdownPreferenceLayoutDisabled, "isPushdownPreferenceLayoutDisabled");
  function formatPreferenceSideLabel(value) {
    const s2 = String(value);
    return s2.charAt(0).toUpperCase() + s2.slice(1);
  }
  __name(formatPreferenceSideLabel, "formatPreferenceSideLabel");
  function formatNoticePositionLabel(pos) {
    const modifiedString = String(pos).replaceAll("-", " ");
    return modifiedString.charAt(0).toUpperCase() + modifiedString.slice(1);
  }
  __name(formatNoticePositionLabel, "formatNoticePositionLabel");
  function getPreferenceLayouts(law) {
    const all = [
      { type: "popup", title: "Center", positions: [], default: "" },
      {
        type: "sidebar",
        title: "Sidebar",
        positions: ["left", "right"],
        default: "left"
      },
      { type: "pushdown", title: "Push down", positions: [], default: "" }
    ];
    return all.filter((l) => l.type !== "pushdown" || law !== "ccpa");
  }
  __name(getPreferenceLayouts, "getPreferenceLayouts");
  function readLayoutStateFromBanner(banner2) {
    var _a2, _b2, _c2, _d, _e2, _f, _g, _h;
    const props = banner2.properties;
    let rawType = String((_b2 = (_a2 = props == null ? void 0 : props.settings) == null ? void 0 : _a2.type) != null ? _b2 : "box");
    if (rawType.includes("-sidebar")) {
      rawType = rawType.replace("-sidebar", "");
    }
    const rawPref = String((_d = (_c2 = props == null ? void 0 : props.settings) == null ? void 0 : _c2.preferenceCenterType) != null ? _d : "popup");
    let preferenceCenterType = "popup";
    let sidebarPosition = "left";
    if (rawPref.startsWith("sidebar")) {
      preferenceCenterType = "sidebar";
      sidebarPosition = rawPref.endsWith("right") ? "right" : "left";
    } else if (rawPref === "pushdown") {
      preferenceCenterType = "pushdown";
    }
    const bannerType = rawType === "classic" ? "classic" : rawType === "popup" ? "popup" : rawType === "banner" && preferenceCenterType === "pushdown" ? "classic" : rawType === "banner" ? "banner" : "box";
    const defaultPos = bannerType === "box" ? "bottom-left" : bannerType === "popup" ? "center" : "bottom";
    const position = String((_f = (_e2 = props == null ? void 0 : props.settings) == null ? void 0 : _e2.position) != null ? _f : defaultPos);
    const categoriesOnFirstLayer = ((_h = (_g = props == null ? void 0 : props.config) == null ? void 0 : _g.categoryPreview) == null ? void 0 : _h.status) === true;
    return {
      bannerType,
      position,
      preferenceCenterType,
      sidebarPosition,
      categoriesOnFirstLayer
    };
  }
  __name(readLayoutStateFromBanner, "readLayoutStateFromBanner");
  function mergeLayoutStateIntoBanner(banner2, law, state) {
    var _a2, _b2, _c2, _d;
    if (getBannerApplicableLaw$1(banner2) !== law) return deepClone(banner2);
    const b = deepClone(banner2);
    const properties = (_a2 = b.properties) != null ? _a2 : {};
    const settings2 = (_b2 = properties.settings) != null ? _b2 : {};
    const config2 = (_c2 = properties.config) != null ? _c2 : {};
    const categoryPreview = (_d = config2.categoryPreview) != null ? _d : {};
    if (state.preferenceCenterType === "sidebar") {
      settings2.preferenceCenterType = `sidebar-${state.sidebarPosition}`;
    } else {
      settings2.preferenceCenterType = state.preferenceCenterType;
    }
    if (state.preferenceCenterType === "pushdown") {
      settings2.type = "classic";
    } else {
      settings2.type = state.bannerType === "classic" ? "banner" : state.bannerType;
    }
    settings2.position = state.position;
    categoryPreview.status = state.categoriesOnFirstLayer;
    const preferenceCenter = ensureNested(config2, "preferenceCenter");
    const pcElements = ensureNested(preferenceCenter, "elements");
    const buttons = ensureNested(pcElements, "buttons");
    const buttonsElements = ensureNested(buttons, "elements");
    const save = ensureNested(buttonsElements, "save");
    const categories = ensureNested(pcElements, "categories");
    const categoriesElements = ensureNested(categories, "elements");
    const toggle = ensureNested(categoriesElements, "toggle");
    const toggleStatus = state.preferenceCenterType === "pushdown" ? !state.categoriesOnFirstLayer : true;
    toggle.status = toggleStatus;
    const mergedNoticeType = String(settings2.type);
    save.status = !(mergedNoticeType === "classic" && state.categoriesOnFirstLayer);
    config2.categoryPreview = categoryPreview;
    properties.config = config2;
    properties.settings = settings2;
    b.properties = properties;
    return b;
  }
  __name(mergeLayoutStateIntoBanner, "mergeLayoutStateIntoBanner");
  function mergeAllBannersWithLayoutState(banners, law, state) {
    return banners.map(
      (b) => getBannerApplicableLaw$1(b) === law ? mergeLayoutStateIntoBanner(b, law, state) : deepClone(b)
    );
  }
  __name(mergeAllBannersWithLayoutState, "mergeAllBannersWithLayoutState");
  function ensureNested(obj, key) {
    if (!obj[key] || typeof obj[key] !== "object") {
      obj[key] = {};
    }
    return obj[key];
  }
  __name(ensureNested, "ensureNested");
  const Caret = /* @__PURE__ */ __name(({
    width = "10px",
    height = "7px",
    color: color2 = "currentColor",
    className = ""
  }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
    "svg",
    {
      width,
      height,
      viewBox: "0 0 10 7",
      className,
      "aria-hidden": true,
      children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { fill: color2, d: "M5 0 L10 7 H0 Z" })
    }
  ), "Caret");
  const AccordionChevron = /* @__PURE__ */ __name(({
    width = "11px",
    height = "8px",
    color: color2 = "currentColor"
  }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
    "svg",
    {
      width,
      height,
      viewBox: "0 0 7 5",
      fill: color2,
      xmlns: "http://www.w3.org/2000/svg",
      children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M3.75 5 .502.5h6.496L3.75 5z" })
    }
  ), "AccordionChevron");
  const CONSENT_TRIGGER_CHEVRON = 'url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Ctitle%3Edown-arrow%3C%2Ftitle%3E%3Cg%20fill%3D%22%23000000%22%3E%3Cpath%20d%3D%22M10.293%2C3.293%2C6%2C7.586%2C1.707%2C3.293A1%2C1%2C0%2C0%2C0%2C.293%2C4.707l5%2C5a1%2C1%2C0%2C0%2C0%2C1.414%2C0l5-5a1%2C1%2C0%2C1%2C0-1.414-1.414Z%22%20fill%3D%22%23000000%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3C%2Fsvg%3E")';
  const ITEM_CLASS = "cky:!m-0 cky:!min-h-0 cky:!cursor-pointer cky:!rounded-none cky:!py-[7px] cky:!text-sm cky:!font-medium cky:!leading-snug cky:!text-[#23282d] hover:cky:!bg-[#f8f9fa] hover:cky:!text-[#23282d] data-[highlighted]:cky:!bg-[#f8f9fa] data-[highlighted]:cky:!text-[#23282d]";
  const GDPR_TEMPLATE_HOVER_TEXT = __$2(
    "The selected template (opt-in banner) supports GDPR (EU & UK), LGPD (Brazil), PIPEDA (Canada), Law 25 (Quebec), POPIA (South Africa), nFADP (Switzerland), Privacy Act (Australia), PDPL (Saudi Arabia), PDPL (Argentina), PDPL (Andorra), DPA (Faroe Island).",
    "cookie-law-info"
  );
  const US_STATE_TEMPLATE_HOVER_TEXT = __$2(
    "The selected template (opt-out banner) supports CCPA/CPRA (California), VCDPA (Virginia), CPA (Colorado), CTDPA (Connecticut), & UCPA (Utah).",
    "cookie-law-info"
  );
  const TEMPLATE_TOOLTIP_ROW_CLASS = "cky:!block cky:w-full cky:min-w-0 cky:cursor-pointer cky:text-inherit";
  function displayName(law) {
    if (law === "ccpa") return __$2("US State Laws", "cookie-law-info");
    return __$2("GDPR", "cookie-law-info");
  }
  __name(displayName, "displayName");
  const ConsentTemplateDropdown = /* @__PURE__ */ __name(({
    value,
    onChange
  }) => {
    const dualLawModalRef = reactExports.useRef(null);
    const [consentMenuOpen, setConsentMenuOpen] = reactExports.useState(false);
    const openDualLawModal = /* @__PURE__ */ __name(() => {
      var _a2;
      setConsentMenuOpen(false);
      (_a2 = dualLawModalRef.current) == null ? void 0 : _a2.show();
    }, "openDualLawModal");
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:relative cky:box-border cky:flex cky:min-h-10 cky:w-[332px] cky:max-w-full cky:items-center cky:justify-between cky:rounded cky:border-[0.5px] cky:border-[#adadad] cky:bg-[#f6f7f7] cky:pl-3", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Label$1,
          {
            className: "cky:m-0 cky:inline-block cky:whitespace-nowrap cky:text-sm cky:font-medium cky:text-[#23282d]",
            htmlFor: "cky-consent-template-trigger",
            children: __$2("Consent Template", "cookie-law-info")
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:flex cky:min-w-0 cky:flex-1 cky:flex-col cky:items-stretch", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
          DropdownMenu,
          {
            modal: false,
            open: consentMenuOpen,
            onOpenChange: setConsentMenuOpen,
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                Button,
                {
                  id: "cky-consent-template-trigger",
                  variant: "ghost",
                  className: "cky:box-border cky:m-0 cky:flex cky:h-max cky:min-h-10 cky:w-full cky:max-w-full cky:min-w-0 cky:items-center cky:justify-end cky:border-0 cky:bg-transparent cky:px-3 cky:py-2 cky:pr-7 cky:text-right cky:text-sm cky:font-normal cky:leading-4 cky:!text-[#23282d] cky:shadow-none cky:outline-none cky:transition-all cky:duration-300 cky:ease-in-out hover:cky:bg-transparent hover:cky:!text-[#23282d]",
                  style: {
                    WebkitAppearance: "none",
                    appearance: "none",
                    fontFamily: "inherit",
                    backgroundImage: CONSENT_TRIGGER_CHEVRON,
                    backgroundSize: "10px",
                    backgroundPosition: "calc(100% - 10px) center",
                    backgroundRepeat: "no-repeat"
                  },
                  "aria-label": __$2("Consent Template", "cookie-law-info"),
                  children: displayName(value)
                }
              ) }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                DropdownMenuContent,
                {
                  align: "end",
                  side: "bottom",
                  className: "cky:!z-[100050] cky:!min-w-[195px] cky:!w-auto cky:!overflow-visible cky:!rounded-[3px] cky:!border cky:!border-[#ddd] cky:!bg-white cky:!p-2.5 cky:!m-0 cky:shadow-[0_3px_7px_0_rgba(0,0,0,0.07)]",
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      DropdownMenuItem,
                      {
                        className: ITEM_CLASS,
                        onSelect: /* @__PURE__ */ __name(() => onChange("gdpr"), "onSelect"),
                        children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip$1, { delayDuration: 0, children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: TEMPLATE_TOOLTIP_ROW_CLASS, children: __$2("GDPR", "cookie-law-info") }) }),
                          /* @__PURE__ */ jsxRuntimeExports.jsx(
                            TooltipContentWithArrow,
                            {
                              side: "right",
                              sideOffset: 8,
                              children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:block", children: GDPR_TEMPLATE_HOVER_TEXT })
                            }
                          )
                        ] })
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      DropdownMenuItem,
                      {
                        className: ITEM_CLASS,
                        onSelect: /* @__PURE__ */ __name(() => onChange("ccpa"), "onSelect"),
                        children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Tooltip$1, { delayDuration: 0, children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: TEMPLATE_TOOLTIP_ROW_CLASS, children: __$2("US State Laws", "cookie-law-info") }) }),
                          /* @__PURE__ */ jsxRuntimeExports.jsx(
                            TooltipContentWithArrow,
                            {
                              side: "right",
                              sideOffset: 8,
                              children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:block", children: US_STATE_TEMPLATE_HOVER_TEXT })
                            }
                          )
                        ] })
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      DropdownMenuItem,
                      {
                        className: `${ITEM_CLASS} cky:!flex cky:!items-center data-[highlighted]:cky:[&_.cky-consent-premium-crown]:!text-[#FFB240]`,
                        onSelect: openDualLawModal,
                        children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "cky:flex cky:w-full cky:min-w-0 cky:items-center cky:gap-2", children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:min-w-0 cky:flex-1 cky:leading-snug", children: __$2("GDPR & US State Laws", "cookie-law-info") }),
                          /* @__PURE__ */ jsxRuntimeExports.jsx(
                            Badge,
                            {
                              variant: "premium",
                              className: "cky-consent-premium-crown cky:!h-[18px] cky:!min-h-0 cky:!w-[18px] cky:!min-w-[18px] cky:!shrink-0 cky:!border-0 cky:!p-0 cky:!py-0 cky:!px-0 cky:!text-[#FFB240] cky:flex cky:items-center cky:justify-center cky:rounded-full",
                              "aria-hidden": true,
                              children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "crown", width: "10px", height: "8px" })
                            }
                          )
                        ] })
                      }
                    )
                  ]
                }
              )
            ]
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyConnectModal,
        {
          ref: dualLawModalRef,
          availablePlan: "pro",
          title: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "img",
            {
              src: assets.gdprUs,
              alt: __$2("GDPR and US State Laws", "cookie-law-info")
            }
          ),
          featureText: __$2(
            "Display GDPR (opt-in) and US State Laws (opt-out) banners at the same time",
            "cookie-law-info"
          ),
          availabilityText: __$2(
            "Available in: <b>Pro and Ultimate plans</b>",
            "cookie-law-info"
          )
        }
      )
    ] });
  }, "ConsentTemplateDropdown");
  function BannerCustomizeToolbar({
    consentLaw,
    onConsentLawChange,
    bannerPreviewOn,
    onBannerPreviewChange,
    showBanner,
    previewControlId,
    publishDisabled,
    publishing,
    onPublish
  }) {
    const previewNotice = previewDisabledNotice(__$2);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:-mx-[15px] cky:mb-0 cky:flex cky:flex-wrap cky:items-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:max-w-[66.666667%] cky:flex-[0_0_66.666667%] cky:flex-wrap cky:items-center cky:gap-0 cky:px-[15px] max-[782px]:cky:max-w-full max-[782px]:cky:flex-[0_0_100%]", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            ConsentTemplateDropdown,
            {
              value: consentLaw,
              onChange: onConsentLawChange
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:ml-[15px] cky:inline-flex cky:cursor-pointer cky:items-center cky:gap-2", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Label$1,
              {
                htmlFor: previewControlId,
                className: "cky:m-0 cky:cursor-pointer cky:text-sm",
                children: __$2("Banner Preview", "cookie-law-info")
              }
            ),
            !showBanner ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              TooltipWithContent,
              {
                content: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:max-w-[260px] cky:text-left cky:text-xs cky:font-normal cky:leading-snug", children: previewNotice }),
                children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  Switch,
                  {
                    id: previewControlId,
                    checked: bannerPreviewOn,
                    disabled: true,
                    onCheckedChange: onBannerPreviewChange,
                    className: "cky:cursor-help"
                  }
                )
              }
            ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
              Switch,
              {
                id: previewControlId,
                checked: bannerPreviewOn,
                onCheckedChange: onBannerPreviewChange
              }
            )
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:max-w-[33.333333%] cky:flex-[0_0_33.333333%] cky:items-center cky:justify-end cky:px-[15px] max-[782px]:cky:mt-3 max-[782px]:cky:max-w-full max-[782px]:cky:flex-[0_0_100%] max-[782px]:cky:justify-start", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Button,
          {
            variant: "green",
            className: "cky:ml-[15px] cky:min-w-20 cky:rounded-[3px]",
            disabled: publishDisabled,
            loading: publishing,
            loadingText: __$2("Saving…", "cookie-law-info"),
            onClick: /* @__PURE__ */ __name(() => void onPublish(), "onClick"),
            children: __$2("Publish Changes", "cookie-law-info")
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mt-5", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TemplateLawBanner, { consentLaw }) })
    ] });
  }
  __name(BannerCustomizeToolbar, "BannerCustomizeToolbar");
  const EXPIRY_TOOLTIP_GDPR = __$2(
    "Customise the validity period of your users' consent preferences here. While the <b>GDPR</b> does not specify a specific time limit for consent durations, the French Data Protection Authority, <b>CNIL</b>, recommends retaining user choices for a period of six months (<b>180</b> days) as a best practice.",
    "cookie-law-info"
  );
  const EXPIRY_TOOLTIP_CCPA = __$2(
    "Customise the validity period of your users' consent preferences here. The <b>US State Laws</b> do not specify a specific time limit for retaining user choices.",
    "cookie-law-info"
  );
  const IAB_TCF_LABEL = __$2(
    "Support IAB TCF v2.3",
    "cookie-law-info"
  );
  const IAB_TCF_TOOLTIP = __$2(
    "Enable the support for IAB Transparency and Consent Framework if you run ads on your site. When enabled, a GDPR-compliant consent banner will appear on your site, allowing your visitors to set granular advertising tracking preferences.",
    "cookie-law-info"
  );
  const GACM_LABEL = __$2(
    "Support Google's Additional Consent Mode",
    "cookie-law-info"
  );
  const GACM_TOOLTIP = __$2(
    "Google's Additional Consent (AC) Mode allows the collection of consents for Google's Ad Technology Providers (ATPs) that are not yet registered on the IAB Europe Global Vendor List (GVL). AC Mode is intended only for use alongside IAB TCF.",
    "cookie-law-info"
  );
  const TCF_UPGRADE_MESSAGE = __$2(
    "Comply with Google's requirements for serving ads in EEA, UK & Switzerland",
    "cookie-law-info"
  );
  const PRIOR_CONSENT_WARNING = __$2(
    "Choosing any of these categories(cookies) to load prior to receiving user consent will make your website non-compliant with GDPR.",
    "cookie-law-info"
  );
  const HIDE_CATEGORIES_WARNING = __$2(
    "Hiding any of the categories (with cookies) will make your website non-compliant with GDPR.",
    "cookie-law-info"
  );
  function expiryRangeErrorMessage() {
    return __$2(consentExpiryRangeMessage(), "cookie-law-info");
  }
  __name(expiryRangeErrorMessage, "expiryRangeErrorMessage");
  function ConsentExpirationDaysBlock({
    consentLaw,
    value,
    onChange,
    tooltipHtml
  }) {
    const inputId = `cky-consent-expiration-${consentLaw}`;
    const errorId = `${inputId}-error`;
    const hasError = consentExpiryInputHasError(value);
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mb-[15px] cky:rounded-[3px] cky:border cky:border-[#dcdcde] cky:bg-white cky:px-5 cky:py-3 cky:shadow-[0_1px_1px_rgba(0,0,0,0.04)]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:-mx-[15px] cky:flex cky:flex-wrap cky:items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:box-border cky:min-w-0 cky:max-w-[33.333%] cky:flex-[0_0_33.333%] cky:px-[15px] max-[600px]:cky:max-w-full max-[600px]:cky:flex-[0_0_100%]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        Label$1,
        {
          className: "cky:m-0 cky:mb-0 cky:inline-flex cky:max-w-full cky:cursor-pointer cky:items-center cky:gap-1.5 cky:text-sm cky:font-medium cky:leading-none cky:text-[#23282d]",
          htmlFor: inputId,
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:min-w-0", children: __$2("Consent expiration (days)", "cookie-law-info") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              TooltipWithContent,
              {
                content: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "div",
                  {
                    className: "cky:max-w-[280px] cky:text-left cky:text-xs cky:font-normal cky:leading-snug [&_b]:cky:font-semibold",
                    dangerouslySetInnerHTML: { __html: tooltipHtml }
                  }
                ),
                children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  Button,
                  {
                    type: "button",
                    variant: "ghost",
                    className: "cky:m-0 cky:h-auto cky:w-auto cky:shrink-0 cky:cursor-help cky:rounded-full cky:border-0 cky:bg-transparent cky:p-0 cky:leading-none cky:text-[#a6a8b1] hover:cky:bg-transparent hover:cky:text-[#8c8f9a] focus-visible:cky:outline focus-visible:cky:outline-2 focus-visible:cky:outline-offset-2 focus-visible:cky:outline-[var(--cky-primary)]",
                    "aria-label": __$2("More information", "cookie-law-info"),
                    children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "tooltip", width: "14px", height: "14px" })
                  }
                )
              }
            )
          ]
        }
      ) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:box-border cky:max-w-[33.333%] cky:flex-[0_0_33.333%] cky:px-[15px] max-[600px]:cky:mt-2 max-[600px]:cky:max-w-full max-[600px]:cky:flex-[0_0_100%]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:box-border cky:w-full", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "input",
          {
            id: inputId,
            className: cn$1(
              "cky:box-border cky:m-0 cky:h-10 cky:w-full cky:rounded-[3px] cky:border cky:border-[#d1d5db] cky:bg-white cky:bg-none cky:px-[14px] cky:py-[9px] cky:text-left cky:text-sm cky:font-normal cky:leading-[1.3] cky:text-[#23282d] cky:shadow-none cky:outline-none cky:transition-[border-color,box-shadow] cky:duration-100 cky:ease-in-out",
              "focus:cky:border-[#1863dc] focus:cky:shadow-none focus:cky:outline-none",
              "active:cky:border-[#1863dc] active:cky:shadow-none",
              hasError && "cky:border-[#dc3545] focus:cky:border-[#dc3545] focus:cky:shadow-[0_0_0_0.5px_#dc3545] active:cky:border-[#dc3545] active:cky:shadow-[0_0_0_0.5px_#dc3545]"
            ),
            type: "number",
            min: CONSENT_EXPIRY_MIN,
            max: CONSENT_EXPIRY_MAX,
            autoComplete: "off",
            value,
            onChange: /* @__PURE__ */ __name((e) => onChange(e.target.value), "onChange"),
            "aria-invalid": hasError,
            "aria-describedby": hasError ? errorId : void 0
          }
        ),
        hasError ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mt-1", id: errorId, role: "alert", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:m-0 cky:text-sm cky:font-normal cky:leading-normal cky:text-[#dc3545]", children: expiryRangeErrorMessage() }) }) : null
      ] }) })
    ] }) });
  }
  __name(ConsentExpirationDaysBlock, "ConsentExpirationDaysBlock");
  function readBannerPropertiesTree(banner2) {
    let raw = banner2.properties;
    if (typeof raw === "string") {
      try {
        raw = JSON.parse(raw);
      } catch (e) {
        return void 0;
      }
    }
    if (!raw || typeof raw !== "object") return void 0;
    return raw;
  }
  __name(readBannerPropertiesTree, "readBannerPropertiesTree");
  function categoryDisplayName(cat, lang) {
    const n2 = cat.name;
    if (n2 && typeof n2 === "object") {
      if (lang && n2[lang]) return n2[lang];
      if (n2.en) return n2.en;
      const val = Object.values(n2).find((v) => v && String(v).trim() !== "");
      if (val) return String(val);
    }
    return cat.slug ? String(cat.slug) : `#${cat.id}`;
  }
  __name(categoryDisplayName, "categoryDisplayName");
  function isEditableCategorySlug(slug) {
    if (typeof slug !== "string") return false;
    const normalized = slug.trim().toLowerCase();
    return normalized !== "" && normalized !== "necessary";
  }
  __name(isEditableCategorySlug, "isEditableCategorySlug");
  function BannerBoxedAccordionSection({
    sectionId,
    title,
    open,
    onToggle,
    children
  }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "cky:m-0 cky:list-none cky:p-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: "cky:overflow-hidden cky:rounded cky:bg-white", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          className: "cky:outline-none focus-visible:cky:outline focus-visible:cky:outline-2 focus-visible:cky:outline-offset-2 focus-visible:cky:outline-[var(--cky-primary)]",
          role: "button",
          tabIndex: 0,
          "aria-expanded": open,
          "aria-controls": `${sectionId}-panel`,
          id: `${sectionId}-trigger`,
          onClick: onToggle,
          onKeyDown: /* @__PURE__ */ __name((e) => {
            if (e.key === "Enter" || e.key === " ") {
              e.preventDefault();
              onToggle();
            }
          }, "onKeyDown"),
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "span",
            {
              className: cn$1(
                "cky:flex cky:cursor-pointer cky:items-center cky:px-5 cky:py-[13px] cky:text-sm cky:font-medium cky:leading-snug cky:text-inherit",
                open && "cky:border-b cky:border-[#f3f4f5]"
              ),
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "span",
                  {
                    className: cn$1(
                      "cky:mr-2.5 cky:inline-flex cky:shrink-0 cky:items-center cky:justify-center cky:text-inherit cky:opacity-85 cky:transition-transform cky:duration-100",
                      open ? "cky:rotate-0" : "cky:-rotate-90"
                    ),
                    "aria-hidden": true,
                    children: /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionChevron, {})
                  }
                ),
                title
              ]
            }
          )
        }
      ),
      open ? /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          id: `${sectionId}-panel`,
          role: "region",
          "aria-labelledby": `${sectionId}-trigger`,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:px-5 cky:py-[15px]", children })
        }
      ) : null
    ] }) });
  }
  __name(BannerBoxedAccordionSection, "BannerBoxedAccordionSection");
  function GdprPremiumToggleRow({
    id,
    label,
    tooltipText,
    onOpenPremium
  }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:-mx-[15px] cky:!mb-0 cky:flex cky:flex-wrap cky:items-center", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:box-border cky:flex cky:min-w-0 cky:max-w-[41.666%] cky:flex-[0_0_41.666%] cky:flex-wrap cky:items-center cky:gap-1.5 cky:px-[15px] max-[600px]:cky:max-w-full max-[600px]:cky:flex-[0_0_100%]", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Label$1,
          {
            className: "cky:m-0 cky:cursor-pointer cky:text-sm cky:font-normal cky:leading-snug cky:text-[#23282d]",
            htmlFor: id,
            children: label
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          TooltipWithContent,
          {
            content: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:max-w-[280px] cky:text-left cky:text-xs cky:font-normal cky:leading-snug", children: tooltipText }),
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              Button,
              {
                variant: "ghost",
                className: "cky:m-0 cky:h-auto cky:w-auto cky:shrink-0 cky:cursor-help cky:rounded-full cky:border-0 cky:bg-transparent cky:p-0 cky:leading-none cky:text-[#a6a8b1] hover:cky:bg-transparent hover:cky:text-[#8c8f9a] focus-visible:cky:outline focus-visible:cky:outline-2 focus-visible:cky:outline-offset-2 focus-visible:cky:outline-[var(--cky-primary)]",
                "aria-label": __$2("More information", "cookie-law-info"),
                children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "tooltip", width: "14px", height: "14px" })
              }
            )
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Button,
          {
            variant: "ghost",
            className: "cky:m-0 cky:h-auto cky:w-auto cky:shrink-0 cky:rounded cky:border-0 cky:bg-transparent cky:p-0 cky:align-middle cky:leading-none hover:cky:bg-transparent focus-visible:cky:outline focus-visible:cky:outline-2 focus-visible:cky:outline-offset-2 focus-visible:cky:outline-[var(--cky-primary)]",
            "aria-label": __$2("Premium feature", "cookie-law-info"),
            onClick: /* @__PURE__ */ __name((e) => {
              e.preventDefault();
              e.stopPropagation();
              onOpenPremium();
            }, "onClick"),
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              Badge,
              {
                variant: "premium",
                className: "cky:!h-[18px] cky:!min-h-0 cky:!w-[18px] cky:!min-w-[18px] cky:!shrink-0 cky:!p-0 cky:!py-0 cky:!px-0 cky:flex cky:items-center cky:justify-center cky:rounded-full",
                "aria-hidden": true,
                children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "crown", width: "10px", height: "8px" })
              }
            )
          }
        )
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:box-border cky:min-w-0 cky:max-w-[58.333%] cky:flex-[0_0_58.333%] cky:px-[15px] max-[600px]:cky:mt-2 max-[600px]:cky:max-w-full max-[600px]:cky:flex-[0_0_100%]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        Switch,
        {
          id,
          checked: false,
          onCheckedChange: /* @__PURE__ */ __name(() => onOpenPremium(), "onCheckedChange")
        }
      ) })
    ] });
  }
  __name(GdprPremiumToggleRow, "GdprPremiumToggleRow");
  function AccordionWarningNote({ message }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:mb-2 cky:box-border cky:flex cky:w-full cky:justify-between cky:rounded cky:border cky:border-transparent cky:bg-[#ffe8c6] cky:px-3 cky:py-1.5 cky:shadow-[0_5px_15px_0_rgba(0,0,0,0.02)]", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "cky:relative cky:m-0 cky:flex-1 cky:border-0 cky:p-0 cky:text-xs cky:font-normal cky:leading-snug cky:text-[#23282d]", children: message }) });
  }
  __name(AccordionWarningNote, "AccordionWarningNote");
  function CategoryCheckboxList({
    categories,
    idPrefix,
    values,
    adminLang,
    onChange
  }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:py-[15px]", children: categories.map((cat) => {
      var _a2;
      const slug = cat.slug;
      const id = `${idPrefix}-${slug}`;
      const checked = (_a2 = values[slug]) != null ? _a2 : false;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mb-2.5 cky:flex cky:items-center last:cky:mb-0", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          CkyCheckbox,
          {
            id,
            className: "cky:m-0 cky:mr-2 cky:cursor-pointer",
            checked,
            onCheckedChange: /* @__PURE__ */ __name((c2) => onChange(slug, c2 === true), "onCheckedChange")
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Label$1,
          {
            className: "cky:m-0 cky:cursor-pointer cky:text-sm cky:font-normal cky:leading-snug cky:text-[#23282d]",
            htmlFor: id,
            children: categoryDisplayName(cat, adminLang)
          }
        )
      ] }, slug);
    }) });
  }
  __name(CategoryCheckboxList, "CategoryCheckboxList");
  function geoPremiumFeatureText(code) {
    if (code === "EU") {
      return __$2(
        "Display your banner only in the EU and the UK",
        "cookie-law-info"
      );
    }
    if (code === "US") {
      return __$2("Display your banner only in the US", "cookie-law-info");
    }
    return __$2(
      "Select the countries where you want to display your banner",
      "cookie-law-info"
    );
  }
  __name(geoPremiumFeatureText, "geoPremiumFeatureText");
  const CkyCustomizeGeneralPanel = /* @__PURE__ */ __name(({
    consentLaw: consentTemplate,
    onConsentLawChange: setConsentTemplate,
    bannerPreviewOn,
    onBannerPreviewChange,
    allBanners,
    allCookies,
    settingsReady,
    onRefreshSettings,
    onAfterPublish,
    dataEpoch,
    layoutPanelStateRef
  }) => {
    const { triggerNotification } = useNotifications();
    const geoModalRef = reactExports.useRef(null);
    const tcfModalRef = reactExports.useRef(null);
    const [geoModalCode, setGeoModalCode] = reactExports.useState("EU");
    const [priorAccordionOpen, setPriorAccordionOpen] = reactExports.useState(false);
    const [hideCategoriesAccordionOpen, setHideCategoriesAccordionOpen] = reactExports.useState(false);
    const [priorConsent, setPriorConsent] = reactExports.useState({});
    const [hideCategoryFromBanner, setHideCategoryFromBanner] = reactExports.useState({});
    const [showBanner, setShowBanner] = reactExports.useState(true);
    const [advancedOpen, setAdvancedOpen] = reactExports.useState(false);
    const [consentExpiration, setConsentExpiration] = reactExports.useState(
      () => String(DEFAULT_CONSENT_EXPIRY_DAYS)
    );
    const [reloadOnConsent, setReloadOnConsent] = reactExports.useState(false);
    const [region, setRegion] = reactExports.useState("ALL");
    const [publishing, setPublishing] = reactExports.useState(false);
    const [dirty, setDirty] = reactExports.useState(false);
    useSyncBannerPanelDirty("general", dirty);
    const baselineFingerprintRef = reactExports.useRef(null);
    const allBannersRef = reactExports.useRef(allBanners);
    allBannersRef.current = allBanners;
    const adminLang = getAdminBannerLanguage();
    const gdprCategoryRows = reactExports.useMemo(
      () => allCookies.filter(
        (c2) => isEditableCategorySlug(c2.slug)
      ),
      [allCookies]
    );
    const bannerForCurrentLaw = reactExports.useMemo(
      () => {
        var _a2;
        return (_a2 = allBanners.find((b) => getBannerApplicableLaw$1(b) === consentTemplate)) != null ? _a2 : null;
      },
      [allBanners, consentTemplate]
    );
    reactExports.useEffect(() => {
      setRegion("ALL");
    }, [consentTemplate]);
    reactExports.useEffect(() => {
      var _a2, _b2, _c2, _d, _e2, _f, _g, _h, _i;
      if (!settingsReady) return;
      const b = (_a2 = allBannersRef.current.find(
        (x2) => getBannerApplicableLaw$1(x2) === consentTemplate
      )) != null ? _a2 : null;
      if (!b) return;
      const props = readBannerPropertiesTree(b);
      const code = (_d = (_c2 = (_b2 = props == null ? void 0 : props.settings) == null ? void 0 : _b2.ruleSet) == null ? void 0 : _c2[0]) == null ? void 0 : _d.code;
      if (code === "EU" || code === "US" || code === "OTHER" || code === "ALL") {
        setRegion(code);
      } else {
        setRegion("ALL");
      }
      const ce2 = (_e2 = props == null ? void 0 : props.settings) == null ? void 0 : _e2.consentExpiry;
      const raw = ce2 && typeof ce2 === "object" ? ce2.value : void 0;
      setConsentExpiration(consentExpiryStoredValueToInputString(raw));
      setReloadOnConsent(!!((_g = (_f = props == null ? void 0 : props.behaviours) == null ? void 0 : _f.reloadBannerOnAccept) == null ? void 0 : _g.status));
      setShowBanner(((_i = (_h = props == null ? void 0 : props.config) == null ? void 0 : _h.notice) == null ? void 0 : _i.status) !== false);
    }, [dataEpoch, consentTemplate, settingsReady]);
    reactExports.useEffect(() => {
      if (consentTemplate !== "gdpr") return;
      const prior = {};
      const hide2 = {};
      for (const cat of allCookies) {
        const slug = cat.slug;
        if (!isEditableCategorySlug(slug)) continue;
        prior[slug] = !!cat.prior_consent;
        hide2[slug] = cat.visibility === false;
      }
      setPriorConsent(prior);
      setHideCategoryFromBanner(hide2);
    }, [allCookies, consentTemplate]);
    const computeFingerprint = reactExports.useCallback(() => {
      const panelState = {
        region,
        showBanner,
        consentExpiration,
        reloadOnConsent
      };
      const mergedList = allBanners.map(
        (b) => getBannerApplicableLaw$1(b) === consentTemplate ? mergeGeneralStateIntoBanner(b, consentTemplate, panelState) : deepClone(b)
      );
      const categoriesPayload = consentTemplate === "gdpr" ? mergeGdprCookieMapsIntoCategories(
        allCookies,
        priorConsent,
        hideCategoryFromBanner
      ) : allCookies.map((c2) => deepClone(c2));
      return JSON.stringify({
        mergedList,
        categoriesPayload,
        consentTemplate
      });
    }, [
      allBanners,
      allCookies,
      consentTemplate,
      region,
      showBanner,
      consentExpiration,
      reloadOnConsent,
      priorConsent,
      hideCategoryFromBanner
    ]);
    const computeFingerprintRef = reactExports.useRef(computeFingerprint);
    computeFingerprintRef.current = computeFingerprint;
    const currentBannerId = bannerForCurrentLaw != null ? bannerForCurrentLaw.id : void 0;
    reactExports.useEffect(() => {
      if (!settingsReady || !bannerForCurrentLaw) return;
      const t2 = globalThis.setTimeout(() => {
        baselineFingerprintRef.current = computeFingerprintRef.current();
        setDirty(false);
      }, 0);
      return () => window.clearTimeout(t2);
    }, [dataEpoch, settingsReady, consentTemplate, currentBannerId, bannerForCurrentLaw]);
    reactExports.useEffect(() => {
      if (!baselineFingerprintRef.current) return;
      setDirty(
        computeFingerprintRef.current() !== baselineFingerprintRef.current
      );
    }, [
      region,
      showBanner,
      consentExpiration,
      reloadOnConsent,
      priorConsent,
      hideCategoryFromBanner,
      consentTemplate
    ]);
    reactExports.useEffect(() => {
      if (!showBanner && bannerPreviewOn) {
        onBannerPreviewChange(false);
      }
    }, [showBanner, bannerPreviewOn, onBannerPreviewChange]);
    reactExports.useEffect(() => {
      if (!bannerPreviewOn || !settingsReady || !bannerForCurrentLaw) {
        return;
      }
      const panelState = {
        region,
        showBanner,
        consentExpiration,
        reloadOnConsent,
        priorConsent,
        hideCategoryFromBanner
      };
      const timer = globalThis.setTimeout(() => {
        var _a2;
        try {
          const layoutAwareBanners = (layoutPanelStateRef == null ? void 0 : layoutPanelStateRef.current) ? mergeAllBannersWithLayoutState(
            allBanners,
            consentTemplate,
            layoutPanelStateRef.current
          ) : allBanners.map((b) => deepClone(b));
          const currentBanner = (_a2 = layoutAwareBanners.find(
            (b) => getBannerApplicableLaw$1(b) === consentTemplate
          )) != null ? _a2 : null;
          if (!currentBanner) return;
          const mergedBanner = mergeGeneralStateIntoBanner(
            currentBanner,
            consentTemplate,
            panelState
          );
          const previewCookies2 = consentTemplate === "gdpr" ? mergeGdprCookieMapsIntoCategories(
            allCookies,
            priorConsent,
            hideCategoryFromBanner
          ) : allCookies.map((c2) => deepClone(c2));
          setBannerPreviewContext(
            mergedBanner,
            adminLang,
            toPreviewCookieCategories(previewCookies2)
          );
          bannerPreview.startLoading();
          bannerPreview.generate(false, true).catch((e) => console.error(e)).finally(() => bannerPreview.stopLoading());
        } catch (e) {
          console.error(e);
        }
      }, 300);
      return () => globalThis.clearTimeout(timer);
    }, [
      bannerPreviewOn,
      settingsReady,
      bannerForCurrentLaw,
      region,
      showBanner,
      consentExpiration,
      reloadOnConsent,
      priorConsent,
      hideCategoryFromBanner,
      layoutPanelStateRef,
      allBanners,
      consentTemplate,
      allCookies,
      adminLang
    ]);
    const handlePublish = /* @__PURE__ */ __name(() => __async(null, null, function* () {
      if (!bannerForCurrentLaw || !bannerForCurrentLaw.id) {
        triggerNotification({ type: "error", message: noBannerFoundMessage(__$2) });
        return;
      }
      if (consentExpiryInputHasError(consentExpiration)) {
        triggerNotification({ type: "error", message: expiryRangeErrorMessage() });
        return;
      }
      setPublishing(true);
      let publishSucceeded = false;
      try {
        const panelState = {
          region,
          showBanner,
          consentExpiration,
          reloadOnConsent,
          priorConsent,
          hideCategoryFromBanner
        };
        const layoutAwareBanners = (layoutPanelStateRef == null ? void 0 : layoutPanelStateRef.current) ? mergeAllBannersWithLayoutState(
          allBanners,
          consentTemplate,
          layoutPanelStateRef.current
        ) : allBanners.map((b) => deepClone(b));
        const mergedList = layoutAwareBanners.map(
          (b) => getBannerApplicableLaw$1(b) === consentTemplate ? mergeGeneralStateIntoBanner(b, consentTemplate, panelState) : deepClone(b)
        );
        const withStatus = setBannerStatusByLaw(mergedList, consentTemplate);
        const res = yield bulkSaveBanners(withStatus, false);
        if (!Array.isArray(res) || res.length === 0) {
          throw new Error("Banner bulk save returned no data");
        }
        const categoriesPayload = consentTemplate === "gdpr" ? mergeGdprCookieMapsIntoCategories(
          allCookies,
          priorConsent,
          hideCategoryFromBanner
        ) : allCookies.map((c2) => deepClone(c2));
        yield cookieApi.bulkUpdateCookieCategory(categoriesPayload);
        publishSucceeded = true;
      } catch (e) {
        console.error(e);
      } finally {
        try {
          yield onRefreshSettings();
          yield onAfterPublish();
        } catch (refreshErr) {
          console.error(refreshErr);
        }
        if (publishSucceeded) {
          triggerNotification({
            type: "success",
            message: saveSuccessMessage(__$2)
          });
        } else {
          triggerNotification({ type: "error", message: saveErrorMessage(__$2) });
        }
        setPublishing(false);
      }
    }), "handlePublish");
    const geoOptions = consentTemplate === "gdpr" ? [
      { code: "ALL", label: __$2("Worldwide", "cookie-law-info"), premium: false },
      { code: "EU", label: __$2("EU Countries & UK", "cookie-law-info"), premium: true },
      { code: "OTHER", label: __$2("Select countries", "cookie-law-info"), premium: true }
    ] : [
      { code: "ALL", label: __$2("Worldwide", "cookie-law-info"), premium: false },
      { code: "US", label: __$2("United States", "cookie-law-info"), premium: true },
      { code: "OTHER", label: __$2("Select countries", "cookie-law-info"), premium: true }
    ];
    const openGeoPremiumModal = /* @__PURE__ */ __name((code, resetRegion) => {
      var _a2;
      setGeoModalCode(code);
      {
        setRegion("ALL");
      }
      (_a2 = geoModalRef.current) == null ? void 0 : _a2.show();
    }, "openGeoPremiumModal");
    const handleGeoChange = /* @__PURE__ */ __name((opt) => {
      if (opt.premium) {
        openGeoPremiumModal(opt.code);
        return;
      }
      setRegion(opt.code);
    }, "handleGeoChange");
    const openTcfPremiumModal = /* @__PURE__ */ __name(() => {
      var _a2;
      (_a2 = tcfModalRef.current) == null ? void 0 : _a2.show();
    }, "openTcfPremiumModal");
    const expiryTooltipHtml = consentTemplate === "gdpr" ? EXPIRY_TOOLTIP_GDPR : EXPIRY_TOOLTIP_CCPA;
    const handleConsentExpirationChange = /* @__PURE__ */ __name((raw) => {
      setConsentExpiration(raw);
    }, "handleConsentExpirationChange");
    return /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        BannerCustomizeToolbar,
        {
          consentLaw: consentTemplate,
          onConsentLawChange: setConsentTemplate,
          bannerPreviewOn,
          onBannerPreviewChange,
          showBanner,
          previewControlId: "cky-banner-preview-react",
          publishDisabled: !settingsReady || !bannerForCurrentLaw || publishing || consentExpiryInputHasError(consentExpiration),
          publishing,
          onPublish: handlePublish
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:min-h-[min(700px,70vh)]", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mb-[15px] cky:rounded-[3px] cky:border cky:border-[#dcdcde] cky:bg-white cky:px-5 cky:py-3 cky:shadow-[0_1px_1px_rgba(0,0,0,0.04)]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:w-full", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:m-0 cky:mb-4 cky:p-0 cky:text-sm cky:font-medium cky:leading-snug cky:text-[var(--cky-text-primary)]", children: __$2("Geo-target Banner", "cookie-law-info") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            RadioGroup,
            {
              value: region,
              onValueChange: /* @__PURE__ */ __name((code) => {
                const opt = geoOptions.find((o2) => o2.code === code);
                if (opt) handleGeoChange(opt);
              }, "onValueChange"),
              children: geoOptions.map((opt) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
                "div",
                {
                  className: "cky:grid cky:items-center cky:gap-x-2.5",
                  style: { gridTemplateColumns: "16px minmax(0, 1fr)" },
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      RadioGroupItem,
                      {
                        value: opt.code,
                        id: `cky-geo-${consentTemplate}-${opt.code}`,
                        className: "cky:justify-self-center cky:self-center"
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsxs(
                      Label$1,
                      {
                        className: "cky:m-0 cky:inline-flex cky:min-w-0 cky:cursor-pointer cky:items-center cky:gap-2 cky:p-0 cky:text-sm cky:font-normal cky:leading-normal cky:tracking-normal cky:text-black cky:antialiased",
                        htmlFor: `cky-geo-${consentTemplate}-${opt.code}`,
                        children: [
                          opt.label,
                          opt.premium ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                            Badge,
                            {
                              variant: "premium",
                              className: "cky:!h-[18px] cky:!min-h-0 cky:!w-[18px] cky:!min-w-[18px] cky:!shrink-0 cky:!p-0 cky:!py-0 cky:!px-0 cky:flex cky:items-center cky:justify-center cky:rounded-full",
                              "aria-hidden": true,
                              children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "crown", width: "10px", height: "8px" })
                            }
                          ) : null
                        ]
                      }
                    )
                  ]
                },
                `${consentTemplate}-${opt.code}`
              ))
            }
          )
        ] }) }),
        consentTemplate === "gdpr" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mb-[15px] cky:rounded-[3px] cky:border cky:border-[#dcdcde] cky:bg-white cky:px-5 cky:py-3 cky:shadow-[0_1px_1px_rgba(0,0,0,0.04)]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            GdprPremiumToggleRow,
            {
              id: "cky-toggle-iab-react",
              label: IAB_TCF_LABEL,
              tooltipText: IAB_TCF_TOOLTIP,
              onOpenPremium: openTcfPremiumModal
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            GdprPremiumToggleRow,
            {
              id: "cky-toggle-gacm-react",
              label: GACM_LABEL,
              tooltipText: GACM_TOOLTIP,
              onOpenPremium: openTcfPremiumModal
            }
          )
        ] }) }) : null,
        consentTemplate === "ccpa" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mb-[15px] cky:rounded-[3px] cky:border cky:border-[#dcdcde] cky:bg-white cky:px-5 cky:py-3 cky:shadow-[0_1px_1px_rgba(0,0,0,0.04)]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:-mx-[15px] cky:flex cky:flex-wrap cky:items-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            Label$1,
            {
              className: "cky:m-0 cky:max-w-[25%] cky:flex-[0_0_25%] cky:px-[15px] cky:text-sm cky:font-normal cky:text-[var(--cky-text-primary)] max-[600px]:cky:max-w-full max-[600px]:cky:flex-[0_0_100%]",
              htmlFor: "cky-show-banner-react",
              children: __$2("Show Banner", "cookie-law-info")
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:max-w-[75%] cky:flex-[0_0_75%] cky:px-[15px] max-[600px]:cky:mt-2 max-[600px]:cky:max-w-full max-[600px]:cky:flex-[0_0_100%]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Switch,
            {
              id: "cky-show-banner-react",
              checked: showBanner,
              onCheckedChange: setShowBanner
            }
          ) })
        ] }) }) : null,
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          Button,
          {
            variant: "ghost",
            className: "cky:mt-1 cky:h-auto cky:gap-1 cky:border-0 cky:bg-transparent cky:p-0 cky:text-sm cky:font-normal cky:text-[#1863dc] hover:cky:bg-transparent hover:cky:text-[var(--cky-primary-dark)] hover:cky:underline [&_svg]:cky:shrink-0",
            onClick: /* @__PURE__ */ __name(() => setAdvancedOpen((o2) => !o2), "onClick"),
            children: [
              advancedOpen ? __$2("Hide advanced settings", "cookie-law-info") : __$2("Show advanced settings", "cookie-law-info"),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                Caret,
                {
                  className: cn$1(
                    "cky:shrink-0 cky:transition-transform cky:duration-200 cky:ease-in-out",
                    advancedOpen ? "cky:rotate-0" : "cky:rotate-180"
                  )
                }
              )
            ]
          }
        ),
        advancedOpen ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mt-4 cky:flex cky:flex-col cky:gap-[4px]", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            ConsentExpirationDaysBlock,
            {
              consentLaw: consentTemplate,
              value: consentExpiration,
              onChange: handleConsentExpirationChange,
              tooltipHtml: expiryTooltipHtml
            },
            consentTemplate
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:mb-[15px] cky:rounded-[3px] cky:border cky:border-[#dcdcde] cky:bg-white cky:px-5 cky:py-3 cky:shadow-[0_1px_1px_rgba(0,0,0,0.04)]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:-mx-[15px] cky:flex cky:flex-wrap cky:items-center cky:justify-start cky:gap-0", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Label$1,
              {
                className: "cky:box-border cky:min-w-0 cky:max-w-[33.333%] cky:flex-[0_0_33.333%] cky:cursor-pointer cky:px-[15px] cky:text-sm cky:font-normal cky:leading-snug cky:text-[#23282d] max-[600px]:cky:mt-0 max-[600px]:cky:max-w-full max-[600px]:cky:flex-[0_0_100%]",
                htmlFor: "cky-reload-on-consent-react",
                children: __$2(
                  "Reload page on consent action",
                  "cookie-law-info"
                )
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:box-border cky:min-w-0 cky:max-w-[16.667%] cky:flex-[0_0_16.667%] cky:px-[15px] max-[600px]:cky:mt-2 max-[600px]:cky:max-w-full max-[600px]:cky:flex-[0_0_100%]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              Switch,
              {
                id: "cky-reload-on-consent-react",
                checked: reloadOnConsent,
                onCheckedChange: setReloadOnConsent
              }
            ) })
          ] }) }),
          consentTemplate === "gdpr" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              BannerBoxedAccordionSection,
              {
                sectionId: "cky-banner-prior-consent",
                title: __$2(
                  "Load cookies prior to consent",
                  "cookie-law-info"
                ),
                open: priorAccordionOpen,
                onToggle: /* @__PURE__ */ __name(() => setPriorAccordionOpen((o2) => !o2), "onToggle"),
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionWarningNote, { message: PRIOR_CONSENT_WARNING }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    CategoryCheckboxList,
                    {
                      categories: gdprCategoryRows,
                      idPrefix: "cky-prior-consent",
                      values: priorConsent,
                      adminLang,
                      onChange: /* @__PURE__ */ __name((slug, checked) => setPriorConsent((p2) => __spreadProps(__spreadValues({}, p2), { [slug]: checked })), "onChange")
                    }
                  )
                ]
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              BannerBoxedAccordionSection,
              {
                sectionId: "cky-banner-hide-categories",
                title: __$2("Hide categories from banner", "cookie-law-info"),
                open: hideCategoriesAccordionOpen,
                onToggle: /* @__PURE__ */ __name(() => setHideCategoriesAccordionOpen((o2) => !o2), "onToggle"),
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionWarningNote, { message: HIDE_CATEGORIES_WARNING }),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    CategoryCheckboxList,
                    {
                      categories: gdprCategoryRows,
                      idPrefix: "cky-hide-cat",
                      values: hideCategoryFromBanner,
                      adminLang,
                      onChange: /* @__PURE__ */ __name((slug, checked) => setHideCategoryFromBanner((p2) => __spreadProps(__spreadValues({}, p2), { [slug]: checked })), "onChange")
                    }
                  )
                ]
              }
            )
          ] }) : null
        ] }) : null
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyConnectModal,
        {
          ref: geoModalRef,
          visible: false,
          availablePlan: "pro",
          feature: "config_geo_rules",
          title: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.geoTarget, alt: __$2("Geo targeting", "cookie-law-info") }),
          featureText: geoPremiumFeatureText(geoModalCode),
          availabilityText: __$2(
            "Available in: <b>Pro</b> and <b>Ultimate</b> plans",
            "cookie-law-info"
          )
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyConnectModal,
        {
          ref: tcfModalRef,
          visible: false,
          availablePlan: "pro",
          title: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "img",
            {
              src: assets.tcfGcm,
              alt: __$2("TCF and Google Consent Mode", "cookie-law-info")
            }
          ),
          featureText: TCF_UPGRADE_MESSAGE,
          availabilityText: __$2(
            "Available in: <b> Pro and Ultimate plans </b>",
            "cookie-law-info"
          )
        }
      )
    ] }) });
  }, "CkyCustomizeGeneralPanel");
  const __ = /* @__PURE__ */ __name((text) => __$2(text, "cookie-law-info"), "__");
  function patchNoticePackElement(patchDraft, adminLang, key, value) {
    patchDraft((d) => {
      mutateContentLang(d, adminLang, (pack) => {
        var _a2;
        const notice = pack.notice;
        const els = (_a2 = notice.elements) != null ? _a2 : {};
        notice.elements = els;
        els[key] = value;
      });
    });
  }
  __name(patchNoticePackElement, "patchNoticePackElement");
  function patchNoticeToggleBtnStatus(patchDraft, btnKey, on) {
    patchDraft((d) => {
      var _a2, _b2, _c2, _d;
      const cfg = d.properties.config;
      if (btnKey === "readMore" && !(cfg == null ? void 0 : cfg.notice)) return;
      const noticeC = cfg.notice;
      const els = (_a2 = noticeC.elements) != null ? _a2 : {};
      noticeC.elements = els;
      const btns = (_b2 = els.buttons) != null ? _b2 : {};
      els.buttons = btns;
      const be2 = (_c2 = btns.elements) != null ? _c2 : {};
      btns.elements = be2;
      const node = (_d = be2[btnKey]) != null ? _d : {};
      be2[btnKey] = node;
      node.status = on;
    });
  }
  __name(patchNoticeToggleBtnStatus, "patchNoticeToggleBtnStatus");
  function NoticeButtonTextRow({
    control,
    name,
    inputId,
    contentKey,
    setNoticeButtonText
  }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Controller,
      {
        control,
        name,
        render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
          Field,
          {
            "data-invalid": fieldState.invalid,
            className: "cky:space-y-0",
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              FormRow,
              {
                label: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  FieldLabel,
                  {
                    htmlFor: inputId,
                    className: "cky:!font-normal cky:text-[#23282d]",
                    children: __("Label")
                  }
                ),
                labelTypography: "plain",
                children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-1", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    CkyInput,
                    __spreadProps(__spreadValues({
                      id: inputId,
                      type: "text",
                      className: "cky:w-full",
                      "aria-invalid": fieldState.invalid
                    }, field), {
                      value: typeof field.value === "string" ? field.value : "",
                      onChange: /* @__PURE__ */ __name((e) => {
                        field.onChange(e.target.value);
                        setNoticeButtonText(contentKey, e.target.value);
                      }, "onChange")
                    })
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
                ] })
              }
            )
          }
        ), "render")
      }
    );
  }
  __name(NoticeButtonTextRow, "NoticeButtonTextRow");
  function NoticeBtnColoursMaybe({
    cfg,
    btnKey,
    patchNoticeBtnStyle,
    onOpenPremium,
    bg = true,
    border = true
  }) {
    if (!cfg) return null;
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      BtnColours,
      {
        cfgBtn: cfg,
        bg,
        border,
        text: true,
        onStyleChange: /* @__PURE__ */ __name((prop, v) => patchNoticeBtnStyle(btnKey, prop, v), "onStyleChange"),
        onOpenPremium
      }
    );
  }
  __name(NoticeBtnColoursMaybe, "NoticeBtnColoursMaybe");
  function NoticeAccordion({
    contentPack,
    config: config2,
    bannerId,
    adminLang,
    consentLaw,
    patchDraft,
    onOpenPremium,
    onOpenCustomLogo
  }) {
    var _a2, _b2, _c2, _d, _e2, _f, _g;
    const uid = reactExports.useId();
    const noticeCfg = config2 == null ? void 0 : config2.notice;
    const nStyles = noticeCfg == null ? void 0 : noticeCfg.styles;
    const nEl = noticeCfg == null ? void 0 : noticeCfg.elements;
    const nTitleSt = (_a2 = nEl == null ? void 0 : nEl.title) == null ? void 0 : _a2.styles;
    const nDesc = nEl == null ? void 0 : nEl.description;
    const nDescSt = nDesc == null ? void 0 : nDesc.styles;
    const nBtns = (_b2 = nEl == null ? void 0 : nEl.buttons) == null ? void 0 : _b2.elements;
    const noticeContent = contentPack.notice;
    const nContentEl = noticeContent == null ? void 0 : noticeContent.elements;
    const nContentBtns = (_c2 = nContentEl == null ? void 0 : nContentEl.buttons) == null ? void 0 : _c2.elements;
    const patchNoticeBannerColor = /* @__PURE__ */ __name((which, hex2) => {
      patchDraft((d) => {
        var _a3, _b3, _c3, _d2, _e3, _f2, _g2;
        const cfg = d.properties.config;
        const noticeC = cfg.notice;
        if (which === "bg" || which === "border") {
          const st2 = (_a3 = noticeC.styles) != null ? _a3 : {};
          noticeC.styles = st2;
          if (which === "bg") st2["background-color"] = hex2;
          else st2["border-color"] = hex2;
          return;
        }
        if (which === "title") {
          const els2 = (_b3 = noticeC.elements) != null ? _b3 : {};
          noticeC.elements = els2;
          const title = (_c3 = els2.title) != null ? _c3 : {};
          els2.title = title;
          const st2 = (_d2 = title.styles) != null ? _d2 : {};
          title.styles = st2;
          st2.color = hex2;
          return;
        }
        const els = (_e3 = noticeC.elements) != null ? _e3 : {};
        noticeC.elements = els;
        const desc = (_f2 = els.description) != null ? _f2 : {};
        els.description = desc;
        const st = (_g2 = desc.styles) != null ? _g2 : {};
        desc.styles = st;
        st.color = hex2;
      });
    }, "patchNoticeBannerColor");
    const patchNoticeBtnStyle = /* @__PURE__ */ __name((btnKey, prop, v) => {
      patchDraft((d) => {
        var _a3, _b3, _c3, _d2, _e3;
        const cfg = d.properties.config;
        const noticeC = cfg.notice;
        const els = (_a3 = noticeC.elements) != null ? _a3 : {};
        noticeC.elements = els;
        const btns = (_b3 = els.buttons) != null ? _b3 : {};
        els.buttons = btns;
        const be2 = (_c3 = btns.elements) != null ? _c3 : {};
        btns.elements = be2;
        const btn = (_d2 = be2[btnKey]) != null ? _d2 : {};
        be2[btnKey] = btn;
        const st = (_e3 = btn.styles) != null ? _e3 : {};
        btn.styles = st;
        st[prop] = v;
      });
    }, "patchNoticeBtnStyle");
    const setNoticeButtonText = /* @__PURE__ */ __name((key, value) => {
      patchDraft((d) => {
        mutateContentLang(d, adminLang, (pack) => {
          var _a3, _b3, _c3, _d2;
          const notice = (_a3 = pack.notice) != null ? _a3 : {};
          pack.notice = notice;
          const els = (_b3 = notice.elements) != null ? _b3 : {};
          notice.elements = els;
          const btns = (_c3 = els.buttons) != null ? _c3 : {};
          els.buttons = btns;
          const be2 = (_d2 = btns.elements) != null ? _d2 : {};
          btns.elements = be2;
          be2[key] = value;
        });
      });
    }, "setNoticeButtonText");
    const form = useForm({
      resolver: t(noticeFormSchema),
      values: {
        title: readString(nContentEl == null ? void 0 : nContentEl.title),
        description: readString(nContentEl == null ? void 0 : nContentEl.description),
        privacyLink: readString(nContentEl == null ? void 0 : nContentEl.privacyLink),
        accept: readString(nContentBtns == null ? void 0 : nContentBtns.accept),
        reject: readString(nContentBtns == null ? void 0 : nContentBtns.reject),
        settings: readString(nContentBtns == null ? void 0 : nContentBtns.settings),
        readMore: readString(nContentBtns == null ? void 0 : nContentBtns.readMore),
        donotSell: readString(nContentBtns == null ? void 0 : nContentBtns.donotSell)
      },
      mode: "onChange"
    });
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(BannerSection, { value: "notice", title: __("Cookie Notice"), children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: FORM_SECTION_TOP, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Controller,
          {
            control: form.control,
            name: "title",
            render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { "data-invalid": fieldState.invalid, className: "cky:space-y-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              FormRow,
              {
                label: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  FieldLabel,
                  {
                    htmlFor: `${uid}-title`,
                    className: "cky:!font-medium cky:!leading-[18px] cky:text-[#23282d]",
                    children: __("Title")
                  }
                ),
                labelTypography: "plain",
                children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-1", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    CkyInput,
                    __spreadProps(__spreadValues({
                      id: `${uid}-title`,
                      type: "text",
                      className: "cky:w-full",
                      "aria-invalid": fieldState.invalid
                    }, field), {
                      value: typeof field.value === "string" ? field.value : "",
                      onChange: /* @__PURE__ */ __name((e) => {
                        field.onChange(e.target.value);
                        patchNoticePackElement(
                          patchDraft,
                          adminLang,
                          "title",
                          e.target.value
                        );
                      }, "onChange")
                    })
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
                ] })
              }
            ) }), "render")
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Controller,
          {
            control: form.control,
            name: "description",
            render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { "data-invalid": fieldState.invalid, className: "cky:space-y-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              FormRow,
              {
                label: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  FieldLabel,
                  {
                    htmlFor: `cky-notice-desc-${bannerId}`,
                    className: "cky:!font-medium cky:!leading-[18px] cky:text-[#23282d]",
                    children: __("Message")
                  }
                ),
                labelTypography: "plain",
                children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:w-full cky:flex-col cky:gap-1", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    WpEditor,
                    {
                      id: `cky-notice-desc-${bannerId}`,
                      value: field.value,
                      onChange: /* @__PURE__ */ __name((html) => {
                        field.onChange(html);
                        patchNoticePackElement(
                          patchDraft,
                          adminLang,
                          "description",
                          html
                        );
                      }, "onChange"),
                      language: adminLang,
                      height: "150"
                    }
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
                ] })
              }
            ) }), "render")
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(
          PremiumColourBlock,
          {
            label: __("Colours"),
            onPremiumClick: onOpenPremium,
            children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                ColourPickerField,
                {
                  fieldLabel: __("Background"),
                  value: readString(nStyles == null ? void 0 : nStyles["background-color"]),
                  onChange: /* @__PURE__ */ __name((hex2) => patchNoticeBannerColor("bg", hex2), "onChange")
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                ColourPickerField,
                {
                  fieldLabel: __("Border"),
                  value: readString(nStyles == null ? void 0 : nStyles["border-color"]),
                  onChange: /* @__PURE__ */ __name((hex2) => patchNoticeBannerColor("border", hex2), "onChange")
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                ColourPickerField,
                {
                  fieldLabel: __("Title"),
                  value: readString(nTitleSt == null ? void 0 : nTitleSt.color),
                  onChange: /* @__PURE__ */ __name((hex2) => patchNoticeBannerColor("title", hex2), "onChange"),
                  labelClassName: "cky:font-medium cky:text-[#23282d]"
                }
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                ColourPickerField,
                {
                  fieldLabel: __("Message"),
                  value: readString(nDescSt == null ? void 0 : nDescSt.color),
                  onChange: /* @__PURE__ */ __name((hex2) => patchNoticeBannerColor("desc", hex2), "onChange"),
                  labelClassName: "cky:font-medium cky:text-[#23282d]"
                }
              )
            ]
          }
        )
      ] }),
      consentLaw === "gdpr" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: SECTION_RULE, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: SUBSECTION_TITLE, children: __('"Accept All" button') }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            NoticeButtonTextRow,
            {
              control: form.control,
              name: "accept",
              inputId: `${uid}-accept`,
              contentKey: "accept",
              setNoticeButtonText
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            NoticeBtnColoursMaybe,
            {
              cfg: nBtns == null ? void 0 : nBtns.accept,
              btnKey: "accept",
              patchNoticeBtnStyle,
              onOpenPremium
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: SECTION_RULE, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(FormRow, { label: __('"Reject All" button'), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Switch,
            {
              id: "cky-notice-reject-toggle",
              checked: !!((_d = nBtns == null ? void 0 : nBtns.reject) == null ? void 0 : _d.status),
              onCheckedChange: /* @__PURE__ */ __name((on) => patchNoticeToggleBtnStatus(patchDraft, "reject", on), "onCheckedChange")
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            NoticeButtonTextRow,
            {
              control: form.control,
              name: "reject",
              inputId: `${uid}-reject`,
              contentKey: "reject",
              setNoticeButtonText
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            NoticeBtnColoursMaybe,
            {
              cfg: nBtns == null ? void 0 : nBtns.reject,
              btnKey: "reject",
              patchNoticeBtnStyle,
              onOpenPremium
            }
          )
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: SECTION_RULE, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(FormRow, { label: __('"Customise" button'), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Switch,
            {
              id: "cky-notice-settings-toggle",
              checked: !!((_e2 = nBtns == null ? void 0 : nBtns.settings) == null ? void 0 : _e2.status),
              onCheckedChange: /* @__PURE__ */ __name((on) => patchNoticeToggleBtnStatus(patchDraft, "settings", on), "onCheckedChange")
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            NoticeButtonTextRow,
            {
              control: form.control,
              name: "settings",
              inputId: `${uid}-settings`,
              contentKey: "settings",
              setNoticeButtonText
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            NoticeBtnColoursMaybe,
            {
              cfg: nBtns == null ? void 0 : nBtns.settings,
              btnKey: "settings",
              patchNoticeBtnStyle,
              onOpenPremium
            }
          )
        ] })
      ] }) : null,
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: SECTION_RULE, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(FormRow, { label: __('"Cookie Policy" link'), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Switch,
          {
            id: "cky-notice-readmore-toggle",
            checked: !!((_f = nBtns == null ? void 0 : nBtns.readMore) == null ? void 0 : _f.status),
            onCheckedChange: /* @__PURE__ */ __name((on) => patchNoticeToggleBtnStatus(patchDraft, "readMore", on), "onCheckedChange")
          }
        ) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          NoticeButtonTextRow,
          {
            control: form.control,
            name: "readMore",
            inputId: `${uid}-read-more`,
            contentKey: "readMore",
            setNoticeButtonText
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          NoticeBtnColoursMaybe,
          {
            cfg: nBtns == null ? void 0 : nBtns.readMore,
            btnKey: "readMore",
            patchNoticeBtnStyle,
            onOpenPremium,
            bg: false,
            border: false
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Controller,
          {
            control: form.control,
            name: "privacyLink",
            render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { "data-invalid": fieldState.invalid, className: "cky:space-y-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              FormRow,
              {
                label: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  FieldLabel,
                  {
                    htmlFor: `${uid}-privacy`,
                    className: "cky:!font-normal cky:text-[#23282d]",
                    children: __("URL")
                  }
                ),
                labelTypography: "plain",
                children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-1", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    CkyInput,
                    __spreadProps(__spreadValues({
                      id: `${uid}-privacy`,
                      type: "text",
                      className: "cky:w-full",
                      "aria-invalid": fieldState.invalid,
                      placeholder: __(
                        "Enter the URL to your cookie policy or privacy page"
                      )
                    }, field), {
                      value: typeof field.value === "string" ? field.value : "",
                      onChange: /* @__PURE__ */ __name((e) => {
                        field.onChange(e.target.value);
                        patchNoticePackElement(
                          patchDraft,
                          adminLang,
                          "privacyLink",
                          e.target.value
                        );
                      }, "onChange")
                    })
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
                ] })
              }
            ) }), "render")
          }
        )
      ] }),
      consentLaw === "ccpa" && (nBtns == null ? void 0 : nBtns.donotSell) ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: SECTION_RULE, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: SUBSECTION_TITLE, children: __('"Do Not Sell" link') }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          NoticeButtonTextRow,
          {
            control: form.control,
            name: "donotSell",
            inputId: `${uid}-donot-sell`,
            contentKey: "donotSell",
            setNoticeButtonText
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          NoticeBtnColoursMaybe,
          {
            cfg: nBtns.donotSell,
            btnKey: "donotSell",
            patchNoticeBtnStyle,
            onOpenPremium,
            bg: false,
            border: false
          }
        )
      ] }) : null,
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: SECTION_RULE, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:-mx-[15px] cky:flex cky:flex-wrap cky:items-center", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:min-h-[1px] cky:box-border cky:w-[25%] cky:max-w-[25%] cky:basis-[25%] cky:px-[15px] max-[700px]:cky:max-w-full max-[700px]:cky:w-full max-[700px]:cky:basis-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "label",
          {
            htmlFor: "cky-toggle-banner-close-btn",
            className: "cky:m-0 cky:flex cky:min-h-10 cky:items-center cky:gap-1 cky:p-0 cky:text-sm cky:font-normal cky:leading-4 cky:text-[#23282d]",
            children: [
              __("Close [X] button"),
              consentLaw === "gdpr" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                TooltipWithContent,
                {
                  content: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:max-w-[260px] cky:text-xs", children: __(
                    "Enable the close button to let users close the banner and continue browsing the site without being tracked. A close button is required by the Italian DPA."
                  ) }),
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                    Button,
                    {
                      variant: "ghost",
                      className: "cky:m-0 cky:h-auto cky:w-auto cky:shrink-0 cky:cursor-help cky:rounded-full cky:border-0 cky:bg-transparent cky:p-0 cky:leading-none cky:text-[#a6a8b1] hover:cky:bg-transparent hover:cky:text-[#8c8f9a] focus-visible:cky:outline focus-visible:cky:outline-2 focus-visible:cky:outline-offset-2 focus-visible:cky:outline-[var(--cky-primary)]",
                      "aria-label": __("More information"),
                      children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "tooltip", width: "14px", height: "14px" })
                    }
                  )
                }
              ) : null
            ]
          }
        ) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: FORM_ROW_COL_5, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Switch,
          {
            id: "cky-toggle-banner-close-btn",
            checked: !!((_g = nEl == null ? void 0 : nEl.closeButton) == null ? void 0 : _g.status),
            onCheckedChange: /* @__PURE__ */ __name((on) => patchDraft((d) => {
              var _a3;
              const cfg = d.properties.config;
              const noticeC = cfg.notice;
              const els = noticeC.elements;
              const cb = (_a3 = els.closeButton) != null ? _a3 : {};
              els.closeButton = cb;
              cb.status = on;
            }), "onCheckedChange")
          }
        ) })
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: SECTION_RULE, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        FormRow,
        {
          label: /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "label",
            {
              htmlFor: "cky-customize-branding",
              className: "cky:m-0 cky:inline-flex cky:min-h-10 cky:cursor-pointer cky:items-center cky:gap-1.5 cky:border-0 cky:bg-transparent cky:p-0 cky:text-sm cky:font-normal cky:leading-4 cky:text-[#23282d] hover:cky:opacity-90",
              children: [
                __("Custom logo"),
                /* @__PURE__ */ jsxRuntimeExports.jsx(CrownInline, {})
              ]
            }
          ),
          valueClassName: FORM_ROW_COL_5,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Switch,
            {
              id: "cky-customize-branding",
              checked: false,
              onCheckedChange: /* @__PURE__ */ __name(() => onOpenCustomLogo(), "onCheckedChange")
            }
          )
        }
      ) })
    ] });
  }
  __name(NoticeAccordion, "NoticeAccordion");
  const DEFAULT_LABEL_CLASS = "cky:!font-normal cky:text-[#23282d]";
  function CustomizeFormTextRow({
    control,
    name,
    inputId,
    label,
    labelClassName,
    onCommit
  }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Controller,
      {
        control,
        name,
        render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { "data-invalid": fieldState.invalid, className: "cky:space-y-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          FormRow,
          {
            label: /* @__PURE__ */ jsxRuntimeExports.jsx(
              FieldLabel,
              {
                htmlFor: inputId,
                className: labelClassName != null ? labelClassName : DEFAULT_LABEL_CLASS,
                children: label
              }
            ),
            labelTypography: "plain",
            children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-1", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                CkyInput,
                __spreadProps(__spreadValues({
                  id: inputId,
                  type: "text",
                  className: "cky:w-full",
                  "aria-invalid": fieldState.invalid
                }, field), {
                  value: typeof field.value === "string" ? field.value : "",
                  onChange: /* @__PURE__ */ __name((e) => {
                    field.onChange(e.target.value);
                    onCommit(e.target.value);
                  }, "onChange")
                })
              ),
              /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
            ] })
          }
        ) }), "render")
      }
    );
  }
  __name(CustomizeFormTextRow, "CustomizeFormTextRow");
  function PreferenceCentreAccordion({
    contentPack,
    config: config2,
    bannerId,
    adminLang,
    patchDraft,
    onOpenPremium
  }) {
    var _a2, _b2, _c2, _d, _e2, _f, _g, _h, _i, _j, _k;
    const uid = reactExports.useId();
    const pc = contentPack.preferenceCenter;
    const pcEl = pc == null ? void 0 : pc.elements;
    const prefCfg = config2 == null ? void 0 : config2.preferenceCenter;
    const saveSt = (_b2 = (_a2 = prefCfg == null ? void 0 : prefCfg.elements) == null ? void 0 : _a2.buttons) == null ? void 0 : _b2.elements;
    const usePrefSave = ((_c2 = saveSt == null ? void 0 : saveSt.save) == null ? void 0 : _c2.status) === true;
    const catPrev = contentPack.categoryPreview;
    const catPrevCfg = config2 == null ? void 0 : config2.categoryPreview;
    const saveLabelKey = usePrefSave ? (_e2 = (_d = pcEl == null ? void 0 : pcEl.buttons) == null ? void 0 : _d.elements) == null ? void 0 : _e2.save : (_h = (_g = (_f = catPrev == null ? void 0 : catPrev.elements) == null ? void 0 : _f.buttons) == null ? void 0 : _g.elements) == null ? void 0 : _h.save;
    const readableSaveCfg = usePrefSave ? saveSt == null ? void 0 : saveSt.save : (_k = (_j = (_i = catPrevCfg == null ? void 0 : catPrevCfg.elements) == null ? void 0 : _i.buttons) == null ? void 0 : _j.elements) == null ? void 0 : _k.save;
    const saveRootKey = usePrefSave ? "preferenceCenter" : "categoryPreview";
    const patchSaveButtonStyle = /* @__PURE__ */ __name((prop, v) => {
      patchDraft((d) => {
        const st = ensureObjectPath(d, [
          "properties",
          "config",
          saveRootKey,
          "elements",
          "buttons",
          "elements",
          "save",
          "styles"
        ]);
        st[prop] = v;
      });
    }, "patchSaveButtonStyle");
    const form = useForm({
      resolver: t(preferenceFormSchema),
      values: {
        title: readString(pcEl == null ? void 0 : pcEl.title),
        description: readString(pcEl == null ? void 0 : pcEl.description),
        showMore: readString(pcEl == null ? void 0 : pcEl.showMore),
        showLess: readString(pcEl == null ? void 0 : pcEl.showLess),
        saveLabel: readString(saveLabelKey)
      },
      mode: "onChange"
    });
    const updatePreferenceCenterField = /* @__PURE__ */ __name((field, value) => {
      patchDraft((d) => {
        mutateContentLang(
          d,
          adminLang,
          (pack) => setPreferenceCenterPackField(pack, field, value)
        );
      });
    }, "updatePreferenceCenterField");
    const patchDescriptionField = /* @__PURE__ */ __name((html) => {
      patchDraft((d) => {
        mutateContentLang(
          d,
          adminLang,
          (pack) => setPreferenceCenterPackField(
            pack,
            "description",
            html
          )
        );
      });
    }, "patchDescriptionField");
    const patchPcTextField = /* @__PURE__ */ __name((field) => (value) => {
      updatePreferenceCenterField(field, value);
    }, "patchPcTextField");
    const patchSavePackLabel = /* @__PURE__ */ __name((value) => {
      patchDraft((d) => {
        mutateContentLang(d, adminLang, (pack) => {
          const target = ensureObjectPath(pack, [
            saveRootKey,
            "elements",
            "buttons",
            "elements"
          ]);
          target.save = value;
        });
      });
    }, "patchSavePackLabel");
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      BannerSection,
      {
        value: "preference",
        title: __$2("Preference Centre", "cookie-law-info"),
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: FORM_SECTION_TOP, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              CustomizeFormTextRow,
              {
                control: form.control,
                name: "title",
                inputId: `${uid}-title`,
                label: __$2("Title", "cookie-law-info"),
                labelClassName: "cky:!font-medium cky:!leading-[18px] cky:text-[#23282d]",
                onCommit: patchPcTextField("title")
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Controller,
              {
                control: form.control,
                name: "description",
                render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { "data-invalid": fieldState.invalid, className: "cky:space-y-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  FormRow,
                  {
                    label: /* @__PURE__ */ jsxRuntimeExports.jsx(
                      FieldLabel,
                      {
                        htmlFor: `cky-pc-desc-${bannerId}`,
                        className: "cky:!font-normal cky:text-[#23282d]",
                        children: __$2("Privacy overview", "cookie-law-info")
                      }
                    ),
                    labelTypography: "plain",
                    children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:w-full cky:flex-col cky:gap-1", children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx(
                        WpEditor,
                        {
                          id: `cky-pc-desc-${bannerId}`,
                          value: field.value,
                          onChange: /* @__PURE__ */ __name((html) => {
                            field.onChange(html);
                            patchDescriptionField(html);
                          }, "onChange"),
                          language: adminLang
                        }
                      ),
                      /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
                    ] })
                  }
                ) }), "render")
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              CustomizeFormTextRow,
              {
                control: form.control,
                name: "showMore",
                inputId: `${uid}-show-more`,
                label: __$2('"Show more" button', "cookie-law-info"),
                onCommit: patchPcTextField("showMore")
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              CustomizeFormTextRow,
              {
                control: form.control,
                name: "showLess",
                inputId: `${uid}-show-less`,
                label: __$2('"Show less" button', "cookie-law-info"),
                onCommit: patchPcTextField("showLess")
              }
            )
          ] }),
          readableSaveCfg ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: SECTION_RULE, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: SUBSECTION_TITLE, children: __$2('"Save My Preferences" button', "cookie-law-info") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              CustomizeFormTextRow,
              {
                control: form.control,
                name: "saveLabel",
                inputId: `${uid}-save`,
                label: __$2("Label", "cookie-law-info"),
                onCommit: patchSavePackLabel
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              BtnColours,
              {
                cfgBtn: readableSaveCfg,
                bg: true,
                border: true,
                text: true,
                onStyleChange: patchSaveButtonStyle,
                onOpenPremium
              }
            )
          ] }) : null
        ]
      }
    );
  }
  __name(PreferenceCentreAccordion, "PreferenceCentreAccordion");
  function OptOutCenterAccordion({
    contentPack,
    config: config2,
    bannerId,
    adminLang,
    patchDraft,
    onOpenPremium,
    onOpenGpc
  }) {
    var _a2, _b2, _c2, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n2, _o, _p, _q, _r;
    const uid = reactExports.useId();
    const op = contentPack.optoutPopup;
    const opEl = op == null ? void 0 : op.elements;
    const opCfg = config2 == null ? void 0 : config2.optoutPopup;
    const optOptionCfg = (_a2 = opCfg == null ? void 0 : opCfg.elements) == null ? void 0 : _a2.optOption;
    const optToggleCfg = (_b2 = optOptionCfg == null ? void 0 : optOptionCfg.elements) == null ? void 0 : _b2.toggle;
    const optToggleStates = (_c2 = optToggleCfg == null ? void 0 : optToggleCfg.states) != null ? _c2 : {};
    const optActiveSt = (_d = optToggleStates.active) == null ? void 0 : _d.styles;
    const optInactiveSt = (_e2 = optToggleStates.inactive) == null ? void 0 : _e2.styles;
    const cancelCfg = (_h = (_g = (_f = opCfg == null ? void 0 : opCfg.elements) == null ? void 0 : _f.buttons) == null ? void 0 : _g.elements) == null ? void 0 : _h.cancel;
    const confirmCfg = (_k = (_j = (_i = opCfg == null ? void 0 : opCfg.elements) == null ? void 0 : _i.buttons) == null ? void 0 : _j.elements) == null ? void 0 : _k.confirm;
    const optSuccessContent = opEl == null ? void 0 : opEl.optoutSuccess;
    const optSuccessEls = optSuccessContent == null ? void 0 : optSuccessContent.elements;
    const opCfgEls = opCfg == null ? void 0 : opCfg.elements;
    const optSuccessCfg = opCfgEls == null ? void 0 : opCfgEls.optoutSuccess;
    const optSuccessSt = optSuccessCfg == null ? void 0 : optSuccessCfg.styles;
    const optSuccessCfgEls = optSuccessCfg == null ? void 0 : optSuccessCfg.elements;
    const optSuccessIconSt = (_l = optSuccessCfgEls == null ? void 0 : optSuccessCfgEls.icon) == null ? void 0 : _l.styles;
    const optSuccessTextSt = (_m = optSuccessCfgEls == null ? void 0 : optSuccessCfgEls.text) == null ? void 0 : _m.styles;
    const optSuccessSubtextSt = (_n2 = optSuccessCfgEls == null ? void 0 : optSuccessCfgEls.subtext) == null ? void 0 : _n2.styles;
    const requireOptSuccessMessage = Boolean(optSuccessContent);
    const schema = reactExports.useMemo(
      () => buildOptOutFormSchema(requireOptSuccessMessage),
      [requireOptSuccessMessage]
    );
    const form = useForm({
      resolver: t(schema),
      values: {
        title: readString(opEl == null ? void 0 : opEl.title),
        description: readString(opEl == null ? void 0 : opEl.description),
        showMore: readString(opEl == null ? void 0 : opEl.showMore),
        showLess: readString(opEl == null ? void 0 : opEl.showLess),
        cancel: readString(
          (_p = (_o = opEl == null ? void 0 : opEl.buttons) == null ? void 0 : _o.elements) == null ? void 0 : _p.cancel
        ),
        confirm: readString(
          (_r = (_q = opEl == null ? void 0 : opEl.buttons) == null ? void 0 : _q.elements) == null ? void 0 : _r.confirm
        ),
        optSuccessText: readString(optSuccessEls == null ? void 0 : optSuccessEls.text)
      },
      mode: "onChange"
    });
    const patchOptToggleBg = /* @__PURE__ */ __name((state, hex2) => {
      patchDraft((d) => {
        const popup = ensureObjectPath(d, [
          "properties",
          "config",
          "optoutPopup"
        ]);
        const st = ensureObjectPath(popup, [
          "elements",
          "optOption",
          "elements",
          "toggle",
          "states",
          state,
          "styles"
        ]);
        st["background-color"] = hex2;
      });
    }, "patchOptToggleBg");
    const patchOptSuccessStyle = /* @__PURE__ */ __name((target, hex2) => {
      patchDraft((d) => {
        const popup = ensureObjectPath(d, [
          "properties",
          "config",
          "optoutPopup"
        ]);
        const success = ensureObjectPath(popup, ["elements", "optoutSuccess"]);
        if (target === "bg") {
          const st = ensureObjectPath(success, ["styles"]);
          st["background-color"] = hex2;
        } else {
          const key = target === "icon" ? "icon" : target === "text" ? "text" : "subtext";
          const st = ensureObjectPath(success, ["elements", key, "styles"]);
          st.color = hex2;
        }
      });
    }, "patchOptSuccessStyle");
    const patchOptBtnStyle = /* @__PURE__ */ __name((btnKey, prop, v) => {
      patchDraft((d) => {
        const popup = ensureObjectPath(d, [
          "properties",
          "config",
          "optoutPopup"
        ]);
        const st = ensureObjectPath(popup, [
          "elements",
          "buttons",
          "elements",
          btnKey,
          "styles"
        ]);
        st[prop] = v;
      });
    }, "patchOptBtnStyle");
    const patchOptoutButtonText = /* @__PURE__ */ __name((key, value) => {
      patchDraft((d) => {
        mutateContentLang(d, adminLang, (pack) => {
          var _a3, _b3, _c3, _d2;
          const o2 = (_a3 = pack.optoutPopup) != null ? _a3 : {};
          pack.optoutPopup = o2;
          const els = (_b3 = o2.elements) != null ? _b3 : {};
          o2.elements = els;
          const btns = (_c3 = els.buttons) != null ? _c3 : {};
          els.buttons = btns;
          const be2 = (_d2 = btns.elements) != null ? _d2 : {};
          btns.elements = be2;
          be2[key] = value;
        });
      });
    }, "patchOptoutButtonText");
    const renderOptoutButtonSection = /* @__PURE__ */ __name((key, heading, cfgBtn) => {
      if (!cfgBtn) return null;
      return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: SECTION_RULE, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: SUBSECTION_TITLE, children: heading }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          CustomizeFormRowTextRow,
          {
            control: form.control,
            name: key,
            uid,
            inputSuffix: key,
            label: __$2("Label", "cookie-law-info"),
            onCommit: /* @__PURE__ */ __name((v) => patchOptoutButtonText(key, v), "onCommit")
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          BtnColours,
          {
            cfgBtn,
            bg: true,
            border: true,
            text: true,
            onStyleChange: /* @__PURE__ */ __name((prop, v) => patchOptBtnStyle(key, prop, v), "onStyleChange"),
            onOpenPremium
          }
        )
      ] });
    }, "renderOptoutButtonSection");
    const updateOptoutField = /* @__PURE__ */ __name((field, value) => {
      patchDraft((d) => {
        mutateContentLang(
          d,
          adminLang,
          (pack) => setOptoutPopupPackField(pack, field, value)
        );
      });
    }, "updateOptoutField");
    const patchOpTextField = /* @__PURE__ */ __name((field) => (value) => {
      updateOptoutField(field, value);
    }, "patchOpTextField");
    const patchOpDescription = /* @__PURE__ */ __name((html) => {
      patchDraft((d) => {
        mutateContentLang(
          d,
          adminLang,
          (pack) => setOptoutPopupPackField(pack, "description", html)
        );
      });
    }, "patchOpDescription");
    const patchOptSuccessTextCommit = /* @__PURE__ */ __name((value) => {
      patchDraft((d) => {
        mutateContentLang(
          d,
          adminLang,
          (pack) => setOptoutSuccessPackText(pack, value)
        );
      });
    }, "patchOptSuccessTextCommit");
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      BannerSection,
      {
        value: "opt-out-center",
        title: __$2("Opt-out center", "cookie-law-info"),
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: FORM_SECTION_TOP, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              CustomizeFormRowTextRow,
              {
                control: form.control,
                name: "title",
                uid,
                inputSuffix: "title",
                label: __$2("Title", "cookie-law-info"),
                onCommit: patchOpTextField("title")
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Controller,
              {
                control: form.control,
                name: "description",
                render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { "data-invalid": fieldState.invalid, className: "cky:space-y-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                  FormRow,
                  {
                    label: /* @__PURE__ */ jsxRuntimeExports.jsx(
                      FieldLabel,
                      {
                        htmlFor: `cky-optout-desc-${bannerId}`,
                        className: "cky:!font-normal cky:text-[#23282d]",
                        children: __$2("Privacy overview", "cookie-law-info")
                      }
                    ),
                    labelTypography: "plain",
                    children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:w-full cky:flex-col cky:gap-1", children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx(
                        WpEditor,
                        {
                          id: `cky-optout-desc-${bannerId}`,
                          value: field.value,
                          onChange: /* @__PURE__ */ __name((html) => {
                            field.onChange(html);
                            patchOpDescription(html);
                          }, "onChange"),
                          language: adminLang,
                          height: "180"
                        }
                      ),
                      /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
                    ] })
                  }
                ) }), "render")
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              CustomizeFormRowTextRow,
              {
                control: form.control,
                name: "showMore",
                uid,
                inputSuffix: "show-more",
                label: __$2('"Show more" button', "cookie-law-info"),
                onCommit: patchOpTextField("showMore")
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              CustomizeFormRowTextRow,
              {
                control: form.control,
                name: "showLess",
                uid,
                inputSuffix: "show-less",
                label: __$2('"Show less" button', "cookie-law-info"),
                onCommit: patchOpTextField("showLess")
              }
            )
          ] }),
          optToggleCfg ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: SECTION_RULE, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
            PremiumColourBlock,
            {
              label: __$2("Checkbox", "cookie-law-info"),
              labelVariant: "heading",
              onPremiumClick: onOpenPremium,
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  ColourPickerField,
                  {
                    fieldLabel: __$2("Enabled state", "cookie-law-info"),
                    value: readString(optActiveSt == null ? void 0 : optActiveSt["background-color"]),
                    onChange: /* @__PURE__ */ __name((hex2) => patchOptToggleBg("active", hex2), "onChange")
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  ColourPickerField,
                  {
                    fieldLabel: __$2("Disabled state", "cookie-law-info"),
                    value: readString(optInactiveSt == null ? void 0 : optInactiveSt["background-color"]),
                    onChange: /* @__PURE__ */ __name((hex2) => patchOptToggleBg("inactive", hex2), "onChange")
                  }
                )
              ]
            }
          ) }) : null,
          renderOptoutButtonSection(
            "cancel",
            __$2('"Cancel" button', "cookie-law-info"),
            cancelCfg
          ),
          renderOptoutButtonSection(
            "confirm",
            __$2('"Save My Preferences" button', "cookie-law-info"),
            confirmCfg
          ),
          optSuccessContent ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: SECTION_RULE, children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: SUBSECTION_TITLE, children: __$2("Opt-out confirmation message", "cookie-law-info") }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              CustomizeFormRowTextRow,
              {
                control: form.control,
                name: "optSuccessText",
                uid,
                inputSuffix: "osuccess",
                inputIdOverride: "cky-optout-success-message",
                label: __$2("Label", "cookie-law-info"),
                placeholder: __$2(
                  "Your opt-out preference has been honored.",
                  "cookie-law-info"
                ),
                inputWrapClassName: "cky:flex cky:w-full cky:flex-col cky:gap-1",
                onCommit: patchOptSuccessTextCommit
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              PremiumColourBlock,
              {
                label: __$2("Colours", "cookie-law-info"),
                onPremiumClick: onOpenPremium,
                children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    ColourPickerField,
                    {
                      fieldLabel: __$2("Background", "cookie-law-info"),
                      value: readString(optSuccessSt == null ? void 0 : optSuccessSt["background-color"]),
                      onChange: /* @__PURE__ */ __name((hex2) => patchOptSuccessStyle("bg", hex2), "onChange")
                    }
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    ColourPickerField,
                    {
                      fieldLabel: __$2("Icon", "cookie-law-info"),
                      value: readString(optSuccessIconSt == null ? void 0 : optSuccessIconSt.color),
                      onChange: /* @__PURE__ */ __name((hex2) => patchOptSuccessStyle("icon", hex2), "onChange")
                    }
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    ColourPickerField,
                    {
                      fieldLabel: __$2("Text", "cookie-law-info"),
                      value: readString(optSuccessTextSt == null ? void 0 : optSuccessTextSt.color),
                      onChange: /* @__PURE__ */ __name((hex2) => patchOptSuccessStyle("text", hex2), "onChange")
                    }
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    ColourPickerField,
                    {
                      fieldLabel: __$2("Subtext", "cookie-law-info"),
                      value: readString(optSuccessSubtextSt == null ? void 0 : optSuccessSubtextSt.color),
                      onChange: /* @__PURE__ */ __name((hex2) => patchOptSuccessStyle("subtext", hex2), "onChange")
                    }
                  )
                ]
              }
            )
          ] }) : null,
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: SECTION_RULE, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            FormRow,
            {
              labelClassName: "cky:relative cky:min-h-[1px] cky:box-border cky:w-[33.33%] cky:max-w-[33.33%] cky:basis-[33.33%] cky:px-[15px] max-[700px]:cky:max-w-full max-[700px]:cky:w-full max-[700px]:cky:basis-full",
              valueClassName: "cky:relative cky:min-h-[1px] cky:box-border cky:min-w-0 cky:w-[41.67%] cky:max-w-[41.67%] cky:basis-[41.67%] cky:px-[15px] max-[700px]:cky:mt-2 max-[700px]:cky:max-w-full max-[700px]:cky:w-full max-[700px]:cky:basis-full",
              labelTypography: "plain",
              label: /* @__PURE__ */ jsxRuntimeExports.jsxs(
                Button,
                {
                  variant: "ghost",
                  className: "cky-action-link cky:m-0 cky:inline-flex cky:items-center cky:gap-1.5 cky:border-0 cky:bg-transparent cky:p-0 cky:text-left cky:text-[13px] cky:font-normal cky:leading-snug cky:text-[#23282d] hover:cky:bg-transparent hover:cky:opacity-90",
                  onClick: /* @__PURE__ */ __name(() => onOpenGpc(), "onClick"),
                  children: [
                    __$2('Respect "Global Privacy control"', "cookie-law-info"),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(CrownInline, {})
                  ]
                }
              ),
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                Switch,
                {
                  id: "cky-gpc-placeholder",
                  checked: false,
                  onCheckedChange: /* @__PURE__ */ __name(() => onOpenGpc(), "onCheckedChange")
                }
              )
            }
          ) })
        ]
      }
    );
  }
  __name(OptOutCenterAccordion, "OptOutCenterAccordion");
  function CookieListAccordion({
    contentPack,
    config: config2,
    consentLaw,
    adminLang,
    patchDraft
  }) {
    var _a2, _b2, _c2, _d;
    const uid = reactExports.useId();
    const at = contentPack.auditTable;
    const atEl = at == null ? void 0 : at.elements;
    const headers = atEl == null ? void 0 : atEl.headers;
    const he2 = (_a2 = headers == null ? void 0 : headers.elements) != null ? _a2 : {};
    const auditCfg = config2 == null ? void 0 : config2.auditTable;
    const prefCat = contentPack.preferenceCenter;
    const catAlways = (_d = (_c2 = (_b2 = prefCat == null ? void 0 : prefCat.elements) == null ? void 0 : _b2.category) == null ? void 0 : _c2.elements) == null ? void 0 : _d.alwaysEnabled;
    const patchAuditHeader = /* @__PURE__ */ __name((field, value) => {
      patchDraft((d) => {
        mutateContentLang(d, adminLang, (pack) => {
          var _a3, _b3, _c3, _d2;
          const a2 = (_a3 = pack.auditTable) != null ? _a3 : {};
          pack.auditTable = a2;
          const els = (_b3 = a2.elements) != null ? _b3 : {};
          a2.elements = els;
          const h = (_c3 = els.headers) != null ? _c3 : {};
          els.headers = h;
          const hel = (_d2 = h.elements) != null ? _d2 : {};
          h.elements = hel;
          hel[field] = value;
        });
      });
    }, "patchAuditHeader");
    const patchAlwaysEnabled = /* @__PURE__ */ __name((value) => {
      patchDraft((d) => {
        mutateContentLang(d, adminLang, (pack) => {
          var _a3, _b3, _c3, _d2;
          const p2 = (_a3 = pack.preferenceCenter) != null ? _a3 : {};
          pack.preferenceCenter = p2;
          const els = (_b3 = p2.elements) != null ? _b3 : {};
          p2.elements = els;
          const cat = (_c3 = els.category) != null ? _c3 : {};
          els.category = cat;
          const ce2 = (_d2 = cat.elements) != null ? _d2 : {};
          cat.elements = ce2;
          ce2.alwaysEnabled = value;
        });
      });
    }, "patchAlwaysEnabled");
    const patchNoCookiesMessage = /* @__PURE__ */ __name((value) => {
      patchDraft((d) => {
        mutateContentLang(d, adminLang, (pack) => {
          var _a3, _b3;
          const a2 = (_a3 = pack.auditTable) != null ? _a3 : {};
          pack.auditTable = a2;
          const els = (_b3 = a2.elements) != null ? _b3 : {};
          a2.elements = els;
          els.message = value;
        });
      });
    }, "patchNoCookiesMessage");
    const form = useForm({
      resolver: t(cookieListFormSchema),
      values: {
        headerId: readString(he2.id),
        headerDuration: readString(he2.duration),
        headerDescription: readString(he2.description),
        alwaysEnabled: readString(catAlways),
        noCookiesMessage: readString(atEl == null ? void 0 : atEl.message)
      },
      mode: "onChange"
    });
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      BannerSection,
      {
        value: "cookie-list",
        title: __$2("Cookie List", "cookie-law-info"),
        contentClassName: "cky:!pb-[15px]",
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: SECTION_RULE, children: [
          consentLaw === "gdpr" ? /* @__PURE__ */ jsxRuntimeExports.jsx(FormRow, { label: __$2("Show cookie list", "cookie-law-info"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Switch,
            {
              id: "cky-audit-table",
              checked: (auditCfg == null ? void 0 : auditCfg.status) !== false,
              onCheckedChange: /* @__PURE__ */ __name((on) => patchDraft((d) => {
                var _a3;
                const cfg = d.properties.config;
                const a2 = (_a3 = cfg.auditTable) != null ? _a3 : {};
                cfg.auditTable = a2;
                a2.status = on;
              }), "onCheckedChange")
            }
          ) }) : null,
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            CustomizeFormTextRow,
            {
              control: form.control,
              name: "headerId",
              inputId: `${uid}-hid`,
              label: __$2('"Cookie" label', "cookie-law-info"),
              onCommit: /* @__PURE__ */ __name((v) => patchAuditHeader("id", v), "onCommit")
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            CustomizeFormTextRow,
            {
              control: form.control,
              name: "headerDuration",
              inputId: `${uid}-hdur`,
              label: __$2('"Duration" label', "cookie-law-info"),
              onCommit: /* @__PURE__ */ __name((v) => patchAuditHeader("duration", v), "onCommit")
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            CustomizeFormTextRow,
            {
              control: form.control,
              name: "headerDescription",
              inputId: `${uid}-hdesc`,
              label: __$2('"Description" label', "cookie-law-info"),
              onCommit: /* @__PURE__ */ __name((v) => patchAuditHeader("description", v), "onCommit")
            }
          ),
          consentLaw === "gdpr" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              CustomizeFormTextRow,
              {
                control: form.control,
                name: "alwaysEnabled",
                inputId: `${uid}-always`,
                label: __$2('"Always Active" label', "cookie-law-info"),
                onCommit: patchAlwaysEnabled
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              CustomizeFormTextRow,
              {
                control: form.control,
                name: "noCookiesMessage",
                inputId: `${uid}-empty`,
                label: __$2('"No cookies to display" label', "cookie-law-info"),
                onCommit: patchNoCookiesMessage
              }
            )
          ] }) : null
        ] })
      }
    );
  }
  __name(CookieListAccordion, "CookieListAccordion");
  const revisitFormSchema = objectType({
    hoverTitle: stringType(),
    position: enumType(["bottom-left", "bottom-right"])
  });
  function RevisitConsentAccordion({
    contentPack,
    config: config2,
    consentLaw,
    adminLang,
    patchDraft,
    onOpenPremium,
    onOpenRevisitIcon
  }) {
    const uid = reactExports.useId();
    const rv = contentPack.revisitConsent;
    const rvEl = rv == null ? void 0 : rv.elements;
    const rvCfg = config2 == null ? void 0 : config2.revisitConsent;
    const rvStyles = rvCfg == null ? void 0 : rvCfg.styles;
    const updateHoverTitle = /* @__PURE__ */ __name((value) => {
      patchDraft((d) => {
        mutateContentLang(d, adminLang, (pack) => {
          var _a2, _b2;
          const r2 = (_a2 = pack.revisitConsent) != null ? _a2 : {};
          pack.revisitConsent = r2;
          const els = (_b2 = r2.elements) != null ? _b2 : {};
          r2.elements = els;
          els.title = value;
        });
      });
    }, "updateHoverTitle");
    const positionRaw = (rvCfg == null ? void 0 : rvCfg.position) || "bottom-right";
    const position = positionRaw === "bottom-left" ? "bottom-left" : "bottom-right";
    const form = useForm({
      resolver: t(revisitFormSchema),
      values: {
        hoverTitle: readString(rvEl == null ? void 0 : rvEl.title),
        position
      },
      mode: "onChange"
    });
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      BannerSection,
      {
        value: "revisit-consent",
        title: __$2("Revisit Consent Button", "cookie-law-info"),
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: FORM_SECTION_TOP, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(FormRow, { label: __$2("Revisit consent button", "cookie-law-info"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            Switch,
            {
              id: "cky-revisit-status",
              checked: (rvCfg == null ? void 0 : rvCfg.status) !== false,
              onCheckedChange: /* @__PURE__ */ __name((on) => patchDraft((d) => {
                var _a2;
                const cfg = d.properties.config;
                const r2 = (_a2 = cfg.revisitConsent) != null ? _a2 : {};
                cfg.revisitConsent = r2;
                r2.status = on;
              }), "onCheckedChange")
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            Controller,
            {
              control: form.control,
              name: "hoverTitle",
              render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { "data-invalid": fieldState.invalid, className: "cky:space-y-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                FormRow,
                {
                  label: /* @__PURE__ */ jsxRuntimeExports.jsx(
                    FieldLabel,
                    {
                      htmlFor: `${uid}-hover`,
                      className: "cky:!font-normal cky:text-[#23282d]",
                      children: __$2("Text on hover", "cookie-law-info")
                    }
                  ),
                  labelTypography: "plain",
                  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-1", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      CkyInput,
                      __spreadProps(__spreadValues({
                        id: `${uid}-hover`,
                        type: "text",
                        className: "cky:w-full",
                        "aria-invalid": fieldState.invalid
                      }, field), {
                        value: typeof field.value === "string" ? field.value : "",
                        onChange: /* @__PURE__ */ __name((e) => {
                          field.onChange(e.target.value);
                          updateHoverTitle(e.target.value);
                        }, "onChange")
                      })
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
                  ] })
                }
              ) }), "render")
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            Controller,
            {
              control: form.control,
              name: "position",
              render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { "data-invalid": fieldState.invalid, className: "cky:space-y-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                FormRow,
                {
                  label: /* @__PURE__ */ jsxRuntimeExports.jsx(FieldLabel, { className: "cky:!font-normal cky:text-[#23282d]", children: __$2("Position", "cookie-law-info") }),
                  labelTypography: "plain",
                  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-1", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsxs(
                      RadioGroup,
                      {
                        value: field.value,
                        onValueChange: /* @__PURE__ */ __name((value) => {
                          const v = value;
                          field.onChange(v);
                          patchDraft((d) => {
                            var _a2;
                            const cfg = d.properties.config;
                            const r2 = (_a2 = cfg.revisitConsent) != null ? _a2 : {};
                            cfg.revisitConsent = r2;
                            r2.position = v;
                          });
                        }, "onValueChange"),
                        className: "cky:flex cky:flex-wrap cky:items-center cky:gap-6",
                        "aria-invalid": fieldState.invalid,
                        children: [
                          /* @__PURE__ */ jsxRuntimeExports.jsxs(
                            Label$2,
                            {
                              htmlFor: `cky-revisit-pos-left-${consentLaw}`,
                              className: "cky:flex cky:cursor-pointer cky:items-center cky:gap-2",
                              children: [
                                /* @__PURE__ */ jsxRuntimeExports.jsx(
                                  RadioGroupItem,
                                  {
                                    value: "bottom-left",
                                    id: `cky-revisit-pos-left-${consentLaw}`
                                  }
                                ),
                                __$2("Left", "cookie-law-info")
                              ]
                            }
                          ),
                          /* @__PURE__ */ jsxRuntimeExports.jsxs(
                            Label$2,
                            {
                              htmlFor: `cky-revisit-pos-right-${consentLaw}`,
                              className: "cky:flex cky:cursor-pointer cky:items-center cky:gap-2",
                              children: [
                                /* @__PURE__ */ jsxRuntimeExports.jsx(
                                  RadioGroupItem,
                                  {
                                    value: "bottom-right",
                                    id: `cky-revisit-pos-right-${consentLaw}`
                                  }
                                ),
                                __$2("Right", "cookie-law-info")
                              ]
                            }
                          )
                        ]
                      }
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
                  ] })
                }
              ) }), "render")
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            PremiumColourBlock,
            {
              label: __$2("Colours", "cookie-law-info"),
              onPremiumClick: onOpenPremium,
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                ColourPickerField,
                {
                  fieldLabel: __$2("Background", "cookie-law-info"),
                  value: readString(rvStyles == null ? void 0 : rvStyles["background-color"]),
                  onChange: /* @__PURE__ */ __name((hex2) => patchDraft((d) => {
                    var _a2, _b2;
                    const cfg = d.properties.config;
                    const r2 = (_a2 = cfg.revisitConsent) != null ? _a2 : {};
                    cfg.revisitConsent = r2;
                    const st = (_b2 = r2.styles) != null ? _b2 : {};
                    r2.styles = st;
                    st["background-color"] = hex2;
                  }), "onChange")
                }
              )
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            FormRow,
            {
              label: /* @__PURE__ */ jsxRuntimeExports.jsxs(
                Button,
                {
                  type: "button",
                  variant: "ghost",
                  className: "cky:m-0 cky:inline-flex cky:items-center cky:gap-1.5 cky:border-0 cky:bg-transparent cky:p-0 cky:text-left cky:text-[13px] cky:font-normal cky:leading-snug cky:text-[#23282d] hover:cky:bg-transparent hover:cky:opacity-90",
                  onClick: /* @__PURE__ */ __name(() => onOpenRevisitIcon(), "onClick"),
                  children: [
                    __$2("Custom icon", "cookie-law-info"),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(CrownInline, {})
                  ]
                }
              ),
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                Switch,
                {
                  id: "cky-revisit-icon-ph",
                  checked: false,
                  onCheckedChange: /* @__PURE__ */ __name(() => onOpenRevisitIcon(), "onCheckedChange")
                }
              )
            }
          )
        ] })
      }
    );
  }
  __name(RevisitConsentAccordion, "RevisitConsentAccordion");
  function BlockedContentAccordion({
    contentPack,
    config: config2,
    adminLang,
    patchDraft,
    onOpenPremium
  }) {
    var _a2;
    const uid = reactExports.useId();
    const vp = contentPack.videoPlaceholder;
    const vpEl = vp == null ? void 0 : vp.elements;
    const vpCfg = config2 == null ? void 0 : config2.videoPlaceholder;
    const vpSt = vpCfg == null ? void 0 : vpCfg.styles;
    const titleSt = (_a2 = vpCfg == null ? void 0 : vpCfg.elements) == null ? void 0 : _a2.title;
    const titleStyles = titleSt == null ? void 0 : titleSt.styles;
    const labelFromPack = readString(vpEl == null ? void 0 : vpEl.title);
    const form = useForm({
      resolver: t(blockedLabelSchema),
      values: { blockedLabel: labelFromPack },
      mode: "onChange"
    });
    const patchVideoPlaceholderStyle = /* @__PURE__ */ __name((key, value) => {
      patchDraft((d) => {
        const styles = ensureObjectPath(d, [
          "properties",
          "config",
          "videoPlaceholder",
          "styles"
        ]);
        styles[key] = value;
      });
    }, "patchVideoPlaceholderStyle");
    const patchVideoPlaceholderTitleColor = /* @__PURE__ */ __name((value) => {
      patchDraft((d) => {
        const styles = ensureObjectPath(d, [
          "properties",
          "config",
          "videoPlaceholder",
          "elements",
          "title",
          "styles"
        ]);
        styles.color = value;
      });
    }, "patchVideoPlaceholderTitleColor");
    const patchBlockedLabel = /* @__PURE__ */ __name((value) => {
      patchDraft((d) => {
        mutateContentLang(
          d,
          adminLang,
          (pack) => setVideoPlaceholderTitleInPack(pack, value)
        );
      });
    }, "patchBlockedLabel");
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      BannerSection,
      {
        value: "blocked-content",
        title: __$2("Blocked Content", "cookie-law-info"),
        contentClassName: "cky:!pb-[15px]",
        children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: SECTION_RULE, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            Controller,
            {
              control: form.control,
              name: "blockedLabel",
              render: /* @__PURE__ */ __name(({ field, fieldState }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Field, { "data-invalid": fieldState.invalid, className: "cky:space-y-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                FormRow,
                {
                  label: /* @__PURE__ */ jsxRuntimeExports.jsx(
                    FieldLabel,
                    {
                      htmlFor: `${uid}-blocked-label`,
                      className: "cky:!font-normal cky:text-[#23282d]",
                      children: __$2("Label", "cookie-law-info")
                    }
                  ),
                  labelTypography: "plain",
                  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:gap-1", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      CkyInput,
                      __spreadProps(__spreadValues({
                        id: `${uid}-blocked-label`,
                        type: "text",
                        className: "cky:w-full",
                        "aria-invalid": fieldState.invalid
                      }, field), {
                        value: typeof field.value === "string" ? field.value : "",
                        onChange: /* @__PURE__ */ __name((e) => {
                          field.onChange(e.target.value);
                          patchBlockedLabel(e.target.value);
                        }, "onChange")
                      })
                    ),
                    /* @__PURE__ */ jsxRuntimeExports.jsx(FieldError, { errors: fieldState.error })
                  ] })
                }
              ) }), "render")
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            PremiumColourBlock,
            {
              label: __$2("Colours", "cookie-law-info"),
              onPremiumClick: onOpenPremium,
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  ColourPickerField,
                  {
                    fieldLabel: __$2("Background", "cookie-law-info"),
                    value: readString(vpSt == null ? void 0 : vpSt["background-color"]),
                    onChange: /* @__PURE__ */ __name((hex2) => patchVideoPlaceholderStyle("background-color", hex2), "onChange")
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  ColourPickerField,
                  {
                    fieldLabel: __$2("Border", "cookie-law-info"),
                    value: readString(vpSt == null ? void 0 : vpSt["border-color"]),
                    onChange: /* @__PURE__ */ __name((hex2) => patchVideoPlaceholderStyle("border-color", hex2), "onChange")
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  ColourPickerField,
                  {
                    fieldLabel: __$2("Text", "cookie-law-info"),
                    value: readString(titleStyles == null ? void 0 : titleStyles.color),
                    onChange: /* @__PURE__ */ __name((hex2) => patchVideoPlaceholderTitleColor(hex2), "onChange")
                  }
                )
              ]
            }
          )
        ] })
      }
    );
  }
  __name(BlockedContentAccordion, "BlockedContentAccordion");
  function themeOptionLabel(tid) {
    if (tid === "light") return __$2("Light", "cookie-law-info");
    if (tid === "dark") return __$2("Dark", "cookie-law-info");
    return __$2("Custom", "cookie-law-info");
  }
  __name(themeOptionLabel, "themeOptionLabel");
  const CkyCustomizeContentPanel = /* @__PURE__ */ __name(({
    consentLaw,
    onConsentLawChange,
    bannerPreviewOn,
    onBannerPreviewChange,
    allBanners,
    allCookies,
    settingsReady,
    onRefreshSettings,
    onAfterPublish,
    dataEpoch,
    contentBannerDraftRef,
    layoutPanelStateRef
  }) => {
    const adminLang = getAdminBannerLanguage();
    const bannerForLaw = reactExports.useMemo(
      () => {
        var _a2;
        return (_a2 = allBanners.find((b) => getBannerApplicableLaw$1(b) === consentLaw)) != null ? _a2 : null;
      },
      [allBanners, consentLaw]
    );
    const [draft, setDraft] = reactExports.useState(null);
    const [openSection, setOpenSection] = reactExports.useState(void 0);
    const [publishing, setPublishing] = reactExports.useState(false);
    const baselineRef = reactExports.useRef(null);
    const [dirty, setDirty] = reactExports.useState(false);
    useSyncBannerPanelDirty("content", dirty);
    const customLogoModalRef = reactExports.useRef(null);
    const revisitIconModalRef = reactExports.useRef(null);
    const customThemeModalRef = reactExports.useRef(null);
    const gpcModalRef = reactExports.useRef(null);
    const themeHeadsUpRef = reactExports.useRef(null);
    const [pendingTheme, setPendingTheme] = reactExports.useState(
      null
    );
    const [presets, setPresets] = reactExports.useState([]);
    const bannerId = reactExports.useMemo(
      () => bannerForLaw == null ? 0 : Number(bannerForLaw.id),
      [bannerForLaw]
    );
    const patchDraft = reactExports.useCallback(
      (mutator) => {
        setDraft((prev) => {
          if (!prev) return prev;
          const next = deepClone(prev);
          mutator(next);
          applyPreferenceSaveButtonVisibility(next);
          syncNoticeDerivedFields(next, adminLang);
          return next;
        });
      },
      [adminLang]
    );
    reactExports.useEffect(() => {
      setOpenSection(void 0);
    }, [consentLaw]);
    reactExports.useEffect(() => {
      if (contentBannerDraftRef) contentBannerDraftRef.current = draft;
    }, [draft, contentBannerDraftRef]);
    reactExports.useLayoutEffect(() => {
      if (!settingsReady || !bannerForLaw || !bannerId) {
        setDraft(null);
        baselineRef.current = null;
        return;
      }
      const d = deepClone(bannerForLaw);
      applyPreferenceSaveButtonVisibility(d);
      if (getBannerApplicableLaw$1(bannerForLaw) === "ccpa") {
        ensureCcpaOptoutSuccessContent(d, adminLang);
      }
      setDraft(d);
      const t2 = globalThis.setTimeout(() => {
        baselineRef.current = contentSettingsFingerprint(d);
        setDirty(false);
      }, 0);
      return () => globalThis.clearTimeout(t2);
    }, [settingsReady, bannerForLaw, bannerId, dataEpoch, adminLang]);
    reactExports.useEffect(() => {
      if (!draft || !baselineRef.current) return;
      setDirty(contentSettingsFingerprint(draft) !== baselineRef.current);
    }, [draft]);
    const props = draft == null ? void 0 : draft.properties;
    const settings2 = props == null ? void 0 : props.settings;
    const config2 = props == null ? void 0 : props.config;
    const theme = (settings2 == null ? void 0 : settings2.theme) || "light";
    const versionID = (settings2 == null ? void 0 : settings2.versionID) || "6.2.0";
    reactExports.useEffect(() => {
      let cancelled = false;
      fetchBannerPresets(versionID).then((list) => {
        if (!cancelled) setPresets(list);
      });
      return () => {
        cancelled = true;
      };
    }, [versionID]);
    const prevPreviewRef = reactExports.useRef(false);
    const previewStateRef = reactExports.useRef(bannerPreviewOn);
    previewStateRef.current = bannerPreviewOn;
    const lastPreviewApplicableLawRef = reactExports.useRef(void 0);
    reactExports.useEffect(() => {
      const previewToggledOn = !prevPreviewRef.current && bannerPreviewOn;
      prevPreviewRef.current = bannerPreviewOn;
      if (!bannerPreviewOn || !draft) return;
      const render = /* @__PURE__ */ __name(() => {
        const previewBanner = (layoutPanelStateRef == null ? void 0 : layoutPanelStateRef.current) != null ? mergeLayoutStateIntoBanner(draft, consentLaw, layoutPanelStateRef.current) : draft;
        const applicable = getBannerApplicableLaw$1(previewBanner);
        if (applicable !== lastPreviewApplicableLawRef.current) {
          lastPreviewApplicableLawRef.current = applicable;
          bannerPreview.resetTemplateCache();
        }
        setBannerPreviewContext(
          previewBanner,
          adminLang,
          toPreviewCookieCategories(allCookies)
        );
        bannerPreview.startLoading();
        bannerPreview.generate(false, true).catch((e) => console.error(e)).finally(() => {
          bannerPreview.stopLoading();
          if (!previewStateRef.current) {
            bannerPreview.hidePreview();
          }
        });
      }, "render");
      if (previewToggledOn) {
        render();
        return;
      }
      const handle = window.setTimeout(render, 300);
      return () => window.clearTimeout(handle);
    }, [draft, bannerPreviewOn, allCookies, adminLang, consentLaw, layoutPanelStateRef]);
    const applyThemePreset = reactExports.useCallback(
      (name) => {
        patchDraft((d) => {
          var _a2;
          const p2 = d.properties;
          const s2 = p2.settings;
          s2.theme = name;
          const preset = presets.find((pr) => pr.name === name);
          if (!preset) return;
          const cfg = (_a2 = p2.config) != null ? _a2 : {};
          p2.config = arrayReplaceRecursive(cfg, preset.settings);
        });
      },
      [patchDraft, presets]
    );
    const noticeOn = (config2 == null ? void 0 : config2.notice) == null || config2.notice.status !== false;
    const customHtmlMode = reactExports.useMemo(() => {
      const ch = settings2 == null ? void 0 : settings2.customHtml;
      return (ch == null ? void 0 : ch.status) === true;
    }, [settings2]);
    const contentPack = reactExports.useMemo(() => {
      const contents = draft == null ? void 0 : draft.contents;
      return draft ? getContentPackForLanguage(contents, adminLang, getDefaultLanguage()) : {};
    }, [draft, adminLang]);
    const optOutConfirmationInvalid = reactExports.useMemo(
      () => consentLaw === "ccpa" && isCcpaOptoutSuccessTextInvalid(draft, adminLang),
      [consentLaw, draft, adminLang]
    );
    const saveConfig = reactExports.useCallback(() => __async(null, null, function* () {
      if (!draft || !bannerId) {
        toast.error(noBannerFoundMessage(__$2));
        return;
      }
      if (consentLaw === "ccpa" && isCcpaOptoutSuccessTextInvalid(draft, adminLang)) {
        toast.error(
          __$2("A message is required to show upon opt-out.", "cookie-law-info")
        );
        return;
      }
      setPublishing(true);
      try {
        const layoutAwareBanners = (layoutPanelStateRef == null ? void 0 : layoutPanelStateRef.current) ? mergeAllBannersWithLayoutState(
          allBanners,
          consentLaw,
          layoutPanelStateRef.current
        ) : allBanners.map((b) => deepClone(b));
        const currentDraft = (layoutPanelStateRef == null ? void 0 : layoutPanelStateRef.current) != null ? mergeLayoutStateIntoBanner(draft, consentLaw, layoutPanelStateRef.current) : deepClone(draft);
        const merged = layoutAwareBanners.map(
          (b) => getBannerApplicableLaw$1(b) === consentLaw ? currentDraft : deepClone(b)
        );
        const withStatus = setBannerStatusByLaw(merged, consentLaw);
        const res = yield bulkSaveBanners(withStatus, false);
        if (!Array.isArray(res) || res.length === 0) {
          throw new Error("Banner bulk save returned no data");
        }
        yield cookieApi.bulkUpdateCookieCategory(
          allCookies.map((c2) => deepClone(c2))
        );
        yield onRefreshSettings();
        yield onAfterPublish();
        toast.success(saveSuccessMessage(__$2));
        baselineRef.current = contentSettingsFingerprint(draft);
        setDirty(false);
      } catch (e) {
        console.error(e);
        toast.error(saveErrorMessage(__$2));
      } finally {
        setPublishing(false);
      }
    }), [
      draft,
      bannerId,
      allBanners,
      consentLaw,
      adminLang,
      allCookies,
      onRefreshSettings,
      onAfterPublish
    ]);
    reactExports.useEffect(() => {
      if (!noticeOn && bannerPreviewOn) {
        onBannerPreviewChange(false);
      }
    }, [noticeOn, bannerPreviewOn, onBannerPreviewChange]);
    const handleThemeRadio = reactExports.useCallback(
      (next) => {
        var _a2, _b2;
        if (next === "custom") {
          (_a2 = customThemeModalRef.current) == null ? void 0 : _a2.show();
          return;
        }
        if (theme === "custom") {
          setPendingTheme(next);
          (_b2 = themeHeadsUpRef.current) == null ? void 0 : _b2.show();
          return;
        }
        applyThemePreset(next);
      },
      [theme, applyThemePreset]
    );
    const confirmThemeSwitch = reactExports.useCallback(() => {
      if (!pendingTheme) return;
      applyThemePreset(pendingTheme);
      setPendingTheme(null);
    }, [pendingTheme, applyThemePreset]);
    const openPremium = reactExports.useCallback(
      () => {
        var _a2;
        return (_a2 = customThemeModalRef.current) == null ? void 0 : _a2.show();
      },
      []
    );
    const openCustomLogoModal = reactExports.useCallback(
      () => {
        var _a2;
        return (_a2 = customLogoModalRef.current) == null ? void 0 : _a2.show();
      },
      []
    );
    const openGpcModal = reactExports.useCallback(() => {
      var _a2;
      return (_a2 = gpcModalRef.current) == null ? void 0 : _a2.show();
    }, []);
    const openRevisitIconModal = reactExports.useCallback(
      () => {
        var _a2;
        return (_a2 = revisitIconModalRef.current) == null ? void 0 : _a2.show();
      },
      []
    );
    const handleThemeSelectionChange = reactExports.useCallback(
      (v) => handleThemeRadio(v),
      [handleThemeRadio]
    );
    const handleOpenSectionChange = reactExports.useCallback((v) => {
      setOpenSection(v === "" ? void 0 : v);
    }, []);
    const handleCustomThemeKeyDown = reactExports.useCallback(
      (e) => {
        if (e.key === "Enter" || e.key === " ") {
          e.preventDefault();
          openPremium();
        }
      },
      [openPremium]
    );
    const sharedAccordionProps = reactExports.useMemo(
      () => ({
        contentPack,
        config: config2,
        bannerId,
        adminLang,
        patchDraft,
        onOpenPremium: openPremium
      }),
      [contentPack, config2, bannerId, adminLang, patchDraft, openPremium]
    );
    const sections = getContentSectionsForLaw(consentLaw);
    const contentTabRtl = isRTLLanguage(getDefaultLanguage());
    const confirmBtnLabel = reactExports.useMemo(() => {
      if (pendingTheme === "light") {
        return __$2("Select light theme", "cookie-law-info");
      }
      if (pendingTheme === "dark") {
        return __$2("Select dark theme", "cookie-law-info");
      }
      return __$2("Select theme", "cookie-law-info");
    }, [pendingTheme]);
    const sectionRenderers = reactExports.useMemo(
      () => ({
        notice: /* @__PURE__ */ __name(() => noticeOn ? /* @__PURE__ */ jsxRuntimeExports.jsx(
          NoticeAccordion,
          __spreadValues({
            consentLaw,
            onOpenCustomLogo: openCustomLogoModal
          }, sharedAccordionProps),
          "notice"
        ) : null, "notice"),
        preference: /* @__PURE__ */ __name(() => consentLaw === "gdpr" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
          PreferenceCentreAccordion,
          __spreadValues({}, sharedAccordionProps),
          "preference"
        ) : null, "preference"),
        "opt-out-center": /* @__PURE__ */ __name(() => consentLaw === "ccpa" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
          OptOutCenterAccordion,
          __spreadValues({
            onOpenGpc: openGpcModal
          }, sharedAccordionProps),
          "opt-out-center"
        ) : null, "opt-out-center"),
        "cookie-list": /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntimeExports.jsx(
          CookieListAccordion,
          __spreadValues({
            consentLaw
          }, sharedAccordionProps),
          "cookie-list"
        ), "cookie-list"),
        "revisit-consent": /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntimeExports.jsx(
          RevisitConsentAccordion,
          __spreadValues({
            consentLaw,
            onOpenRevisitIcon: openRevisitIconModal
          }, sharedAccordionProps),
          "revisit-consent"
        ), "revisit-consent"),
        "blocked-content": /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntimeExports.jsx(
          BlockedContentAccordion,
          __spreadValues({}, sharedAccordionProps),
          "blocked-content"
        ), "blocked-content")
      }),
      [
        consentLaw,
        noticeOn,
        sharedAccordionProps,
        openCustomLogoModal,
        openGpcModal,
        openRevisitIconModal
      ]
    );
    if (!settingsReady || !draft || !bannerForLaw) {
      return /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          className: "cky:flex cky:min-h-[min(400px,50vh)] cky:flex-col cky:items-stretch cky:justify-center",
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:p-3" })
        }
      );
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        BannerCustomizeToolbar,
        {
          consentLaw,
          onConsentLawChange,
          bannerPreviewOn,
          onBannerPreviewChange,
          showBanner: noticeOn,
          previewControlId: "cky-banner-preview-react-content",
          publishDisabled: !settingsReady || !draft || optOutConfirmationInvalid,
          publishing,
          onPublish: saveConfig
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:min-h-[min(700px,70vh)]", children: [
        customHtmlMode ? /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { variant: "warning", className: "cky:mb-4 cky:rounded-[3px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(AlertDescription, { className: "cky:text-sm cky:leading-snug cky:text-[#23282d]", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: __$2("You're in Custom HTML mode. ", "cookie-law-info") }),
          __$2(
            "The edits that you have made in the HTML Editor will override any changes made to the settings below",
            "cookie-law-info"
          )
        ] }) }) : null,
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: COLOUR_SCHEME_ROW, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:m-0 cky:inline-flex cky:shrink-0 cky:items-center cky:px-[15px] cky:text-sm cky:font-medium cky:leading-5 cky:text-[#23282d]", children: __$2("Colour scheme", "cookie-law-info") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            RadioGroup,
            {
              value: theme,
              onValueChange: handleThemeSelectionChange,
              className: "cky:flex cky:min-w-0 cky:flex-1 cky:flex-row cky:flex-nowrap cky:items-center cky:gap-x-5 cky:gap-y-0",
              "aria-label": __$2("Colour scheme", "cookie-law-info"),
              children: ["light", "dark", "custom"].map((tid) => {
                const id = `cky-content-theme-${consentLaw}-${tid}`;
                return /* @__PURE__ */ jsxRuntimeExports.jsxs(
                  "div",
                  __spreadProps(__spreadValues({
                    className: cn$1(
                      "cky:inline-flex cky:shrink-0 cky:items-center",
                      tid === "custom" && "cky:cursor-pointer"
                    )
                  }, tid === "custom" ? {
                    onClick: openPremium,
                    onKeyDown: handleCustomThemeKeyDown,
                    tabIndex: 0
                  } : {}), {
                    children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx(RadioGroupItem, { id, value: tid }),
                      /* @__PURE__ */ jsxRuntimeExports.jsxs(
                        Label$1,
                        {
                          htmlFor: id,
                          className: "cky:ml-[5px] cky:inline-flex cky:cursor-pointer cky:items-center cky:text-sm cky:font-normal cky:leading-5",
                          children: [
                            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:leading-5", children: themeOptionLabel(tid) }),
                            tid === "custom" && /* @__PURE__ */ jsxRuntimeExports.jsx(
                              "span",
                              {
                                className: "cky:ml-[6px] cky:inline-flex cky:shrink-0",
                                "aria-hidden": true,
                                children: /* @__PURE__ */ jsxRuntimeExports.jsx(CrownInline, {})
                              }
                            )
                          ]
                        }
                      )
                    ]
                  }),
                  tid
                );
              })
            }
          )
        ] }),
        theme === "custom" ? /* @__PURE__ */ jsxRuntimeExports.jsx(CustomThemeLimitedNotice, {}) : null,
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "div",
          {
            className: cn$1(
              "cky-tab-content-accordion cky:w-full",
              contentTabRtl && "cky-app-rtl"
            ),
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(CustomizeAccordion, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
              Accordion,
              {
                type: "single",
                collapsible: true,
                value: openSection != null ? openSection : "",
                onValueChange: handleOpenSectionChange,
                className: CONTENT_PANEL_ACCORDION_CLASSNAME,
                children: renderContentSections(sections, sectionRenderers)
              }
            ) })
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          CkyConnectModal,
          {
            ref: customLogoModalRef,
            visible: false,
            availablePlan: "ultimate",
            feature: "custom_branding",
            title: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.customLogo, alt: "", className: "cky:mx-auto" }),
            featureText: __$2(
              "Add a custom logo on the banner to match your brand's unique identity",
              "cookie-law-info"
            ),
            availabilityText: __$2(
              "Available in: <b>Ultimate plan</b>",
              "cookie-law-info"
            )
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          CkyConnectModal,
          {
            ref: revisitIconModalRef,
            visible: false,
            availablePlan: "ultimate",
            feature: "revisit_custom_branding",
            title: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.customIcon, alt: "", className: "cky:mx-auto" }),
            featureText: __$2(
              "Add a personal flair to your cookie revisit widget with a custom icon",
              "cookie-law-info"
            ),
            availabilityText: __$2(
              "Available in: <b>Ultimate plan</b>",
              "cookie-law-info"
            )
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          CkyConnectModal,
          {
            ref: customThemeModalRef,
            visible: false,
            availablePlan: "premium",
            feature: "custom_theme",
            title: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.customTheme, alt: "", className: "cky:mx-auto" }),
            featureText: __$2(
              "Design a banner that blends perfectly with your site",
              "cookie-law-info"
            ),
            availabilityText: __$2(
              "Available in: <b>All premium plans</b>",
              "cookie-law-info"
            )
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          CkyConnectModal,
          {
            ref: gpcModalRef,
            visible: false,
            availablePlan: "pro",
            feature: "respect_gpc",
            title: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: assets.globalPrivacy, alt: "", className: "cky:mx-auto" }),
            featureText: __$2(
              "Respect Global Privacy Control (GPC) signals and honour users’ privacy settings",
              "cookie-law-info"
            ),
            availabilityText: __$2(
              "Available in: <b>Pro and Ultimate plans</b>",
              "cookie-law-info"
            )
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          CkyHeadsUpPopup,
          {
            ref: themeHeadsUpRef,
            header: __$2(
              "Colour customisation is now limited on Free plan",
              "cookie-law-info"
            ),
            headerIconSrc: assets.circleWarning,
            maxWidth: "600",
            confirmVariant: "default",
            body: /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                className: cn$1(
                  "cky:m-0 cky:w-full cky:rounded cky:border cky:border-transparent",
                  "cky:shadow-[0_5px_15px_rgba(0,0,0,0.02)]",
                  "cky:bg-[#FFE8C6] cky:text-[#4E4B66]"
                ),
                children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:box-border cky:px-[15px] cky:py-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:box-border cky:pt-[5px] cky:pb-[3px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
                  "ul",
                  {
                    className: cn$1(
                      "cky:m-0 cky:box-border",
                      "cky:!py-[10px]",
                      "cky:!list-outside cky:!list-disc cky:!pl-[15px]",
                      "cky:text-[13px] cky:leading-normal cky:text-[#4E4B66]",
                      "[&>li]:cky:mb-2 [&>li:last-child]:cky:mb-0",
                      "[&>li]:cky:marker:text-[#4E4B66]",
                      "[&_b]:cky:font-bold"
                    ),
                    children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx(
                        "li",
                        {
                          className: "cky:list-item",
                          dangerouslySetInnerHTML: {
                            __html: __$2(
                              "If you switch to Light or Dark theme, your <b>existing colour customisations will be replaced with the default version.</b>",
                              "cookie-law-info"
                            )
                          }
                        }
                      ),
                      /* @__PURE__ */ jsxRuntimeExports.jsx(
                        "li",
                        {
                          className: "cky:list-item",
                          dangerouslySetInnerHTML: {
                            __html: __$2(
                              "You can keep using your existing customised banner, but <b>further edits or new colour customisations are no longer available in your Free plan.</b>",
                              "cookie-law-info"
                            )
                          }
                        }
                      )
                    ]
                  }
                ) }) })
              }
            ),
            cancelBtn: __$2("Keep current banner", "cookie-law-info"),
            confirmBtn: confirmBtnLabel,
            onDeleteItem: confirmThemeSwitch,
            onClear: /* @__PURE__ */ __name(() => setPendingTheme(null), "onClear")
          }
        )
      ] })
    ] }) });
  }, "CkyCustomizeContentPanel");
  function useHasCustomCssPlanFeature(dataEpoch) {
    return reactExports.useMemo(() => {
      var _a2, _b2;
      const info = getInfo(false);
      return ((_b2 = (_a2 = info == null ? void 0 : info.plan) == null ? void 0 : _a2.features) == null ? void 0 : _b2.custom_css) === true;
    }, [dataEpoch]);
  }
  __name(useHasCustomCssPlanFeature, "useHasCustomCssPlanFeature");
  const CkyCustomizeCssPanel = /* @__PURE__ */ __name(({
    consentLaw: consentTemplate,
    onConsentLawChange: setConsentTemplate,
    bannerPreviewOn,
    onBannerPreviewChange,
    allBanners,
    allCookies,
    settingsReady,
    onRefreshSettings,
    onAfterPublish,
    dataEpoch,
    layoutPanelStateRef,
    customCssDraft,
    onCustomCssDraftChange
  }) => {
    var _a2, _b2, _c2;
    const { triggerNotification } = useGlobalUtilities();
    const connectFlow = useConnectFlowOptional();
    const [publishing, setPublishing] = reactExports.useState(false);
    const hasCustomCss = useHasCustomCssPlanFeature(dataEpoch);
    const bannerForCurrentLaw = reactExports.useMemo(
      () => {
        var _a3;
        return (_a3 = allBanners.find((b) => getBannerApplicableLaw$1(b) === consentTemplate)) != null ? _a3 : null;
      },
      [allBanners, consentTemplate]
    );
    const showBanner = ((_c2 = (_b2 = (_a2 = bannerForCurrentLaw == null ? void 0 : bannerForCurrentLaw.properties) == null ? void 0 : _a2.config) == null ? void 0 : _b2.notice) == null ? void 0 : _c2.status) !== false;
    const handlePlansNavigate = reactExports.useCallback(() => {
      globalThis.location.href = "#/dashboard/plans?available=premium";
    }, []);
    const handleConnectExisting = reactExports.useCallback(() => {
      connectFlow == null ? void 0 : connectFlow.connectToApp(true, "custom_css");
    }, [connectFlow]);
    const saveConfig = /* @__PURE__ */ __name(() => __async(null, null, function* () {
      if (!bannerForCurrentLaw || !bannerForCurrentLaw.id) {
        triggerNotification({
          type: "error",
          message: noBannerFoundMessage(__$2)
        });
        return;
      }
      setPublishing(true);
      try {
        const layoutAwareBanners = (layoutPanelStateRef == null ? void 0 : layoutPanelStateRef.current) ? mergeAllBannersWithLayoutState(
          allBanners,
          consentTemplate,
          layoutPanelStateRef.current
        ) : allBanners.map((b) => deepClone(b));
        const mergedList = layoutAwareBanners.map(
          (b) => getBannerApplicableLaw$1(b) === consentTemplate ? mergeCustomCssIntoBanner(b, consentTemplate, customCssDraft) : deepClone(b)
        );
        const withStatus = setBannerStatusByLaw(mergedList, consentTemplate);
        const res = yield bulkSaveBanners(withStatus, false);
        if (!Array.isArray(res) || res.length === 0) {
          throw new Error("Banner bulk save returned no data");
        }
        yield cookieApi.bulkUpdateCookieCategory(
          allCookies.map((c2) => deepClone(c2))
        );
        yield onRefreshSettings();
        yield onAfterPublish();
        triggerNotification({
          type: "success",
          message: saveSuccessMessage(__$2)
        });
      } catch (e) {
        console.error(e);
        triggerNotification({
          type: "error",
          message: saveErrorMessage(__$2)
        });
      } finally {
        setPublishing(false);
      }
    }), "saveConfig");
    const publishDisabled = !settingsReady || !bannerForCurrentLaw || publishing;
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(TooltipProvider, { delayDuration: 300, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        BannerCustomizeToolbar,
        {
          consentLaw: consentTemplate,
          onConsentLawChange: setConsentTemplate,
          bannerPreviewOn,
          onBannerPreviewChange,
          showBanner,
          previewControlId: "cky-banner-preview-css",
          publishDisabled,
          publishing,
          onPublish: saveConfig
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:min-h-[min(700px,70vh)]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:relative cky:rounded-[3px] cky:border cky:border-[#dcdcde] cky:bg-white cky:px-5 cky:py-3 cky:shadow-[0_1px_1px_rgba(0,0,0,0.04)]", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mb-3 cky:flex cky:flex-wrap cky:items-center cky:gap-1.5", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:inline-flex cky:min-w-0 cky:max-w-full cky:items-center cky:gap-1.5", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Label$1,
              {
                className: "cky:m-0 cky:inline cky:text-sm cky:font-normal cky:leading-snug cky:text-[#23282d]",
                htmlFor: "cky-textarea-custom-css",
                children: __$2("Custom CSS for additional styling", "cookie-law-info")
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:inline-flex cky:shrink-0", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CrownInline, {}) })
          ] }),
          hasCustomCss ? /* @__PURE__ */ jsxRuntimeExports.jsx(
            TooltipWithContent,
            {
              content: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:max-w-[280px] cky:text-left cky:text-xs cky:font-normal cky:leading-snug", children: __$2(
                "Add custom CSS to fine-tune how your cookie banner looks on your site.",
                "cookie-law-info"
              ) }),
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                Button,
                {
                  type: "button",
                  variant: "ghost",
                  className: "cky:!h-[22px] cky:!min-h-0 cky:!w-[22px] cky:m-0 cky:inline-flex cky:shrink-0 cky:cursor-help cky:items-center cky:justify-center cky:rounded-full cky:border-0 cky:bg-[#f0f0f1] cky:p-0 cky:leading-none cky:text-[#72777d] hover:cky:bg-[#e8e9eb] hover:cky:text-[#50575e] focus-visible:cky:outline focus-visible:cky:outline-2 focus-visible:cky:outline-offset-2 focus-visible:cky:outline-[var(--cky-primary)]",
                  "aria-label": __$2("More information", "cookie-law-info"),
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "tooltip", width: "12px", height: "12px" })
                }
              )
            }
          ) : null
        ] }),
        hasCustomCss ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:relative cky:min-h-[350px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          "textarea",
          {
            id: "cky-textarea-custom-css",
            className: "cky:box-border cky:min-h-[350px] cky:w-full cky:resize-y cky:rounded-md cky:border cky:border-[#dcdcde] cky:px-3 cky:py-2 cky:font-mono cky:text-sm cky:leading-snug cky:text-[#23282d] focus:cky:border-[var(--cky-primary)] focus:cky:shadow-[0_0_0_1px_var(--cky-primary)] focus:cky:outline-none",
            style: { background: "#edf0f3" },
            rows: 12,
            value: customCssDraft,
            onChange: /* @__PURE__ */ __name((e) => onCustomCssDraftChange(e.target.value), "onChange"),
            spellCheck: false,
            autoComplete: "off"
          }
        ) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:relative cky:min-h-[350px] cky:cursor-not-allowed", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            "textarea",
            {
              id: "cky-textarea-custom-css",
              className: "cky:pointer-events-none cky:box-border cky:min-h-[350px] cky:w-full cky:cursor-not-allowed cky:resize-y cky:rounded-md cky:border cky:border-[#dcdcde] cky:px-3 cky:py-2 cky:font-mono cky:text-sm cky:leading-snug cky:text-[#646970] focus:cky:outline-none disabled:cky:cursor-not-allowed",
              style: { background: "#edf0f3" },
              rows: 12,
              value: customCssDraft,
              readOnly: true,
              disabled: true,
              spellCheck: false,
              autoComplete: "off",
              "aria-readonly": true,
              tabIndex: -1
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:absolute cky:inset-0 cky:z-[1] cky:flex cky:cursor-not-allowed cky:items-center cky:justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "div",
            {
              className: "cky:box-border cky:mx-auto cky:w-[calc(100%-60px)] cky:max-w-[439px] cky:cursor-default cky:rounded-xl cky:bg-white cky:px-[30px] cky:pb-[30px] cky:pt-[50px] cky:text-center",
              role: "region",
              "aria-label": __$2(
                "Put your cookie banner in the spotlight with custom CSS",
                "cookie-law-info"
              ),
              children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:w-full cky:flex-col cky:items-center cky:gap-5", children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:m-0 cky:w-full cky:text-center cky:text-base cky:font-semibold cky:leading-6 cky:text-[#14142A]", children: __$2(
                  "Put your cookie banner in the spotlight with custom CSS",
                  "cookie-law-info"
                ) }),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:w-full cky:justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "cky:text-center cky:text-sm cky:leading-[22px] cky:text-[#4E4B66] [&_b]:cky:font-semibold", children: [
                  __$2("Available in:", "cookie-law-info"),
                  " ",
                  /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: __$2("All premium plans", "cookie-law-info") })
                ] }) }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:w-full cky:flex-col cky:items-center cky:justify-center cky:gap-4", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    Button,
                    {
                      type: "button",
                      variant: "default",
                      className: "cky:w-auto cky:text-[14px]!",
                      onClick: handlePlansNavigate,
                      children: __$2("Connect to Web App to Access", "cookie-law-info")
                    }
                  ),
                  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:block cky:max-w-full cky:text-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                    Button,
                    {
                      type: "button",
                      variant: "link",
                      external: true,
                      className: "cky:text-[16px]! cky:font-[500]! cky:hover:border-transparent cky:hover:no-underline cky:hover:opacity-100",
                      onClick: /* @__PURE__ */ __name((e) => {
                        e.preventDefault();
                        handleConnectExisting();
                      }, "onClick"),
                      children: __$2(
                        "Have an account? Log in and connect",
                        "cookie-law-info"
                      )
                    }
                  ) })
                ] })
              ] })
            }
          ) })
        ] })
      ] }) })
    ] });
  }, "CkyCustomizeCssPanel");
  const LAYOUT_PREVIEW_DEBOUNCE_MS = 450;
  const CATEGORIES_FIRST_LAYER_TOOLTIP = __$2(
    "Enabling this option will display cookie categories on the first layer of your banner. The categories will be displayed on the second layer (preference centre) even if this option is disabled.",
    "cookie-law-info"
  );
  const PUSHDOWN_DISABLED_TOOLTIP = __$2(
    "The Push down style is supported for the Banner layout only.",
    "cookie-law-info"
  );
  const CATEGORIES_FIRST_LAYER_DISABLED_TOOLTIP = __$2(
    "This feature is available with <b>Banner + Push down</b> layout only.",
    "cookie-law-info"
  );
  const LAYOUT_ICON_SRC = {
    box: assets.layouts.box,
    classic: assets.layouts.classic,
    banner: assets.layouts.banner,
    popup: assets.layouts.popup
  };
  const PREFERENCE_ICON_SRC = {
    popup: assets.layouts.center,
    sidebar: assets.layouts.sidebar,
    pushdown: assets.layouts.pushdown
  };
  const layoutColPad = "cky:box-border cky:relative cky:min-h-px cky:px-[15px]";
  const layoutColFullClass = cn$1(
    layoutColPad,
    "cky:w-full cky:max-w-full cky:basis-full"
  );
  const layoutImageRadioRowClass = cn$1(
    "cky:flex cky:flex-wrap cky:gap-0",
    "cky:[&>*+*]:ml-[15px]"
  );
  const layoutPositionRadioGroupClass = cn$1(
    layoutColPad,
    "cky:mt-4",
    "cky:w-1/3 cky:max-w-[33.333333%] cky:basis-1/3 max-[600px]:cky:w-full max-[600px]:cky:max-w-full max-[600px]:cky:basis-full",
    "cky:flex cky:flex-wrap cky:items-center"
  );
  const layoutNoticePositionRadioGroupClass = cn$1(
    layoutPositionRadioGroupClass,
    "cky:gap-3"
  );
  const layoutSidebarPositionRadioGroupClass = cn$1(
    layoutPositionRadioGroupClass,
    "cky:gap-6"
  );
  const layoutTooltipBodyClass = "cky:max-w-[280px] cky:text-left cky:text-xs cky:font-normal cky:leading-snug cky:[&_b]:font-semibold";
  const layoutTooltipNarrowClass = cn$1(
    layoutTooltipBodyClass,
    "cky:max-w-[260px]"
  );
  const layoutPositionLabelClass = "cky:!m-0 cky:!inline-flex cky:!cursor-pointer cky:!items-center cky:!gap-[10px] cky:!text-[13px] cky:!font-normal cky:!leading-none cky:!text-[#23282d]";
  const layoutCategoriesMutedClass = "cky:!text-[#adadad] [&_.cky-app-switch]:cky:opacity-[0.85]";
  const layoutImageRadioItemBaseClass = cn$1(
    "cky:absolute cky:inset-0 cky:z-[1] cky:m-0 cky:h-full cky:w-full cky:!min-h-0 cky:!min-w-0",
    "cky:!aspect-auto cky:!rounded-none cky:!border-0 cky:!bg-transparent cky:!p-0 cky:!shadow-none cky:!opacity-0",
    "cky:cursor-pointer [&_svg]:cky:!hidden"
  );
  const SIDEBAR_POSITIONS = ["left", "right"];
  function LayoutSectionTitle({ children }) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        role: "heading",
        "aria-level": 3,
        className: "cky:mx-0 cky:my-2 cky:text-sm cky:font-semibold cky:leading-4 cky:text-[#23282d]",
        children
      }
    );
  }
  __name(LayoutSectionTitle, "LayoutSectionTitle");
  function LayoutItemCard({
    radioValue,
    selected,
    disabled,
    isPremium,
    title,
    iconSrc,
    iconAlt
  }) {
    const inputId = `cky-layout-${radioValue}-${title.replaceAll(/\s+/g, "-").toLowerCase()}`;
    const radioDisabled = disabled && !isPremium;
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:flex cky:flex-col cky:items-start", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:mb-2 cky:m-0 cky:inline-flex cky:items-center cky:gap-1.5 cky:text-[13px] cky:font-normal cky:leading-none cky:text-[#23282d]", children: [
        title,
        isPremium ? /* @__PURE__ */ jsxRuntimeExports.jsx(
          "span",
          {
            className: "cky:inline-flex cky:h-[18px] cky:w-[18px] cky:shrink-0 cky:items-center cky:justify-center cky:rounded-[17px] cky:bg-[#FFE8C6] cky:px-1 cky:py-[5px] cky:leading-none cky:text-[#FFB240]",
            "aria-hidden": true,
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "crown", width: "10px", height: "8px" })
          }
        ) : null
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "div",
        {
          className: cn$1(
            "cky:flex",
            disabled && !isPremium && "cky:cursor-default cky:opacity-50 cky:grayscale"
          ),
          children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
            Label$1,
            {
              htmlFor: inputId,
              className: cn$1(
                "cky:relative cky:m-0 cky:inline-block cky:font-normal",
                !disabled && "cky:cursor-pointer",
                disabled && isPremium && "cky:cursor-pointer cky:!opacity-100 cky:!grayscale-0"
              ),
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  RadioGroupItem,
                  {
                    value: radioValue,
                    id: inputId,
                    disabled: radioDisabled,
                    className: cn$1(
                      layoutImageRadioItemBaseClass,
                      radioDisabled && "cky:pointer-events-none cky:cursor-default"
                    )
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "cky:relative cky:inline-block", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "img",
                    {
                      className: "cky:block cky:h-auto cky:w-[100px] cky:max-w-full",
                      src: iconSrc,
                      alt: iconAlt
                    }
                  ),
                  selected ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                    "img",
                    {
                      src: assets.success,
                      alt: "",
                      "aria-hidden": true,
                      className: "cky:pointer-events-none cky:absolute cky:bottom-0 cky:right-0 cky:h-[15px] cky:w-[15px]"
                    }
                  ) : null
                ] })
              ]
            }
          )
        }
      )
    ] });
  }
  __name(LayoutItemCard, "LayoutItemCard");
  const CkyCustomizeLayoutPanel = /* @__PURE__ */ __name(({
    consentLaw,
    onConsentLawChange,
    bannerPreviewOn,
    onBannerPreviewChange,
    allBanners,
    allCookies,
    settingsReady,
    onRefreshSettings,
    onAfterPublish,
    dataEpoch,
    contentBannerDraftRef,
    layoutPanelStateRef
  }) => {
    const popupModalRef = reactExports.useRef(null);
    const [publishing, setPublishing] = reactExports.useState(false);
    const [dirty, setDirty] = reactExports.useState(false);
    useSyncBannerPanelDirty("layout", dirty);
    const baselineFingerprintRef = reactExports.useRef(null);
    const bannerForCurrentLaw = reactExports.useMemo(
      () => {
        var _a2;
        return (_a2 = allBanners.find((b) => getBannerApplicableLaw$1(b) === consentLaw)) != null ? _a2 : null;
      },
      [allBanners, consentLaw]
    );
    const buildAllBannersForLayoutMerge = reactExports.useCallback(() => {
      return allBanners.map((b) => {
        if (getBannerApplicableLaw$1(b) !== consentLaw) return b;
        const r2 = contentBannerDraftRef == null ? void 0 : contentBannerDraftRef.current;
        if (r2 && typeof r2 === "object" && getBannerApplicableLaw$1(r2) === consentLaw) {
          return r2;
        }
        return b;
      });
    }, [allBanners, consentLaw, contentBannerDraftRef]);
    const persistedSettingsType = reactExports.useMemo(() => {
      var _a2, _b2;
      if (!bannerForCurrentLaw) return void 0;
      const s2 = (_b2 = (_a2 = bannerForCurrentLaw.properties) == null ? void 0 : _a2.settings) == null ? void 0 : _b2.type;
      return s2 == null ? void 0 : String(s2);
    }, [bannerForCurrentLaw]);
    const defaultState = reactExports.useMemo(
      () => bannerForCurrentLaw ? readLayoutStateFromBanner(bannerForCurrentLaw) : EMPTY_LAYOUT_PANEL_STATE,
      [bannerForCurrentLaw]
    );
    const [bannerType, setBannerType] = reactExports.useState(
      defaultState.bannerType
    );
    const [position, setPosition] = reactExports.useState(defaultState.position);
    const [preferenceCenterType, setPreferenceCenterType] = reactExports.useState(defaultState.preferenceCenterType);
    const [sidebarPosition, setSidebarPosition] = reactExports.useState(
      defaultState.sidebarPosition
    );
    const [categoriesOnFirstLayer, setCategoriesOnFirstLayer] = reactExports.useState(
      defaultState.categoriesOnFirstLayer
    );
    const [layoutStateHydrated, setLayoutStateHydrated] = reactExports.useState(false);
    const panelState = reactExports.useMemo(
      () => ({
        bannerType,
        position,
        preferenceCenterType,
        sidebarPosition,
        categoriesOnFirstLayer
      }),
      [
        bannerType,
        position,
        preferenceCenterType,
        sidebarPosition,
        categoriesOnFirstLayer
      ]
    );
    reactExports.useEffect(() => {
      if (!layoutPanelStateRef) return;
      layoutPanelStateRef.current = layoutStateHydrated ? panelState : null;
    }, [panelState, layoutPanelStateRef, layoutStateHydrated]);
    const bannerId = bannerForCurrentLaw != null ? bannerForCurrentLaw.id : void 0;
    reactExports.useLayoutEffect(() => {
      if (!settingsReady || !bannerForCurrentLaw) {
        setLayoutStateHydrated(false);
        return;
      }
      const s2 = readLayoutStateFromBanner(bannerForCurrentLaw);
      setBannerType(s2.bannerType);
      setPosition(s2.position);
      setPreferenceCenterType(s2.preferenceCenterType);
      setSidebarPosition(s2.sidebarPosition);
      setCategoriesOnFirstLayer(s2.categoriesOnFirstLayer);
      setLayoutStateHydrated(true);
    }, [settingsReady, dataEpoch, consentLaw, bannerId, bannerForCurrentLaw]);
    const prevNoticeLayoutTypeRef = reactExports.useRef(null);
    reactExports.useEffect(() => {
      const prev = prevNoticeLayoutTypeRef.current;
      if (prev !== null && prev !== bannerType) {
        if (bannerType !== "classic") {
          setCategoriesOnFirstLayer(false);
        } else if (prev !== "classic" && bannerForCurrentLaw) {
          setCategoriesOnFirstLayer(
            readLayoutStateFromBanner(bannerForCurrentLaw).categoriesOnFirstLayer
          );
        }
      }
      prevNoticeLayoutTypeRef.current = bannerType;
    }, [bannerType, bannerForCurrentLaw]);
    const bannerLayouts = reactExports.useMemo(
      () => getBannerLayouts(consentLaw),
      [consentLaw]
    );
    const preferenceLayouts = reactExports.useMemo(
      () => getPreferenceLayouts(consentLaw),
      [consentLaw]
    );
    const selectedBannerLayout = reactExports.useMemo(() => {
      const layoutKey = getPositionLayoutKeyForFields(bannerType);
      const fromList = bannerLayouts.find((l) => l.type === layoutKey);
      if (fromList) return fromList;
      const meta = getBannerLayoutPositionMeta(layoutKey);
      return {
        type: layoutKey,
        title: "",
        positions: meta.positions,
        default: meta.defaultPosition,
        isPremium: layoutKey === "popup"
      };
    }, [bannerLayouts, bannerType]);
    const noticeRowSelectedCardKey = reactExports.useMemo(
      () => getNoticeLayoutRowSelectedCardKey(bannerType),
      [bannerType]
    );
    const layoutPanelSlice = reactExports.useMemo(
      () => ({ bannerType, preferenceCenterType }),
      [bannerType, preferenceCenterType]
    );
    const pushdownCardDisabled = reactExports.useMemo(
      () => isPushdownPreferenceLayoutDisabled(
        layoutPanelSlice,
        persistedSettingsType
      ),
      [layoutPanelSlice, persistedSettingsType]
    );
    reactExports.useEffect(() => {
      var _a2;
      if (!bannerPreviewOn || !settingsReady || !bannerForCurrentLaw || !layoutStateHydrated)
        return void 0;
      const baseForPreview = (_a2 = buildAllBannersForLayoutMerge().find(
        (b) => getBannerApplicableLaw$1(b) === consentLaw
      )) != null ? _a2 : null;
      if (!baseForPreview) return void 0;
      let cancelled = false;
      const timer = globalThis.setTimeout(() => {
        void (() => __async(null, null, function* () {
          if (cancelled) return;
          if (!settingsReady) return;
          const merged = mergeLayoutStateIntoBanner(
            baseForPreview,
            consentLaw,
            panelState
          );
          if (cancelled) return;
          try {
            bannerPreview.startLoading();
            const cats = yield fetchCookieCategoriesForPreview();
            if (cancelled) return;
            setBannerPreviewContext(merged, getAdminBannerLanguage(), cats);
            bannerPreview.resetTemplateCache();
            yield bannerPreview.generate(false, true);
          } catch (e) {
            console.error(e);
          } finally {
            if (!cancelled) {
              bannerPreview.stopLoading();
            }
          }
        }))();
      }, LAYOUT_PREVIEW_DEBOUNCE_MS);
      return () => {
        cancelled = true;
        globalThis.clearTimeout(timer);
      };
    }, [
      bannerPreviewOn,
      settingsReady,
      layoutStateHydrated,
      consentLaw,
      bannerForCurrentLaw,
      panelState,
      buildAllBannersForLayoutMerge
    ]);
    const computeFingerprint = reactExports.useCallback(() => {
      const allBannersForLayoutMerge = buildAllBannersForLayoutMerge();
      const merged = mergeAllBannersWithLayoutState(
        allBannersForLayoutMerge,
        consentLaw,
        panelState
      );
      return JSON.stringify({ merged, consentLaw });
    }, [buildAllBannersForLayoutMerge, consentLaw, panelState]);
    const computeFingerprintRef = reactExports.useRef(computeFingerprint);
    computeFingerprintRef.current = computeFingerprint;
    reactExports.useEffect(() => {
      if (!settingsReady || !bannerForCurrentLaw) return;
      const t2 = globalThis.setTimeout(() => {
        baselineFingerprintRef.current = computeFingerprintRef.current();
        setDirty(false);
      }, 0);
      return () => globalThis.clearTimeout(t2);
    }, [dataEpoch, settingsReady, consentLaw, bannerId, bannerForCurrentLaw]);
    reactExports.useEffect(() => {
      if (!baselineFingerprintRef.current) return;
      setDirty(
        computeFingerprintRef.current() !== baselineFingerprintRef.current
      );
    }, [panelState, consentLaw, buildAllBannersForLayoutMerge]);
    const handleBannerTypeSelect = reactExports.useCallback(
      (type) => {
        var _a2;
        const fromList = bannerLayouts.find((l) => l.type === type);
        const meta = getBannerLayoutPositionMeta(type);
        const defaultPosition = (_a2 = fromList == null ? void 0 : fromList.default) != null ? _a2 : meta.defaultPosition;
        setBannerType(type);
        setPosition(defaultPosition);
        if (type === "classic") {
          setPreferenceCenterType("pushdown");
        } else {
          setPreferenceCenterType("popup");
        }
      },
      [bannerLayouts]
    );
    const handlePreferenceTypeSelect = reactExports.useCallback(
      (type) => {
        if (type === "sidebar") {
          setSidebarPosition("left");
        }
        setPreferenceCenterType(type);
        if (type === "pushdown") {
          setBannerType("classic");
          return;
        }
        setBannerType((bt) => bt === "classic" ? "banner" : bt);
      },
      []
    );
    const handleNoticeLayoutValueChange = reactExports.useCallback(
      (value) => {
        var _a2;
        const layout = bannerLayouts.find((l) => l.type === value);
        if (!layout) return;
        if (layout.isPremium) {
          (_a2 = popupModalRef.current) == null ? void 0 : _a2.show();
          return;
        }
        handleBannerTypeSelect(layout.type);
      },
      [bannerLayouts, handleBannerTypeSelect]
    );
    const categoriesToggleDisabled = bannerType !== "classic";
    const saveConfig = reactExports.useCallback(() => __async(null, null, function* () {
      if (!bannerForCurrentLaw || !bannerForCurrentLaw.id) {
        toast.error(noBannerFoundMessage(__$2));
        return;
      }
      setPublishing(true);
      try {
        const mergedList = mergeAllBannersWithLayoutState(
          buildAllBannersForLayoutMerge(),
          consentLaw,
          panelState
        );
        const withStatus = setBannerStatusByLaw(mergedList, consentLaw);
        const res = yield bulkSaveBanners(withStatus, false);
        if (!Array.isArray(res) || res.length === 0) {
          throw new Error("Banner bulk save returned no data");
        }
        yield cookieApi.bulkUpdateCookieCategory(
          allCookies.map((c2) => deepClone(c2))
        );
        yield onRefreshSettings();
        yield onAfterPublish();
        toast.success(saveSuccessMessage(__$2));
      } catch (e) {
        console.error(e);
        toast.error(saveErrorMessage(__$2));
      } finally {
        setPublishing(false);
      }
    }), [
      bannerForCurrentLaw,
      buildAllBannersForLayoutMerge,
      consentLaw,
      panelState,
      allCookies,
      onRefreshSettings,
      onAfterPublish
    ]);
    const categoriesSwitch = reactExports.useMemo(
      () => /* @__PURE__ */ jsxRuntimeExports.jsx(
        Switch,
        {
          id: "cky-toggle-categories-on-firstlayer",
          checked: categoriesOnFirstLayer,
          disabled: categoriesToggleDisabled,
          onCheckedChange: setCategoriesOnFirstLayer
        }
      ),
      [categoriesOnFirstLayer, categoriesToggleDisabled]
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(TooltipProvider, { delayDuration: 300, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        BannerCustomizeToolbar,
        {
          consentLaw,
          onConsentLawChange,
          bannerPreviewOn,
          onBannerPreviewChange,
          showBanner: true,
          previewControlId: "cky-banner-preview-react-layout",
          publishDisabled: !settingsReady || !bannerForCurrentLaw || publishing,
          publishing,
          onPublish: saveConfig
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:bg-white cky:p-5", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:flex-wrap cky:items-start cky:-mx-[15px] cky:border-b cky:border-[#d9d9d9] cky:pb-[20px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: layoutColFullClass, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(LayoutSectionTitle, { children: __$2("Cookie Notice", "cookie-law-info") }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            RadioGroup,
            {
              value: noticeRowSelectedCardKey,
              onValueChange: handleNoticeLayoutValueChange,
              className: layoutImageRadioRowClass,
              children: bannerLayouts.map((layout) => /* @__PURE__ */ jsxRuntimeExports.jsx(
                LayoutItemCard,
                {
                  radioValue: layout.type,
                  selected: noticeRowSelectedCardKey === layout.type,
                  disabled: layout.isPremium,
                  isPremium: layout.isPremium,
                  title: __$2(layout.title, "cookie-law-info"),
                  iconSrc: LAYOUT_ICON_SRC[layout.type],
                  iconAlt: layout.title
                },
                layout.type
              ))
            }
          ),
          selectedBannerLayout && selectedBannerLayout.positions.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
            RadioGroup,
            {
              value: position,
              onValueChange: setPosition,
              className: layoutNoticePositionRadioGroupClass,
              children: selectedBannerLayout.positions.map((pos) => {
                const id = `cky-consent-type-${selectedBannerLayout.type}-${pos}`;
                return /* @__PURE__ */ jsxRuntimeExports.jsxs(
                  Label$1,
                  {
                    htmlFor: id,
                    className: layoutPositionLabelClass,
                    children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx(RadioGroupItem, { value: pos, id }),
                      /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:inline-block cky:w-[100px]", children: formatNoticePositionLabel(pos) })
                    ]
                  },
                  pos
                );
              })
            }
          ) : null
        ] }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:flex cky:flex-wrap cky:-mx-[15px] cky:pt-[15px]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: layoutColFullClass, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(LayoutSectionTitle, { children: __$2("Preference Centre", "cookie-law-info") }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              RadioGroup,
              {
                value: preferenceCenterType,
                onValueChange: /* @__PURE__ */ __name((v) => handlePreferenceTypeSelect(v), "onValueChange"),
                className: layoutImageRadioRowClass,
                children: preferenceLayouts.map((layout) => {
                  const disabled = layout.type === "pushdown" && pushdownCardDisabled;
                  const itemProps = {
                    radioValue: layout.type,
                    selected: preferenceCenterType === layout.type,
                    disabled,
                    isPremium: false,
                    title: __$2(layout.title, "cookie-law-info"),
                    iconSrc: PREFERENCE_ICON_SRC[layout.type],
                    iconAlt: layout.title
                  };
                  if (disabled) {
                    return /* @__PURE__ */ jsxRuntimeExports.jsx(
                      TooltipWithContent,
                      {
                        content: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: layoutTooltipNarrowClass, children: PUSHDOWN_DISABLED_TOOLTIP }),
                        children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(LayoutItemCard, __spreadValues({}, itemProps)) })
                      },
                      layout.type
                    );
                  }
                  return /* @__PURE__ */ jsxRuntimeExports.jsx(LayoutItemCard, __spreadValues({}, itemProps), layout.type);
                })
              }
            ),
            preferenceCenterType === "sidebar" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
              RadioGroup,
              {
                value: sidebarPosition,
                onValueChange: /* @__PURE__ */ __name((v) => setSidebarPosition(v), "onValueChange"),
                className: layoutSidebarPositionRadioGroupClass,
                children: SIDEBAR_POSITIONS.map((pos) => {
                  const id = `cky-preference-type-sidebar-${pos}`;
                  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
                    Label$1,
                    {
                      htmlFor: id,
                      className: layoutPositionLabelClass,
                      children: [
                        /* @__PURE__ */ jsxRuntimeExports.jsx(RadioGroupItem, { value: pos, id }),
                        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:inline-block cky:min-w-[20px]", children: formatPreferenceSideLabel(pos) })
                      ]
                    },
                    pos
                  );
                })
              }
            ) : null
          ] }),
          consentLaw === "gdpr" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "div",
            {
              className: cn$1(
                "cky:mt-4 cky:flex cky:flex-wrap cky:-mx-[15px]",
                categoriesToggleDisabled && layoutCategoriesMutedClass
              ),
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsxs(
                  "div",
                  {
                    className: cn$1(
                      layoutColPad,
                      "cky:flex cky:w-1/4 cky:max-w-[25%] cky:basis-1/4 cky:items-center cky:gap-1.5 max-[600px]:cky:w-full max-[600px]:cky:max-w-full max-[600px]:cky:basis-full"
                    ),
                    children: [
                      /* @__PURE__ */ jsxRuntimeExports.jsx(
                        Label$1,
                        {
                          className: cn$1(
                            "cky:m-0 cky:cursor-pointer cky:p-0 cky:text-[13px] cky:leading-[1.45] cky:!font-normal",
                            categoriesToggleDisabled && "cky:cursor-default",
                            categoriesToggleDisabled && "cky:!text-[#adadad]"
                          ),
                          htmlFor: "cky-toggle-categories-on-firstlayer",
                          children: __$2("Categories on first layer", "cookie-law-info")
                        }
                      ),
                      /* @__PURE__ */ jsxRuntimeExports.jsx(
                        TooltipWithContent,
                        {
                          side: "right",
                          sideOffset: 8,
                          content: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: layoutTooltipBodyClass, children: CATEGORIES_FIRST_LAYER_TOOLTIP }),
                          children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                            Button,
                            {
                              type: "button",
                              variant: "ghost",
                              size: "icon",
                              className: cn$1(
                                "cky:mx-0 cky:inline-flex cky:!h-8 cky:!w-8 cky:min-h-0 cky:shrink-0 cky:items-center cky:justify-center cky:rounded-full cky:border-0 cky:bg-transparent cky:!p-0 cky:leading-none",
                                "hover:cky:bg-transparent active:cky:bg-transparent",
                                categoriesToggleDisabled ? "cky:!text-[#adadad] hover:cky:!text-[#adadad]" : "cky:text-[#a6a8b1] hover:cky:text-[#8c8f9a]"
                              ),
                              "aria-label": __$2("More information", "cookie-law-info"),
                              children: /* @__PURE__ */ jsxRuntimeExports.jsx(CkyIcon, { icon: "tooltip", width: "14px", height: "14px" })
                            }
                          )
                        }
                      )
                    ]
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "div",
                  {
                    className: cn$1(
                      layoutColPad,
                      "cky:flex cky:w-[41.666667%] cky:max-w-[41.666667%] cky:basis-[41.666667%] cky:items-center max-[600px]:cky:w-full max-[600px]:cky:max-w-full max-[600px]:cky:basis-full",
                      categoriesToggleDisabled && layoutCategoriesMutedClass
                    ),
                    children: categoriesToggleDisabled ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                      TooltipWithContent,
                      {
                        content: /* @__PURE__ */ jsxRuntimeExports.jsx(
                          "div",
                          {
                            className: layoutTooltipBodyClass,
                            dangerouslySetInnerHTML: {
                              __html: CATEGORIES_FIRST_LAYER_DISABLED_TOOLTIP
                            }
                          }
                        ),
                        children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: categoriesSwitch })
                      }
                    ) : categoriesSwitch
                  }
                )
              ]
            }
          ) : null
        ] }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyConnectModal,
        {
          ref: popupModalRef,
          visible: false,
          availablePlan: "pro",
          feature: "popup_layout",
          title: /* @__PURE__ */ jsxRuntimeExports.jsx(
            "img",
            {
              src: assets.popupLayout,
              alt: __$2("Popup layout", "cookie-law-info")
            }
          ),
          featureText: __$2(
            "Use a popup layout to boost your consent opt-in rates",
            "cookie-law-info"
          ),
          availabilityText: __$2(
            "Available in: <b>Pro and Ultimate plans</b>",
            "cookie-law-info"
          )
        }
      )
    ] });
  }, "CkyCustomizeLayoutPanel");
  function renderBannerCustomizePanel(currentTab, sharedProps, cssDraft) {
    switch (currentTab) {
      case "general":
        return /* @__PURE__ */ jsxRuntimeExports.jsx(CkyCustomizeGeneralPanel, __spreadValues({}, sharedProps));
      case "layout":
        return /* @__PURE__ */ jsxRuntimeExports.jsx(CkyCustomizeLayoutPanel, __spreadValues({}, sharedProps));
      case "content":
        return /* @__PURE__ */ jsxRuntimeExports.jsx(CkyCustomizeContentPanel, __spreadValues({}, sharedProps));
      case "css":
        return /* @__PURE__ */ jsxRuntimeExports.jsx(CkyCustomizeCssPanel, __spreadValues(__spreadValues({}, sharedProps), cssDraft));
    }
  }
  __name(renderBannerCustomizePanel, "renderBannerCustomizePanel");
  function useBannerCustomizeData() {
    const [settingsLoading, setSettingsLoading] = reactExports.useState(true);
    const [loadError, setLoadError] = reactExports.useState(false);
    const [banners, setBanners] = reactExports.useState([]);
    const [cookieCategories, setCookieCategories] = reactExports.useState(
      []
    );
    const [dataEpoch, setDataEpoch] = reactExports.useState(0);
    const refreshCustomizeData = reactExports.useCallback(() => __async(null, null, function* () {
      var _a2;
      const b = yield ckyRest.get({ path: "banners" });
      const freshBanners = Array.isArray(b) ? b : [];
      setBanners(freshBanners);
      const cats = yield cookieApi.getCookieCategories();
      setCookieCategories(Array.isArray(cats) ? cats : []);
      setDataEpoch((e) => e + 1);
      if (freshBanners.length > 0) {
        const bannerStore2 = useBannerStore.getState();
        bannerStore2.setBanners(freshBanners);
        const active = (_a2 = freshBanners.find((ban) => ban.status === true)) != null ? _a2 : freshBanners[0];
        bannerStore2.setCurrentBanner(active);
      }
    }), []);
    reactExports.useEffect(() => {
      let cancelled = false;
      (() => __async(null, null, function* () {
        try {
          setLoadError(false);
          yield refreshCustomizeData();
        } catch (e) {
          console.error(e);
          setLoadError(true);
        } finally {
          if (!cancelled) {
            setSettingsLoading(false);
          }
        }
      }))();
      return () => {
        cancelled = true;
      };
    }, [refreshCustomizeData]);
    return {
      banners,
      cookieCategories,
      settingsLoading,
      loadError,
      dataEpoch,
      refreshCustomizeData
    };
  }
  __name(useBannerCustomizeData, "useBannerCustomizeData");
  const BannerCustomizeContent = reactExports.forwardRef(
    /* @__PURE__ */ __name(function BannerCustomizeContent2(_props, ref) {
      const [activeTab, setActiveTab] = reactExports.useState("general");
      const [bannerPreviewOn, setBannerPreviewOn] = reactExports.useState(false);
      const [consentLaw, setConsentLaw] = reactExports.useState("gdpr");
      const consentLawInitRef = reactExports.useRef(false);
      const initialConsentLawRef = reactExports.useRef(null);
      const [customCssDraft, setCustomCssDraft] = reactExports.useState("");
      const [panelsDirty, setPanelsDirty] = reactExports.useState(false);
      const contentBannerDraftRef = reactExports.useRef(null);
      const layoutPanelStateRef = reactExports.useRef(null);
      const {
        banners,
        cookieCategories,
        settingsLoading,
        loadError,
        dataEpoch,
        refreshCustomizeData
      } = useBannerCustomizeData();
      const { onAfterPublish } = useBannerCustomizePreview(
        consentLaw,
        bannerPreviewOn,
        setBannerPreviewOn
      );
      const bannerForConsentLaw = reactExports.useMemo(
        () => {
          var _a2;
          return (_a2 = banners.find((b) => getBannerApplicableLaw$1(b) === consentLaw)) != null ? _a2 : null;
        },
        [banners, consentLaw]
      );
      reactExports.useLayoutEffect(() => {
        if (settingsLoading || banners.length === 0) return;
        const activeLaw = getActiveConsentLawFromBanners(banners);
        if (!consentLawInitRef.current) {
          setConsentLaw(activeLaw);
          initialConsentLawRef.current = activeLaw;
          consentLawInitRef.current = true;
          return;
        }
        initialConsentLawRef.current = activeLaw;
      }, [settingsLoading, banners, dataEpoch]);
      reactExports.useLayoutEffect(() => {
        setCustomCssDraft(readCustomCssFromBanner(bannerForConsentLaw));
      }, [bannerForConsentLaw, dataEpoch]);
      const cssDirty = reactExports.useMemo(() => {
        if (!bannerForConsentLaw) return false;
        return customCssDraft !== readCustomCssFromBanner(bannerForConsentLaw);
      }, [bannerForConsentLaw, customCssDraft]);
      const consentLawDirty = initialConsentLawRef.current !== null && consentLaw !== initialConsentLawRef.current;
      const hasChanges = reactExports.useCallback(
        () => panelsDirty || cssDirty || consentLawDirty,
        [panelsDirty, cssDirty, consentLawDirty]
      );
      reactExports.useImperativeHandle(ref, () => ({ hasChanges }), [hasChanges]);
      const showCustomizeLoader = !loadError && (settingsLoading || banners.length === 0);
      const generalProps = {
        consentLaw,
        onConsentLawChange: setConsentLaw,
        bannerPreviewOn,
        onBannerPreviewChange: setBannerPreviewOn,
        allBanners: banners,
        allCookies: cookieCategories,
        settingsReady: !settingsLoading,
        onRefreshSettings: refreshCustomizeData,
        onAfterPublish,
        dataEpoch,
        contentBannerDraftRef,
        layoutPanelStateRef
      };
      return /* @__PURE__ */ jsxRuntimeExports.jsx(BannerCustomizeDirtyProvider, { onPanelsDirtyChange: setPanelsDirty, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
        "section",
        {
          className: "cky-section-consent-banner cky:flex cky:flex-1 cky:flex-col cky:px-0 cky:pb-0 cky:pt-8",
          "aria-labelledby": "cky-banner-customize-heading",
          children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { id: "cky-banner-customize-heading", className: "cky:sr-only", children: __$2("Cookie banner", "cookie-law-info") }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:relative cky:flex cky:min-h-0 cky:flex-1 cky:w-full cky:flex-col cky:overflow-hidden cky:border cky:border-[#d9d9d9] cky:bg-[#f0f0f1]", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs(
                Root2$1,
                {
                  value: activeTab,
                  onValueChange: /* @__PURE__ */ __name((v) => setActiveTab(v), "onValueChange"),
                  orientation: "vertical",
                  className: cn$1(
                    "cky:flex cky:min-h-0 cky:flex-1 cky:w-full cky:overflow-hidden cky:border-0",
                    showCustomizeLoader && "cky:pointer-events-none cky:invisible"
                  ),
                  children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(
                      List,
                      {
                        "aria-label": __$2(
                          "Cookie banner settings sections",
                          "cookie-law-info"
                        ),
                        className: "cky:flex cky:h-full cky:min-h-0 cky:w-[18%] cky:min-w-[160px] cky:shrink-0 cky:flex-col cky:overflow-x-hidden cky:overflow-y-auto cky:bg-[#f0f0f1]",
                        children: BANNER_CUSTOMIZE_TABS.map((tab) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
                          Trigger,
                          {
                            value: tab.id,
                            className: cn$1(
                              "cky:flex cky:w-full cky:cursor-pointer cky:items-center cky:gap-0 cky:border-0 cky:border-l-4 cky:border-l-transparent cky:border-r cky:border-solid cky:border-r-[#d9d9d9] cky:bg-transparent cky:px-[10px] cky:py-3 cky:text-left cky:text-sm cky:font-medium cky:leading-snug cky:text-[#505b66] cky:outline-none cky:transition-colors cky:duration-200 cky:ease-in-out",
                              "cky:hover:text-[var(--cky-primary)]",
                              "cky:focus-visible:outline cky:focus-visible:outline-2 cky:focus-visible:outline-offset-[-2px] cky:focus-visible:outline-[var(--cky-primary)]",
                              "cky:data-[state=active]:border-l-[var(--cky-primary)] cky:data-[state=active]:border-r-0 cky:data-[state=active]:bg-[#e6e8e9] cky:data-[state=active]:text-[var(--cky-primary)]"
                            ),
                            children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsx(
                                "span",
                                {
                                  className: "cky:inline-flex cky:shrink-0 cky:items-center cky:self-stretch cky:pr-[5px]",
                                  "aria-hidden": "true",
                                  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                                    CkyIcon,
                                    {
                                      icon: tab.icon,
                                      width: "18px",
                                      height: "100%",
                                      "aria-hidden": true
                                    }
                                  )
                                }
                              ),
                              /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "cky:min-w-0 cky:flex-1", children: __$2(tab.titleKey, "cookie-law-info") })
                            ]
                          },
                          tab.id
                        ))
                      }
                    ),
                    BANNER_CUSTOMIZE_TABS.map((tab) => /* @__PURE__ */ jsxRuntimeExports.jsx(
                      Content,
                      {
                        value: tab.id,
                        forceMount: true,
                        className: "cky:flex-1 cky:min-h-0 cky:min-w-0 cky:overflow-auto cky:bg-[#e6e8e9] cky:px-5 cky:py-[15px] cky:outline-none cky:data-[state=inactive]:hidden",
                        children: loadError ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "cky:m-0 cky:text-sm cky:text-[#d63638]", children: __$2(
                          "Failed to load settings. Please refresh the page.",
                          "cookie-law-info"
                        ) }) : renderBannerCustomizePanel(tab.id, generalProps, {
                          customCssDraft,
                          onCustomCssDraftChange: setCustomCssDraft
                        })
                      },
                      tab.id
                    ))
                  ]
                }
              ),
              showCustomizeLoader ? /* @__PURE__ */ jsxRuntimeExports.jsx(
                "div",
                {
                  className: "cky:absolute cky:inset-0 cky:z-10 cky:flex cky:min-h-[400px] cky:flex-col cky:items-center cky:justify-center cky:bg-[#f0f0f1] cky:px-5 cky:py-10",
                  "aria-busy": "true",
                  "aria-live": "polite",
                  children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardLoader, { className: "cky:w-full cky:max-w-md" })
                }
              ) : null
            ] })
          ]
        }
      ) });
    }, "BannerCustomizeContent2")
  );
  BannerCustomizeContent.displayName = "BannerCustomizeContent";
  const BannerCustomizePage = /* @__PURE__ */ __name(() => {
    const contentRef = reactExports.useRef(null);
    const shouldBlockOrWarnOnUnload = reactExports.useCallback(
      () => {
        var _a2, _b2;
        return (_b2 = (_a2 = contentRef.current) == null ? void 0 : _a2.hasChanges()) != null ? _b2 : false;
      },
      []
    );
    const { exitIntentRef, handleDiscardNavigation, handleStayOnPage } = useDirtyExitIntentBlocker(shouldBlockOrWarnOnUnload);
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "cky:box-border cky:flex cky:min-h-[calc(100vh-108px)] cky:flex-col", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        CkyExitIntentPopup,
        {
          ref: exitIntentRef,
          onStayOnPage: handleStayOnPage,
          onDiscardChanges: handleDiscardNavigation
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(BannerCustomizeContent, { ref: contentRef })
    ] });
  }, "BannerCustomizePage");
  const SplitComponent$a = SiteSettings;
  const settings = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    component: SplitComponent$a
  }, Symbol.toStringTag, { value: "Module" }));
  const SplitComponent$9 = PolicyGenerator;
  const policies = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    component: SplitComponent$9
  }, Symbol.toStringTag, { value: "Module" }));
  const SplitComponent$8 = /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {}), "SplitComponent$8");
  const languages = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    component: SplitComponent$8
  }, Symbol.toStringTag, { value: "Module" }));
  const SplitComponent$7 = Gcm;
  const gcm = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    component: SplitComponent$7
  }, Symbol.toStringTag, { value: "Module" }));
  const SplitComponent$6 = /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxRuntimeExports.jsx(Outlet, {}), "SplitComponent$6");
  const dashboard = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    component: SplitComponent$6
  }, Symbol.toStringTag, { value: "Module" }));
  const SplitComponent$5 = BannerCustomizePage;
  const customize = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    component: SplitComponent$5
  }, Symbol.toStringTag, { value: "Module" }));
  const SplitComponent$4 = Cookies;
  const cookies = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    component: SplitComponent$4
  }, Symbol.toStringTag, { value: "Module" }));
  const SplitComponent$3 = Languages;
  const languages_index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    component: SplitComponent$3
  }, Symbol.toStringTag, { value: "Module" }));
  const SplitComponent$2 = Dashboard;
  const dashboard_index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    component: SplitComponent$2
  }, Symbol.toStringTag, { value: "Module" }));
  const SplitComponent$1 = Plans;
  const dashboard_plans = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    component: SplitComponent$1
  }, Symbol.toStringTag, { value: "Module" }));
  const SplitComponent = LanguagesEdit;
  const languages_edit_$language = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    component: SplitComponent
  }, Symbol.toStringTag, { value: "Module" }));
})();
