/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ "../../node_modules/dompurify/dist/purify.es.mjs":
/*!*******************************************************!*\
  !*** ../../node_modules/dompurify/dist/purify.es.mjs ***!
  \*******************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ purify)
/* harmony export */ });
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */

const {
  entries,
  setPrototypeOf,
  isFrozen,
  getPrototypeOf,
  getOwnPropertyDescriptor
} = Object;
let {
  freeze,
  seal,
  create
} = Object; // eslint-disable-line import/no-mutable-exports
let {
  apply,
  construct
} = typeof Reflect !== 'undefined' && Reflect;
if (!freeze) {
  freeze = function freeze(x) {
    return x;
  };
}
if (!seal) {
  seal = function seal(x) {
    return x;
  };
}
if (!apply) {
  apply = function apply(fun, thisValue, args) {
    return fun.apply(thisValue, args);
  };
}
if (!construct) {
  construct = function construct(Func, args) {
    return new Func(...args);
  };
}
const arrayForEach = unapply(Array.prototype.forEach);
const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
const arrayPop = unapply(Array.prototype.pop);
const arrayPush = unapply(Array.prototype.push);
const arraySplice = unapply(Array.prototype.splice);
const stringToLowerCase = unapply(String.prototype.toLowerCase);
const stringToString = unapply(String.prototype.toString);
const stringMatch = unapply(String.prototype.match);
const stringReplace = unapply(String.prototype.replace);
const stringIndexOf = unapply(String.prototype.indexOf);
const stringTrim = unapply(String.prototype.trim);
const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
const regExpTest = unapply(RegExp.prototype.test);
const typeErrorCreate = unconstruct(TypeError);
/**
 * Creates a new function that calls the given function with a specified thisArg and arguments.
 *
 * @param func - The function to be wrapped and called.
 * @returns A new function that calls the given function with a specified thisArg and arguments.
 */
function unapply(func) {
  return function (thisArg) {
    if (thisArg instanceof RegExp) {
      thisArg.lastIndex = 0;
    }
    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }
    return apply(func, thisArg, args);
  };
}
/**
 * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
 *
 * @param func - The constructor function to be wrapped and called.
 * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
 */
function unconstruct(func) {
  return function () {
    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
      args[_key2] = arguments[_key2];
    }
    return construct(func, args);
  };
}
/**
 * Add properties to a lookup table
 *
 * @param set - The set to which elements will be added.
 * @param array - The array containing elements to be added to the set.
 * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
 * @returns The modified set with added elements.
 */
function addToSet(set, array) {
  let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
  if (setPrototypeOf) {
    // Make 'in' and truthy checks like Boolean(set.constructor)
    // independent of any properties defined on Object.prototype.
    // Prevent prototype setters from intercepting set as a this value.
    setPrototypeOf(set, null);
  }
  let l = array.length;
  while (l--) {
    let element = array[l];
    if (typeof element === 'string') {
      const lcElement = transformCaseFunc(element);
      if (lcElement !== element) {
        // Config presets (e.g. tags.js, attrs.js) are immutable.
        if (!isFrozen(array)) {
          array[l] = lcElement;
        }
        element = lcElement;
      }
    }
    set[element] = true;
  }
  return set;
}
/**
 * Clean up an array to harden against CSPP
 *
 * @param array - The array to be cleaned.
 * @returns The cleaned version of the array
 */
function cleanArray(array) {
  for (let index = 0; index < array.length; index++) {
    const isPropertyExist = objectHasOwnProperty(array, index);
    if (!isPropertyExist) {
      array[index] = null;
    }
  }
  return array;
}
/**
 * Shallow clone an object
 *
 * @param object - The object to be cloned.
 * @returns A new object that copies the original.
 */
function clone(object) {
  const newObject = create(null);
  for (const [property, value] of entries(object)) {
    const isPropertyExist = objectHasOwnProperty(object, property);
    if (isPropertyExist) {
      if (Array.isArray(value)) {
        newObject[property] = cleanArray(value);
      } else if (value && typeof value === 'object' && value.constructor === Object) {
        newObject[property] = clone(value);
      } else {
        newObject[property] = value;
      }
    }
  }
  return newObject;
}
/**
 * This method automatically checks if the prop is function or getter and behaves accordingly.
 *
 * @param object - The object to look up the getter function in its prototype chain.
 * @param prop - The property name for which to find the getter function.
 * @returns The getter function found in the prototype chain or a fallback function.
 */
function lookupGetter(object, prop) {
  while (object !== null) {
    const desc = getOwnPropertyDescriptor(object, prop);
    if (desc) {
      if (desc.get) {
        return unapply(desc.get);
      }
      if (typeof desc.value === 'function') {
        return unapply(desc.value);
      }
    }
    object = getPrototypeOf(object);
  }
  function fallbackValue() {
    return null;
  }
  return fallbackValue;
}

const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
// List of SVG elements that are disallowed by default.
// We still need to know them so that we can do namespace
// checks properly in case one wants to add them to
// allow-list.
const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);
// Similarly to SVG, we want to know all MathML elements,
// even those that we disallow by default.
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
const text = freeze(['#text']);

const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);

// eslint-disable-next-line unicorn/better-regex
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
);
const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
);
const DOCTYPE_NAME = seal(/^html$/i);
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);

var EXPRESSIONS = /*#__PURE__*/Object.freeze({
  __proto__: null,
  ARIA_ATTR: ARIA_ATTR,
  ATTR_WHITESPACE: ATTR_WHITESPACE,
  CUSTOM_ELEMENT: CUSTOM_ELEMENT,
  DATA_ATTR: DATA_ATTR,
  DOCTYPE_NAME: DOCTYPE_NAME,
  ERB_EXPR: ERB_EXPR,
  IS_ALLOWED_URI: IS_ALLOWED_URI,
  IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
  MUSTACHE_EXPR: MUSTACHE_EXPR,
  TMPLIT_EXPR: TMPLIT_EXPR
});

/* eslint-disable @typescript-eslint/indent */
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
const NODE_TYPE = {
  element: 1,
  attribute: 2,
  text: 3,
  cdataSection: 4,
  entityReference: 5,
  // Deprecated
  entityNode: 6,
  // Deprecated
  progressingInstruction: 7,
  comment: 8,
  document: 9,
  documentType: 10,
  documentFragment: 11,
  notation: 12 // Deprecated
};
const getGlobal = function getGlobal() {
  return typeof window === 'undefined' ? null : window;
};
/**
 * Creates a no-op policy for internal use only.
 * Don't export this function outside this module!
 * @param trustedTypes The policy factory.
 * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
 * @return The policy created (or null, if Trusted Types
 * are not supported or creating the policy failed).
 */
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
  if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
    return null;
  }
  // Allow the callers to control the unique policy name
  // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
  // Policy creation with duplicate names throws in Trusted Types.
  let suffix = null;
  const ATTR_NAME = 'data-tt-policy-suffix';
  if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
    suffix = purifyHostElement.getAttribute(ATTR_NAME);
  }
  const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
  try {
    return trustedTypes.createPolicy(policyName, {
      createHTML(html) {
        return html;
      },
      createScriptURL(scriptUrl) {
        return scriptUrl;
      }
    });
  } catch (_) {
    // Policy creation failed (most likely another DOMPurify script has
    // already run). Skip creating the policy, as this will only cause errors
    // if TT are enforced.
    console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
    return null;
  }
};
const _createHooksMap = function _createHooksMap() {
  return {
    afterSanitizeAttributes: [],
    afterSanitizeElements: [],
    afterSanitizeShadowDOM: [],
    beforeSanitizeAttributes: [],
    beforeSanitizeElements: [],
    beforeSanitizeShadowDOM: [],
    uponSanitizeAttribute: [],
    uponSanitizeElement: [],
    uponSanitizeShadowNode: []
  };
};
function createDOMPurify() {
  let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
  const DOMPurify = root => createDOMPurify(root);
  DOMPurify.version = '3.2.6';
  DOMPurify.removed = [];
  if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
    // Not running in a browser, provide a factory function
    // so that you can pass your own Window
    DOMPurify.isSupported = false;
    return DOMPurify;
  }
  let {
    document
  } = window;
  const originalDocument = document;
  const currentScript = originalDocument.currentScript;
  const {
    DocumentFragment,
    HTMLTemplateElement,
    Node,
    Element,
    NodeFilter,
    NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
    HTMLFormElement,
    DOMParser,
    trustedTypes
  } = window;
  const ElementPrototype = Element.prototype;
  const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
  const remove = lookupGetter(ElementPrototype, 'remove');
  const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
  const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
  const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
  // As per issue #47, the web-components registry is inherited by a
  // new document created via createHTMLDocument. As per the spec
  // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
  // a new empty registry is used when creating a template contents owner
  // document, so we use that as our parent document to ensure nothing
  // is inherited.
  if (typeof HTMLTemplateElement === 'function') {
    const template = document.createElement('template');
    if (template.content && template.content.ownerDocument) {
      document = template.content.ownerDocument;
    }
  }
  let trustedTypesPolicy;
  let emptyHTML = '';
  const {
    implementation,
    createNodeIterator,
    createDocumentFragment,
    getElementsByTagName
  } = document;
  const {
    importNode
  } = originalDocument;
  let hooks = _createHooksMap();
  /**
   * Expose whether this browser supports running the full DOMPurify.
   */
  DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
  const {
    MUSTACHE_EXPR,
    ERB_EXPR,
    TMPLIT_EXPR,
    DATA_ATTR,
    ARIA_ATTR,
    IS_SCRIPT_OR_DATA,
    ATTR_WHITESPACE,
    CUSTOM_ELEMENT
  } = EXPRESSIONS;
  let {
    IS_ALLOWED_URI: IS_ALLOWED_URI$1
  } = EXPRESSIONS;
  /**
   * We consider the elements and attributes below to be safe. Ideally
   * don't add any new ones but feel free to remove unwanted ones.
   */
  /* allowed element names */
  let ALLOWED_TAGS = null;
  const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
  /* Allowed attribute names */
  let ALLOWED_ATTR = null;
  const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
  /*
   * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
   * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
   * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
   * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
   */
  let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
    tagNameCheck: {
      writable: true,
      configurable: false,
      enumerable: true,
      value: null
    },
    attributeNameCheck: {
      writable: true,
      configurable: false,
      enumerable: true,
      value: null
    },
    allowCustomizedBuiltInElements: {
      writable: true,
      configurable: false,
      enumerable: true,
      value: false
    }
  }));
  /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
  let FORBID_TAGS = null;
  /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
  let FORBID_ATTR = null;
  /* Decide if ARIA attributes are okay */
  let ALLOW_ARIA_ATTR = true;
  /* Decide if custom data attributes are okay */
  let ALLOW_DATA_ATTR = true;
  /* Decide if unknown protocols are okay */
  let ALLOW_UNKNOWN_PROTOCOLS = false;
  /* Decide if self-closing tags in attributes are allowed.
   * Usually removed due to a mXSS issue in jQuery 3.0 */
  let ALLOW_SELF_CLOSE_IN_ATTR = true;
  /* Output should be safe for common template engines.
   * This means, DOMPurify removes data attributes, mustaches and ERB
   */
  let SAFE_FOR_TEMPLATES = false;
  /* Output should be safe even for XML used within HTML and alike.
   * This means, DOMPurify removes comments when containing risky content.
   */
  let SAFE_FOR_XML = true;
  /* Decide if document with <html>... should be returned */
  let WHOLE_DOCUMENT = false;
  /* Track whether config is already set on this instance of DOMPurify. */
  let SET_CONFIG = false;
  /* Decide if all elements (e.g. style, script) must be children of
   * document.body. By default, browsers might move them to document.head */
  let FORCE_BODY = false;
  /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
   * string (or a TrustedHTML object if Trusted Types are supported).
   * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
   */
  let RETURN_DOM = false;
  /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
   * string  (or a TrustedHTML object if Trusted Types are supported) */
  let RETURN_DOM_FRAGMENT = false;
  /* Try to return a Trusted Type object instead of a string, return a string in
   * case Trusted Types are not supported  */
  let RETURN_TRUSTED_TYPE = false;
  /* Output should be free from DOM clobbering attacks?
   * This sanitizes markups named with colliding, clobberable built-in DOM APIs.
   */
  let SANITIZE_DOM = true;
  /* Achieve full DOM Clobbering protection by isolating the namespace of named
   * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
   *
   * HTML/DOM spec rules that enable DOM Clobbering:
   *   - Named Access on Window (§7.3.3)
   *   - DOM Tree Accessors (§3.1.5)
   *   - Form Element Parent-Child Relations (§4.10.3)
   *   - Iframe srcdoc / Nested WindowProxies (§4.8.5)
   *   - HTMLCollection (§4.2.10.2)
   *
   * Namespace isolation is implemented by prefixing `id` and `name` attributes
   * with a constant string, i.e., `user-content-`
   */
  let SANITIZE_NAMED_PROPS = false;
  const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
  /* Keep element content when removing element? */
  let KEEP_CONTENT = true;
  /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
   * of importing it into a new Document and returning a sanitized copy */
  let IN_PLACE = false;
  /* Allow usage of profiles like html, svg and mathMl */
  let USE_PROFILES = {};
  /* Tags to ignore content of when KEEP_CONTENT is true */
  let FORBID_CONTENTS = null;
  const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
  /* Tags that are safe for data: URIs */
  let DATA_URI_TAGS = null;
  const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
  /* Attributes safe for values like "javascript:" */
  let URI_SAFE_ATTRIBUTES = null;
  const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
  const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
  const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
  const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
  /* Document namespace */
  let NAMESPACE = HTML_NAMESPACE;
  let IS_EMPTY_INPUT = false;
  /* Allowed XHTML+XML namespaces */
  let ALLOWED_NAMESPACES = null;
  const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
  let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
  let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
  // Certain elements are allowed in both SVG and HTML
  // namespace. We need to specify them explicitly
  // so that they don't get erroneously deleted from
  // HTML namespace.
  const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
  /* Parsing of strict XHTML documents */
  let PARSER_MEDIA_TYPE = null;
  const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
  const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
  let transformCaseFunc = null;
  /* Keep a reference to config to pass to hooks */
  let CONFIG = null;
  /* Ideally, do not touch anything below this line */
  /* ______________________________________________ */
  const formElement = document.createElement('form');
  const isRegexOrFunction = function isRegexOrFunction(testValue) {
    return testValue instanceof RegExp || testValue instanceof Function;
  };
  /**
   * _parseConfig
   *
   * @param cfg optional config literal
   */
  // eslint-disable-next-line complexity
  const _parseConfig = function _parseConfig() {
    let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    if (CONFIG && CONFIG === cfg) {
      return;
    }
    /* Shield configuration object from tampering */
    if (!cfg || typeof cfg !== 'object') {
      cfg = {};
    }
    /* Shield configuration object from prototype pollution */
    cfg = clone(cfg);
    PARSER_MEDIA_TYPE =
    // eslint-disable-next-line unicorn/prefer-includes
    SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
    // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
    transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
    /* Set configuration parameters */
    ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
    ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
    ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
    URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
    DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
    FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
    FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
    FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
    USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
    ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
    ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
    ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
    ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
    SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
    SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
    WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
    RETURN_DOM = cfg.RETURN_DOM || false; // Default false
    RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
    RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
    FORCE_BODY = cfg.FORCE_BODY || false; // Default false
    SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
    SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
    KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
    IN_PLACE = cfg.IN_PLACE || false; // Default false
    IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
    NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
    MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
    HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
    CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
    if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
      CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
    }
    if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
      CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
    }
    if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
      CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
    }
    if (SAFE_FOR_TEMPLATES) {
      ALLOW_DATA_ATTR = false;
    }
    if (RETURN_DOM_FRAGMENT) {
      RETURN_DOM = true;
    }
    /* Parse profile info */
    if (USE_PROFILES) {
      ALLOWED_TAGS = addToSet({}, text);
      ALLOWED_ATTR = [];
      if (USE_PROFILES.html === true) {
        addToSet(ALLOWED_TAGS, html$1);
        addToSet(ALLOWED_ATTR, html);
      }
      if (USE_PROFILES.svg === true) {
        addToSet(ALLOWED_TAGS, svg$1);
        addToSet(ALLOWED_ATTR, svg);
        addToSet(ALLOWED_ATTR, xml);
      }
      if (USE_PROFILES.svgFilters === true) {
        addToSet(ALLOWED_TAGS, svgFilters);
        addToSet(ALLOWED_ATTR, svg);
        addToSet(ALLOWED_ATTR, xml);
      }
      if (USE_PROFILES.mathMl === true) {
        addToSet(ALLOWED_TAGS, mathMl$1);
        addToSet(ALLOWED_ATTR, mathMl);
        addToSet(ALLOWED_ATTR, xml);
      }
    }
    /* Merge configuration parameters */
    if (cfg.ADD_TAGS) {
      if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
        ALLOWED_TAGS = clone(ALLOWED_TAGS);
      }
      addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
    }
    if (cfg.ADD_ATTR) {
      if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
        ALLOWED_ATTR = clone(ALLOWED_ATTR);
      }
      addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
    }
    if (cfg.ADD_URI_SAFE_ATTR) {
      addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
    }
    if (cfg.FORBID_CONTENTS) {
      if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
        FORBID_CONTENTS = clone(FORBID_CONTENTS);
      }
      addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
    }
    /* Add #text in case KEEP_CONTENT is set to true */
    if (KEEP_CONTENT) {
      ALLOWED_TAGS['#text'] = true;
    }
    /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
    if (WHOLE_DOCUMENT) {
      addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
    }
    /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
    if (ALLOWED_TAGS.table) {
      addToSet(ALLOWED_TAGS, ['tbody']);
      delete FORBID_TAGS.tbody;
    }
    if (cfg.TRUSTED_TYPES_POLICY) {
      if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
        throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
      }
      if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
        throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
      }
      // Overwrite existing TrustedTypes policy.
      trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
      // Sign local variables required by `sanitize`.
      emptyHTML = trustedTypesPolicy.createHTML('');
    } else {
      // Uninitialized policy, attempt to initialize the internal dompurify policy.
      if (trustedTypesPolicy === undefined) {
        trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
      }
      // If creating the internal policy succeeded sign internal variables.
      if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
        emptyHTML = trustedTypesPolicy.createHTML('');
      }
    }
    // Prevent further manipulation of configuration.
    // Not available in IE8, Safari 5, etc.
    if (freeze) {
      freeze(cfg);
    }
    CONFIG = cfg;
  };
  /* Keep track of all possible SVG and MathML tags
   * so that we can perform the namespace checks
   * correctly. */
  const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
  const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
  /**
   * @param element a DOM element whose namespace is being checked
   * @returns Return false if the element has a
   *  namespace that a spec-compliant parser would never
   *  return. Return true otherwise.
   */
  const _checkValidNamespace = function _checkValidNamespace(element) {
    let parent = getParentNode(element);
    // In JSDOM, if we're inside shadow DOM, then parentNode
    // can be null. We just simulate parent in this case.
    if (!parent || !parent.tagName) {
      parent = {
        namespaceURI: NAMESPACE,
        tagName: 'template'
      };
    }
    const tagName = stringToLowerCase(element.tagName);
    const parentTagName = stringToLowerCase(parent.tagName);
    if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
      return false;
    }
    if (element.namespaceURI === SVG_NAMESPACE) {
      // The only way to switch from HTML namespace to SVG
      // is via <svg>. If it happens via any other tag, then
      // it should be killed.
      if (parent.namespaceURI === HTML_NAMESPACE) {
        return tagName === 'svg';
      }
      // The only way to switch from MathML to SVG is via`
      // svg if parent is either <annotation-xml> or MathML
      // text integration points.
      if (parent.namespaceURI === MATHML_NAMESPACE) {
        return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
      }
      // We only allow elements that are defined in SVG
      // spec. All others are disallowed in SVG namespace.
      return Boolean(ALL_SVG_TAGS[tagName]);
    }
    if (element.namespaceURI === MATHML_NAMESPACE) {
      // The only way to switch from HTML namespace to MathML
      // is via <math>. If it happens via any other tag, then
      // it should be killed.
      if (parent.namespaceURI === HTML_NAMESPACE) {
        return tagName === 'math';
      }
      // The only way to switch from SVG to MathML is via
      // <math> and HTML integration points
      if (parent.namespaceURI === SVG_NAMESPACE) {
        return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
      }
      // We only allow elements that are defined in MathML
      // spec. All others are disallowed in MathML namespace.
      return Boolean(ALL_MATHML_TAGS[tagName]);
    }
    if (element.namespaceURI === HTML_NAMESPACE) {
      // The only way to switch from SVG to HTML is via
      // HTML integration points, and from MathML to HTML
      // is via MathML text integration points
      if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
        return false;
      }
      if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
        return false;
      }
      // We disallow tags that are specific for MathML
      // or SVG and should never appear in HTML namespace
      return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
    }
    // For XHTML and XML documents that support custom namespaces
    if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
      return true;
    }
    // The code should never reach this place (this means
    // that the element somehow got namespace that is not
    // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
    // Return false just in case.
    return false;
  };
  /**
   * _forceRemove
   *
   * @param node a DOM node
   */
  const _forceRemove = function _forceRemove(node) {
    arrayPush(DOMPurify.removed, {
      element: node
    });
    try {
      // eslint-disable-next-line unicorn/prefer-dom-node-remove
      getParentNode(node).removeChild(node);
    } catch (_) {
      remove(node);
    }
  };
  /**
   * _removeAttribute
   *
   * @param name an Attribute name
   * @param element a DOM node
   */
  const _removeAttribute = function _removeAttribute(name, element) {
    try {
      arrayPush(DOMPurify.removed, {
        attribute: element.getAttributeNode(name),
        from: element
      });
    } catch (_) {
      arrayPush(DOMPurify.removed, {
        attribute: null,
        from: element
      });
    }
    element.removeAttribute(name);
    // We void attribute values for unremovable "is" attributes
    if (name === 'is') {
      if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
        try {
          _forceRemove(element);
        } catch (_) {}
      } else {
        try {
          element.setAttribute(name, '');
        } catch (_) {}
      }
    }
  };
  /**
   * _initDocument
   *
   * @param dirty - a string of dirty markup
   * @return a DOM, filled with the dirty markup
   */
  const _initDocument = function _initDocument(dirty) {
    /* Create a HTML document */
    let doc = null;
    let leadingWhitespace = null;
    if (FORCE_BODY) {
      dirty = '<remove></remove>' + dirty;
    } else {
      /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
      const matches = stringMatch(dirty, /^[\r\n\t ]+/);
      leadingWhitespace = matches && matches[0];
    }
    if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
      // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
      dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
    }
    const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
    /*
     * Use the DOMParser API by default, fallback later if needs be
     * DOMParser not work for svg when has multiple root element.
     */
    if (NAMESPACE === HTML_NAMESPACE) {
      try {
        doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
      } catch (_) {}
    }
    /* Use createHTMLDocument in case DOMParser is not available */
    if (!doc || !doc.documentElement) {
      doc = implementation.createDocument(NAMESPACE, 'template', null);
      try {
        doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
      } catch (_) {
        // Syntax error if dirtyPayload is invalid xml
      }
    }
    const body = doc.body || doc.documentElement;
    if (dirty && leadingWhitespace) {
      body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
    }
    /* Work on whole document or just its body */
    if (NAMESPACE === HTML_NAMESPACE) {
      return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
    }
    return WHOLE_DOCUMENT ? doc.documentElement : body;
  };
  /**
   * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
   *
   * @param root The root element or node to start traversing on.
   * @return The created NodeIterator
   */
  const _createNodeIterator = function _createNodeIterator(root) {
    return createNodeIterator.call(root.ownerDocument || root, root,
    // eslint-disable-next-line no-bitwise
    NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
  };
  /**
   * _isClobbered
   *
   * @param element element to check for clobbering attacks
   * @return true if clobbered, false if safe
   */
  const _isClobbered = function _isClobbered(element) {
    return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');
  };
  /**
   * Checks whether the given object is a DOM node.
   *
   * @param value object to check whether it's a DOM node
   * @return true is object is a DOM node
   */
  const _isNode = function _isNode(value) {
    return typeof Node === 'function' && value instanceof Node;
  };
  function _executeHooks(hooks, currentNode, data) {
    arrayForEach(hooks, hook => {
      hook.call(DOMPurify, currentNode, data, CONFIG);
    });
  }
  /**
   * _sanitizeElements
   *
   * @protect nodeName
   * @protect textContent
   * @protect removeChild
   * @param currentNode to check for permission to exist
   * @return true if node was killed, false if left alive
   */
  const _sanitizeElements = function _sanitizeElements(currentNode) {
    let content = null;
    /* Execute a hook if present */
    _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
    /* Check if element is clobbered or can clobber */
    if (_isClobbered(currentNode)) {
      _forceRemove(currentNode);
      return true;
    }
    /* Now let's check the element's type and name */
    const tagName = transformCaseFunc(currentNode.nodeName);
    /* Execute a hook if present */
    _executeHooks(hooks.uponSanitizeElement, currentNode, {
      tagName,
      allowedTags: ALLOWED_TAGS
    });
    /* Detect mXSS attempts abusing namespace confusion */
    if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
      _forceRemove(currentNode);
      return true;
    }
    /* Remove any occurrence of processing instructions */
    if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
      _forceRemove(currentNode);
      return true;
    }
    /* Remove any kind of possibly harmful comments */
    if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
      _forceRemove(currentNode);
      return true;
    }
    /* Remove element if anything forbids its presence */
    if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
      /* Check if we have a custom element to handle */
      if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
        if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
          return false;
        }
        if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
          return false;
        }
      }
      /* Keep content except for bad-listed elements */
      if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
        const parentNode = getParentNode(currentNode) || currentNode.parentNode;
        const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
        if (childNodes && parentNode) {
          const childCount = childNodes.length;
          for (let i = childCount - 1; i >= 0; --i) {
            const childClone = cloneNode(childNodes[i], true);
            childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
            parentNode.insertBefore(childClone, getNextSibling(currentNode));
          }
        }
      }
      _forceRemove(currentNode);
      return true;
    }
    /* Check whether element has a valid namespace */
    if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
      _forceRemove(currentNode);
      return true;
    }
    /* Make sure that older browsers don't get fallback-tag mXSS */
    if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
      _forceRemove(currentNode);
      return true;
    }
    /* Sanitize element content to be template-safe */
    if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
      /* Get the element's text content */
      content = currentNode.textContent;
      arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
        content = stringReplace(content, expr, ' ');
      });
      if (currentNode.textContent !== content) {
        arrayPush(DOMPurify.removed, {
          element: currentNode.cloneNode()
        });
        currentNode.textContent = content;
      }
    }
    /* Execute a hook if present */
    _executeHooks(hooks.afterSanitizeElements, currentNode, null);
    return false;
  };
  /**
   * _isValidAttribute
   *
   * @param lcTag Lowercase tag name of containing element.
   * @param lcName Lowercase attribute name.
   * @param value Attribute value.
   * @return Returns true if `value` is valid, otherwise false.
   */
  // eslint-disable-next-line complexity
  const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
    /* Make sure attribute cannot clobber */
    if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
      return false;
    }
    /* Allow valid data-* attributes: At least one character after "-"
        (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
        XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
        We don't need to check the value; it's always URI safe. */
    if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
      if (
      // First condition does a very basic check if a) it's basically a valid custom element tagname AND
      // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
      // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
      _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||
      // Alternative, second condition checks if it's an `is`-attribute, AND
      // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
      lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {
        return false;
      }
      /* Check value is safe. First, is attr inert? If so, is safe */
    } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
      return false;
    } else ;
    return true;
  };
  /**
   * _isBasicCustomElement
   * checks if at least one dash is included in tagName, and it's not the first char
   * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
   *
   * @param tagName name of the tag of the node to sanitize
   * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
   */
  const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
    return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
  };
  /**
   * _sanitizeAttributes
   *
   * @protect attributes
   * @protect nodeName
   * @protect removeAttribute
   * @protect setAttribute
   *
   * @param currentNode to sanitize
   */
  const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
    /* Execute a hook if present */
    _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
    const {
      attributes
    } = currentNode;
    /* Check if we have attributes; if not we might have a text node */
    if (!attributes || _isClobbered(currentNode)) {
      return;
    }
    const hookEvent = {
      attrName: '',
      attrValue: '',
      keepAttr: true,
      allowedAttributes: ALLOWED_ATTR,
      forceKeepAttr: undefined
    };
    let l = attributes.length;
    /* Go backwards over all attributes; safely remove bad ones */
    while (l--) {
      const attr = attributes[l];
      const {
        name,
        namespaceURI,
        value: attrValue
      } = attr;
      const lcName = transformCaseFunc(name);
      const initValue = attrValue;
      let value = name === 'value' ? initValue : stringTrim(initValue);
      /* Execute a hook if present */
      hookEvent.attrName = lcName;
      hookEvent.attrValue = value;
      hookEvent.keepAttr = true;
      hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
      _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
      value = hookEvent.attrValue;
      /* Full DOM Clobbering protection via namespace isolation,
       * Prefix id and name attributes with `user-content-`
       */
      if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
        // Remove the attribute with this value
        _removeAttribute(name, currentNode);
        // Prefix the value and later re-create the attribute with the sanitized value
        value = SANITIZE_NAMED_PROPS_PREFIX + value;
      }
      /* Work around a security issue with comments inside attributes */
      if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
        _removeAttribute(name, currentNode);
        continue;
      }
      /* Did the hooks approve of the attribute? */
      if (hookEvent.forceKeepAttr) {
        continue;
      }
      /* Did the hooks approve of the attribute? */
      if (!hookEvent.keepAttr) {
        _removeAttribute(name, currentNode);
        continue;
      }
      /* Work around a security issue in jQuery 3.0 */
      if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
        _removeAttribute(name, currentNode);
        continue;
      }
      /* Sanitize attribute content to be template-safe */
      if (SAFE_FOR_TEMPLATES) {
        arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
          value = stringReplace(value, expr, ' ');
        });
      }
      /* Is `value` valid for this attribute? */
      const lcTag = transformCaseFunc(currentNode.nodeName);
      if (!_isValidAttribute(lcTag, lcName, value)) {
        _removeAttribute(name, currentNode);
        continue;
      }
      /* Handle attributes that require Trusted Types */
      if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
        if (namespaceURI) ; else {
          switch (trustedTypes.getAttributeType(lcTag, lcName)) {
            case 'TrustedHTML':
              {
                value = trustedTypesPolicy.createHTML(value);
                break;
              }
            case 'TrustedScriptURL':
              {
                value = trustedTypesPolicy.createScriptURL(value);
                break;
              }
          }
        }
      }
      /* Handle invalid data-* attribute set by try-catching it */
      if (value !== initValue) {
        try {
          if (namespaceURI) {
            currentNode.setAttributeNS(namespaceURI, name, value);
          } else {
            /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
            currentNode.setAttribute(name, value);
          }
          if (_isClobbered(currentNode)) {
            _forceRemove(currentNode);
          } else {
            arrayPop(DOMPurify.removed);
          }
        } catch (_) {
          _removeAttribute(name, currentNode);
        }
      }
    }
    /* Execute a hook if present */
    _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
  };
  /**
   * _sanitizeShadowDOM
   *
   * @param fragment to iterate over recursively
   */
  const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
    let shadowNode = null;
    const shadowIterator = _createNodeIterator(fragment);
    /* Execute a hook if present */
    _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
    while (shadowNode = shadowIterator.nextNode()) {
      /* Execute a hook if present */
      _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
      /* Sanitize tags and elements */
      _sanitizeElements(shadowNode);
      /* Check attributes next */
      _sanitizeAttributes(shadowNode);
      /* Deep shadow DOM detected */
      if (shadowNode.content instanceof DocumentFragment) {
        _sanitizeShadowDOM(shadowNode.content);
      }
    }
    /* Execute a hook if present */
    _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
  };
  // eslint-disable-next-line complexity
  DOMPurify.sanitize = function (dirty) {
    let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    let body = null;
    let importedNode = null;
    let currentNode = null;
    let returnNode = null;
    /* Make sure we have a string to sanitize.
      DO NOT return early, as this will return the wrong type if
      the user has requested a DOM object rather than a string */
    IS_EMPTY_INPUT = !dirty;
    if (IS_EMPTY_INPUT) {
      dirty = '<!-->';
    }
    /* Stringify, in case dirty is an object */
    if (typeof dirty !== 'string' && !_isNode(dirty)) {
      if (typeof dirty.toString === 'function') {
        dirty = dirty.toString();
        if (typeof dirty !== 'string') {
          throw typeErrorCreate('dirty is not a string, aborting');
        }
      } else {
        throw typeErrorCreate('toString is not a function');
      }
    }
    /* Return dirty HTML if DOMPurify cannot run */
    if (!DOMPurify.isSupported) {
      return dirty;
    }
    /* Assign config vars */
    if (!SET_CONFIG) {
      _parseConfig(cfg);
    }
    /* Clean up removed elements */
    DOMPurify.removed = [];
    /* Check if dirty is correctly typed for IN_PLACE */
    if (typeof dirty === 'string') {
      IN_PLACE = false;
    }
    if (IN_PLACE) {
      /* Do some early pre-sanitization to avoid unsafe root nodes */
      if (dirty.nodeName) {
        const tagName = transformCaseFunc(dirty.nodeName);
        if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
          throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
        }
      }
    } else if (dirty instanceof Node) {
      /* If dirty is a DOM element, append to an empty document to avoid
         elements being stripped by the parser */
      body = _initDocument('<!---->');
      importedNode = body.ownerDocument.importNode(dirty, true);
      if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
        /* Node is already a body, use as is */
        body = importedNode;
      } else if (importedNode.nodeName === 'HTML') {
        body = importedNode;
      } else {
        // eslint-disable-next-line unicorn/prefer-dom-node-append
        body.appendChild(importedNode);
      }
    } else {
      /* Exit directly if we have nothing to do */
      if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
      // eslint-disable-next-line unicorn/prefer-includes
      dirty.indexOf('<') === -1) {
        return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
      }
      /* Initialize the document to work on */
      body = _initDocument(dirty);
      /* Check we have a DOM node from the data */
      if (!body) {
        return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
      }
    }
    /* Remove first element node (ours) if FORCE_BODY is set */
    if (body && FORCE_BODY) {
      _forceRemove(body.firstChild);
    }
    /* Get node iterator */
    const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
    /* Now start iterating over the created document */
    while (currentNode = nodeIterator.nextNode()) {
      /* Sanitize tags and elements */
      _sanitizeElements(currentNode);
      /* Check attributes next */
      _sanitizeAttributes(currentNode);
      /* Shadow DOM detected, sanitize it */
      if (currentNode.content instanceof DocumentFragment) {
        _sanitizeShadowDOM(currentNode.content);
      }
    }
    /* If we sanitized `dirty` in-place, return it. */
    if (IN_PLACE) {
      return dirty;
    }
    /* Return sanitized string or DOM */
    if (RETURN_DOM) {
      if (RETURN_DOM_FRAGMENT) {
        returnNode = createDocumentFragment.call(body.ownerDocument);
        while (body.firstChild) {
          // eslint-disable-next-line unicorn/prefer-dom-node-append
          returnNode.appendChild(body.firstChild);
        }
      } else {
        returnNode = body;
      }
      if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
        /*
          AdoptNode() is not used because internal state is not reset
          (e.g. the past names map of a HTMLFormElement), this is safe
          in theory but we would rather not risk another attack vector.
          The state that is cloned by importNode() is explicitly defined
          by the specs.
        */
        returnNode = importNode.call(originalDocument, returnNode, true);
      }
      return returnNode;
    }
    let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
    /* Serialize doctype if allowed */
    if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
      serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
    }
    /* Sanitize final string template-safe */
    if (SAFE_FOR_TEMPLATES) {
      arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
        serializedHTML = stringReplace(serializedHTML, expr, ' ');
      });
    }
    return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
  };
  DOMPurify.setConfig = function () {
    let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    _parseConfig(cfg);
    SET_CONFIG = true;
  };
  DOMPurify.clearConfig = function () {
    CONFIG = null;
    SET_CONFIG = false;
  };
  DOMPurify.isValidAttribute = function (tag, attr, value) {
    /* Initialize shared config vars if necessary. */
    if (!CONFIG) {
      _parseConfig({});
    }
    const lcTag = transformCaseFunc(tag);
    const lcName = transformCaseFunc(attr);
    return _isValidAttribute(lcTag, lcName, value);
  };
  DOMPurify.addHook = function (entryPoint, hookFunction) {
    if (typeof hookFunction !== 'function') {
      return;
    }
    arrayPush(hooks[entryPoint], hookFunction);
  };
  DOMPurify.removeHook = function (entryPoint, hookFunction) {
    if (hookFunction !== undefined) {
      const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
      return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
    }
    return arrayPop(hooks[entryPoint]);
  };
  DOMPurify.removeHooks = function (entryPoint) {
    hooks[entryPoint] = [];
  };
  DOMPurify.removeAllHooks = function () {
    hooks = _createHooksMap();
  };
  return DOMPurify;
}
var purify = createDOMPurify();


//# sourceMappingURL=purify.es.mjs.map


/***/ }),

/***/ "../utils/helpers.js":
/*!***************************!*\
  !*** ../utils/helpers.js ***!
  \***************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   classNames: () => (/* binding */ classNames),
/* harmony export */   debounce: () => (/* binding */ debounce),
/* harmony export */   getAstraProTitle: () => (/* binding */ getAstraProTitle),
/* harmony export */   getAstraProTitleFreePage: () => (/* binding */ getAstraProTitleFreePage),
/* harmony export */   getSpinner: () => (/* binding */ getSpinner),
/* harmony export */   handleGetAstraPro: () => (/* binding */ handleGetAstraPro),
/* harmony export */   saveSetting: () => (/* binding */ saveSetting)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! dompurify */ "../../node_modules/dompurify/dist/purify.es.mjs");




/**
 * Returns the class names.
 *
 * @param {...string} classes The class names.
 *
 * @return {string} Returns the class names.
 */
const classNames = (...classes) => classes.filter(Boolean).join(' ');

/**
 * Handles the Astra Pro CTA button click event, opening the upgrade URL in a new tab.
 * This function also handles the display of a spinner during the upgrade process.
 *
 * @param {Event} e - The event object.
 * @param {Object} options - Options for the upgrade process.
 * @param {string} options.url - The URL for the upgrade.
 * @param {string} options.campaign - The UTM campaign parameter.
 * @param {boolean} options.disableSpinner - Optional. Disables the spinner if true.
 * @param {string} options.spinnerPosition - Optional. The position of the spinner.
 */
const handleGetAstraPro = (e, {
  url = astra_admin.upgrade_url,
  campaign = '',
  disableSpinner = false,
  spinnerPosition = 'right'
} = {}) => {
  e.preventDefault();
  e.stopPropagation();
  if (!astra_admin.pro_installed_status) {
    // If a custom campaign is provided, modify the URL
    if (campaign) {
      const urlObj = new URL(url);
      urlObj.searchParams.set('utm_campaign', campaign);
      url = urlObj.toString();
    }
    window.open(url, '_blank');
    return;
  }
  const spinnerHTML = disableSpinner ? '' : getSpinner();
  const buttonHTML = spinnerPosition === 'right' ? `<span class="button-text">${astra_admin.plugin_activating_text}</span>${spinnerHTML}` : `${spinnerHTML}<span class="button-text">${astra_admin.plugin_activating_text}</span>`;
  e.target.innerHTML = dompurify__WEBPACK_IMPORTED_MODULE_2__["default"].sanitize(buttonHTML);
  e.target.disabled = true;
  const formData = new window.FormData();
  formData.append('action', 'astra_recommended_plugin_activate');
  formData.append('security', astra_admin.plugin_manager_nonce);
  formData.append('init', 'astra-addon/astra-addon.php');
  _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({
    url: astra_admin.ajax_url,
    method: 'POST',
    body: formData
  }).then(data => {
    if (data.success) {
      window.open(astra_admin.astra_base_url, '_self');
      return;
    }
  }).catch(error => {
    e.target.innerText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Activation failed. Please try again.', 'astra');
    e.target.disabled = false;
    console.error('Error during API request:', error);
    // Optionally, notify the user about the error or handle it appropriately.
  });
};

/**
 * Creates a debounced function that delays its execution until after the specified delay.
 *
 * The debounce() function can also be used from lodash.debounce package in future.
 *
 * @param {Function} func - The function to debounce.
 * @param {number} delay - The delay in milliseconds before the function is executed.
 *
 * @returns {Function} A debounced function.
 */
const debounce = (func, delay) => {
  let timer;
  function debounced(...args) {
    clearTimeout(timer);
    timer = setTimeout(() => func(...args), delay);
  }

  // Attach a `cancel` method to clear the timeout.
  debounced.cancel = () => {
    clearTimeout(timer);
  };
  return debounced;
};

/**
 * Returns the Astra Pro title.
 *
 * @return {string} Returns the Astra Pro title.
 */
const getAstraProTitle = () => {
  return astra_admin.pro_installed_status ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Activate Now', 'astra') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Upgrade Now', 'astra');
};

/**
 * Returns the Astra Pro title.
 *
 * @return {string} Returns the Astra Pro title.
 */
const getAstraProTitleFreePage = () => {
  return astra_admin.pro_installed_status ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Activate Now', 'astra') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('See all Astra Pro Features', 'astra');
};

/**
 * Returns the spinner SVG text.
 *
 * @return {string} Returns the spinner SVG text..
 */
const getSpinner = () => {
  return `
		<svg class="animate-spin installer-spinner ml-2 inline-block align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" width="16" height="16">
			<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
			<path class="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"></path>
		</svg>
	`;
};

/**
 * A function to save astra admin settings.
 *
 * @function
 *
 * @param {string}   key                - Settings key.
 * @param {string}   value              - The data to send.
 * @param {Function} dispatch           - The dispatch function.
 * @param {Object}   abortControllerRef - The ref object with to hold abort controller.
 *
 * @return {Promise} Returns a promise representing the processed request.
 */
const saveSetting = debounce(({
  action = 'astra_update_admin_setting',
  security = astra_admin.update_nonce,
  key = '',
  value
}, dispatch, abortControllerRef = {
  current: {}
}) => {
  // Abort any previous request.
  if (abortControllerRef.current[key]) {
    abortControllerRef.current[key]?.abort();
  }

  // Create a new AbortController.
  const abortController = new AbortController();
  abortControllerRef.current[key] = abortController;
  const formData = new window.FormData();
  formData.append('action', action);
  formData.append('security', security);
  formData.append('key', key);
  formData.append('value', value);
  return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({
    url: astra_admin.ajax_url,
    method: 'POST',
    body: formData,
    signal: abortControllerRef.current[key]?.signal // Pass the signal to the fetch request.
  }).then(() => {
    dispatch({
      type: 'UPDATE_SETTINGS_SAVED_NOTIFICATION',
      payload: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Successfully saved!', 'astra')
    });
  }).catch(error => {
    // Ignore if it is intentionally aborted.
    if (error.name === 'AbortError') {
      return;
    }
    console.error('Error during API request:', error);
    dispatch({
      type: 'UPDATE_SETTINGS_SAVED_NOTIFICATION',
      payload: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('An error occurred while saving.', 'astra')
    });
  });
}, 300);


/***/ }),

/***/ "./node_modules/@bsf/force-ui/dist/_commonjsHelpers-DaMA6jEr.js":
/*!**********************************************************************!*\
  !*** ./node_modules/@bsf/force-ui/dist/_commonjsHelpers-DaMA6jEr.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   c: () => (/* binding */ o),
/* harmony export */   g: () => (/* binding */ l)
/* harmony export */ });
var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function l(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}



/***/ }),

/***/ "./node_modules/@bsf/force-ui/dist/force-ui.js":
/*!*****************************************************!*\
  !*** ./node_modules/@bsf/force-ui/dist/force-ui.js ***!
  \*****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

var react__WEBPACK_IMPORTED_MODULE_1___namespace_cache;
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Accordion: () => (/* binding */ ake),
/* harmony export */   Alert: () => (/* binding */ nke),
/* harmony export */   AreaChart: () => (/* binding */ uke),
/* harmony export */   Avatar: () => (/* binding */ GEe),
/* harmony export */   Badge: () => (/* binding */ mg),
/* harmony export */   BarChart: () => (/* binding */ ske),
/* harmony export */   Breadcrumb: () => (/* binding */ Xs),
/* harmony export */   Button: () => (/* binding */ Hn),
/* harmony export */   ButtonGroup: () => (/* binding */ XEe),
/* harmony export */   Checkbox: () => (/* binding */ Jw),
/* harmony export */   Container: () => (/* binding */ kR),
/* harmony export */   DatePicker: () => (/* binding */ oke),
/* harmony export */   Dialog: () => (/* binding */ Xo),
/* harmony export */   Drawer: () => (/* binding */ Jo),
/* harmony export */   DropdownMenu: () => (/* binding */ Js),
/* harmony export */   Dropzone: () => (/* binding */ FEe),
/* harmony export */   EditorInput: () => (/* binding */ UQ),
/* harmony export */   HamburgerMenu: () => (/* binding */ zg),
/* harmony export */   Input: () => (/* binding */ fY),
/* harmony export */   Label: () => (/* binding */ to),
/* harmony export */   LineChart: () => (/* binding */ lke),
/* harmony export */   Loader: () => (/* binding */ d1),
/* harmony export */   Menu: () => (/* binding */ Ha),
/* harmony export */   Pagination: () => (/* binding */ Fc),
/* harmony export */   PieChart: () => (/* binding */ cke),
/* harmony export */   ProgressBar: () => (/* binding */ qEe),
/* harmony export */   ProgressSteps: () => (/* binding */ qQ),
/* harmony export */   RadioButton: () => (/* binding */ KEe),
/* harmony export */   SearchBox: () => (/* binding */ Zo),
/* harmony export */   Select: () => (/* binding */ QEe),
/* harmony export */   Sidebar: () => (/* binding */ ike),
/* harmony export */   Skeleton: () => (/* binding */ rke),
/* harmony export */   Switch: () => (/* binding */ J$),
/* harmony export */   Table: () => (/* binding */ ol),
/* harmony export */   Tabs: () => (/* binding */ K1),
/* harmony export */   TextArea: () => (/* binding */ cY),
/* harmony export */   Title: () => (/* binding */ YEe),
/* harmony export */   Toaster: () => (/* binding */ tke),
/* harmony export */   Tooltip: () => (/* binding */ f1),
/* harmony export */   Topbar: () => (/* binding */ _d),
/* harmony export */   toast: () => (/* binding */ eke)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "./node_modules/react/jsx-runtime.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "react-dom");
/* harmony import */ var _commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_commonjsHelpers-DaMA6jEr.js */ "./node_modules/@bsf/force-ui/dist/_commonjsHelpers-DaMA6jEr.js");
"use client";
var nH = Object.defineProperty;
var pT = (e) => {
  throw TypeError(e);
};
var rH = (e, t, n) => t in e ? nH(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var ha = (e, t, n) => rH(e, typeof t != "symbol" ? t + "" : t, n), mT = (e, t, n) => t.has(e) || pT("Cannot " + n);
var Dr = (e, t, n) => (mT(e, t, "read from private field"), n ? n.call(e) : t.get(e)), zv = (e, t, n) => t.has(e) ? pT("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), as = (e, t, n, r) => (mT(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);






const qw = "-", sH = (e) => {
  const t = cH(e), {
    conflictingClassGroups: n,
    conflictingClassGroupModifiers: r
  } = e;
  return {
    getClassGroupId: (a) => {
      const s = a.split(qw);
      return s[0] === "" && s.length !== 1 && s.shift(), K$(s, t) || lH(a);
    },
    getConflictingClassGroupIds: (a, s) => {
      const l = n[a] || [];
      return s && r[a] ? [...l, ...r[a]] : l;
    }
  };
}, K$ = (e, t) => {
  var a;
  if (e.length === 0)
    return t.classGroupId;
  const n = e[0], r = t.nextPart.get(n), i = r ? K$(e.slice(1), r) : void 0;
  if (i)
    return i;
  if (t.validators.length === 0)
    return;
  const o = e.join(qw);
  return (a = t.validators.find(({
    validator: s
  }) => s(o))) == null ? void 0 : a.classGroupId;
}, gT = /^\[(.+)\]$/, lH = (e) => {
  if (gT.test(e)) {
    const t = gT.exec(e)[1], n = t == null ? void 0 : t.substring(0, t.indexOf(":"));
    if (n)
      return "arbitrary.." + n;
  }
}, cH = (e) => {
  const {
    theme: t,
    prefix: n
  } = e, r = {
    nextPart: /* @__PURE__ */ new Map(),
    validators: []
  };
  return fH(Object.entries(e.classGroups), n).forEach(([o, a]) => {
    u0(a, r, o, t);
  }), r;
}, u0 = (e, t, n, r) => {
  e.forEach((i) => {
    if (typeof i == "string") {
      const o = i === "" ? t : yT(t, i);
      o.classGroupId = n;
      return;
    }
    if (typeof i == "function") {
      if (uH(i)) {
        u0(i(r), t, n, r);
        return;
      }
      t.validators.push({
        validator: i,
        classGroupId: n
      });
      return;
    }
    Object.entries(i).forEach(([o, a]) => {
      u0(a, yT(t, o), n, r);
    });
  });
}, yT = (e, t) => {
  let n = e;
  return t.split(qw).forEach((r) => {
    n.nextPart.has(r) || n.nextPart.set(r, {
      nextPart: /* @__PURE__ */ new Map(),
      validators: []
    }), n = n.nextPart.get(r);
  }), n;
}, uH = (e) => e.isThemeGetter, fH = (e, t) => t ? e.map(([n, r]) => {
  const i = r.map((o) => typeof o == "string" ? t + o : typeof o == "object" ? Object.fromEntries(Object.entries(o).map(([a, s]) => [t + a, s])) : o);
  return [n, i];
}) : e, dH = (e) => {
  if (e < 1)
    return {
      get: () => {
      },
      set: () => {
      }
    };
  let t = 0, n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
  const i = (o, a) => {
    n.set(o, a), t++, t > e && (t = 0, r = n, n = /* @__PURE__ */ new Map());
  };
  return {
    get(o) {
      let a = n.get(o);
      if (a !== void 0)
        return a;
      if ((a = r.get(o)) !== void 0)
        return i(o, a), a;
    },
    set(o, a) {
      n.has(o) ? n.set(o, a) : i(o, a);
    }
  };
}, G$ = "!", hH = (e) => {
  const {
    separator: t,
    experimentalParseClassName: n
  } = e, r = t.length === 1, i = t[0], o = t.length, a = (s) => {
    const l = [];
    let c = 0, f = 0, d;
    for (let v = 0; v < s.length; v++) {
      let x = s[v];
      if (c === 0) {
        if (x === i && (r || s.slice(v, v + o) === t)) {
          l.push(s.slice(f, v)), f = v + o;
          continue;
        }
        if (x === "/") {
          d = v;
          continue;
        }
      }
      x === "[" ? c++ : x === "]" && c--;
    }
    const p = l.length === 0 ? s : s.substring(f), m = p.startsWith(G$), y = m ? p.substring(1) : p, g = d && d > f ? d - f : void 0;
    return {
      modifiers: l,
      hasImportantModifier: m,
      baseClassName: y,
      maybePostfixModifierPosition: g
    };
  };
  return n ? (s) => n({
    className: s,
    parseClassName: a
  }) : a;
}, pH = (e) => {
  if (e.length <= 1)
    return e;
  const t = [];
  let n = [];
  return e.forEach((r) => {
    r[0] === "[" ? (t.push(...n.sort(), r), n = []) : n.push(r);
  }), t.push(...n.sort()), t;
}, mH = (e) => ({
  cache: dH(e.cacheSize),
  parseClassName: hH(e),
  ...sH(e)
}), gH = /\s+/, yH = (e, t) => {
  const {
    parseClassName: n,
    getClassGroupId: r,
    getConflictingClassGroupIds: i
  } = t, o = [], a = e.trim().split(gH);
  let s = "";
  for (let l = a.length - 1; l >= 0; l -= 1) {
    const c = a[l], {
      modifiers: f,
      hasImportantModifier: d,
      baseClassName: p,
      maybePostfixModifierPosition: m
    } = n(c);
    let y = !!m, g = r(y ? p.substring(0, m) : p);
    if (!g) {
      if (!y) {
        s = c + (s.length > 0 ? " " + s : s);
        continue;
      }
      if (g = r(p), !g) {
        s = c + (s.length > 0 ? " " + s : s);
        continue;
      }
      y = !1;
    }
    const v = pH(f).join(":"), x = d ? v + G$ : v, w = x + g;
    if (o.includes(w))
      continue;
    o.push(w);
    const S = i(g, y);
    for (let A = 0; A < S.length; ++A) {
      const _ = S[A];
      o.push(x + _);
    }
    s = c + (s.length > 0 ? " " + s : s);
  }
  return s;
};
function vH() {
  let e = 0, t, n, r = "";
  for (; e < arguments.length; )
    (t = arguments[e++]) && (n = Y$(t)) && (r && (r += " "), r += n);
  return r;
}
const Y$ = (e) => {
  if (typeof e == "string")
    return e;
  let t, n = "";
  for (let r = 0; r < e.length; r++)
    e[r] && (t = Y$(e[r])) && (n && (n += " "), n += t);
  return n;
};
function bH(e, ...t) {
  let n, r, i, o = a;
  function a(l) {
    const c = t.reduce((f, d) => d(f), e());
    return n = mH(c), r = n.cache.get, i = n.cache.set, o = s, s(l);
  }
  function s(l) {
    const c = r(l);
    if (c)
      return c;
    const f = yH(l, n);
    return i(l, f), f;
  }
  return function() {
    return o(vH.apply(null, arguments));
  };
}
const Wt = (e) => {
  const t = (n) => n[e] || [];
  return t.isThemeGetter = !0, t;
}, q$ = /^\[(?:([a-z-]+):)?(.+)\]$/i, xH = /^\d+\/\d+$/, wH = /* @__PURE__ */ new Set(["px", "full", "screen"]), _H = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, SH = /\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$/, OH = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/, AH = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, TH = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, bo = (e) => Vl(e) || wH.has(e) || xH.test(e), pa = (e) => Nc(e, "length", DH), Vl = (e) => !!e && !Number.isNaN(Number(e)), Vv = (e) => Nc(e, "number", Vl), bu = (e) => !!e && Number.isInteger(Number(e)), PH = (e) => e.endsWith("%") && Vl(e.slice(0, -1)), Je = (e) => q$.test(e), ma = (e) => _H.test(e), CH = /* @__PURE__ */ new Set(["length", "size", "percentage"]), EH = (e) => Nc(e, CH, X$), kH = (e) => Nc(e, "position", X$), MH = /* @__PURE__ */ new Set(["image", "url"]), NH = (e) => Nc(e, MH, RH), $H = (e) => Nc(e, "", IH), xu = () => !0, Nc = (e, t, n) => {
  const r = q$.exec(e);
  return r ? r[1] ? typeof t == "string" ? r[1] === t : t.has(r[1]) : n(r[2]) : !1;
}, DH = (e) => (
  // `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.
  SH.test(e) && !OH.test(e)
), X$ = () => !1, IH = (e) => AH.test(e), RH = (e) => TH.test(e), jH = () => {
  const e = Wt("colors"), t = Wt("spacing"), n = Wt("blur"), r = Wt("brightness"), i = Wt("borderColor"), o = Wt("borderRadius"), a = Wt("borderSpacing"), s = Wt("borderWidth"), l = Wt("contrast"), c = Wt("grayscale"), f = Wt("hueRotate"), d = Wt("invert"), p = Wt("gap"), m = Wt("gradientColorStops"), y = Wt("gradientColorStopPositions"), g = Wt("inset"), v = Wt("margin"), x = Wt("opacity"), w = Wt("padding"), S = Wt("saturate"), A = Wt("scale"), _ = Wt("sepia"), O = Wt("skew"), P = Wt("space"), C = Wt("translate"), k = () => ["auto", "contain", "none"], I = () => ["auto", "hidden", "clip", "visible", "scroll"], $ = () => ["auto", Je, t], N = () => [Je, t], D = () => ["", bo, pa], j = () => ["auto", Vl, Je], F = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], W = () => ["solid", "dashed", "dotted", "double", "none"], z = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], H = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], U = () => ["", "0", Je], V = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], Y = () => [Vl, Je];
  return {
    cacheSize: 500,
    separator: ":",
    theme: {
      colors: [xu],
      spacing: [bo, pa],
      blur: ["none", "", ma, Je],
      brightness: Y(),
      borderColor: [e],
      borderRadius: ["none", "", "full", ma, Je],
      borderSpacing: N(),
      borderWidth: D(),
      contrast: Y(),
      grayscale: U(),
      hueRotate: Y(),
      invert: U(),
      gap: N(),
      gradientColorStops: [e],
      gradientColorStopPositions: [PH, pa],
      inset: $(),
      margin: $(),
      opacity: Y(),
      padding: N(),
      saturate: Y(),
      scale: Y(),
      sepia: U(),
      skew: Y(),
      space: N(),
      translate: N()
    },
    classGroups: {
      // Layout
      /**
       * Aspect Ratio
       * @see https://tailwindcss.com/docs/aspect-ratio
       */
      aspect: [{
        aspect: ["auto", "square", "video", Je]
      }],
      /**
       * Container
       * @see https://tailwindcss.com/docs/container
       */
      container: ["container"],
      /**
       * Columns
       * @see https://tailwindcss.com/docs/columns
       */
      columns: [{
        columns: [ma]
      }],
      /**
       * Break After
       * @see https://tailwindcss.com/docs/break-after
       */
      "break-after": [{
        "break-after": V()
      }],
      /**
       * Break Before
       * @see https://tailwindcss.com/docs/break-before
       */
      "break-before": [{
        "break-before": V()
      }],
      /**
       * 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"],
      /**
       * 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: [...F(), Je]
      }],
      /**
       * Overflow
       * @see https://tailwindcss.com/docs/overflow
       */
      overflow: [{
        overflow: I()
      }],
      /**
       * Overflow X
       * @see https://tailwindcss.com/docs/overflow
       */
      "overflow-x": [{
        "overflow-x": I()
      }],
      /**
       * Overflow Y
       * @see https://tailwindcss.com/docs/overflow
       */
      "overflow-y": [{
        "overflow-y": I()
      }],
      /**
       * Overscroll Behavior
       * @see https://tailwindcss.com/docs/overscroll-behavior
       */
      overscroll: [{
        overscroll: k()
      }],
      /**
       * Overscroll Behavior X
       * @see https://tailwindcss.com/docs/overscroll-behavior
       */
      "overscroll-x": [{
        "overscroll-x": k()
      }],
      /**
       * Overscroll Behavior Y
       * @see https://tailwindcss.com/docs/overscroll-behavior
       */
      "overscroll-y": [{
        "overscroll-y": k()
      }],
      /**
       * 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: [g]
      }],
      /**
       * Right / Left
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      "inset-x": [{
        "inset-x": [g]
      }],
      /**
       * Top / Bottom
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      "inset-y": [{
        "inset-y": [g]
      }],
      /**
       * Start
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      start: [{
        start: [g]
      }],
      /**
       * End
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      end: [{
        end: [g]
      }],
      /**
       * Top
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      top: [{
        top: [g]
      }],
      /**
       * Right
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      right: [{
        right: [g]
      }],
      /**
       * Bottom
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      bottom: [{
        bottom: [g]
      }],
      /**
       * Left
       * @see https://tailwindcss.com/docs/top-right-bottom-left
       */
      left: [{
        left: [g]
      }],
      /**
       * Visibility
       * @see https://tailwindcss.com/docs/visibility
       */
      visibility: ["visible", "invisible", "collapse"],
      /**
       * Z-Index
       * @see https://tailwindcss.com/docs/z-index
       */
      z: [{
        z: ["auto", bu, Je]
      }],
      // Flexbox and Grid
      /**
       * Flex Basis
       * @see https://tailwindcss.com/docs/flex-basis
       */
      basis: [{
        basis: $()
      }],
      /**
       * 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: ["wrap", "wrap-reverse", "nowrap"]
      }],
      /**
       * Flex
       * @see https://tailwindcss.com/docs/flex
       */
      flex: [{
        flex: ["1", "auto", "initial", "none", Je]
      }],
      /**
       * Flex Grow
       * @see https://tailwindcss.com/docs/flex-grow
       */
      grow: [{
        grow: U()
      }],
      /**
       * Flex Shrink
       * @see https://tailwindcss.com/docs/flex-shrink
       */
      shrink: [{
        shrink: U()
      }],
      /**
       * Order
       * @see https://tailwindcss.com/docs/order
       */
      order: [{
        order: ["first", "last", "none", bu, Je]
      }],
      /**
       * Grid Template Columns
       * @see https://tailwindcss.com/docs/grid-template-columns
       */
      "grid-cols": [{
        "grid-cols": [xu]
      }],
      /**
       * Grid Column Start / End
       * @see https://tailwindcss.com/docs/grid-column
       */
      "col-start-end": [{
        col: ["auto", {
          span: ["full", bu, Je]
        }, Je]
      }],
      /**
       * Grid Column Start
       * @see https://tailwindcss.com/docs/grid-column
       */
      "col-start": [{
        "col-start": j()
      }],
      /**
       * Grid Column End
       * @see https://tailwindcss.com/docs/grid-column
       */
      "col-end": [{
        "col-end": j()
      }],
      /**
       * Grid Template Rows
       * @see https://tailwindcss.com/docs/grid-template-rows
       */
      "grid-rows": [{
        "grid-rows": [xu]
      }],
      /**
       * Grid Row Start / End
       * @see https://tailwindcss.com/docs/grid-row
       */
      "row-start-end": [{
        row: ["auto", {
          span: [bu, Je]
        }, Je]
      }],
      /**
       * Grid Row Start
       * @see https://tailwindcss.com/docs/grid-row
       */
      "row-start": [{
        "row-start": j()
      }],
      /**
       * Grid Row End
       * @see https://tailwindcss.com/docs/grid-row
       */
      "row-end": [{
        "row-end": j()
      }],
      /**
       * 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": ["auto", "min", "max", "fr", Je]
      }],
      /**
       * Grid Auto Rows
       * @see https://tailwindcss.com/docs/grid-auto-rows
       */
      "auto-rows": [{
        "auto-rows": ["auto", "min", "max", "fr", Je]
      }],
      /**
       * Gap
       * @see https://tailwindcss.com/docs/gap
       */
      gap: [{
        gap: [p]
      }],
      /**
       * Gap X
       * @see https://tailwindcss.com/docs/gap
       */
      "gap-x": [{
        "gap-x": [p]
      }],
      /**
       * Gap Y
       * @see https://tailwindcss.com/docs/gap
       */
      "gap-y": [{
        "gap-y": [p]
      }],
      /**
       * Justify Content
       * @see https://tailwindcss.com/docs/justify-content
       */
      "justify-content": [{
        justify: ["normal", ...H()]
      }],
      /**
       * Justify Items
       * @see https://tailwindcss.com/docs/justify-items
       */
      "justify-items": [{
        "justify-items": ["start", "end", "center", "stretch"]
      }],
      /**
       * Justify Self
       * @see https://tailwindcss.com/docs/justify-self
       */
      "justify-self": [{
        "justify-self": ["auto", "start", "end", "center", "stretch"]
      }],
      /**
       * Align Content
       * @see https://tailwindcss.com/docs/align-content
       */
      "align-content": [{
        content: ["normal", ...H(), "baseline"]
      }],
      /**
       * Align Items
       * @see https://tailwindcss.com/docs/align-items
       */
      "align-items": [{
        items: ["start", "end", "center", "baseline", "stretch"]
      }],
      /**
       * Align Self
       * @see https://tailwindcss.com/docs/align-self
       */
      "align-self": [{
        self: ["auto", "start", "end", "center", "stretch", "baseline"]
      }],
      /**
       * Place Content
       * @see https://tailwindcss.com/docs/place-content
       */
      "place-content": [{
        "place-content": [...H(), "baseline"]
      }],
      /**
       * Place Items
       * @see https://tailwindcss.com/docs/place-items
       */
      "place-items": [{
        "place-items": ["start", "end", "center", "baseline", "stretch"]
      }],
      /**
       * Place Self
       * @see https://tailwindcss.com/docs/place-self
       */
      "place-self": [{
        "place-self": ["auto", "start", "end", "center", "stretch"]
      }],
      // Spacing
      /**
       * Padding
       * @see https://tailwindcss.com/docs/padding
       */
      p: [{
        p: [w]
      }],
      /**
       * Padding X
       * @see https://tailwindcss.com/docs/padding
       */
      px: [{
        px: [w]
      }],
      /**
       * Padding Y
       * @see https://tailwindcss.com/docs/padding
       */
      py: [{
        py: [w]
      }],
      /**
       * Padding Start
       * @see https://tailwindcss.com/docs/padding
       */
      ps: [{
        ps: [w]
      }],
      /**
       * Padding End
       * @see https://tailwindcss.com/docs/padding
       */
      pe: [{
        pe: [w]
      }],
      /**
       * Padding Top
       * @see https://tailwindcss.com/docs/padding
       */
      pt: [{
        pt: [w]
      }],
      /**
       * Padding Right
       * @see https://tailwindcss.com/docs/padding
       */
      pr: [{
        pr: [w]
      }],
      /**
       * Padding Bottom
       * @see https://tailwindcss.com/docs/padding
       */
      pb: [{
        pb: [w]
      }],
      /**
       * Padding Left
       * @see https://tailwindcss.com/docs/padding
       */
      pl: [{
        pl: [w]
      }],
      /**
       * Margin
       * @see https://tailwindcss.com/docs/margin
       */
      m: [{
        m: [v]
      }],
      /**
       * Margin X
       * @see https://tailwindcss.com/docs/margin
       */
      mx: [{
        mx: [v]
      }],
      /**
       * Margin Y
       * @see https://tailwindcss.com/docs/margin
       */
      my: [{
        my: [v]
      }],
      /**
       * Margin Start
       * @see https://tailwindcss.com/docs/margin
       */
      ms: [{
        ms: [v]
      }],
      /**
       * Margin End
       * @see https://tailwindcss.com/docs/margin
       */
      me: [{
        me: [v]
      }],
      /**
       * Margin Top
       * @see https://tailwindcss.com/docs/margin
       */
      mt: [{
        mt: [v]
      }],
      /**
       * Margin Right
       * @see https://tailwindcss.com/docs/margin
       */
      mr: [{
        mr: [v]
      }],
      /**
       * Margin Bottom
       * @see https://tailwindcss.com/docs/margin
       */
      mb: [{
        mb: [v]
      }],
      /**
       * Margin Left
       * @see https://tailwindcss.com/docs/margin
       */
      ml: [{
        ml: [v]
      }],
      /**
       * Space Between X
       * @see https://tailwindcss.com/docs/space
       */
      "space-x": [{
        "space-x": [P]
      }],
      /**
       * Space Between X Reverse
       * @see https://tailwindcss.com/docs/space
       */
      "space-x-reverse": ["space-x-reverse"],
      /**
       * Space Between Y
       * @see https://tailwindcss.com/docs/space
       */
      "space-y": [{
        "space-y": [P]
      }],
      /**
       * Space Between Y Reverse
       * @see https://tailwindcss.com/docs/space
       */
      "space-y-reverse": ["space-y-reverse"],
      // Sizing
      /**
       * Width
       * @see https://tailwindcss.com/docs/width
       */
      w: [{
        w: ["auto", "min", "max", "fit", "svw", "lvw", "dvw", Je, t]
      }],
      /**
       * Min-Width
       * @see https://tailwindcss.com/docs/min-width
       */
      "min-w": [{
        "min-w": [Je, t, "min", "max", "fit"]
      }],
      /**
       * Max-Width
       * @see https://tailwindcss.com/docs/max-width
       */
      "max-w": [{
        "max-w": [Je, t, "none", "full", "min", "max", "fit", "prose", {
          screen: [ma]
        }, ma]
      }],
      /**
       * Height
       * @see https://tailwindcss.com/docs/height
       */
      h: [{
        h: [Je, t, "auto", "min", "max", "fit", "svh", "lvh", "dvh"]
      }],
      /**
       * Min-Height
       * @see https://tailwindcss.com/docs/min-height
       */
      "min-h": [{
        "min-h": [Je, t, "min", "max", "fit", "svh", "lvh", "dvh"]
      }],
      /**
       * Max-Height
       * @see https://tailwindcss.com/docs/max-height
       */
      "max-h": [{
        "max-h": [Je, t, "min", "max", "fit", "svh", "lvh", "dvh"]
      }],
      /**
       * Size
       * @see https://tailwindcss.com/docs/size
       */
      size: [{
        size: [Je, t, "auto", "min", "max", "fit"]
      }],
      // Typography
      /**
       * Font Size
       * @see https://tailwindcss.com/docs/font-size
       */
      "font-size": [{
        text: ["base", ma, pa]
      }],
      /**
       * 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: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", Vv]
      }],
      /**
       * Font Family
       * @see https://tailwindcss.com/docs/font-family
       */
      "font-family": [{
        font: [xu]
      }],
      /**
       * 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-fractons"],
      /**
       * Letter Spacing
       * @see https://tailwindcss.com/docs/letter-spacing
       */
      tracking: [{
        tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", Je]
      }],
      /**
       * Line Clamp
       * @see https://tailwindcss.com/docs/line-clamp
       */
      "line-clamp": [{
        "line-clamp": ["none", Vl, Vv]
      }],
      /**
       * Line Height
       * @see https://tailwindcss.com/docs/line-height
       */
      leading: [{
        leading: ["none", "tight", "snug", "normal", "relaxed", "loose", bo, Je]
      }],
      /**
       * List Style Image
       * @see https://tailwindcss.com/docs/list-style-image
       */
      "list-image": [{
        "list-image": ["none", Je]
      }],
      /**
       * List Style Type
       * @see https://tailwindcss.com/docs/list-style-type
       */
      "list-style-type": [{
        list: ["none", "disc", "decimal", Je]
      }],
      /**
       * List Style Position
       * @see https://tailwindcss.com/docs/list-style-position
       */
      "list-style-position": [{
        list: ["inside", "outside"]
      }],
      /**
       * Placeholder Color
       * @deprecated since Tailwind CSS v3.0.0
       * @see https://tailwindcss.com/docs/placeholder-color
       */
      "placeholder-color": [{
        placeholder: [e]
      }],
      /**
       * Placeholder Opacity
       * @see https://tailwindcss.com/docs/placeholder-opacity
       */
      "placeholder-opacity": [{
        "placeholder-opacity": [x]
      }],
      /**
       * Text Alignment
       * @see https://tailwindcss.com/docs/text-align
       */
      "text-alignment": [{
        text: ["left", "center", "right", "justify", "start", "end"]
      }],
      /**
       * Text Color
       * @see https://tailwindcss.com/docs/text-color
       */
      "text-color": [{
        text: [e]
      }],
      /**
       * Text Opacity
       * @see https://tailwindcss.com/docs/text-opacity
       */
      "text-opacity": [{
        "text-opacity": [x]
      }],
      /**
       * 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: [...W(), "wavy"]
      }],
      /**
       * Text Decoration Thickness
       * @see https://tailwindcss.com/docs/text-decoration-thickness
       */
      "text-decoration-thickness": [{
        decoration: ["auto", "from-font", bo, pa]
      }],
      /**
       * Text Underline Offset
       * @see https://tailwindcss.com/docs/text-underline-offset
       */
      "underline-offset": [{
        "underline-offset": ["auto", bo, Je]
      }],
      /**
       * Text Decoration Color
       * @see https://tailwindcss.com/docs/text-decoration-color
       */
      "text-decoration-color": [{
        decoration: [e]
      }],
      /**
       * 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: N()
      }],
      /**
       * Vertical Alignment
       * @see https://tailwindcss.com/docs/vertical-align
       */
      "vertical-align": [{
        align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", Je]
      }],
      /**
       * 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"]
      }],
      /**
       * Hyphens
       * @see https://tailwindcss.com/docs/hyphens
       */
      hyphens: [{
        hyphens: ["none", "manual", "auto"]
      }],
      /**
       * Content
       * @see https://tailwindcss.com/docs/content
       */
      content: [{
        content: ["none", Je]
      }],
      // 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 Opacity
       * @deprecated since Tailwind CSS v3.0.0
       * @see https://tailwindcss.com/docs/background-opacity
       */
      "bg-opacity": [{
        "bg-opacity": [x]
      }],
      /**
       * 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: [...F(), kH]
      }],
      /**
       * Background Repeat
       * @see https://tailwindcss.com/docs/background-repeat
       */
      "bg-repeat": [{
        bg: ["no-repeat", {
          repeat: ["", "x", "y", "round", "space"]
        }]
      }],
      /**
       * Background Size
       * @see https://tailwindcss.com/docs/background-size
       */
      "bg-size": [{
        bg: ["auto", "cover", "contain", EH]
      }],
      /**
       * Background Image
       * @see https://tailwindcss.com/docs/background-image
       */
      "bg-image": [{
        bg: ["none", {
          "gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
        }, NH]
      }],
      /**
       * Background Color
       * @see https://tailwindcss.com/docs/background-color
       */
      "bg-color": [{
        bg: [e]
      }],
      /**
       * Gradient Color Stops From Position
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-from-pos": [{
        from: [y]
      }],
      /**
       * Gradient Color Stops Via Position
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-via-pos": [{
        via: [y]
      }],
      /**
       * Gradient Color Stops To Position
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-to-pos": [{
        to: [y]
      }],
      /**
       * Gradient Color Stops From
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-from": [{
        from: [m]
      }],
      /**
       * Gradient Color Stops Via
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-via": [{
        via: [m]
      }],
      /**
       * Gradient Color Stops To
       * @see https://tailwindcss.com/docs/gradient-color-stops
       */
      "gradient-to": [{
        to: [m]
      }],
      // Borders
      /**
       * Border Radius
       * @see https://tailwindcss.com/docs/border-radius
       */
      rounded: [{
        rounded: [o]
      }],
      /**
       * Border Radius Start
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-s": [{
        "rounded-s": [o]
      }],
      /**
       * Border Radius End
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-e": [{
        "rounded-e": [o]
      }],
      /**
       * Border Radius Top
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-t": [{
        "rounded-t": [o]
      }],
      /**
       * Border Radius Right
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-r": [{
        "rounded-r": [o]
      }],
      /**
       * Border Radius Bottom
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-b": [{
        "rounded-b": [o]
      }],
      /**
       * Border Radius Left
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-l": [{
        "rounded-l": [o]
      }],
      /**
       * Border Radius Start Start
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-ss": [{
        "rounded-ss": [o]
      }],
      /**
       * Border Radius Start End
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-se": [{
        "rounded-se": [o]
      }],
      /**
       * Border Radius End End
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-ee": [{
        "rounded-ee": [o]
      }],
      /**
       * Border Radius End Start
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-es": [{
        "rounded-es": [o]
      }],
      /**
       * Border Radius Top Left
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-tl": [{
        "rounded-tl": [o]
      }],
      /**
       * Border Radius Top Right
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-tr": [{
        "rounded-tr": [o]
      }],
      /**
       * Border Radius Bottom Right
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-br": [{
        "rounded-br": [o]
      }],
      /**
       * Border Radius Bottom Left
       * @see https://tailwindcss.com/docs/border-radius
       */
      "rounded-bl": [{
        "rounded-bl": [o]
      }],
      /**
       * Border Width
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w": [{
        border: [s]
      }],
      /**
       * Border Width X
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-x": [{
        "border-x": [s]
      }],
      /**
       * Border Width Y
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-y": [{
        "border-y": [s]
      }],
      /**
       * Border Width Start
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-s": [{
        "border-s": [s]
      }],
      /**
       * Border Width End
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-e": [{
        "border-e": [s]
      }],
      /**
       * Border Width Top
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-t": [{
        "border-t": [s]
      }],
      /**
       * Border Width Right
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-r": [{
        "border-r": [s]
      }],
      /**
       * Border Width Bottom
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-b": [{
        "border-b": [s]
      }],
      /**
       * Border Width Left
       * @see https://tailwindcss.com/docs/border-width
       */
      "border-w-l": [{
        "border-l": [s]
      }],
      /**
       * Border Opacity
       * @see https://tailwindcss.com/docs/border-opacity
       */
      "border-opacity": [{
        "border-opacity": [x]
      }],
      /**
       * Border Style
       * @see https://tailwindcss.com/docs/border-style
       */
      "border-style": [{
        border: [...W(), "hidden"]
      }],
      /**
       * Divide Width X
       * @see https://tailwindcss.com/docs/divide-width
       */
      "divide-x": [{
        "divide-x": [s]
      }],
      /**
       * Divide Width X Reverse
       * @see https://tailwindcss.com/docs/divide-width
       */
      "divide-x-reverse": ["divide-x-reverse"],
      /**
       * Divide Width Y
       * @see https://tailwindcss.com/docs/divide-width
       */
      "divide-y": [{
        "divide-y": [s]
      }],
      /**
       * Divide Width Y Reverse
       * @see https://tailwindcss.com/docs/divide-width
       */
      "divide-y-reverse": ["divide-y-reverse"],
      /**
       * Divide Opacity
       * @see https://tailwindcss.com/docs/divide-opacity
       */
      "divide-opacity": [{
        "divide-opacity": [x]
      }],
      /**
       * Divide Style
       * @see https://tailwindcss.com/docs/divide-style
       */
      "divide-style": [{
        divide: W()
      }],
      /**
       * Border Color
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color": [{
        border: [i]
      }],
      /**
       * Border Color X
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-x": [{
        "border-x": [i]
      }],
      /**
       * Border Color Y
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-y": [{
        "border-y": [i]
      }],
      /**
       * Border Color S
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-s": [{
        "border-s": [i]
      }],
      /**
       * Border Color E
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-e": [{
        "border-e": [i]
      }],
      /**
       * Border Color Top
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-t": [{
        "border-t": [i]
      }],
      /**
       * Border Color Right
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-r": [{
        "border-r": [i]
      }],
      /**
       * Border Color Bottom
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-b": [{
        "border-b": [i]
      }],
      /**
       * Border Color Left
       * @see https://tailwindcss.com/docs/border-color
       */
      "border-color-l": [{
        "border-l": [i]
      }],
      /**
       * Divide Color
       * @see https://tailwindcss.com/docs/divide-color
       */
      "divide-color": [{
        divide: [i]
      }],
      /**
       * Outline Style
       * @see https://tailwindcss.com/docs/outline-style
       */
      "outline-style": [{
        outline: ["", ...W()]
      }],
      /**
       * Outline Offset
       * @see https://tailwindcss.com/docs/outline-offset
       */
      "outline-offset": [{
        "outline-offset": [bo, Je]
      }],
      /**
       * Outline Width
       * @see https://tailwindcss.com/docs/outline-width
       */
      "outline-w": [{
        outline: [bo, pa]
      }],
      /**
       * Outline Color
       * @see https://tailwindcss.com/docs/outline-color
       */
      "outline-color": [{
        outline: [e]
      }],
      /**
       * Ring Width
       * @see https://tailwindcss.com/docs/ring-width
       */
      "ring-w": [{
        ring: D()
      }],
      /**
       * Ring Width Inset
       * @see https://tailwindcss.com/docs/ring-width
       */
      "ring-w-inset": ["ring-inset"],
      /**
       * Ring Color
       * @see https://tailwindcss.com/docs/ring-color
       */
      "ring-color": [{
        ring: [e]
      }],
      /**
       * Ring Opacity
       * @see https://tailwindcss.com/docs/ring-opacity
       */
      "ring-opacity": [{
        "ring-opacity": [x]
      }],
      /**
       * Ring Offset Width
       * @see https://tailwindcss.com/docs/ring-offset-width
       */
      "ring-offset-w": [{
        "ring-offset": [bo, pa]
      }],
      /**
       * Ring Offset Color
       * @see https://tailwindcss.com/docs/ring-offset-color
       */
      "ring-offset-color": [{
        "ring-offset": [e]
      }],
      // Effects
      /**
       * Box Shadow
       * @see https://tailwindcss.com/docs/box-shadow
       */
      shadow: [{
        shadow: ["", "inner", "none", ma, $H]
      }],
      /**
       * Box Shadow Color
       * @see https://tailwindcss.com/docs/box-shadow-color
       */
      "shadow-color": [{
        shadow: [xu]
      }],
      /**
       * Opacity
       * @see https://tailwindcss.com/docs/opacity
       */
      opacity: [{
        opacity: [x]
      }],
      /**
       * Mix Blend Mode
       * @see https://tailwindcss.com/docs/mix-blend-mode
       */
      "mix-blend": [{
        "mix-blend": [...z(), "plus-lighter", "plus-darker"]
      }],
      /**
       * Background Blend Mode
       * @see https://tailwindcss.com/docs/background-blend-mode
       */
      "bg-blend": [{
        "bg-blend": z()
      }],
      // Filters
      /**
       * Filter
       * @deprecated since Tailwind CSS v3.0.0
       * @see https://tailwindcss.com/docs/filter
       */
      filter: [{
        filter: ["", "none"]
      }],
      /**
       * Blur
       * @see https://tailwindcss.com/docs/blur
       */
      blur: [{
        blur: [n]
      }],
      /**
       * Brightness
       * @see https://tailwindcss.com/docs/brightness
       */
      brightness: [{
        brightness: [r]
      }],
      /**
       * Contrast
       * @see https://tailwindcss.com/docs/contrast
       */
      contrast: [{
        contrast: [l]
      }],
      /**
       * Drop Shadow
       * @see https://tailwindcss.com/docs/drop-shadow
       */
      "drop-shadow": [{
        "drop-shadow": ["", "none", ma, Je]
      }],
      /**
       * Grayscale
       * @see https://tailwindcss.com/docs/grayscale
       */
      grayscale: [{
        grayscale: [c]
      }],
      /**
       * Hue Rotate
       * @see https://tailwindcss.com/docs/hue-rotate
       */
      "hue-rotate": [{
        "hue-rotate": [f]
      }],
      /**
       * Invert
       * @see https://tailwindcss.com/docs/invert
       */
      invert: [{
        invert: [d]
      }],
      /**
       * Saturate
       * @see https://tailwindcss.com/docs/saturate
       */
      saturate: [{
        saturate: [S]
      }],
      /**
       * Sepia
       * @see https://tailwindcss.com/docs/sepia
       */
      sepia: [{
        sepia: [_]
      }],
      /**
       * Backdrop Filter
       * @deprecated since Tailwind CSS v3.0.0
       * @see https://tailwindcss.com/docs/backdrop-filter
       */
      "backdrop-filter": [{
        "backdrop-filter": ["", "none"]
      }],
      /**
       * Backdrop Blur
       * @see https://tailwindcss.com/docs/backdrop-blur
       */
      "backdrop-blur": [{
        "backdrop-blur": [n]
      }],
      /**
       * Backdrop Brightness
       * @see https://tailwindcss.com/docs/backdrop-brightness
       */
      "backdrop-brightness": [{
        "backdrop-brightness": [r]
      }],
      /**
       * Backdrop Contrast
       * @see https://tailwindcss.com/docs/backdrop-contrast
       */
      "backdrop-contrast": [{
        "backdrop-contrast": [l]
      }],
      /**
       * Backdrop Grayscale
       * @see https://tailwindcss.com/docs/backdrop-grayscale
       */
      "backdrop-grayscale": [{
        "backdrop-grayscale": [c]
      }],
      /**
       * Backdrop Hue Rotate
       * @see https://tailwindcss.com/docs/backdrop-hue-rotate
       */
      "backdrop-hue-rotate": [{
        "backdrop-hue-rotate": [f]
      }],
      /**
       * Backdrop Invert
       * @see https://tailwindcss.com/docs/backdrop-invert
       */
      "backdrop-invert": [{
        "backdrop-invert": [d]
      }],
      /**
       * Backdrop Opacity
       * @see https://tailwindcss.com/docs/backdrop-opacity
       */
      "backdrop-opacity": [{
        "backdrop-opacity": [x]
      }],
      /**
       * Backdrop Saturate
       * @see https://tailwindcss.com/docs/backdrop-saturate
       */
      "backdrop-saturate": [{
        "backdrop-saturate": [S]
      }],
      /**
       * Backdrop Sepia
       * @see https://tailwindcss.com/docs/backdrop-sepia
       */
      "backdrop-sepia": [{
        "backdrop-sepia": [_]
      }],
      // 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": [a]
      }],
      /**
       * Border Spacing X
       * @see https://tailwindcss.com/docs/border-spacing
       */
      "border-spacing-x": [{
        "border-spacing-x": [a]
      }],
      /**
       * Border Spacing Y
       * @see https://tailwindcss.com/docs/border-spacing
       */
      "border-spacing-y": [{
        "border-spacing-y": [a]
      }],
      /**
       * 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
      /**
       * Tranisition Property
       * @see https://tailwindcss.com/docs/transition-property
       */
      transition: [{
        transition: ["none", "all", "", "colors", "opacity", "shadow", "transform", Je]
      }],
      /**
       * Transition Duration
       * @see https://tailwindcss.com/docs/transition-duration
       */
      duration: [{
        duration: Y()
      }],
      /**
       * Transition Timing Function
       * @see https://tailwindcss.com/docs/transition-timing-function
       */
      ease: [{
        ease: ["linear", "in", "out", "in-out", Je]
      }],
      /**
       * Transition Delay
       * @see https://tailwindcss.com/docs/transition-delay
       */
      delay: [{
        delay: Y()
      }],
      /**
       * Animation
       * @see https://tailwindcss.com/docs/animation
       */
      animate: [{
        animate: ["none", "spin", "ping", "pulse", "bounce", Je]
      }],
      // Transforms
      /**
       * Transform
       * @see https://tailwindcss.com/docs/transform
       */
      transform: [{
        transform: ["", "gpu", "none"]
      }],
      /**
       * Scale
       * @see https://tailwindcss.com/docs/scale
       */
      scale: [{
        scale: [A]
      }],
      /**
       * Scale X
       * @see https://tailwindcss.com/docs/scale
       */
      "scale-x": [{
        "scale-x": [A]
      }],
      /**
       * Scale Y
       * @see https://tailwindcss.com/docs/scale
       */
      "scale-y": [{
        "scale-y": [A]
      }],
      /**
       * Rotate
       * @see https://tailwindcss.com/docs/rotate
       */
      rotate: [{
        rotate: [bu, Je]
      }],
      /**
       * Translate X
       * @see https://tailwindcss.com/docs/translate
       */
      "translate-x": [{
        "translate-x": [C]
      }],
      /**
       * Translate Y
       * @see https://tailwindcss.com/docs/translate
       */
      "translate-y": [{
        "translate-y": [C]
      }],
      /**
       * Skew X
       * @see https://tailwindcss.com/docs/skew
       */
      "skew-x": [{
        "skew-x": [O]
      }],
      /**
       * Skew Y
       * @see https://tailwindcss.com/docs/skew
       */
      "skew-y": [{
        "skew-y": [O]
      }],
      /**
       * Transform Origin
       * @see https://tailwindcss.com/docs/transform-origin
       */
      "transform-origin": [{
        origin: ["center", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", Je]
      }],
      // Interactivity
      /**
       * Accent Color
       * @see https://tailwindcss.com/docs/accent-color
       */
      accent: [{
        accent: ["auto", e]
      }],
      /**
       * Appearance
       * @see https://tailwindcss.com/docs/appearance
       */
      appearance: [{
        appearance: ["none", "auto"]
      }],
      /**
       * 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", Je]
      }],
      /**
       * Caret Color
       * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
       */
      "caret-color": [{
        caret: [e]
      }],
      /**
       * Pointer Events
       * @see https://tailwindcss.com/docs/pointer-events
       */
      "pointer-events": [{
        "pointer-events": ["none", "auto"]
      }],
      /**
       * 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": N()
      }],
      /**
       * Scroll Margin X
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mx": [{
        "scroll-mx": N()
      }],
      /**
       * Scroll Margin Y
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-my": [{
        "scroll-my": N()
      }],
      /**
       * Scroll Margin Start
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-ms": [{
        "scroll-ms": N()
      }],
      /**
       * Scroll Margin End
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-me": [{
        "scroll-me": N()
      }],
      /**
       * Scroll Margin Top
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mt": [{
        "scroll-mt": N()
      }],
      /**
       * Scroll Margin Right
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mr": [{
        "scroll-mr": N()
      }],
      /**
       * Scroll Margin Bottom
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-mb": [{
        "scroll-mb": N()
      }],
      /**
       * Scroll Margin Left
       * @see https://tailwindcss.com/docs/scroll-margin
       */
      "scroll-ml": [{
        "scroll-ml": N()
      }],
      /**
       * Scroll Padding
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-p": [{
        "scroll-p": N()
      }],
      /**
       * Scroll Padding X
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-px": [{
        "scroll-px": N()
      }],
      /**
       * Scroll Padding Y
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-py": [{
        "scroll-py": N()
      }],
      /**
       * Scroll Padding Start
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-ps": [{
        "scroll-ps": N()
      }],
      /**
       * Scroll Padding End
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pe": [{
        "scroll-pe": N()
      }],
      /**
       * Scroll Padding Top
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pt": [{
        "scroll-pt": N()
      }],
      /**
       * Scroll Padding Right
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pr": [{
        "scroll-pr": N()
      }],
      /**
       * Scroll Padding Bottom
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pb": [{
        "scroll-pb": N()
      }],
      /**
       * Scroll Padding Left
       * @see https://tailwindcss.com/docs/scroll-padding
       */
      "scroll-pl": [{
        "scroll-pl": N()
      }],
      /**
       * 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", Je]
      }],
      // SVG
      /**
       * Fill
       * @see https://tailwindcss.com/docs/fill
       */
      fill: [{
        fill: [e, "none"]
      }],
      /**
       * Stroke Width
       * @see https://tailwindcss.com/docs/stroke-width
       */
      "stroke-w": [{
        stroke: [bo, pa, Vv]
      }],
      /**
       * Stroke
       * @see https://tailwindcss.com/docs/stroke
       */
      stroke: [{
        stroke: [e, "none"]
      }],
      // Accessibility
      /**
       * Screen Readers
       * @see https://tailwindcss.com/docs/screen-readers
       */
      sr: ["sr-only", "not-sr-only"],
      /**
       * 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-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-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"],
      "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"]
    }
  };
}, LH = /* @__PURE__ */ bH(jH);
function Z$(e) {
  var t, n, r = "";
  if (typeof e == "string" || typeof e == "number") r += e;
  else if (typeof e == "object") if (Array.isArray(e)) {
    var i = e.length;
    for (t = 0; t < i; t++) e[t] && (n = Z$(e[t])) && (r && (r += " "), r += n);
  } else for (n in e) e[n] && (r && (r += " "), r += n);
  return r;
}
function Xe() {
  for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = Z$(e)) && (r && (r += " "), r += t);
  return r;
}
const K = (...e) => LH(Xe(...e)), cf = (...e) => (...t) => e.forEach((n) => n == null ? void 0 : n(...t)), Jm = (e) => {
  const t = {
    0: "gap-0",
    xxs: "gap-1",
    xs: "gap-2",
    sm: "gap-3",
    md: "gap-4",
    lg: "gap-5",
    xl: "gap-6",
    "2xl": "gap-8"
  };
  return t[e] || t.md;
}, BH = {
  1: "grid-cols-1",
  2: "grid-cols-2",
  3: "grid-cols-3",
  4: "grid-cols-4",
  5: "grid-cols-5",
  6: "grid-cols-6",
  7: "grid-cols-7",
  8: "grid-cols-8",
  9: "grid-cols-9",
  10: "grid-cols-10",
  11: "grid-cols-11",
  12: "grid-cols-12"
}, FH = () => {
  var i, o;
  const e = ((o = (i = window.navigator) == null ? void 0 : i.userAgentData) == null ? void 0 : o.platform) || window.navigator.platform, t = [
    "macOS",
    "Macintosh",
    "MacIntel",
    "MacPPC",
    "Mac68K"
  ], n = ["Win32", "Win64", "Windows", "WinCE"];
  let r = "null";
  return t.includes(e) ? r = "Mac OS" : n.includes(e) && (r = "Windows"), r;
}, WH = (e) => e < 1024 ? `${e} bytes` : e < 1024 * 1024 ? `${(e / 1024).toFixed(2)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`, ju = {
  set: (e, t) => {
    if (!(typeof window > "u"))
      try {
        localStorage.setItem(e, JSON.stringify(t));
      } catch (n) {
        console.error(n);
      }
  },
  get: (e) => {
    if (typeof window > "u")
      return null;
    try {
      const t = localStorage.getItem(e);
      return t ? JSON.parse(t) : null;
    } catch (t) {
      return console.error(t), null;
    }
  },
  remove: (e) => {
    if (!(typeof window > "u"))
      try {
        localStorage.removeItem(e);
      } catch (t) {
        console.error(t);
      }
  }
}, Hn = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
  (e, t) => {
    const {
      variant: n = "primary",
      // primary, secondary, outline, ghost, link
      size: r = "md",
      // xs, sm, md, lg
      type: i = "button",
      tag: o = "button",
      className: a,
      children: s,
      disabled: l = !1,
      destructive: c = !1,
      // true, false
      icon: f = null,
      // icon component
      iconPosition: d = "left",
      // left, right,
      loading: p = !1,
      ...m
    } = e, y = "outline outline-1 border-none cursor-pointer transition-colors duration-300 ease-in-out text-xs font-semibold focus:ring-2 focus:ring-toggle-on focus:ring-offset-2 disabled:text-text-disabled", g = p ? "opacity-50 disabled:cursor-not-allowed" : "", v = {
      primary: "text-text-on-color bg-button-primary hover:bg-button-primary-hover outline-button-primary hover:outline-button-primary-hover disabled:bg-button-disabled disabled:outline-button-disabled",
      secondary: "text-text-on-color bg-button-secondary hover:bg-button-secondary-hover outline-button-secondary hover:outline-button-secondary-hover disabled:bg-button-disabled disabled:outline-button-disabled",
      outline: "text-button-tertiary-color outline-border-subtle bg-button-tertiary hover:bg-button-tertiary-hover hover:outline-border-subtle disabled:bg-button-tertiary disabled:outline-border-disabled",
      ghost: "text-text-primary bg-transparent outline-transparent hover:bg-button-tertiary-hover",
      link: "outline-none text-link-primary bg-transparent hover:text-link-primary-hover hover:underline p-0 border-0 leading-none"
    }[n], x = c && !l ? {
      primary: "bg-button-danger hover:bg-button-danger-hover outline-button-danger hover:outline-button-danger-hover",
      secondary: "bg-button-danger hover:bg-button-danger-hover outline-button-danger hover:outline-button-danger-hover",
      outline: "text-button-danger outline outline-1 outline-button-danger hover:outline-button-danger bg-button-tertiary hover:bg-field-background-error",
      ghost: "text-button-danger hover:bg-field-background-error",
      link: "text-button-danger hover:text-button-danger-secondary"
    }[n] : "", w = {
      xs: "p-1 rounded [&>svg]:size-4",
      sm: "p-2 rounded [&>svg]:size-4 gap-0.5",
      md: "p-2.5 rounded-md text-sm [&>svg]:size-5 gap-1",
      lg: "p-3 rounded-lg text-base [&>svg]:size-6 gap-1"
    }[r];
    let S, A = null, _ = "";
    return f && (_ = "flex items-center justify-center", d === "left" ? S = f : A = f), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      o,
      {
        ref: t,
        type: i,
        className: K(
          _,
          y,
          w,
          v,
          x,
          g,
          {
            "cursor-default": l
          },
          a
        ),
        disabled: l,
        ...m,
        children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { children: S }, "left-icon"),
          s ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-1", children: s }) : null,
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { children: A }, "right-icon")
        ]
      }
    );
  }
);
Hn.displayName = "Button";
const zH = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
let io = (e = 21) => {
  let t = "", n = crypto.getRandomValues(new Uint8Array(e));
  for (; e--; )
    t += zH[n[e] & 63];
  return t;
};
const to = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
  ({
    children: e = null,
    tag: t = "label",
    size: n = "sm",
    // xs, sm, md
    className: r = "",
    variant: i = "neutral",
    // neutral, help, error, disabled
    required: o = !1,
    ...a
  }, s) => {
    const l = "font-medium text-field-label flex items-center gap-0.5", c = {
      xs: "text-xs [&>*]:text-xs [&>svg]:h-3 [&>svg]:w-3",
      sm: "text-sm [&>*]:text-sm [&>svg]:h-4 [&>svg]:w-4",
      md: "text-base [&>*]:text-base [&>svg]:h-5 [&>svg]:w-5"
    }, f = {
      neutral: "text-field-label [&>*]:text-field-label",
      help: "text-field-helper [&>*]:text-field-helper",
      error: "text-support-error [&>*]:text-support-error",
      disabled: "text-field-color-disabled disabled cursor-not-allowed [&>*]:text-field-color-disabled"
    }, d = {
      neutral: "",
      help: "font-normal",
      error: "font-normal",
      disabled: ""
    };
    if (!e)
      return null;
    let p = "";
    return o && (p = "after:content-['*'] after:text-field-required after:ml-0.5"), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      t,
      {
        ref: s,
        className: K(
          l,
          c[n],
          f[i],
          p,
          d == null ? void 0 : d[i],
          r
        ),
        ...a,
        children: e
      }
    );
  }
);
to.displayName = "Label";
const VH = ({
  label: e,
  switchId: t,
  disabled: n = !1,
  children: r,
  size: i
}) => {
  const o = {
    sm: "text-sm leading-5 font-medium",
    md: "text-base leading-6 font-medium"
  }, a = {
    sm: "text-sm leading-5 font-normal",
    md: "text-sm leading-5 font-normal"
  }, s = {
    sm: "space-y-0.5",
    md: "space-y-1"
  };
  if ((0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(e))
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "div",
      {
        className: K("inline-flex items-center gap-3", "items-start"),
        children: [
          r,
          e
        ]
      }
    );
  const c = () => {
    const { heading: p = "", description: m = "" } = e || {};
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: K("space-y-0.5", s[i]), children: [
      p && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        to,
        {
          htmlFor: t,
          className: K("m-0", o[i]),
          ...n && { variant: "disabled" },
          children: p
        }
      ),
      m && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        to,
        {
          tag: "p",
          variant: "help",
          className: K(
            "text-sm font-normal leading-5 m-0",
            a[i]
          ),
          ...n && { variant: "disabled" },
          children: m
        }
      )
    ] });
  }, f = !(e != null && e.heading) && !(e != null && e.description), d = !(e != null && e.heading) || !(e != null && e.description) ? "items-center" : "items-start";
  return f ? r : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: K("inline-flex", d, "gap-3"), children: [
    r,
    c()
  ] });
}, UH = ({
  id: e,
  onChange: t,
  value: n,
  defaultValue: r = !1,
  size: i = "sm",
  disabled: o = !1,
  label: a = { heading: "", description: "" },
  name: s,
  className: l,
  ...c
}, f) => {
  const d = i === "lg" ? "md" : i, p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => typeof n < "u", [n]), m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => e || `switch-${io()}`, []), [y, g] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(r), v = "primary", x = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    () => p ? n : y,
    [p, n, y]
  ), w = (C) => {
    if (o)
      return;
    const k = C.target.checked;
    p || g(k), typeof t == "function" && t(k);
  }, S = {
    primary: {
      input: "bg-toggle-off checked:bg-toggle-on focus:ring focus:ring-toggle-on focus:ring-offset-2 border border-solid border-toggle-off-border checked:border-toggle-on-border shadow-toggleContainer focus:outline-none checked:focus:border-toggle-on-border focus:border-toggle-off-border",
      toggleDial: "bg-toggle-dial-background shadow-toggleDial"
    }
  }, A = {
    primary: {
      input: "group-hover/switch:bg-toggle-off-hover checked:group-hover/switch:bg-toggle-on-hover checked:group-hover/switch:border-toggle-on-border"
    }
  }, _ = {
    md: {
      container: "w-11 h-6",
      toggleDial: "size-4 peer-checked:translate-x-5"
    },
    sm: {
      container: "w-10 h-5",
      toggleDial: "size-3 peer-checked:translate-x-5"
    }
  }, O = {
    md: "group-hover/switch:size-5 group-focus-within/switch:size-5 group-focus-within/switch:left-0.5 group-hover/switch:left-0.5",
    sm: "group-hover/switch:size-4 group-focus-within/switch:size-4 group-focus-within/switch:left-0.5 group-hover/switch:left-0.5"
  }, P = {
    input: "bg-toggle-off-disabled disabled:border-transparent shadow-none disabled:cursor-not-allowed checked:disabled:bg-toggle-on-disabled",
    toggleDial: "peer-disabled:cursor-not-allowed"
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    VH,
    {
      label: a,
      switchId: m,
      disabled: o,
      size: d,
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
        "div",
        {
          className: K(
            "relative group/switch inline-block cursor-pointer rounded-full shrink-0",
            _[d].container,
            l
          ),
          children: [
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              "input",
              {
                ref: f,
                id: m,
                type: "checkbox",
                className: K(
                  "peer appearance-none absolute rounded-full cursor-pointer transition-colors duration-300 h-full w-full  before:content-[''] checked:before:content-[''] m-0 checked:[background-image:none]",
                  S[v].input,
                  o && P.input,
                  !o && A[v].input
                ),
                checked: x(),
                onChange: w,
                disabled: o,
                name: s,
                ...c
              }
            ),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              "label",
              {
                htmlFor: m,
                className: K(
                  "peer/toggle-dial bg-white border rounded-full absolute cursor-pointer shadow-md before:content[''] before:transition-opacity before:opacity-0 hover:before:opacity-10 before:hidden border-none transition-all duration-300 top-2/4 left-1 -translate-y-2/4 before:w-10 before:h-10 before:rounded-full before:absolute before:top-2/4 before:left-2/4 before:-translate-y-2/4 before:-translate-x-2/4",
                  _[d].toggleDial,
                  S[v].toggleDial,
                  o && P.toggleDial,
                  !o && O[d]
                )
              }
            )
          ]
        }
      )
    }
  );
}, J$ = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(UH);
J$.displayName = "Switch";
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const HH = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Q$ = (...e) => e.filter((t, n, r) => !!t && r.indexOf(t) === n).join(" ");
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
var KH = {
  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.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const GH = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
  ({
    color: e = "currentColor",
    size: t = 24,
    strokeWidth: n = 2,
    absoluteStrokeWidth: r,
    className: i = "",
    children: o,
    iconNode: a,
    ...s
  }, l) => (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(
    "svg",
    {
      ref: l,
      ...KH,
      width: t,
      height: t,
      stroke: e,
      strokeWidth: r ? Number(n) * 24 / Number(t) : n,
      className: Q$("lucide", i),
      ...s
    },
    [
      ...a.map(([c, f]) => (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(c, f)),
      ...Array.isArray(o) ? o : [o]
    ]
  )
);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const on = (e, t) => {
  const n = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
    ({ className: r, ...i }, o) => (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(GH, {
      ref: o,
      iconNode: t,
      className: Q$(`lucide-${HH(e)}`, r),
      ...i
    })
  );
  return n.displayName = `${e}`, n;
};
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const sd = on("Check", [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const Xw = on("ChevronDown", [
  ["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const eD = on("ChevronLeft", [
  ["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const Zw = on("ChevronRight", [
  ["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const YH = on("ChevronsUpDown", [
  ["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
  ["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const qH = on("CloudUpload", [
  ["path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242", key: "1pljnt" }],
  ["path", { d: "M12 12v9", key: "192myk" }],
  ["path", { d: "m16 16-4-4-4 4", key: "119tzi" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const XH = on("Ellipsis", [
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
  ["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
  ["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const ZH = on("File", [
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const JH = on("ImageOff", [
  ["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }],
  ["path", { d: "M10.41 10.41a2 2 0 1 1-2.83-2.83", key: "1bzlo9" }],
  ["line", { x1: "13.5", x2: "6", y1: "13.5", y2: "21", key: "1q0aeu" }],
  ["line", { x1: "18", x2: "21", y1: "12", y2: "15", key: "5mozeu" }],
  [
    "path",
    {
      d: "M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",
      key: "mmje98"
    }
  ],
  ["path", { d: "M21 15V5a2 2 0 0 0-2-2H9", key: "43el77" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const f0 = on("Info", [
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
  ["path", { d: "M12 16v-4", key: "1dtifu" }],
  ["path", { d: "M12 8h.01", key: "e9boi3" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const QH = on("LoaderCircle", [
  ["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const tD = on("Minus", [["path", { d: "M5 12h14", key: "1ays0h" }]]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const eK = on("PanelLeftClose", [
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
  ["path", { d: "M9 3v18", key: "fh3hqa" }],
  ["path", { d: "m16 15-3-3 3-3", key: "14y99z" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const tK = on("PanelLeftOpen", [
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
  ["path", { d: "M9 3v18", key: "fh3hqa" }],
  ["path", { d: "m14 9 3 3-3 3", key: "8010ee" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const nD = on("Plus", [
  ["path", { d: "M5 12h14", key: "1ays0h" }],
  ["path", { d: "M12 5v14", key: "s699le" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const rD = on("Search", [
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
  ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const nK = on("Trash2", [
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
  ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
  ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
  ["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
  ["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const rK = on("Trash", [
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
  ["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
  ["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const iK = on("TriangleAlert", [
  [
    "path",
    {
      d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
      key: "wmoenq"
    }
  ],
  ["path", { d: "M12 9v4", key: "juzpu7" }],
  ["path", { d: "M12 17h.01", key: "p32p05" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const vT = on("Upload", [
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
  ["polyline", { points: "17 8 12 3 7 8", key: "t8dd8p" }],
  ["line", { x1: "12", x2: "12", y1: "3", y2: "15", key: "widbto" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const oK = on("User", [
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
]);
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */
const $a = on("X", [
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
]), aK = ({
  id: e,
  label: t,
  defaultChecked: n = !1,
  checked: r,
  onChange: i,
  indeterminate: o,
  disabled: a,
  size: s = "md",
  className: l,
  ...c
}, f) => {
  var O, P;
  const d = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => e || `checkbox-${io()}`, [e]), p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => typeof r < "u",
    [r]
  ), [m, y] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(n || !1), g = "primary", v = {
    sm: {
      checkbox: "size-4 rounded gap-1",
      icon: "size-3",
      text: "text-sm",
      // text class for sm
      description: "text-sm",
      gap: "gap-0.5"
    },
    md: {
      checkbox: "size-5 rounded gap-1",
      icon: "size-4",
      text: "text-base",
      // text class for md
      description: "text-sm",
      gap: "gap-1"
    }
  }, x = {
    primary: {
      checkbox: "border-border-strong hover:border-border-interactive checked:border-border-interactive bg-white checked:bg-toggle-on checked:hover:bg-toggle-on-hover checked:hover:border-toggle-on-hover focus:ring-2 focus:ring-offset-2 focus:ring-focus",
      icon: "text-white"
    }
  }, w = {
    checkbox: "cursor-not-allowed disabled:bg-white checked:disabled:bg-white disabled:border-border-disabled checked:disabled:border-border-disabled",
    icon: "cursor-not-allowed peer-disabled:text-border-disabled"
  }, S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    () => p ? r : m,
    [p, r, m]
  ), A = (C) => {
    if (a)
      return;
    const k = C.target.checked;
    p || y(k), typeof i == "function" && i(k);
  }, _ = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(t) ? t : !(t != null && t.heading) && !(t != null && t.description) ? null : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: v[s].gap, children: [
    (t == null ? void 0 : t.heading) && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      to,
      {
        className: K(
          "text-text-primary font-medium leading-4 m-0",
          v[s].text,
          v[s].gap,
          a && "text-text-disabled"
        ),
        htmlFor: d,
        children: t == null ? void 0 : t.heading
      }
    ),
    (t == null ? void 0 : t.description) && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      to,
      {
        tag: "p",
        className: K(
          "font-normal leading-5 m-0",
          v[s].description,
          a && "text-text-disabled"
        ),
        variant: "help",
        children: t == null ? void 0 : t.description
      }
    )
  ] }), [t, s, a]);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    "div",
    {
      className: K(
        "inline-flex items-center justify-center gap-2",
        !!t && "items-start",
        a && "cursor-not-allowed"
      ),
      children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
          "label",
          {
            className: K(
              "relative flex items-center justify-center rounded-full p-0.5",
              !a && "cursor-pointer"
            ),
            htmlFor: d,
            children: [
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                "input",
                {
                  ref: f,
                  id: d,
                  type: "checkbox",
                  className: K(
                    "peer relative cursor-pointer appearance-none transition-all m-0 before:content-[''] checked:before:content-[''] checked:before:hidden before:hidden !border-1.5 border-solid",
                    x[g].checkbox,
                    v[s].checkbox,
                    a && w.checkbox,
                    l
                  ),
                  checked: S(),
                  onChange: A,
                  disabled: a,
                  ...c
                }
              ),
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                "span",
                {
                  className: K(
                    "pointer-events-none inline-flex items-center absolute top-2/4 left-2/4 -translate-y-2/4 -translate-x-2/4 text-white opacity-0 transition-opacity peer-checked:opacity-100",
                    x[g].icon,
                    a && w.icon
                  ),
                  children: o ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(tD, { className: K((O = v[s]) == null ? void 0 : O.icon) }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(sd, { className: K((P = v[s]) == null ? void 0 : P.icon) })
                }
              )
            ]
          }
        ),
        !!t && _()
      ]
    }
  );
}, Jw = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(aK);
Jw.displayName = "Checkbox";
const bT = {
  primary: {
    checkbox: "border-border-strong hover:border-border-interactive checked:border-border-interactive bg-white checked:bg-toggle-on checked:hover:bg-toggle-on-hover checked:hover:border-toggle-on-hover focus:ring-2 focus:ring-offset-2 focus:ring-focus",
    icon: "text-white"
  }
}, xT = {
  checkbox: "disabled:bg-white checked:disabled:bg-white disabled:border-border-disabled checked:disabled:border-border-disabled cursor-not-allowed",
  icon: "peer-disabled:text-border-disabled cursor-not-allowed"
}, sK = {
  sm: "text-sm leading-5",
  md: "text-base leading-6"
}, Uv = {
  sm: {
    checkbox: "size-4",
    icon: "size-1.5",
    info: "size-4"
  },
  md: {
    checkbox: "size-5",
    icon: "size-2",
    info: "size-5"
  }
}, wT = {
  sm: {
    switch: "mt-1",
    radio: "mt-0.5"
  },
  md: {
    switch: "mt-0.5",
    radio: "mt-px"
  }
}, lK = {
  xs: "py-1 px-1 text-sm gap-0.5 [&>svg]:size-4",
  sm: "py-1 px-1.5 text-base gap-1 [&>svg]:size-4",
  md: "py-2 px-2.5 text-base gap-1 [&>svg]:size-5",
  lg: "py-2.5 px-3 text-base gap-1 [&>svg]:size-6"
}, cK = "border-0 border-r border-border-subtle border-solid", uK = "bg-background-primary text-primary cursor-pointer flex items-center justify-center", fK = "hover:bg-button-tertiary-hover", dK = "focus:outline-none";
function Qm() {
  return typeof window < "u";
}
function za(e) {
  return iD(e) ? (e.nodeName || "").toLowerCase() : "#document";
}
function Or(e) {
  var t;
  return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
}
function oo(e) {
  var t;
  return (t = (iD(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
}
function iD(e) {
  return Qm() ? e instanceof Node || e instanceof Or(e).Node : !1;
}
function Ct(e) {
  return Qm() ? e instanceof Element || e instanceof Or(e).Element : !1;
}
function pn(e) {
  return Qm() ? e instanceof HTMLElement || e instanceof Or(e).HTMLElement : !1;
}
function d0(e) {
  return !Qm() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof Or(e).ShadowRoot;
}
function ld(e) {
  const {
    overflow: t,
    overflowX: n,
    overflowY: r,
    display: i
  } = Hr(e);
  return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !["inline", "contents"].includes(i);
}
function hK(e) {
  return ["table", "td", "th"].includes(za(e));
}
function eg(e) {
  return [":popover-open", ":modal"].some((t) => {
    try {
      return e.matches(t);
    } catch {
      return !1;
    }
  });
}
function Qw(e) {
  const t = tg(), n = Ct(e) ? Hr(e) : e;
  return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((r) => (n.willChange || "").includes(r)) || ["paint", "layout", "strict", "content"].some((r) => (n.contain || "").includes(r));
}
function pK(e) {
  let t = Fo(e);
  for (; pn(t) && !Da(t); ) {
    if (Qw(t))
      return t;
    if (eg(t))
      return null;
    t = Fo(t);
  }
  return null;
}
function tg() {
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
}
function Da(e) {
  return ["html", "body", "#document"].includes(za(e));
}
function Hr(e) {
  return Or(e).getComputedStyle(e);
}
function ng(e) {
  return Ct(e) ? {
    scrollLeft: e.scrollLeft,
    scrollTop: e.scrollTop
  } : {
    scrollLeft: e.scrollX,
    scrollTop: e.scrollY
  };
}
function Fo(e) {
  if (za(e) === "html")
    return e;
  const t = (
    // Step into the shadow DOM of the parent of a slotted node.
    e.assignedSlot || // DOM Element detected.
    e.parentNode || // ShadowRoot detected.
    d0(e) && e.host || // Fallback.
    oo(e)
  );
  return d0(t) ? t.host : t;
}
function oD(e) {
  const t = Fo(e);
  return Da(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : pn(t) && ld(t) ? t : oD(t);
}
function Ca(e, t, n) {
  var r;
  t === void 0 && (t = []), n === void 0 && (n = !0);
  const i = oD(e), o = i === ((r = e.ownerDocument) == null ? void 0 : r.body), a = Or(i);
  if (o) {
    const s = h0(a);
    return t.concat(a, a.visualViewport || [], ld(i) ? i : [], s && n ? Ca(s) : []);
  }
  return t.concat(i, Ca(i, [], n));
}
function h0(e) {
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
}
function Pi(e) {
  let t = e.activeElement;
  for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null; ) {
    var n;
    t = t.shadowRoot.activeElement;
  }
  return t;
}
function hn(e, t) {
  if (!e || !t)
    return !1;
  const n = t.getRootNode == null ? void 0 : t.getRootNode();
  if (e.contains(t))
    return !0;
  if (n && d0(n)) {
    let r = t;
    for (; r; ) {
      if (e === r)
        return !0;
      r = r.parentNode || r.host;
    }
  }
  return !1;
}
function aD() {
  const e = navigator.userAgentData;
  return e != null && e.platform ? e.platform : navigator.platform;
}
function sD() {
  const e = navigator.userAgentData;
  return e && Array.isArray(e.brands) ? e.brands.map((t) => {
    let {
      brand: n,
      version: r
    } = t;
    return n + "/" + r;
  }).join(" ") : navigator.userAgent;
}
function lD(e) {
  return e.mozInputSource === 0 && e.isTrusted ? !0 : p0() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
}
function e1(e) {
  return mK() ? !1 : !p0() && e.width === 0 && e.height === 0 || p0() && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
  e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
}
function t1() {
  return /apple/i.test(navigator.vendor);
}
function p0() {
  const e = /android/i;
  return e.test(aD()) || e.test(sD());
}
function cD() {
  return aD().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
}
function mK() {
  return sD().includes("jsdom/");
}
function uf(e, t) {
  const n = ["mouse", "pen"];
  return t || n.push("", void 0), n.includes(e);
}
function gK(e) {
  return "nativeEvent" in e;
}
function yK(e) {
  return e.matches("html,body");
}
function Kn(e) {
  return (e == null ? void 0 : e.ownerDocument) || document;
}
function Hv(e, t) {
  if (t == null)
    return !1;
  if ("composedPath" in e)
    return e.composedPath().includes(t);
  const n = e;
  return n.target != null && t.contains(n.target);
}
function Ao(e) {
  return "composedPath" in e ? e.composedPath()[0] : e.target;
}
const vK = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
function n1(e) {
  return pn(e) && e.matches(vK);
}
function Un(e) {
  e.preventDefault(), e.stopPropagation();
}
function m0(e) {
  return e ? e.getAttribute("role") === "combobox" && n1(e) : !1;
}
const Ia = Math.min, Br = Math.max, hp = Math.round, kl = Math.floor, Ki = (e) => ({
  x: e,
  y: e
}), bK = {
  left: "right",
  right: "left",
  bottom: "top",
  top: "bottom"
}, xK = {
  start: "end",
  end: "start"
};
function g0(e, t, n) {
  return Br(e, Ia(t, n));
}
function $c(e, t) {
  return typeof e == "function" ? e(t) : e;
}
function Ra(e) {
  return e.split("-")[0];
}
function Dc(e) {
  return e.split("-")[1];
}
function uD(e) {
  return e === "x" ? "y" : "x";
}
function r1(e) {
  return e === "y" ? "height" : "width";
}
function Is(e) {
  return ["top", "bottom"].includes(Ra(e)) ? "y" : "x";
}
function i1(e) {
  return uD(Is(e));
}
function wK(e, t, n) {
  n === void 0 && (n = !1);
  const r = Dc(e), i = i1(e), o = r1(i);
  let a = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
  return t.reference[o] > t.floating[o] && (a = pp(a)), [a, pp(a)];
}
function _K(e) {
  const t = pp(e);
  return [y0(e), t, y0(t)];
}
function y0(e) {
  return e.replace(/start|end/g, (t) => xK[t]);
}
function SK(e, t, n) {
  const r = ["left", "right"], i = ["right", "left"], o = ["top", "bottom"], a = ["bottom", "top"];
  switch (e) {
    case "top":
    case "bottom":
      return n ? t ? i : r : t ? r : i;
    case "left":
    case "right":
      return t ? o : a;
    default:
      return [];
  }
}
function OK(e, t, n, r) {
  const i = Dc(e);
  let o = SK(Ra(e), n === "start", r);
  return i && (o = o.map((a) => a + "-" + i), t && (o = o.concat(o.map(y0)))), o;
}
function pp(e) {
  return e.replace(/left|right|bottom|top/g, (t) => bK[t]);
}
function AK(e) {
  return {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0,
    ...e
  };
}
function fD(e) {
  return typeof e != "number" ? AK(e) : {
    top: e,
    right: e,
    bottom: e,
    left: e
  };
}
function mp(e) {
  const {
    x: t,
    y: n,
    width: r,
    height: i
  } = e;
  return {
    width: r,
    height: i,
    top: n,
    left: t,
    right: t + r,
    bottom: n + i,
    x: t,
    y: n
  };
}
/*!
* tabbable 6.2.0
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
*/
var TK = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], gp = /* @__PURE__ */ TK.join(","), dD = typeof Element > "u", Jl = dD ? function() {
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, yp = !dD && Element.prototype.getRootNode ? function(e) {
  var t;
  return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
} : function(e) {
  return e == null ? void 0 : e.ownerDocument;
}, vp = function e(t, n) {
  var r;
  n === void 0 && (n = !0);
  var i = t == null || (r = t.getAttribute) === null || r === void 0 ? void 0 : r.call(t, "inert"), o = i === "" || i === "true", a = o || n && t && e(t.parentNode);
  return a;
}, PK = function(t) {
  var n, r = t == null || (n = t.getAttribute) === null || n === void 0 ? void 0 : n.call(t, "contenteditable");
  return r === "" || r === "true";
}, CK = function(t, n, r) {
  if (vp(t))
    return [];
  var i = Array.prototype.slice.apply(t.querySelectorAll(gp));
  return n && Jl.call(t, gp) && i.unshift(t), i = i.filter(r), i;
}, EK = function e(t, n, r) {
  for (var i = [], o = Array.from(t); o.length; ) {
    var a = o.shift();
    if (!vp(a, !1))
      if (a.tagName === "SLOT") {
        var s = a.assignedElements(), l = s.length ? s : a.children, c = e(l, !0, r);
        r.flatten ? i.push.apply(i, c) : i.push({
          scopeParent: a,
          candidates: c
        });
      } else {
        var f = Jl.call(a, gp);
        f && r.filter(a) && (n || !t.includes(a)) && i.push(a);
        var d = a.shadowRoot || // check for an undisclosed shadow
        typeof r.getShadowRoot == "function" && r.getShadowRoot(a), p = !vp(d, !1) && (!r.shadowRootFilter || r.shadowRootFilter(a));
        if (d && p) {
          var m = e(d === !0 ? a.children : d.children, !0, r);
          r.flatten ? i.push.apply(i, m) : i.push({
            scopeParent: a,
            candidates: m
          });
        } else
          o.unshift.apply(o, a.children);
      }
  }
  return i;
}, hD = function(t) {
  return !isNaN(parseInt(t.getAttribute("tabindex"), 10));
}, pD = function(t) {
  if (!t)
    throw new Error("No node provided");
  return t.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName) || PK(t)) && !hD(t) ? 0 : t.tabIndex;
}, kK = function(t, n) {
  var r = pD(t);
  return r < 0 && n && !hD(t) ? 0 : r;
}, MK = function(t, n) {
  return t.tabIndex === n.tabIndex ? t.documentOrder - n.documentOrder : t.tabIndex - n.tabIndex;
}, mD = function(t) {
  return t.tagName === "INPUT";
}, NK = function(t) {
  return mD(t) && t.type === "hidden";
}, $K = function(t) {
  var n = t.tagName === "DETAILS" && Array.prototype.slice.apply(t.children).some(function(r) {
    return r.tagName === "SUMMARY";
  });
  return n;
}, DK = function(t, n) {
  for (var r = 0; r < t.length; r++)
    if (t[r].checked && t[r].form === n)
      return t[r];
}, IK = function(t) {
  if (!t.name)
    return !0;
  var n = t.form || yp(t), r = function(s) {
    return n.querySelectorAll('input[type="radio"][name="' + s + '"]');
  }, i;
  if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
    i = r(window.CSS.escape(t.name));
  else
    try {
      i = r(t.name);
    } catch (a) {
      return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", a.message), !1;
    }
  var o = DK(i, t.form);
  return !o || o === t;
}, RK = function(t) {
  return mD(t) && t.type === "radio";
}, jK = function(t) {
  return RK(t) && !IK(t);
}, LK = function(t) {
  var n, r = t && yp(t), i = (n = r) === null || n === void 0 ? void 0 : n.host, o = !1;
  if (r && r !== t) {
    var a, s, l;
    for (o = !!((a = i) !== null && a !== void 0 && (s = a.ownerDocument) !== null && s !== void 0 && s.contains(i) || t != null && (l = t.ownerDocument) !== null && l !== void 0 && l.contains(t)); !o && i; ) {
      var c, f, d;
      r = yp(i), i = (c = r) === null || c === void 0 ? void 0 : c.host, o = !!((f = i) !== null && f !== void 0 && (d = f.ownerDocument) !== null && d !== void 0 && d.contains(i));
    }
  }
  return o;
}, _T = function(t) {
  var n = t.getBoundingClientRect(), r = n.width, i = n.height;
  return r === 0 && i === 0;
}, BK = function(t, n) {
  var r = n.displayCheck, i = n.getShadowRoot;
  if (getComputedStyle(t).visibility === "hidden")
    return !0;
  var o = Jl.call(t, "details>summary:first-of-type"), a = o ? t.parentElement : t;
  if (Jl.call(a, "details:not([open]) *"))
    return !0;
  if (!r || r === "full" || r === "legacy-full") {
    if (typeof i == "function") {
      for (var s = t; t; ) {
        var l = t.parentElement, c = yp(t);
        if (l && !l.shadowRoot && i(l) === !0)
          return _T(t);
        t.assignedSlot ? t = t.assignedSlot : !l && c !== t.ownerDocument ? t = c.host : t = l;
      }
      t = s;
    }
    if (LK(t))
      return !t.getClientRects().length;
    if (r !== "legacy-full")
      return !0;
  } else if (r === "non-zero-area")
    return _T(t);
  return !1;
}, FK = function(t) {
  if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))
    for (var n = t.parentElement; n; ) {
      if (n.tagName === "FIELDSET" && n.disabled) {
        for (var r = 0; r < n.children.length; r++) {
          var i = n.children.item(r);
          if (i.tagName === "LEGEND")
            return Jl.call(n, "fieldset[disabled] *") ? !0 : !i.contains(t);
        }
        return !0;
      }
      n = n.parentElement;
    }
  return !1;
}, WK = function(t, n) {
  return !(n.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
  //  because we're limited in the type of selectors we can use in JSDom (see related
  //  note related to `candidateSelectors`)
  vp(n) || NK(n) || BK(n, t) || // For a details element with a summary, the summary element gets the focus
  $K(n) || FK(n));
}, v0 = function(t, n) {
  return !(jK(n) || pD(n) < 0 || !WK(t, n));
}, zK = function(t) {
  var n = parseInt(t.getAttribute("tabindex"), 10);
  return !!(isNaN(n) || n >= 0);
}, VK = function e(t) {
  var n = [], r = [];
  return t.forEach(function(i, o) {
    var a = !!i.scopeParent, s = a ? i.scopeParent : i, l = kK(s, a), c = a ? e(i.candidates) : s;
    l === 0 ? a ? n.push.apply(n, c) : n.push(s) : r.push({
      documentOrder: o,
      tabIndex: l,
      item: i,
      isScope: a,
      content: c
    });
  }), r.sort(MK).reduce(function(i, o) {
    return o.isScope ? i.push.apply(i, o.content) : i.push(o.content), i;
  }, []).concat(n);
}, rg = function(t, n) {
  n = n || {};
  var r;
  return n.getShadowRoot ? r = EK([t], n.includeContainer, {
    filter: v0.bind(null, n),
    flatten: !1,
    getShadowRoot: n.getShadowRoot,
    shadowRootFilter: zK
  }) : r = CK(t, n.includeContainer, v0.bind(null, n)), VK(r);
}, UK = function(t, n) {
  if (n = n || {}, !t)
    throw new Error("No node provided");
  return Jl.call(t, gp) === !1 ? !1 : v0(n, t);
};
function ST(e, t, n) {
  let {
    reference: r,
    floating: i
  } = e;
  const o = Is(t), a = i1(t), s = r1(a), l = Ra(t), c = o === "y", f = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, p = r[s] / 2 - i[s] / 2;
  let m;
  switch (l) {
    case "top":
      m = {
        x: f,
        y: r.y - i.height
      };
      break;
    case "bottom":
      m = {
        x: f,
        y: r.y + r.height
      };
      break;
    case "right":
      m = {
        x: r.x + r.width,
        y: d
      };
      break;
    case "left":
      m = {
        x: r.x - i.width,
        y: d
      };
      break;
    default:
      m = {
        x: r.x,
        y: r.y
      };
  }
  switch (Dc(t)) {
    case "start":
      m[a] -= p * (n && c ? -1 : 1);
      break;
    case "end":
      m[a] += p * (n && c ? -1 : 1);
      break;
  }
  return m;
}
const HK = async (e, t, n) => {
  const {
    placement: r = "bottom",
    strategy: i = "absolute",
    middleware: o = [],
    platform: a
  } = n, s = o.filter(Boolean), l = await (a.isRTL == null ? void 0 : a.isRTL(t));
  let c = await a.getElementRects({
    reference: e,
    floating: t,
    strategy: i
  }), {
    x: f,
    y: d
  } = ST(c, r, l), p = r, m = {}, y = 0;
  for (let g = 0; g < s.length; g++) {
    const {
      name: v,
      fn: x
    } = s[g], {
      x: w,
      y: S,
      data: A,
      reset: _
    } = await x({
      x: f,
      y: d,
      initialPlacement: r,
      placement: p,
      strategy: i,
      middlewareData: m,
      rects: c,
      platform: a,
      elements: {
        reference: e,
        floating: t
      }
    });
    f = w ?? f, d = S ?? d, m = {
      ...m,
      [v]: {
        ...m[v],
        ...A
      }
    }, _ && y <= 50 && (y++, typeof _ == "object" && (_.placement && (p = _.placement), _.rects && (c = _.rects === !0 ? await a.getElementRects({
      reference: e,
      floating: t,
      strategy: i
    }) : _.rects), {
      x: f,
      y: d
    } = ST(c, p, l)), g = -1);
  }
  return {
    x: f,
    y: d,
    placement: p,
    strategy: i,
    middlewareData: m
  };
};
async function o1(e, t) {
  var n;
  t === void 0 && (t = {});
  const {
    x: r,
    y: i,
    platform: o,
    rects: a,
    elements: s,
    strategy: l
  } = e, {
    boundary: c = "clippingAncestors",
    rootBoundary: f = "viewport",
    elementContext: d = "floating",
    altBoundary: p = !1,
    padding: m = 0
  } = $c(t, e), y = fD(m), v = s[p ? d === "floating" ? "reference" : "floating" : d], x = mp(await o.getClippingRect({
    element: (n = await (o.isElement == null ? void 0 : o.isElement(v))) == null || n ? v : v.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(s.floating)),
    boundary: c,
    rootBoundary: f,
    strategy: l
  })), w = d === "floating" ? {
    x: r,
    y: i,
    width: a.floating.width,
    height: a.floating.height
  } : a.reference, S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(s.floating)), A = await (o.isElement == null ? void 0 : o.isElement(S)) ? await (o.getScale == null ? void 0 : o.getScale(S)) || {
    x: 1,
    y: 1
  } : {
    x: 1,
    y: 1
  }, _ = mp(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
    elements: s,
    rect: w,
    offsetParent: S,
    strategy: l
  }) : w);
  return {
    top: (x.top - _.top + y.top) / A.y,
    bottom: (_.bottom - x.bottom + y.bottom) / A.y,
    left: (x.left - _.left + y.left) / A.x,
    right: (_.right - x.right + y.right) / A.x
  };
}
const KK = (e) => ({
  name: "arrow",
  options: e,
  async fn(t) {
    const {
      x: n,
      y: r,
      placement: i,
      rects: o,
      platform: a,
      elements: s,
      middlewareData: l
    } = t, {
      element: c,
      padding: f = 0
    } = $c(e, t) || {};
    if (c == null)
      return {};
    const d = fD(f), p = {
      x: n,
      y: r
    }, m = i1(i), y = r1(m), g = await a.getDimensions(c), v = m === "y", x = v ? "top" : "left", w = v ? "bottom" : "right", S = v ? "clientHeight" : "clientWidth", A = o.reference[y] + o.reference[m] - p[m] - o.floating[y], _ = p[m] - o.reference[m], O = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(c));
    let P = O ? O[S] : 0;
    (!P || !await (a.isElement == null ? void 0 : a.isElement(O))) && (P = s.floating[S] || o.floating[y]);
    const C = A / 2 - _ / 2, k = P / 2 - g[y] / 2 - 1, I = Ia(d[x], k), $ = Ia(d[w], k), N = I, D = P - g[y] - $, j = P / 2 - g[y] / 2 + C, F = g0(N, j, D), W = !l.arrow && Dc(i) != null && j !== F && o.reference[y] / 2 - (j < N ? I : $) - g[y] / 2 < 0, z = W ? j < N ? j - N : j - D : 0;
    return {
      [m]: p[m] + z,
      data: {
        [m]: F,
        centerOffset: j - F - z,
        ...W && {
          alignmentOffset: z
        }
      },
      reset: W
    };
  }
}), GK = function(e) {
  return e === void 0 && (e = {}), {
    name: "flip",
    options: e,
    async fn(t) {
      var n, r;
      const {
        placement: i,
        middlewareData: o,
        rects: a,
        initialPlacement: s,
        platform: l,
        elements: c
      } = t, {
        mainAxis: f = !0,
        crossAxis: d = !0,
        fallbackPlacements: p,
        fallbackStrategy: m = "bestFit",
        fallbackAxisSideDirection: y = "none",
        flipAlignment: g = !0,
        ...v
      } = $c(e, t);
      if ((n = o.arrow) != null && n.alignmentOffset)
        return {};
      const x = Ra(i), w = Is(s), S = Ra(s) === s, A = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), _ = p || (S || !g ? [pp(s)] : _K(s)), O = y !== "none";
      !p && O && _.push(...OK(s, g, y, A));
      const P = [s, ..._], C = await o1(t, v), k = [];
      let I = ((r = o.flip) == null ? void 0 : r.overflows) || [];
      if (f && k.push(C[x]), d) {
        const j = wK(i, a, A);
        k.push(C[j[0]], C[j[1]]);
      }
      if (I = [...I, {
        placement: i,
        overflows: k
      }], !k.every((j) => j <= 0)) {
        var $, N;
        const j = ((($ = o.flip) == null ? void 0 : $.index) || 0) + 1, F = P[j];
        if (F)
          return {
            data: {
              index: j,
              overflows: I
            },
            reset: {
              placement: F
            }
          };
        let W = (N = I.filter((z) => z.overflows[0] <= 0).sort((z, H) => z.overflows[1] - H.overflows[1])[0]) == null ? void 0 : N.placement;
        if (!W)
          switch (m) {
            case "bestFit": {
              var D;
              const z = (D = I.filter((H) => {
                if (O) {
                  const U = Is(H.placement);
                  return U === w || // Create a bias to the `y` side axis due to horizontal
                  // reading directions favoring greater width.
                  U === "y";
                }
                return !0;
              }).map((H) => [H.placement, H.overflows.filter((U) => U > 0).reduce((U, V) => U + V, 0)]).sort((H, U) => H[1] - U[1])[0]) == null ? void 0 : D[0];
              z && (W = z);
              break;
            }
            case "initialPlacement":
              W = s;
              break;
          }
        if (i !== W)
          return {
            reset: {
              placement: W
            }
          };
      }
      return {};
    }
  };
};
async function YK(e, t) {
  const {
    placement: n,
    platform: r,
    elements: i
  } = e, o = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), a = Ra(n), s = Dc(n), l = Is(n) === "y", c = ["left", "top"].includes(a) ? -1 : 1, f = o && l ? -1 : 1, d = $c(t, e);
  let {
    mainAxis: p,
    crossAxis: m,
    alignmentAxis: y
  } = typeof d == "number" ? {
    mainAxis: d,
    crossAxis: 0,
    alignmentAxis: null
  } : {
    mainAxis: d.mainAxis || 0,
    crossAxis: d.crossAxis || 0,
    alignmentAxis: d.alignmentAxis
  };
  return s && typeof y == "number" && (m = s === "end" ? y * -1 : y), l ? {
    x: m * f,
    y: p * c
  } : {
    x: p * c,
    y: m * f
  };
}
const qK = function(e) {
  return e === void 0 && (e = 0), {
    name: "offset",
    options: e,
    async fn(t) {
      var n, r;
      const {
        x: i,
        y: o,
        placement: a,
        middlewareData: s
      } = t, l = await YK(t, e);
      return a === ((n = s.offset) == null ? void 0 : n.placement) && (r = s.arrow) != null && r.alignmentOffset ? {} : {
        x: i + l.x,
        y: o + l.y,
        data: {
          ...l,
          placement: a
        }
      };
    }
  };
}, XK = function(e) {
  return e === void 0 && (e = {}), {
    name: "shift",
    options: e,
    async fn(t) {
      const {
        x: n,
        y: r,
        placement: i
      } = t, {
        mainAxis: o = !0,
        crossAxis: a = !1,
        limiter: s = {
          fn: (v) => {
            let {
              x,
              y: w
            } = v;
            return {
              x,
              y: w
            };
          }
        },
        ...l
      } = $c(e, t), c = {
        x: n,
        y: r
      }, f = await o1(t, l), d = Is(Ra(i)), p = uD(d);
      let m = c[p], y = c[d];
      if (o) {
        const v = p === "y" ? "top" : "left", x = p === "y" ? "bottom" : "right", w = m + f[v], S = m - f[x];
        m = g0(w, m, S);
      }
      if (a) {
        const v = d === "y" ? "top" : "left", x = d === "y" ? "bottom" : "right", w = y + f[v], S = y - f[x];
        y = g0(w, y, S);
      }
      const g = s.fn({
        ...t,
        [p]: m,
        [d]: y
      });
      return {
        ...g,
        data: {
          x: g.x - n,
          y: g.y - r,
          enabled: {
            [p]: o,
            [d]: a
          }
        }
      };
    }
  };
}, ZK = function(e) {
  return e === void 0 && (e = {}), {
    name: "size",
    options: e,
    async fn(t) {
      var n, r;
      const {
        placement: i,
        rects: o,
        platform: a,
        elements: s
      } = t, {
        apply: l = () => {
        },
        ...c
      } = $c(e, t), f = await o1(t, c), d = Ra(i), p = Dc(i), m = Is(i) === "y", {
        width: y,
        height: g
      } = o.floating;
      let v, x;
      d === "top" || d === "bottom" ? (v = d, x = p === (await (a.isRTL == null ? void 0 : a.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (x = d, v = p === "end" ? "top" : "bottom");
      const w = g - f.top - f.bottom, S = y - f.left - f.right, A = Ia(g - f[v], w), _ = Ia(y - f[x], S), O = !t.middlewareData.shift;
      let P = A, C = _;
      if ((n = t.middlewareData.shift) != null && n.enabled.x && (C = S), (r = t.middlewareData.shift) != null && r.enabled.y && (P = w), O && !p) {
        const I = Br(f.left, 0), $ = Br(f.right, 0), N = Br(f.top, 0), D = Br(f.bottom, 0);
        m ? C = y - 2 * (I !== 0 || $ !== 0 ? I + $ : Br(f.left, f.right)) : P = g - 2 * (N !== 0 || D !== 0 ? N + D : Br(f.top, f.bottom));
      }
      await l({
        ...t,
        availableWidth: C,
        availableHeight: P
      });
      const k = await a.getDimensions(s.floating);
      return y !== k.width || g !== k.height ? {
        reset: {
          rects: !0
        }
      } : {};
    }
  };
};
function gD(e) {
  const t = Hr(e);
  let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
  const i = pn(e), o = i ? e.offsetWidth : n, a = i ? e.offsetHeight : r, s = hp(n) !== o || hp(r) !== a;
  return s && (n = o, r = a), {
    width: n,
    height: r,
    $: s
  };
}
function a1(e) {
  return Ct(e) ? e : e.contextElement;
}
function Ul(e) {
  const t = a1(e);
  if (!pn(t))
    return Ki(1);
  const n = t.getBoundingClientRect(), {
    width: r,
    height: i,
    $: o
  } = gD(t);
  let a = (o ? hp(n.width) : n.width) / r, s = (o ? hp(n.height) : n.height) / i;
  return (!a || !Number.isFinite(a)) && (a = 1), (!s || !Number.isFinite(s)) && (s = 1), {
    x: a,
    y: s
  };
}
const JK = /* @__PURE__ */ Ki(0);
function yD(e) {
  const t = Or(e);
  return !tg() || !t.visualViewport ? JK : {
    x: t.visualViewport.offsetLeft,
    y: t.visualViewport.offsetTop
  };
}
function QK(e, t, n) {
  return t === void 0 && (t = !1), !n || t && n !== Or(e) ? !1 : t;
}
function Rs(e, t, n, r) {
  t === void 0 && (t = !1), n === void 0 && (n = !1);
  const i = e.getBoundingClientRect(), o = a1(e);
  let a = Ki(1);
  t && (r ? Ct(r) && (a = Ul(r)) : a = Ul(e));
  const s = QK(o, n, r) ? yD(o) : Ki(0);
  let l = (i.left + s.x) / a.x, c = (i.top + s.y) / a.y, f = i.width / a.x, d = i.height / a.y;
  if (o) {
    const p = Or(o), m = r && Ct(r) ? Or(r) : r;
    let y = p, g = h0(y);
    for (; g && r && m !== y; ) {
      const v = Ul(g), x = g.getBoundingClientRect(), w = Hr(g), S = x.left + (g.clientLeft + parseFloat(w.paddingLeft)) * v.x, A = x.top + (g.clientTop + parseFloat(w.paddingTop)) * v.y;
      l *= v.x, c *= v.y, f *= v.x, d *= v.y, l += S, c += A, y = Or(g), g = h0(y);
    }
  }
  return mp({
    width: f,
    height: d,
    x: l,
    y: c
  });
}
function s1(e, t) {
  const n = ng(e).scrollLeft;
  return t ? t.left + n : Rs(oo(e)).left + n;
}
function vD(e, t, n) {
  n === void 0 && (n = !1);
  const r = e.getBoundingClientRect(), i = r.left + t.scrollLeft - (n ? 0 : (
    // RTL <body> scrollbar.
    s1(e, r)
  )), o = r.top + t.scrollTop;
  return {
    x: i,
    y: o
  };
}
function eG(e) {
  let {
    elements: t,
    rect: n,
    offsetParent: r,
    strategy: i
  } = e;
  const o = i === "fixed", a = oo(r), s = t ? eg(t.floating) : !1;
  if (r === a || s && o)
    return n;
  let l = {
    scrollLeft: 0,
    scrollTop: 0
  }, c = Ki(1);
  const f = Ki(0), d = pn(r);
  if ((d || !d && !o) && ((za(r) !== "body" || ld(a)) && (l = ng(r)), pn(r))) {
    const m = Rs(r);
    c = Ul(r), f.x = m.x + r.clientLeft, f.y = m.y + r.clientTop;
  }
  const p = a && !d && !o ? vD(a, l, !0) : Ki(0);
  return {
    width: n.width * c.x,
    height: n.height * c.y,
    x: n.x * c.x - l.scrollLeft * c.x + f.x + p.x,
    y: n.y * c.y - l.scrollTop * c.y + f.y + p.y
  };
}
function tG(e) {
  return Array.from(e.getClientRects());
}
function nG(e) {
  const t = oo(e), n = ng(e), r = e.ownerDocument.body, i = Br(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), o = Br(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
  let a = -n.scrollLeft + s1(e);
  const s = -n.scrollTop;
  return Hr(r).direction === "rtl" && (a += Br(t.clientWidth, r.clientWidth) - i), {
    width: i,
    height: o,
    x: a,
    y: s
  };
}
function rG(e, t) {
  const n = Or(e), r = oo(e), i = n.visualViewport;
  let o = r.clientWidth, a = r.clientHeight, s = 0, l = 0;
  if (i) {
    o = i.width, a = i.height;
    const c = tg();
    (!c || c && t === "fixed") && (s = i.offsetLeft, l = i.offsetTop);
  }
  return {
    width: o,
    height: a,
    x: s,
    y: l
  };
}
function iG(e, t) {
  const n = Rs(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, o = pn(e) ? Ul(e) : Ki(1), a = e.clientWidth * o.x, s = e.clientHeight * o.y, l = i * o.x, c = r * o.y;
  return {
    width: a,
    height: s,
    x: l,
    y: c
  };
}
function OT(e, t, n) {
  let r;
  if (t === "viewport")
    r = rG(e, n);
  else if (t === "document")
    r = nG(oo(e));
  else if (Ct(t))
    r = iG(t, n);
  else {
    const i = yD(e);
    r = {
      x: t.x - i.x,
      y: t.y - i.y,
      width: t.width,
      height: t.height
    };
  }
  return mp(r);
}
function bD(e, t) {
  const n = Fo(e);
  return n === t || !Ct(n) || Da(n) ? !1 : Hr(n).position === "fixed" || bD(n, t);
}
function oG(e, t) {
  const n = t.get(e);
  if (n)
    return n;
  let r = Ca(e, [], !1).filter((s) => Ct(s) && za(s) !== "body"), i = null;
  const o = Hr(e).position === "fixed";
  let a = o ? Fo(e) : e;
  for (; Ct(a) && !Da(a); ) {
    const s = Hr(a), l = Qw(a);
    !l && s.position === "fixed" && (i = null), (o ? !l && !i : !l && s.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || ld(a) && !l && bD(e, a)) ? r = r.filter((f) => f !== a) : i = s, a = Fo(a);
  }
  return t.set(e, r), r;
}
function aG(e) {
  let {
    element: t,
    boundary: n,
    rootBoundary: r,
    strategy: i
  } = e;
  const a = [...n === "clippingAncestors" ? eg(t) ? [] : oG(t, this._c) : [].concat(n), r], s = a[0], l = a.reduce((c, f) => {
    const d = OT(t, f, i);
    return c.top = Br(d.top, c.top), c.right = Ia(d.right, c.right), c.bottom = Ia(d.bottom, c.bottom), c.left = Br(d.left, c.left), c;
  }, OT(t, s, i));
  return {
    width: l.right - l.left,
    height: l.bottom - l.top,
    x: l.left,
    y: l.top
  };
}
function sG(e) {
  const {
    width: t,
    height: n
  } = gD(e);
  return {
    width: t,
    height: n
  };
}
function lG(e, t, n) {
  const r = pn(t), i = oo(t), o = n === "fixed", a = Rs(e, !0, o, t);
  let s = {
    scrollLeft: 0,
    scrollTop: 0
  };
  const l = Ki(0);
  if (r || !r && !o)
    if ((za(t) !== "body" || ld(i)) && (s = ng(t)), r) {
      const p = Rs(t, !0, o, t);
      l.x = p.x + t.clientLeft, l.y = p.y + t.clientTop;
    } else i && (l.x = s1(i));
  const c = i && !r && !o ? vD(i, s) : Ki(0), f = a.left + s.scrollLeft - l.x - c.x, d = a.top + s.scrollTop - l.y - c.y;
  return {
    x: f,
    y: d,
    width: a.width,
    height: a.height
  };
}
function Kv(e) {
  return Hr(e).position === "static";
}
function AT(e, t) {
  if (!pn(e) || Hr(e).position === "fixed")
    return null;
  if (t)
    return t(e);
  let n = e.offsetParent;
  return oo(e) === n && (n = n.ownerDocument.body), n;
}
function xD(e, t) {
  const n = Or(e);
  if (eg(e))
    return n;
  if (!pn(e)) {
    let i = Fo(e);
    for (; i && !Da(i); ) {
      if (Ct(i) && !Kv(i))
        return i;
      i = Fo(i);
    }
    return n;
  }
  let r = AT(e, t);
  for (; r && hK(r) && Kv(r); )
    r = AT(r, t);
  return r && Da(r) && Kv(r) && !Qw(r) ? n : r || pK(e) || n;
}
const cG = async function(e) {
  const t = this.getOffsetParent || xD, n = this.getDimensions, r = await n(e.floating);
  return {
    reference: lG(e.reference, await t(e.floating), e.strategy),
    floating: {
      x: 0,
      y: 0,
      width: r.width,
      height: r.height
    }
  };
};
function uG(e) {
  return Hr(e).direction === "rtl";
}
const fG = {
  convertOffsetParentRelativeRectToViewportRelativeRect: eG,
  getDocumentElement: oo,
  getClippingRect: aG,
  getOffsetParent: xD,
  getElementRects: cG,
  getClientRects: tG,
  getDimensions: sG,
  getScale: Ul,
  isElement: Ct,
  isRTL: uG
};
function dG(e, t) {
  let n = null, r;
  const i = oo(e);
  function o() {
    var s;
    clearTimeout(r), (s = n) == null || s.disconnect(), n = null;
  }
  function a(s, l) {
    s === void 0 && (s = !1), l === void 0 && (l = 1), o();
    const {
      left: c,
      top: f,
      width: d,
      height: p
    } = e.getBoundingClientRect();
    if (s || t(), !d || !p)
      return;
    const m = kl(f), y = kl(i.clientWidth - (c + d)), g = kl(i.clientHeight - (f + p)), v = kl(c), w = {
      rootMargin: -m + "px " + -y + "px " + -g + "px " + -v + "px",
      threshold: Br(0, Ia(1, l)) || 1
    };
    let S = !0;
    function A(_) {
      const O = _[0].intersectionRatio;
      if (O !== l) {
        if (!S)
          return a();
        O ? a(!1, O) : r = setTimeout(() => {
          a(!1, 1e-7);
        }, 1e3);
      }
      S = !1;
    }
    try {
      n = new IntersectionObserver(A, {
        ...w,
        // Handle <iframe>s
        root: i.ownerDocument
      });
    } catch {
      n = new IntersectionObserver(A, w);
    }
    n.observe(e);
  }
  return a(!0), o;
}
function ig(e, t, n, r) {
  r === void 0 && (r = {});
  const {
    ancestorScroll: i = !0,
    ancestorResize: o = !0,
    elementResize: a = typeof ResizeObserver == "function",
    layoutShift: s = typeof IntersectionObserver == "function",
    animationFrame: l = !1
  } = r, c = a1(e), f = i || o ? [...c ? Ca(c) : [], ...Ca(t)] : [];
  f.forEach((x) => {
    i && x.addEventListener("scroll", n, {
      passive: !0
    }), o && x.addEventListener("resize", n);
  });
  const d = c && s ? dG(c, n) : null;
  let p = -1, m = null;
  a && (m = new ResizeObserver((x) => {
    let [w] = x;
    w && w.target === c && m && (m.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
      var S;
      (S = m) == null || S.observe(t);
    })), n();
  }), c && !l && m.observe(c), m.observe(t));
  let y, g = l ? Rs(e) : null;
  l && v();
  function v() {
    const x = Rs(e);
    g && (x.x !== g.x || x.y !== g.y || x.width !== g.width || x.height !== g.height) && n(), g = x, y = requestAnimationFrame(v);
  }
  return n(), () => {
    var x;
    f.forEach((w) => {
      i && w.removeEventListener("scroll", n), o && w.removeEventListener("resize", n);
    }), d == null || d(), (x = m) == null || x.disconnect(), m = null, l && cancelAnimationFrame(y);
  };
}
const hG = qK, pG = XK, mG = GK, gG = ZK, TT = KK, yG = (e, t, n) => {
  const r = /* @__PURE__ */ new Map(), i = {
    platform: fG,
    ...n
  }, o = {
    ...i.platform,
    _c: r
  };
  return HK(e, t, {
    ...i,
    platform: o
  });
};
var rp = typeof document < "u" ? react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_1__.useEffect;
function bp(e, t) {
  if (e === t)
    return !0;
  if (typeof e != typeof t)
    return !1;
  if (typeof e == "function" && e.toString() === t.toString())
    return !0;
  let n, r, i;
  if (e && t && typeof e == "object") {
    if (Array.isArray(e)) {
      if (n = e.length, n !== t.length) return !1;
      for (r = n; r-- !== 0; )
        if (!bp(e[r], t[r]))
          return !1;
      return !0;
    }
    if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length)
      return !1;
    for (r = n; r-- !== 0; )
      if (!{}.hasOwnProperty.call(t, i[r]))
        return !1;
    for (r = n; r-- !== 0; ) {
      const o = i[r];
      if (!(o === "_owner" && e.$$typeof) && !bp(e[o], t[o]))
        return !1;
    }
    return !0;
  }
  return e !== e && t !== t;
}
function wD(e) {
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
}
function PT(e, t) {
  const n = wD(e);
  return Math.round(t * n) / n;
}
function Gv(e) {
  const t = react__WEBPACK_IMPORTED_MODULE_1__.useRef(e);
  return rp(() => {
    t.current = e;
  }), t;
}
function vG(e) {
  e === void 0 && (e = {});
  const {
    placement: t = "bottom",
    strategy: n = "absolute",
    middleware: r = [],
    platform: i,
    elements: {
      reference: o,
      floating: a
    } = {},
    transform: s = !0,
    whileElementsMounted: l,
    open: c
  } = e, [f, d] = react__WEBPACK_IMPORTED_MODULE_1__.useState({
    x: 0,
    y: 0,
    strategy: n,
    placement: t,
    middlewareData: {},
    isPositioned: !1
  }), [p, m] = react__WEBPACK_IMPORTED_MODULE_1__.useState(r);
  bp(p, r) || m(r);
  const [y, g] = react__WEBPACK_IMPORTED_MODULE_1__.useState(null), [v, x] = react__WEBPACK_IMPORTED_MODULE_1__.useState(null), w = react__WEBPACK_IMPORTED_MODULE_1__.useCallback((H) => {
    H !== O.current && (O.current = H, g(H));
  }, []), S = react__WEBPACK_IMPORTED_MODULE_1__.useCallback((H) => {
    H !== P.current && (P.current = H, x(H));
  }, []), A = o || y, _ = a || v, O = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null), P = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null), C = react__WEBPACK_IMPORTED_MODULE_1__.useRef(f), k = l != null, I = Gv(l), $ = Gv(i), N = Gv(c), D = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(() => {
    if (!O.current || !P.current)
      return;
    const H = {
      placement: t,
      strategy: n,
      middleware: p
    };
    $.current && (H.platform = $.current), yG(O.current, P.current, H).then((U) => {
      const V = {
        ...U,
        // 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: N.current !== !1
      };
      j.current && !bp(C.current, V) && (C.current = V, react_dom__WEBPACK_IMPORTED_MODULE_2__.flushSync(() => {
        d(V);
      }));
    });
  }, [p, t, n, $, N]);
  rp(() => {
    c === !1 && C.current.isPositioned && (C.current.isPositioned = !1, d((H) => ({
      ...H,
      isPositioned: !1
    })));
  }, [c]);
  const j = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!1);
  rp(() => (j.current = !0, () => {
    j.current = !1;
  }), []), rp(() => {
    if (A && (O.current = A), _ && (P.current = _), A && _) {
      if (I.current)
        return I.current(A, _, D);
      D();
    }
  }, [A, _, D, I, k]);
  const F = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    reference: O,
    floating: P,
    setReference: w,
    setFloating: S
  }), [w, S]), W = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    reference: A,
    floating: _
  }), [A, _]), z = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => {
    const H = {
      position: n,
      left: 0,
      top: 0
    };
    if (!W.floating)
      return H;
    const U = PT(W.floating, f.x), V = PT(W.floating, f.y);
    return s ? {
      ...H,
      transform: "translate(" + U + "px, " + V + "px)",
      ...wD(W.floating) >= 1.5 && {
        willChange: "transform"
      }
    } : {
      position: n,
      left: U,
      top: V
    };
  }, [n, s, W.floating, f.x, f.y]);
  return react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    ...f,
    update: D,
    refs: F,
    elements: W,
    floatingStyles: z
  }), [f, D, F, W, z]);
}
const bG = (e) => {
  function t(n) {
    return {}.hasOwnProperty.call(n, "current");
  }
  return {
    name: "arrow",
    options: e,
    fn(n) {
      const {
        element: r,
        padding: i
      } = typeof e == "function" ? e(n) : e;
      return r && t(r) ? r.current != null ? TT({
        element: r.current,
        padding: i
      }).fn(n) : {} : r ? TT({
        element: r,
        padding: i
      }).fn(n) : {};
    }
  };
}, og = (e, t) => ({
  ...hG(e),
  options: [e, t]
}), _D = (e, t) => ({
  ...pG(e),
  options: [e, t]
}), ag = (e, t) => ({
  ...mG(e),
  options: [e, t]
}), SD = (e, t) => ({
  ...gG(e),
  options: [e, t]
}), xG = (e, t) => ({
  ...bG(e),
  options: [e, t]
}), OD = {
  .../*#__PURE__*/ (react__WEBPACK_IMPORTED_MODULE_1___namespace_cache || (react__WEBPACK_IMPORTED_MODULE_1___namespace_cache = __webpack_require__.t(react__WEBPACK_IMPORTED_MODULE_1__, 2)))
}, wG = OD.useInsertionEffect, _G = wG || ((e) => e());
function Nn(e) {
  const t = react__WEBPACK_IMPORTED_MODULE_1__.useRef(() => {
    if (true)
      throw new Error("Cannot call an event handler while rendering.");
  });
  return _G(() => {
    t.current = e;
  }), react__WEBPACK_IMPORTED_MODULE_1__.useCallback(function() {
    for (var n = arguments.length, r = new Array(n), i = 0; i < n; i++)
      r[i] = arguments[i];
    return t.current == null ? void 0 : t.current(...r);
  }, []);
}
const l1 = "ArrowUp", cd = "ArrowDown", Ea = "ArrowLeft", ka = "ArrowRight";
function Th(e, t, n) {
  return Math.floor(e / t) !== n;
}
function Uu(e, t) {
  return t < 0 || t >= e.current.length;
}
function Yv(e, t) {
  return Qn(e, {
    disabledIndices: t
  });
}
function CT(e, t) {
  return Qn(e, {
    decrement: !0,
    startingIndex: e.current.length,
    disabledIndices: t
  });
}
function Qn(e, t) {
  let {
    startingIndex: n = -1,
    decrement: r = !1,
    disabledIndices: i,
    amount: o = 1
  } = t === void 0 ? {} : t;
  const a = e.current;
  let s = n;
  do
    s += r ? -o : o;
  while (s >= 0 && s <= a.length - 1 && ip(a, s, i));
  return s;
}
function SG(e, t) {
  let {
    event: n,
    orientation: r,
    loop: i,
    rtl: o,
    cols: a,
    disabledIndices: s,
    minIndex: l,
    maxIndex: c,
    prevIndex: f,
    stopEvent: d = !1
  } = t, p = f;
  if (n.key === l1) {
    if (d && Un(n), f === -1)
      p = c;
    else if (p = Qn(e, {
      startingIndex: p,
      amount: a,
      decrement: !0,
      disabledIndices: s
    }), i && (f - a < l || p < 0)) {
      const m = f % a, y = c % a, g = c - (y - m);
      y === m ? p = c : p = y > m ? g : g - a;
    }
    Uu(e, p) && (p = f);
  }
  if (n.key === cd && (d && Un(n), f === -1 ? p = l : (p = Qn(e, {
    startingIndex: f,
    amount: a,
    disabledIndices: s
  }), i && f + a > c && (p = Qn(e, {
    startingIndex: f % a - a,
    amount: a,
    disabledIndices: s
  }))), Uu(e, p) && (p = f)), r === "both") {
    const m = kl(f / a);
    n.key === (o ? Ea : ka) && (d && Un(n), f % a !== a - 1 ? (p = Qn(e, {
      startingIndex: f,
      disabledIndices: s
    }), i && Th(p, a, m) && (p = Qn(e, {
      startingIndex: f - f % a - 1,
      disabledIndices: s
    }))) : i && (p = Qn(e, {
      startingIndex: f - f % a - 1,
      disabledIndices: s
    })), Th(p, a, m) && (p = f)), n.key === (o ? ka : Ea) && (d && Un(n), f % a !== 0 ? (p = Qn(e, {
      startingIndex: f,
      decrement: !0,
      disabledIndices: s
    }), i && Th(p, a, m) && (p = Qn(e, {
      startingIndex: f + (a - f % a),
      decrement: !0,
      disabledIndices: s
    }))) : i && (p = Qn(e, {
      startingIndex: f + (a - f % a),
      decrement: !0,
      disabledIndices: s
    })), Th(p, a, m) && (p = f));
    const y = kl(c / a) === m;
    Uu(e, p) && (i && y ? p = n.key === (o ? ka : Ea) ? c : Qn(e, {
      startingIndex: f - f % a - 1,
      disabledIndices: s
    }) : p = f);
  }
  return p;
}
function OG(e, t, n) {
  const r = [];
  let i = 0;
  return e.forEach((o, a) => {
    let {
      width: s,
      height: l
    } = o;
    if (s > t && "development" !== "production")
      throw new Error("[Floating UI]: Invalid grid - item width at index " + a + " is greater than grid columns");
    let c = !1;
    for (n && (i = 0); !c; ) {
      const f = [];
      for (let d = 0; d < s; d++)
        for (let p = 0; p < l; p++)
          f.push(i + d + p * t);
      i % t + s <= t && f.every((d) => r[d] == null) ? (f.forEach((d) => {
        r[d] = a;
      }), c = !0) : i++;
    }
  }), [...r];
}
function AG(e, t, n, r, i) {
  if (e === -1) return -1;
  const o = n.indexOf(e), a = t[e];
  switch (i) {
    case "tl":
      return o;
    case "tr":
      return a ? o + a.width - 1 : o;
    case "bl":
      return a ? o + (a.height - 1) * r : o;
    case "br":
      return n.lastIndexOf(e);
  }
}
function TG(e, t) {
  return t.flatMap((n, r) => e.includes(n) ? [r] : []);
}
function ip(e, t, n) {
  if (n)
    return n.includes(t);
  const r = e[t];
  return r == null || r.hasAttribute("disabled") || r.getAttribute("aria-disabled") === "true";
}
var Nt = typeof document < "u" ? react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_1__.useEffect;
function ff() {
  return ff = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, ff.apply(this, arguments);
}
let ET = !1, PG = 0;
const kT = () => (
  // Ensure the id is unique with multiple independent versions of Floating UI
  // on <React 18
  "floating-ui-" + Math.random().toString(36).slice(2, 6) + PG++
);
function CG() {
  const [e, t] = react__WEBPACK_IMPORTED_MODULE_1__.useState(() => ET ? kT() : void 0);
  return Nt(() => {
    e == null && t(kT());
  }, []), react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    ET = !0;
  }, []), e;
}
const EG = OD.useId, sg = EG || CG;
let df;
 true && (df = /* @__PURE__ */ new Set());
function op() {
  for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
    n[r] = arguments[r];
  const i = "Floating UI: " + n.join(" ");
  if (!((e = df) != null && e.has(i))) {
    var o;
    (o = df) == null || o.add(i), console.warn(i);
  }
}
function kG() {
  for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
    n[r] = arguments[r];
  const i = "Floating UI: " + n.join(" ");
  if (!((e = df) != null && e.has(i))) {
    var o;
    (o = df) == null || o.add(i), console.error(i);
  }
}
const MG = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(function(t, n) {
  const {
    context: {
      placement: r,
      elements: {
        floating: i
      },
      middlewareData: {
        arrow: o,
        shift: a
      }
    },
    width: s = 14,
    height: l = 7,
    tipRadius: c = 0,
    strokeWidth: f = 0,
    staticOffset: d,
    stroke: p,
    d: m,
    style: {
      transform: y,
      ...g
    } = {},
    ...v
  } = t;
   true && (n || op("The `ref` prop is required for `FloatingArrow`."));
  const x = sg(), [w, S] = react__WEBPACK_IMPORTED_MODULE_1__.useState(!1);
  if (Nt(() => {
    if (!i) return;
    Hr(i).direction === "rtl" && S(!0);
  }, [i]), !i)
    return null;
  const [A, _] = r.split("-"), O = A === "top" || A === "bottom";
  let P = d;
  (O && a != null && a.x || !O && a != null && a.y) && (P = null);
  const C = f * 2, k = C / 2, I = s / 2 * (c / -8 + 1), $ = l / 2 * c / 4, N = !!m, D = P && _ === "end" ? "bottom" : "top";
  let j = P && _ === "end" ? "right" : "left";
  P && w && (j = _ === "end" ? "left" : "right");
  const F = (o == null ? void 0 : o.x) != null ? P || o.x : "", W = (o == null ? void 0 : o.y) != null ? P || o.y : "", z = m || "M0,0" + (" H" + s) + (" L" + (s - I) + "," + (l - $)) + (" Q" + s / 2 + "," + l + " " + I + "," + (l - $)) + " Z", H = {
    top: N ? "rotate(180deg)" : "",
    left: N ? "rotate(90deg)" : "rotate(-90deg)",
    bottom: N ? "" : "rotate(180deg)",
    right: N ? "rotate(-90deg)" : "rotate(90deg)"
  }[A];
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("svg", ff({}, v, {
    "aria-hidden": !0,
    ref: n,
    width: N ? s : s + C,
    height: s,
    viewBox: "0 0 " + s + " " + (l > s ? l : s),
    style: {
      position: "absolute",
      pointerEvents: "none",
      [j]: F,
      [D]: W,
      [A]: O || N ? "100%" : "calc(100% - " + C / 2 + "px)",
      transform: [H, y].filter((U) => !!U).join(" "),
      ...g
    }
  }), C > 0 && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", {
    clipPath: "url(#" + x + ")",
    fill: "none",
    stroke: p,
    strokeWidth: C + (m ? 0 : 1),
    d: z
  }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", {
    stroke: C && !m ? v.fill : "none",
    d: z
  }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("clipPath", {
    id: x
  }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
    x: -k,
    y: k * (N ? -1 : 1),
    width: s + C,
    height: s
  })));
});
function NG() {
  const e = /* @__PURE__ */ new Map();
  return {
    emit(t, n) {
      var r;
      (r = e.get(t)) == null || r.forEach((i) => i(n));
    },
    on(t, n) {
      e.set(t, [...e.get(t) || [], n]);
    },
    off(t, n) {
      var r;
      e.set(t, ((r = e.get(t)) == null ? void 0 : r.filter((i) => i !== n)) || []);
    }
  };
}
const $G = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(null), DG = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(null), lg = () => {
  var e;
  return ((e = react__WEBPACK_IMPORTED_MODULE_1__.useContext($G)) == null ? void 0 : e.id) || null;
}, ud = () => react__WEBPACK_IMPORTED_MODULE_1__.useContext(DG);
function js(e) {
  return "data-floating-ui-" + e;
}
function Yn(e) {
  const t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(e);
  return Nt(() => {
    t.current = e;
  }), t;
}
const MT = /* @__PURE__ */ js("safe-polygon");
function qv(e, t, n) {
  return n && !uf(n) ? 0 : typeof e == "number" ? e : e == null ? void 0 : e[t];
}
function IG(e, t) {
  t === void 0 && (t = {});
  const {
    open: n,
    onOpenChange: r,
    dataRef: i,
    events: o,
    elements: a
  } = e, {
    enabled: s = !0,
    delay: l = 0,
    handleClose: c = null,
    mouseOnly: f = !1,
    restMs: d = 0,
    move: p = !0
  } = t, m = ud(), y = lg(), g = Yn(c), v = Yn(l), x = Yn(n), w = react__WEBPACK_IMPORTED_MODULE_1__.useRef(), S = react__WEBPACK_IMPORTED_MODULE_1__.useRef(-1), A = react__WEBPACK_IMPORTED_MODULE_1__.useRef(), _ = react__WEBPACK_IMPORTED_MODULE_1__.useRef(-1), O = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!0), P = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!1), C = react__WEBPACK_IMPORTED_MODULE_1__.useRef(() => {
  }), k = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!1), I = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(() => {
    var z;
    const H = (z = i.current.openEvent) == null ? void 0 : z.type;
    return (H == null ? void 0 : H.includes("mouse")) && H !== "mousedown";
  }, [i]);
  react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    if (!s) return;
    function z(H) {
      let {
        open: U
      } = H;
      U || (clearTimeout(S.current), clearTimeout(_.current), O.current = !0, k.current = !1);
    }
    return o.on("openchange", z), () => {
      o.off("openchange", z);
    };
  }, [s, o]), react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    if (!s || !g.current || !n) return;
    function z(U) {
      I() && r(!1, U, "hover");
    }
    const H = Kn(a.floating).documentElement;
    return H.addEventListener("mouseleave", z), () => {
      H.removeEventListener("mouseleave", z);
    };
  }, [a.floating, n, r, s, g, I]);
  const $ = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(function(z, H, U) {
    H === void 0 && (H = !0), U === void 0 && (U = "hover");
    const V = qv(v.current, "close", w.current);
    V && !A.current ? (clearTimeout(S.current), S.current = window.setTimeout(() => r(!1, z, U), V)) : H && (clearTimeout(S.current), r(!1, z, U));
  }, [v, r]), N = Nn(() => {
    C.current(), A.current = void 0;
  }), D = Nn(() => {
    if (P.current) {
      const z = Kn(a.floating).body;
      z.style.pointerEvents = "", z.removeAttribute(MT), P.current = !1;
    }
  }), j = Nn(() => i.current.openEvent ? ["click", "mousedown"].includes(i.current.openEvent.type) : !1);
  react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    if (!s) return;
    function z(Y) {
      if (clearTimeout(S.current), O.current = !1, f && !uf(w.current) || d > 0 && !qv(v.current, "open"))
        return;
      const Q = qv(v.current, "open", w.current);
      Q ? S.current = window.setTimeout(() => {
        x.current || r(!0, Y, "hover");
      }, Q) : n || r(!0, Y, "hover");
    }
    function H(Y) {
      if (j()) return;
      C.current();
      const Q = Kn(a.floating);
      if (clearTimeout(_.current), k.current = !1, g.current && i.current.floatingContext) {
        n || clearTimeout(S.current), A.current = g.current({
          ...i.current.floatingContext,
          tree: m,
          x: Y.clientX,
          y: Y.clientY,
          onClose() {
            D(), N(), j() || $(Y, !0, "safe-polygon");
          }
        });
        const re = A.current;
        Q.addEventListener("mousemove", re), C.current = () => {
          Q.removeEventListener("mousemove", re);
        };
        return;
      }
      (w.current === "touch" ? !hn(a.floating, Y.relatedTarget) : !0) && $(Y);
    }
    function U(Y) {
      j() || i.current.floatingContext && (g.current == null || g.current({
        ...i.current.floatingContext,
        tree: m,
        x: Y.clientX,
        y: Y.clientY,
        onClose() {
          D(), N(), j() || $(Y);
        }
      })(Y));
    }
    if (Ct(a.domReference)) {
      var V;
      const Y = a.domReference;
      return n && Y.addEventListener("mouseleave", U), (V = a.floating) == null || V.addEventListener("mouseleave", U), p && Y.addEventListener("mousemove", z, {
        once: !0
      }), Y.addEventListener("mouseenter", z), Y.addEventListener("mouseleave", H), () => {
        var Q;
        n && Y.removeEventListener("mouseleave", U), (Q = a.floating) == null || Q.removeEventListener("mouseleave", U), p && Y.removeEventListener("mousemove", z), Y.removeEventListener("mouseenter", z), Y.removeEventListener("mouseleave", H);
      };
    }
  }, [a, s, e, f, d, p, $, N, D, r, n, x, m, v, g, i, j]), Nt(() => {
    var z;
    if (s && n && (z = g.current) != null && z.__options.blockPointerEvents && I()) {
      P.current = !0;
      const U = a.floating;
      if (Ct(a.domReference) && U) {
        var H;
        const V = Kn(a.floating).body;
        V.setAttribute(MT, "");
        const Y = a.domReference, Q = m == null || (H = m.nodesRef.current.find((ne) => ne.id === y)) == null || (H = H.context) == null ? void 0 : H.elements.floating;
        return Q && (Q.style.pointerEvents = ""), V.style.pointerEvents = "none", Y.style.pointerEvents = "auto", U.style.pointerEvents = "auto", () => {
          V.style.pointerEvents = "", Y.style.pointerEvents = "", U.style.pointerEvents = "";
        };
      }
    }
  }, [s, n, y, a, m, g, I]), Nt(() => {
    n || (w.current = void 0, k.current = !1, N(), D());
  }, [n, N, D]), react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => () => {
    N(), clearTimeout(S.current), clearTimeout(_.current), D();
  }, [s, a.domReference, N, D]);
  const F = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => {
    function z(H) {
      w.current = H.pointerType;
    }
    return {
      onPointerDown: z,
      onPointerEnter: z,
      onMouseMove(H) {
        const {
          nativeEvent: U
        } = H;
        function V() {
          !O.current && !x.current && r(!0, U, "hover");
        }
        f && !uf(w.current) || n || d === 0 || k.current && H.movementX ** 2 + H.movementY ** 2 < 2 || (clearTimeout(_.current), w.current === "touch" ? V() : (k.current = !0, _.current = window.setTimeout(V, d)));
      }
    };
  }, [f, r, n, x, d]), W = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    onMouseEnter() {
      clearTimeout(S.current);
    },
    onMouseLeave(z) {
      j() || $(z.nativeEvent, !1);
    }
  }), [$, j]);
  return react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => s ? {
    reference: F,
    floating: W
  } : {}, [s, F, W]);
}
let NT = 0;
function xa(e, t) {
  t === void 0 && (t = {});
  const {
    preventScroll: n = !1,
    cancelPrevious: r = !0,
    sync: i = !1
  } = t;
  r && cancelAnimationFrame(NT);
  const o = () => e == null ? void 0 : e.focus({
    preventScroll: n
  });
  i ? o() : NT = requestAnimationFrame(o);
}
function RG(e, t) {
  var n;
  let r = [], i = (n = e.find((o) => o.id === t)) == null ? void 0 : n.parentId;
  for (; i; ) {
    const o = e.find((a) => a.id === i);
    i = o == null ? void 0 : o.parentId, o && (r = r.concat(o));
  }
  return r;
}
function Cs(e, t) {
  let n = e.filter((i) => {
    var o;
    return i.parentId === t && ((o = i.context) == null ? void 0 : o.open);
  }), r = n;
  for (; r.length; )
    r = e.filter((i) => {
      var o;
      return (o = r) == null ? void 0 : o.some((a) => {
        var s;
        return i.parentId === a.id && ((s = i.context) == null ? void 0 : s.open);
      });
    }), n = n.concat(r);
  return n;
}
function jG(e, t) {
  let n, r = -1;
  function i(o, a) {
    a > r && (n = o, r = a), Cs(e, o).forEach((l) => {
      i(l.id, a + 1);
    });
  }
  return i(t, 0), e.find((o) => o.id === n);
}
let xl = /* @__PURE__ */ new WeakMap(), Ph = /* @__PURE__ */ new WeakSet(), Ch = {}, Xv = 0;
const LG = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype, AD = (e) => e && (e.host || AD(e.parentNode)), BG = (e, t) => t.map((n) => {
  if (e.contains(n))
    return n;
  const r = AD(n);
  return e.contains(r) ? r : null;
}).filter((n) => n != null);
function FG(e, t, n, r) {
  const i = "data-floating-ui-inert", o = r ? "inert" : n ? "aria-hidden" : null, a = BG(t, e), s = /* @__PURE__ */ new Set(), l = new Set(a), c = [];
  Ch[i] || (Ch[i] = /* @__PURE__ */ new WeakMap());
  const f = Ch[i];
  a.forEach(d), p(t), s.clear();
  function d(m) {
    !m || s.has(m) || (s.add(m), m.parentNode && d(m.parentNode));
  }
  function p(m) {
    !m || l.has(m) || [].forEach.call(m.children, (y) => {
      if (za(y) !== "script")
        if (s.has(y))
          p(y);
        else {
          const g = o ? y.getAttribute(o) : null, v = g !== null && g !== "false", x = (xl.get(y) || 0) + 1, w = (f.get(y) || 0) + 1;
          xl.set(y, x), f.set(y, w), c.push(y), x === 1 && v && Ph.add(y), w === 1 && y.setAttribute(i, ""), !v && o && y.setAttribute(o, "true");
        }
    });
  }
  return Xv++, () => {
    c.forEach((m) => {
      const y = (xl.get(m) || 0) - 1, g = (f.get(m) || 0) - 1;
      xl.set(m, y), f.set(m, g), y || (!Ph.has(m) && o && m.removeAttribute(o), Ph.delete(m)), g || m.removeAttribute(i);
    }), Xv--, Xv || (xl = /* @__PURE__ */ new WeakMap(), xl = /* @__PURE__ */ new WeakMap(), Ph = /* @__PURE__ */ new WeakSet(), Ch = {});
  };
}
function $T(e, t, n) {
  t === void 0 && (t = !1), n === void 0 && (n = !1);
  const r = Kn(e[0]).body;
  return FG(e.concat(Array.from(r.querySelectorAll("[aria-live]"))), r, t, n);
}
const hf = () => ({
  getShadowRoot: !0,
  displayCheck: (
    // JSDOM does not support the `tabbable` library. To solve this we can
    // check if `ResizeObserver` is a real function (not polyfilled), which
    // determines if the current environment is JSDOM-like.
    typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
  )
});
function TD(e, t) {
  const n = rg(e, hf());
  t === "prev" && n.reverse();
  const r = n.indexOf(Pi(Kn(e)));
  return n.slice(r + 1)[0];
}
function PD() {
  return TD(document.body, "next");
}
function CD() {
  return TD(document.body, "prev");
}
function Hu(e, t) {
  const n = t || e.currentTarget, r = e.relatedTarget;
  return !r || !hn(n, r);
}
function WG(e) {
  rg(e, hf()).forEach((n) => {
    n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
  });
}
function DT(e) {
  e.querySelectorAll("[data-tabindex]").forEach((n) => {
    const r = n.dataset.tabindex;
    delete n.dataset.tabindex, r ? n.setAttribute("tabindex", r) : n.removeAttribute("tabindex");
  });
}
const cg = {
  border: 0,
  clip: "rect(0 0 0 0)",
  height: "1px",
  margin: "-1px",
  overflow: "hidden",
  padding: 0,
  position: "fixed",
  whiteSpace: "nowrap",
  width: "1px",
  top: 0,
  left: 0
};
let zG;
function IT(e) {
  e.key === "Tab" && (e.target, clearTimeout(zG));
}
const xp = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(function(t, n) {
  const [r, i] = react__WEBPACK_IMPORTED_MODULE_1__.useState();
  Nt(() => (t1() && i("button"), document.addEventListener("keydown", IT), () => {
    document.removeEventListener("keydown", IT);
  }), []);
  const o = {
    ref: n,
    tabIndex: 0,
    // Role is only for VoiceOver
    role: r,
    "aria-hidden": r ? void 0 : !0,
    [js("focus-guard")]: "",
    style: cg
  };
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", ff({}, t, o));
}), ED = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createContext(null), RT = /* @__PURE__ */ js("portal");
function VG(e) {
  e === void 0 && (e = {});
  const {
    id: t,
    root: n
  } = e, r = sg(), i = kD(), [o, a] = react__WEBPACK_IMPORTED_MODULE_1__.useState(null), s = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null);
  return Nt(() => () => {
    o == null || o.remove(), queueMicrotask(() => {
      s.current = null;
    });
  }, [o]), Nt(() => {
    if (!r || s.current) return;
    const l = t ? document.getElementById(t) : null;
    if (!l) return;
    const c = document.createElement("div");
    c.id = r, c.setAttribute(RT, ""), l.appendChild(c), s.current = c, a(c);
  }, [t, r]), Nt(() => {
    if (n === null || !r || s.current) return;
    let l = n || (i == null ? void 0 : i.portalNode);
    l && !Ct(l) && (l = l.current), l = l || document.body;
    let c = null;
    t && (c = document.createElement("div"), c.id = t, l.appendChild(c));
    const f = document.createElement("div");
    f.id = r, f.setAttribute(RT, ""), l = c || l, l.appendChild(f), s.current = f, a(f);
  }, [t, n, r, i]), o;
}
function ug(e) {
  const {
    children: t,
    id: n,
    root: r,
    preserveTabOrder: i = !0
  } = e, o = VG({
    id: n,
    root: r
  }), [a, s] = react__WEBPACK_IMPORTED_MODULE_1__.useState(null), l = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null), c = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null), f = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null), d = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null), p = a == null ? void 0 : a.modal, m = a == null ? void 0 : a.open, y = (
    // The FocusManager and therefore floating element are currently open/
    // rendered.
    !!a && // Guards are only for non-modal focus management.
    !a.modal && // Don't render if unmount is transitioning.
    a.open && i && !!(r || o)
  );
  return react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    if (!o || !i || p)
      return;
    function g(v) {
      o && Hu(v) && (v.type === "focusin" ? DT : WG)(o);
    }
    return o.addEventListener("focusin", g, !0), o.addEventListener("focusout", g, !0), () => {
      o.removeEventListener("focusin", g, !0), o.removeEventListener("focusout", g, !0);
    };
  }, [o, i, p]), react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    o && (m || DT(o));
  }, [m, o]), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(ED.Provider, {
    value: react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
      preserveTabOrder: i,
      beforeOutsideRef: l,
      afterOutsideRef: c,
      beforeInsideRef: f,
      afterInsideRef: d,
      portalNode: o,
      setFocusManagerState: s
    }), [i, o])
  }, y && o && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(xp, {
    "data-type": "outside",
    ref: l,
    onFocus: (g) => {
      if (Hu(g, o)) {
        var v;
        (v = f.current) == null || v.focus();
      } else {
        const x = CD() || (a == null ? void 0 : a.refs.domReference.current);
        x == null || x.focus();
      }
    }
  }), y && o && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", {
    "aria-owns": o.id,
    style: cg
  }), o && /* @__PURE__ */ react_dom__WEBPACK_IMPORTED_MODULE_2__.createPortal(t, o), y && o && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(xp, {
    "data-type": "outside",
    ref: c,
    onFocus: (g) => {
      if (Hu(g, o)) {
        var v;
        (v = d.current) == null || v.focus();
      } else {
        const x = PD() || (a == null ? void 0 : a.refs.domReference.current);
        x == null || x.focus(), a != null && a.closeOnFocusOut && (a == null || a.onOpenChange(!1, g.nativeEvent, "focus-out"));
      }
    }
  }));
}
const kD = () => react__WEBPACK_IMPORTED_MODULE_1__.useContext(ED), b0 = "data-floating-ui-focusable";
function MD(e) {
  return e ? e.hasAttribute(b0) ? e : e.querySelector("[" + b0 + "]") || e : null;
}
const jT = 20;
let hs = [];
function Zv(e) {
  hs = hs.filter((n) => n.isConnected);
  let t = e;
  if (!(!t || za(t) === "body")) {
    if (!UK(t, hf())) {
      const n = rg(t, hf())[0];
      n && (t = n);
    }
    hs.push(t), hs.length > jT && (hs = hs.slice(-jT));
  }
}
function LT() {
  return hs.slice().reverse().find((e) => e.isConnected);
}
const UG = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(function(t, n) {
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("button", ff({}, t, {
    type: "button",
    ref: n,
    tabIndex: -1,
    style: cg
  }));
});
function HG(e) {
  const {
    context: t,
    children: n,
    disabled: r = !1,
    order: i = ["content"],
    guards: o = !0,
    initialFocus: a = 0,
    returnFocus: s = !0,
    restoreFocus: l = !1,
    modal: c = !0,
    visuallyHiddenDismiss: f = !1,
    closeOnFocusOut: d = !0
  } = e, {
    open: p,
    refs: m,
    nodeId: y,
    onOpenChange: g,
    events: v,
    dataRef: x,
    floatingId: w,
    elements: {
      domReference: S,
      floating: A
    }
  } = t, _ = typeof a == "number" && a < 0, O = m0(S) && _, P = LG() ? o : !0, C = Yn(i), k = Yn(a), I = Yn(s), $ = ud(), N = kD(), D = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null), j = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null), F = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!1), W = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!1), z = react__WEBPACK_IMPORTED_MODULE_1__.useRef(-1), H = N != null, U = MD(A), V = Nn(function(re) {
    return re === void 0 && (re = U), re ? rg(re, hf()) : [];
  }), Y = Nn((re) => {
    const ce = V(re);
    return C.current.map((oe) => S && oe === "reference" ? S : U && oe === "floating" ? U : ce).filter(Boolean).flat();
  });
  react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    if (r || !c) return;
    function re(oe) {
      if (oe.key === "Tab") {
        hn(U, Pi(Kn(U))) && V().length === 0 && !O && Un(oe);
        const fe = Y(), ae = Ao(oe);
        C.current[0] === "reference" && ae === S && (Un(oe), oe.shiftKey ? xa(fe[fe.length - 1]) : xa(fe[1])), C.current[1] === "floating" && ae === U && oe.shiftKey && (Un(oe), xa(fe[0]));
      }
    }
    const ce = Kn(U);
    return ce.addEventListener("keydown", re), () => {
      ce.removeEventListener("keydown", re);
    };
  }, [r, S, U, c, C, O, V, Y]), react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    if (r || !A) return;
    function re(ce) {
      const oe = Ao(ce), ae = V().indexOf(oe);
      ae !== -1 && (z.current = ae);
    }
    return A.addEventListener("focusin", re), () => {
      A.removeEventListener("focusin", re);
    };
  }, [r, A, V]), react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    if (r || !d) return;
    function re() {
      W.current = !0, setTimeout(() => {
        W.current = !1;
      });
    }
    function ce(oe) {
      const fe = oe.relatedTarget;
      queueMicrotask(() => {
        const ae = !(hn(S, fe) || hn(A, fe) || hn(fe, A) || hn(N == null ? void 0 : N.portalNode, fe) || fe != null && fe.hasAttribute(js("focus-guard")) || $ && (Cs($.nodesRef.current, y).find((ee) => {
          var se, ge;
          return hn((se = ee.context) == null ? void 0 : se.elements.floating, fe) || hn((ge = ee.context) == null ? void 0 : ge.elements.domReference, fe);
        }) || RG($.nodesRef.current, y).find((ee) => {
          var se, ge;
          return ((se = ee.context) == null ? void 0 : se.elements.floating) === fe || ((ge = ee.context) == null ? void 0 : ge.elements.domReference) === fe;
        })));
        if (l && ae && Pi(Kn(U)) === Kn(U).body) {
          pn(U) && U.focus();
          const ee = z.current, se = V(), ge = se[ee] || se[se.length - 1] || U;
          pn(ge) && ge.focus();
        }
        (O || !c) && fe && ae && !W.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
        fe !== LT() && (F.current = !0, g(!1, oe, "focus-out"));
      });
    }
    if (A && pn(S))
      return S.addEventListener("focusout", ce), S.addEventListener("pointerdown", re), A.addEventListener("focusout", ce), () => {
        S.removeEventListener("focusout", ce), S.removeEventListener("pointerdown", re), A.removeEventListener("focusout", ce);
      };
  }, [r, S, A, U, c, y, $, N, g, d, l, V, O]), react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    var re;
    if (r) return;
    const ce = Array.from((N == null || (re = N.portalNode) == null ? void 0 : re.querySelectorAll("[" + js("portal") + "]")) || []);
    if (A) {
      const oe = [A, ...ce, D.current, j.current, C.current.includes("reference") || O ? S : null].filter((ae) => ae != null), fe = c || O ? $T(oe, P, !P) : $T(oe);
      return () => {
        fe();
      };
    }
  }, [r, S, A, c, C, N, O, P]), Nt(() => {
    if (r || !pn(U)) return;
    const re = Kn(U), ce = Pi(re);
    queueMicrotask(() => {
      const oe = Y(U), fe = k.current, ae = (typeof fe == "number" ? oe[fe] : fe.current) || U, ee = hn(U, ce);
      !_ && !ee && p && xa(ae, {
        preventScroll: ae === U
      });
    });
  }, [r, p, U, _, Y, k]), Nt(() => {
    if (r || !U) return;
    let re = !1;
    const ce = Kn(U), oe = Pi(ce);
    let ae = x.current.openEvent;
    Zv(oe);
    function ee(X) {
      let {
        open: $e,
        reason: de,
        event: ke,
        nested: it
      } = X;
      $e && (ae = ke), de === "escape-key" && m.domReference.current && Zv(m.domReference.current), de === "hover" && ke.type === "mouseleave" && (F.current = !0), de === "outside-press" && (it ? (F.current = !1, re = !0) : F.current = !(lD(ke) || e1(ke)));
    }
    v.on("openchange", ee);
    const se = ce.createElement("span");
    se.setAttribute("tabindex", "-1"), se.setAttribute("aria-hidden", "true"), Object.assign(se.style, cg), H && S && S.insertAdjacentElement("afterend", se);
    function ge() {
      return typeof I.current == "boolean" ? LT() || se : I.current.current || se;
    }
    return () => {
      v.off("openchange", ee);
      const X = Pi(ce), $e = hn(A, X) || $ && Cs($.nodesRef.current, y).some((it) => {
        var lt;
        return hn((lt = it.context) == null ? void 0 : lt.elements.floating, X);
      });
      ($e || ae && ["click", "mousedown"].includes(ae.type)) && m.domReference.current && Zv(m.domReference.current);
      const ke = ge();
      queueMicrotask(() => {
        // eslint-disable-next-line react-hooks/exhaustive-deps
        I.current && !F.current && pn(ke) && // If the focus moved somewhere else after mount, avoid returning focus
        // since it likely entered a different element which should be
        // respected: https://github.com/floating-ui/floating-ui/issues/2607
        (!(ke !== X && X !== ce.body) || $e) && ke.focus({
          preventScroll: re
        }), se.remove();
      });
    };
  }, [r, A, U, I, x, m, v, $, y, H, S]), react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    queueMicrotask(() => {
      F.current = !1;
    });
  }, [r]), Nt(() => {
    if (!r && N)
      return N.setFocusManagerState({
        modal: c,
        closeOnFocusOut: d,
        open: p,
        onOpenChange: g,
        refs: m
      }), () => {
        N.setFocusManagerState(null);
      };
  }, [r, N, c, p, g, m, d]), Nt(() => {
    if (r || !U || typeof MutationObserver != "function" || _) return;
    const re = () => {
      const oe = U.getAttribute("tabindex"), fe = V(), ae = Pi(Kn(A)), ee = fe.indexOf(ae);
      ee !== -1 && (z.current = ee), C.current.includes("floating") || ae !== m.domReference.current && fe.length === 0 ? oe !== "0" && U.setAttribute("tabindex", "0") : oe !== "-1" && U.setAttribute("tabindex", "-1");
    };
    re();
    const ce = new MutationObserver(re);
    return ce.observe(U, {
      childList: !0,
      subtree: !0,
      attributes: !0
    }), () => {
      ce.disconnect();
    };
  }, [r, A, U, m, C, V, _]);
  function Q(re) {
    return r || !f || !c ? null : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(UG, {
      ref: re === "start" ? D : j,
      onClick: (ce) => g(!1, ce.nativeEvent)
    }, typeof f == "string" ? f : "Dismiss");
  }
  const ne = !r && P && (c ? !O : !0) && (H || c);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, ne && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(xp, {
    "data-type": "inside",
    ref: N == null ? void 0 : N.beforeInsideRef,
    onFocus: (re) => {
      if (c) {
        const oe = Y();
        xa(i[0] === "reference" ? oe[0] : oe[oe.length - 1]);
      } else if (N != null && N.preserveTabOrder && N.portalNode)
        if (F.current = !1, Hu(re, N.portalNode)) {
          const oe = PD() || S;
          oe == null || oe.focus();
        } else {
          var ce;
          (ce = N.beforeOutsideRef.current) == null || ce.focus();
        }
    }
  }), !O && Q("start"), n, Q("end"), ne && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(xp, {
    "data-type": "inside",
    ref: N == null ? void 0 : N.afterInsideRef,
    onFocus: (re) => {
      if (c)
        xa(Y()[0]);
      else if (N != null && N.preserveTabOrder && N.portalNode)
        if (d && (F.current = !0), Hu(re, N.portalNode)) {
          const oe = CD() || S;
          oe == null || oe.focus();
        } else {
          var ce;
          (ce = N.afterOutsideRef.current) == null || ce.focus();
        }
    }
  }));
}
function BT(e) {
  return pn(e.target) && e.target.tagName === "BUTTON";
}
function FT(e) {
  return n1(e);
}
function c1(e, t) {
  t === void 0 && (t = {});
  const {
    open: n,
    onOpenChange: r,
    dataRef: i,
    elements: {
      domReference: o
    }
  } = e, {
    enabled: a = !0,
    event: s = "click",
    toggle: l = !0,
    ignoreMouse: c = !1,
    keyboardHandlers: f = !0,
    stickIfOpen: d = !0
  } = t, p = react__WEBPACK_IMPORTED_MODULE_1__.useRef(), m = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!1), y = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    onPointerDown(g) {
      p.current = g.pointerType;
    },
    onMouseDown(g) {
      const v = p.current;
      g.button === 0 && s !== "click" && (uf(v, !0) && c || (n && l && (!(i.current.openEvent && d) || i.current.openEvent.type === "mousedown") ? r(!1, g.nativeEvent, "click") : (g.preventDefault(), r(!0, g.nativeEvent, "click"))));
    },
    onClick(g) {
      const v = p.current;
      if (s === "mousedown" && p.current) {
        p.current = void 0;
        return;
      }
      uf(v, !0) && c || (n && l && (!(i.current.openEvent && d) || i.current.openEvent.type === "click") ? r(!1, g.nativeEvent, "click") : r(!0, g.nativeEvent, "click"));
    },
    onKeyDown(g) {
      p.current = void 0, !(g.defaultPrevented || !f || BT(g)) && (g.key === " " && !FT(o) && (g.preventDefault(), m.current = !0), g.key === "Enter" && r(!(n && l), g.nativeEvent, "click"));
    },
    onKeyUp(g) {
      g.defaultPrevented || !f || BT(g) || FT(o) || g.key === " " && m.current && (m.current = !1, r(!(n && l), g.nativeEvent, "click"));
    }
  }), [i, o, s, c, f, r, n, d, l]);
  return react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => a ? {
    reference: y
  } : {}, [a, y]);
}
const KG = {
  pointerdown: "onPointerDown",
  mousedown: "onMouseDown",
  click: "onClick"
}, GG = {
  pointerdown: "onPointerDownCapture",
  mousedown: "onMouseDownCapture",
  click: "onClickCapture"
}, WT = (e) => {
  var t, n;
  return {
    escapeKey: typeof e == "boolean" ? e : (t = e == null ? void 0 : e.escapeKey) != null ? t : !1,
    outsidePress: typeof e == "boolean" ? e : (n = e == null ? void 0 : e.outsidePress) != null ? n : !0
  };
};
function fg(e, t) {
  t === void 0 && (t = {});
  const {
    open: n,
    onOpenChange: r,
    elements: i,
    dataRef: o
  } = e, {
    enabled: a = !0,
    escapeKey: s = !0,
    outsidePress: l = !0,
    outsidePressEvent: c = "pointerdown",
    referencePress: f = !1,
    referencePressEvent: d = "pointerdown",
    ancestorScroll: p = !1,
    bubbles: m,
    capture: y
  } = t, g = ud(), v = Nn(typeof l == "function" ? l : () => !1), x = typeof l == "function" ? v : l, w = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!1), S = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!1), {
    escapeKey: A,
    outsidePress: _
  } = WT(m), {
    escapeKey: O,
    outsidePress: P
  } = WT(y), C = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!1), k = Nn((F) => {
    var W;
    if (!n || !a || !s || F.key !== "Escape" || C.current)
      return;
    const z = (W = o.current.floatingContext) == null ? void 0 : W.nodeId, H = g ? Cs(g.nodesRef.current, z) : [];
    if (!A && (F.stopPropagation(), H.length > 0)) {
      let U = !0;
      if (H.forEach((V) => {
        var Y;
        if ((Y = V.context) != null && Y.open && !V.context.dataRef.current.__escapeKeyBubbles) {
          U = !1;
          return;
        }
      }), !U)
        return;
    }
    r(!1, gK(F) ? F.nativeEvent : F, "escape-key");
  }), I = Nn((F) => {
    var W;
    const z = () => {
      var H;
      k(F), (H = Ao(F)) == null || H.removeEventListener("keydown", z);
    };
    (W = Ao(F)) == null || W.addEventListener("keydown", z);
  }), $ = Nn((F) => {
    var W;
    const z = w.current;
    w.current = !1;
    const H = S.current;
    if (S.current = !1, c === "click" && H || z || typeof x == "function" && !x(F))
      return;
    const U = Ao(F), V = "[" + js("inert") + "]", Y = Kn(i.floating).querySelectorAll(V);
    let Q = Ct(U) ? U : null;
    for (; Q && !Da(Q); ) {
      const oe = Fo(Q);
      if (Da(oe) || !Ct(oe))
        break;
      Q = oe;
    }
    if (Y.length && Ct(U) && !yK(U) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
    !hn(U, i.floating) && // If the target root element contains none of the markers, then the
    // element was injected after the floating element rendered.
    Array.from(Y).every((oe) => !hn(Q, oe)))
      return;
    if (pn(U) && j) {
      const oe = U.clientWidth > 0 && U.scrollWidth > U.clientWidth, fe = U.clientHeight > 0 && U.scrollHeight > U.clientHeight;
      let ae = fe && F.offsetX > U.clientWidth;
      if (fe && Hr(U).direction === "rtl" && (ae = F.offsetX <= U.offsetWidth - U.clientWidth), ae || oe && F.offsetY > U.clientHeight)
        return;
    }
    const ne = (W = o.current.floatingContext) == null ? void 0 : W.nodeId, re = g && Cs(g.nodesRef.current, ne).some((oe) => {
      var fe;
      return Hv(F, (fe = oe.context) == null ? void 0 : fe.elements.floating);
    });
    if (Hv(F, i.floating) || Hv(F, i.domReference) || re)
      return;
    const ce = g ? Cs(g.nodesRef.current, ne) : [];
    if (ce.length > 0) {
      let oe = !0;
      if (ce.forEach((fe) => {
        var ae;
        if ((ae = fe.context) != null && ae.open && !fe.context.dataRef.current.__outsidePressBubbles) {
          oe = !1;
          return;
        }
      }), !oe)
        return;
    }
    r(!1, F, "outside-press");
  }), N = Nn((F) => {
    var W;
    const z = () => {
      var H;
      $(F), (H = Ao(F)) == null || H.removeEventListener(c, z);
    };
    (W = Ao(F)) == null || W.addEventListener(c, z);
  });
  react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    if (!n || !a)
      return;
    o.current.__escapeKeyBubbles = A, o.current.__outsidePressBubbles = _;
    let F = -1;
    function W(Y) {
      r(!1, Y, "ancestor-scroll");
    }
    function z() {
      window.clearTimeout(F), C.current = !0;
    }
    function H() {
      F = window.setTimeout(
        () => {
          C.current = !1;
        },
        // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
        // Only apply to WebKit for the test to remain 0ms.
        tg() ? 5 : 0
      );
    }
    const U = Kn(i.floating);
    s && (U.addEventListener("keydown", O ? I : k, O), U.addEventListener("compositionstart", z), U.addEventListener("compositionend", H)), x && U.addEventListener(c, P ? N : $, P);
    let V = [];
    return p && (Ct(i.domReference) && (V = Ca(i.domReference)), Ct(i.floating) && (V = V.concat(Ca(i.floating))), !Ct(i.reference) && i.reference && i.reference.contextElement && (V = V.concat(Ca(i.reference.contextElement)))), V = V.filter((Y) => {
      var Q;
      return Y !== ((Q = U.defaultView) == null ? void 0 : Q.visualViewport);
    }), V.forEach((Y) => {
      Y.addEventListener("scroll", W, {
        passive: !0
      });
    }), () => {
      s && (U.removeEventListener("keydown", O ? I : k, O), U.removeEventListener("compositionstart", z), U.removeEventListener("compositionend", H)), x && U.removeEventListener(c, P ? N : $, P), V.forEach((Y) => {
        Y.removeEventListener("scroll", W);
      }), window.clearTimeout(F);
    };
  }, [o, i, s, x, c, n, r, p, a, A, _, k, O, I, $, P, N]), react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    w.current = !1;
  }, [x, c]);
  const D = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    onKeyDown: k,
    [KG[d]]: (F) => {
      f && r(!1, F.nativeEvent, "reference-press");
    }
  }), [k, r, f, d]), j = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    onKeyDown: k,
    onMouseDown() {
      S.current = !0;
    },
    onMouseUp() {
      S.current = !0;
    },
    [GG[c]]: () => {
      w.current = !0;
    }
  }), [k, c]);
  return react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => a ? {
    reference: D,
    floating: j
  } : {}, [a, D, j]);
}
function YG(e) {
  const {
    open: t = !1,
    onOpenChange: n,
    elements: r
  } = e, i = sg(), o = react__WEBPACK_IMPORTED_MODULE_1__.useRef({}), [a] = react__WEBPACK_IMPORTED_MODULE_1__.useState(() => NG()), s = lg() != null;
  if (true) {
    const m = r.reference;
    m && !Ct(m) && kG("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
  }
  const [l, c] = react__WEBPACK_IMPORTED_MODULE_1__.useState(r.reference), f = Nn((m, y, g) => {
    o.current.openEvent = m ? y : void 0, a.emit("openchange", {
      open: m,
      event: y,
      reason: g,
      nested: s
    }), n == null || n(m, y, g);
  }), d = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    setPositionReference: c
  }), []), p = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    reference: l || r.reference || null,
    floating: r.floating || null,
    domReference: r.reference
  }), [l, r.reference, r.floating]);
  return react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    dataRef: o,
    open: t,
    onOpenChange: f,
    elements: p,
    events: a,
    floatingId: i,
    refs: d
  }), [t, f, p, a, i, d]);
}
function dg(e) {
  e === void 0 && (e = {});
  const {
    nodeId: t
  } = e, n = YG({
    ...e,
    elements: {
      reference: null,
      floating: null,
      ...e.elements
    }
  }), r = e.rootContext || n, i = r.elements, [o, a] = react__WEBPACK_IMPORTED_MODULE_1__.useState(null), [s, l] = react__WEBPACK_IMPORTED_MODULE_1__.useState(null), f = (i == null ? void 0 : i.domReference) || o, d = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null), p = ud();
  Nt(() => {
    f && (d.current = f);
  }, [f]);
  const m = vG({
    ...e,
    elements: {
      ...i,
      ...s && {
        reference: s
      }
    }
  }), y = react__WEBPACK_IMPORTED_MODULE_1__.useCallback((S) => {
    const A = Ct(S) ? {
      getBoundingClientRect: () => S.getBoundingClientRect(),
      contextElement: S
    } : S;
    l(A), m.refs.setReference(A);
  }, [m.refs]), g = react__WEBPACK_IMPORTED_MODULE_1__.useCallback((S) => {
    (Ct(S) || S === null) && (d.current = S, a(S)), (Ct(m.refs.reference.current) || m.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
    // `null` to support `positionReference` + an unstable `reference`
    // callback ref.
    S !== null && !Ct(S)) && m.refs.setReference(S);
  }, [m.refs]), v = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    ...m.refs,
    setReference: g,
    setPositionReference: y,
    domReference: d
  }), [m.refs, g, y]), x = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    ...m.elements,
    domReference: f
  }), [m.elements, f]), w = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    ...m,
    ...r,
    refs: v,
    elements: x,
    nodeId: t
  }), [m, v, x, t, r]);
  return Nt(() => {
    r.dataRef.current.floatingContext = w;
    const S = p == null ? void 0 : p.nodesRef.current.find((A) => A.id === t);
    S && (S.context = w);
  }), react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    ...m,
    context: w,
    refs: v,
    elements: x
  }), [m, v, x, w]);
}
function qG(e, t) {
  t === void 0 && (t = {});
  const {
    open: n,
    onOpenChange: r,
    events: i,
    dataRef: o,
    elements: a
  } = e, {
    enabled: s = !0,
    visibleOnly: l = !0
  } = t, c = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!1), f = react__WEBPACK_IMPORTED_MODULE_1__.useRef(), d = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!0);
  react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    if (!s) return;
    const m = Or(a.domReference);
    function y() {
      !n && pn(a.domReference) && a.domReference === Pi(Kn(a.domReference)) && (c.current = !0);
    }
    function g() {
      d.current = !0;
    }
    return m.addEventListener("blur", y), m.addEventListener("keydown", g, !0), () => {
      m.removeEventListener("blur", y), m.removeEventListener("keydown", g, !0);
    };
  }, [a.domReference, n, s]), react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    if (!s) return;
    function m(y) {
      let {
        reason: g
      } = y;
      (g === "reference-press" || g === "escape-key") && (c.current = !0);
    }
    return i.on("openchange", m), () => {
      i.off("openchange", m);
    };
  }, [i, s]), react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => () => {
    clearTimeout(f.current);
  }, []);
  const p = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    onPointerDown(m) {
      e1(m.nativeEvent) || (d.current = !1);
    },
    onMouseLeave() {
      c.current = !1;
    },
    onFocus(m) {
      if (c.current) return;
      const y = Ao(m.nativeEvent);
      if (l && Ct(y))
        try {
          if (t1() && cD()) throw Error();
          if (!y.matches(":focus-visible")) return;
        } catch {
          if (!d.current && !n1(y))
            return;
        }
      r(!0, m.nativeEvent, "focus");
    },
    onBlur(m) {
      c.current = !1;
      const y = m.relatedTarget, g = m.nativeEvent, v = Ct(y) && y.hasAttribute(js("focus-guard")) && y.getAttribute("data-type") === "outside";
      f.current = window.setTimeout(() => {
        var x;
        const w = Pi(a.domReference ? a.domReference.ownerDocument : document);
        !y && w === a.domReference || hn((x = o.current.floatingContext) == null ? void 0 : x.refs.floating.current, w) || hn(a.domReference, w) || v || r(!1, g, "focus");
      });
    }
  }), [o, a.domReference, r, l]);
  return react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => s ? {
    reference: p
  } : {}, [s, p]);
}
const zT = "active", VT = "selected";
function Jv(e, t, n) {
  const r = /* @__PURE__ */ new Map(), i = n === "item";
  let o = e;
  if (i && e) {
    const {
      [zT]: a,
      [VT]: s,
      ...l
    } = e;
    o = l;
  }
  return {
    ...n === "floating" && {
      tabIndex: -1,
      [b0]: ""
    },
    ...o,
    ...t.map((a) => {
      const s = a ? a[n] : null;
      return typeof s == "function" ? e ? s(e) : null : s;
    }).concat(e).reduce((a, s) => (s && Object.entries(s).forEach((l) => {
      let [c, f] = l;
      if (!(i && [zT, VT].includes(c)))
        if (c.indexOf("on") === 0) {
          if (r.has(c) || r.set(c, []), typeof f == "function") {
            var d;
            (d = r.get(c)) == null || d.push(f), a[c] = function() {
              for (var p, m = arguments.length, y = new Array(m), g = 0; g < m; g++)
                y[g] = arguments[g];
              return (p = r.get(c)) == null ? void 0 : p.map((v) => v(...y)).find((v) => v !== void 0);
            };
          }
        } else
          a[c] = f;
    }), a), {})
  };
}
function hg(e) {
  e === void 0 && (e = []);
  const t = e.map((s) => s == null ? void 0 : s.reference), n = e.map((s) => s == null ? void 0 : s.floating), r = e.map((s) => s == null ? void 0 : s.item), i = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(
    (s) => Jv(s, e, "reference"),
    // eslint-disable-next-line react-hooks/exhaustive-deps
    t
  ), o = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(
    (s) => Jv(s, e, "floating"),
    // eslint-disable-next-line react-hooks/exhaustive-deps
    n
  ), a = react__WEBPACK_IMPORTED_MODULE_1__.useCallback(
    (s) => Jv(s, e, "item"),
    // eslint-disable-next-line react-hooks/exhaustive-deps
    r
  );
  return react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    getReferenceProps: i,
    getFloatingProps: o,
    getItemProps: a
  }), [i, o, a]);
}
let UT = !1;
function pg(e, t, n) {
  switch (e) {
    case "vertical":
      return t;
    case "horizontal":
      return n;
    default:
      return t || n;
  }
}
function HT(e, t) {
  return pg(t, e === l1 || e === cd, e === Ea || e === ka);
}
function Qv(e, t, n) {
  return pg(t, e === cd, n ? e === Ea : e === ka) || e === "Enter" || e === " " || e === "";
}
function XG(e, t, n) {
  return pg(t, n ? e === Ea : e === ka, e === cd);
}
function KT(e, t, n) {
  return pg(t, n ? e === ka : e === Ea, e === l1);
}
function ZG(e, t) {
  const {
    open: n,
    onOpenChange: r,
    elements: i
  } = e, {
    listRef: o,
    activeIndex: a,
    onNavigate: s = () => {
    },
    enabled: l = !0,
    selectedIndex: c = null,
    allowEscape: f = !1,
    loop: d = !1,
    nested: p = !1,
    rtl: m = !1,
    virtual: y = !1,
    focusItemOnOpen: g = "auto",
    focusItemOnHover: v = !0,
    openOnArrowKeyDown: x = !0,
    disabledIndices: w = void 0,
    orientation: S = "vertical",
    cols: A = 1,
    scrollItemIntoView: _ = !0,
    virtualItemRef: O,
    itemSizes: P,
    dense: C = !1
  } = t;
   true && (f && (d || op("`useListNavigation` looping must be enabled to allow escaping."), y || op("`useListNavigation` must be virtual to allow escaping.")), S === "vertical" && A > 1 && op("In grid list navigation mode (`cols` > 1), the `orientation` should", 'be either "horizontal" or "both".'));
  const k = MD(i.floating), I = Yn(k), $ = lg(), N = ud(), D = Nn(s), j = m0(i.domReference), F = react__WEBPACK_IMPORTED_MODULE_1__.useRef(g), W = react__WEBPACK_IMPORTED_MODULE_1__.useRef(c ?? -1), z = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null), H = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!0), U = react__WEBPACK_IMPORTED_MODULE_1__.useRef(D), V = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!!i.floating), Y = react__WEBPACK_IMPORTED_MODULE_1__.useRef(n), Q = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!1), ne = react__WEBPACK_IMPORTED_MODULE_1__.useRef(!1), re = Yn(w), ce = Yn(n), oe = Yn(_), fe = Yn(c), [ae, ee] = react__WEBPACK_IMPORTED_MODULE_1__.useState(), [se, ge] = react__WEBPACK_IMPORTED_MODULE_1__.useState(), X = Nn(function(Ie, ct, Oe) {
    Oe === void 0 && (Oe = !1);
    function Ge(mt) {
      y ? (ee(mt.id), N == null || N.events.emit("virtualfocus", mt), O && (O.current = mt)) : xa(mt, {
        preventScroll: !0,
        // Mac Safari does not move the virtual cursor unless the focus call
        // is sync. However, for the very first focus call, we need to wait
        // for the position to be ready in order to prevent unwanted
        // scrolling. This means the virtual cursor will not move to the first
        // item when first opening the floating element, but will on
        // subsequent calls. `preventScroll` is supported in modern Safari,
        // so we can use that instead.
        // iOS Safari must be async or the first item will not be focused.
        sync: cD() && t1() ? UT || Q.current : !1
      });
    }
    const Zt = Ie.current[ct.current];
    Zt && Ge(Zt), requestAnimationFrame(() => {
      const mt = Ie.current[ct.current] || Zt;
      if (!mt) return;
      Zt || Ge(mt);
      const en = oe.current;
      en && de && (Oe || !H.current) && (mt.scrollIntoView == null || mt.scrollIntoView(typeof en == "boolean" ? {
        block: "nearest",
        inline: "nearest"
      } : en));
    });
  });
  Nt(() => {
    document.createElement("div").focus({
      get preventScroll() {
        return UT = !0, !1;
      }
    });
  }, []), Nt(() => {
    l && (n && i.floating ? F.current && c != null && (ne.current = !0, W.current = c, D(c)) : V.current && (W.current = -1, U.current(null)));
  }, [l, n, i.floating, c, D]), Nt(() => {
    if (l && n && i.floating)
      if (a == null) {
        if (Q.current = !1, fe.current != null)
          return;
        if (V.current && (W.current = -1, X(o, W)), (!Y.current || !V.current) && F.current && (z.current != null || F.current === !0 && z.current == null)) {
          let Ie = 0;
          const ct = () => {
            o.current[0] == null ? (Ie < 2 && (Ie ? requestAnimationFrame : queueMicrotask)(ct), Ie++) : (W.current = z.current == null || Qv(z.current, S, m) || p ? Yv(o, re.current) : CT(o, re.current), z.current = null, D(W.current));
          };
          ct();
        }
      } else Uu(o, a) || (W.current = a, X(o, W, ne.current), ne.current = !1);
  }, [l, n, i.floating, a, fe, p, o, S, m, D, X, re]), Nt(() => {
    var Ie;
    if (!l || i.floating || !N || y || !V.current)
      return;
    const ct = N.nodesRef.current, Oe = (Ie = ct.find((mt) => mt.id === $)) == null || (Ie = Ie.context) == null ? void 0 : Ie.elements.floating, Ge = Pi(Kn(i.floating)), Zt = ct.some((mt) => mt.context && hn(mt.context.elements.floating, Ge));
    Oe && !Zt && H.current && Oe.focus({
      preventScroll: !0
    });
  }, [l, i.floating, N, $, y]), Nt(() => {
    if (!l || !N || !y || $) return;
    function Ie(ct) {
      ge(ct.id), O && (O.current = ct);
    }
    return N.events.on("virtualfocus", Ie), () => {
      N.events.off("virtualfocus", Ie);
    };
  }, [l, N, y, $, O]), Nt(() => {
    U.current = D, V.current = !!i.floating;
  }), Nt(() => {
    n || (z.current = null);
  }, [n]), Nt(() => {
    Y.current = n;
  }, [n]);
  const $e = a != null, de = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => {
    function Ie(Oe) {
      if (!n) return;
      const Ge = o.current.indexOf(Oe);
      Ge !== -1 && D(Ge);
    }
    return {
      onFocus(Oe) {
        let {
          currentTarget: Ge
        } = Oe;
        Ie(Ge);
      },
      onClick: (Oe) => {
        let {
          currentTarget: Ge
        } = Oe;
        return Ge.focus({
          preventScroll: !0
        });
      },
      // Safari
      ...v && {
        onMouseMove(Oe) {
          let {
            currentTarget: Ge
          } = Oe;
          Ie(Ge);
        },
        onPointerLeave(Oe) {
          let {
            pointerType: Ge
          } = Oe;
          !H.current || Ge === "touch" || (W.current = -1, X(o, W), D(null), y || xa(I.current, {
            preventScroll: !0
          }));
        }
      }
    };
  }, [n, I, X, v, o, D, y]), ke = Nn((Ie) => {
    if (H.current = !1, Q.current = !0, Ie.which === 229 || !ce.current && Ie.currentTarget === I.current)
      return;
    if (p && KT(Ie.key, S, m)) {
      Un(Ie), r(!1, Ie.nativeEvent, "list-navigation"), pn(i.domReference) && (y ? N == null || N.events.emit("virtualfocus", i.domReference) : i.domReference.focus());
      return;
    }
    const ct = W.current, Oe = Yv(o, w), Ge = CT(o, w);
    if (j || (Ie.key === "Home" && (Un(Ie), W.current = Oe, D(W.current)), Ie.key === "End" && (Un(Ie), W.current = Ge, D(W.current))), A > 1) {
      const Zt = P || Array.from({
        length: o.current.length
      }, () => ({
        width: 1,
        height: 1
      })), mt = OG(Zt, A, C), en = mt.findIndex((yn) => yn != null && !ip(o.current, yn, w)), Yr = mt.reduce((yn, mr, tt) => mr != null && !ip(o.current, mr, w) ? tt : yn, -1), Cn = mt[SG({
        current: mt.map((yn) => yn != null ? o.current[yn] : null)
      }, {
        event: Ie,
        orientation: S,
        loop: d,
        rtl: m,
        cols: A,
        // treat undefined (empty grid spaces) as disabled indices so we
        // don't end up in them
        disabledIndices: TG([...w || o.current.map((yn, mr) => ip(o.current, mr) ? mr : void 0), void 0], mt),
        minIndex: en,
        maxIndex: Yr,
        prevIndex: AG(
          W.current > Ge ? Oe : W.current,
          Zt,
          mt,
          A,
          // use a corner matching the edge closest to the direction
          // we're moving in so we don't end up in the same item. Prefer
          // top/left over bottom/right.
          Ie.key === cd ? "bl" : Ie.key === (m ? Ea : ka) ? "tr" : "tl"
        ),
        stopEvent: !0
      })];
      if (Cn != null && (W.current = Cn, D(W.current)), S === "both")
        return;
    }
    if (HT(Ie.key, S)) {
      if (Un(Ie), n && !y && Pi(Ie.currentTarget.ownerDocument) === Ie.currentTarget) {
        W.current = Qv(Ie.key, S, m) ? Oe : Ge, D(W.current);
        return;
      }
      Qv(Ie.key, S, m) ? d ? W.current = ct >= Ge ? f && ct !== o.current.length ? -1 : Oe : Qn(o, {
        startingIndex: ct,
        disabledIndices: w
      }) : W.current = Math.min(Ge, Qn(o, {
        startingIndex: ct,
        disabledIndices: w
      })) : d ? W.current = ct <= Oe ? f && ct !== -1 ? o.current.length : Ge : Qn(o, {
        startingIndex: ct,
        decrement: !0,
        disabledIndices: w
      }) : W.current = Math.max(Oe, Qn(o, {
        startingIndex: ct,
        decrement: !0,
        disabledIndices: w
      })), Uu(o, W.current) ? D(null) : D(W.current);
    }
  }), it = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => y && n && $e && {
    "aria-activedescendant": se || ae
  }, [y, n, $e, se, ae]), lt = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    "aria-orientation": S === "both" ? void 0 : S,
    ...!m0(i.domReference) && it,
    onKeyDown: ke,
    onPointerMove() {
      H.current = !0;
    }
  }), [it, ke, i.domReference, S]), Xn = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => {
    function Ie(Oe) {
      g === "auto" && lD(Oe.nativeEvent) && (F.current = !0);
    }
    function ct(Oe) {
      F.current = g, g === "auto" && e1(Oe.nativeEvent) && (F.current = !0);
    }
    return {
      ...it,
      onKeyDown(Oe) {
        H.current = !1;
        const Ge = Oe.key.startsWith("Arrow"), Zt = ["Home", "End"].includes(Oe.key), mt = Ge || Zt, en = XG(Oe.key, S, m), Yr = KT(Oe.key, S, m), Cn = HT(Oe.key, S), yn = (p ? en : Cn) || Oe.key === "Enter" || Oe.key.trim() === "";
        if (y && n) {
          const St = N == null ? void 0 : N.nodesRef.current.find((qr) => qr.parentId == null), jn = N && St ? jG(N.nodesRef.current, St.id) : null;
          if (mt && jn && O) {
            const qr = new KeyboardEvent("keydown", {
              key: Oe.key,
              bubbles: !0
            });
            if (en || Yr) {
              var mr, tt;
              const lo = ((mr = jn.context) == null ? void 0 : mr.elements.domReference) === Oe.currentTarget, un = Yr && !lo ? (tt = jn.context) == null ? void 0 : tt.elements.domReference : en ? o.current.find((Pr) => (Pr == null ? void 0 : Pr.id) === ae) : null;
              un && (Un(Oe), un.dispatchEvent(qr), ge(void 0));
            }
            if ((Cn || Zt) && jn.context && jn.context.open && jn.parentId && Oe.currentTarget !== jn.context.elements.domReference) {
              var Kt;
              Un(Oe), (Kt = jn.context.elements.domReference) == null || Kt.dispatchEvent(qr);
              return;
            }
          }
          return ke(Oe);
        }
        if (!(!n && !x && Ge)) {
          if (yn && (z.current = p && Cn ? null : Oe.key), p) {
            en && (Un(Oe), n ? (W.current = Yv(o, re.current), D(W.current)) : r(!0, Oe.nativeEvent, "list-navigation"));
            return;
          }
          Cn && (c != null && (W.current = c), Un(Oe), !n && x ? r(!0, Oe.nativeEvent, "list-navigation") : ke(Oe), n && D(W.current));
        }
      },
      onFocus() {
        n && !y && D(null);
      },
      onPointerDown: ct,
      onMouseDown: Ie,
      onClick: Ie
    };
  }, [ae, it, ke, re, g, o, p, D, r, n, x, S, m, c, N, y, O]);
  return react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => l ? {
    reference: Xn,
    floating: lt,
    item: de
  } : {}, [l, Xn, lt, de]);
}
const JG = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
function u1(e, t) {
  var n;
  t === void 0 && (t = {});
  const {
    open: r,
    floatingId: i
  } = e, {
    enabled: o = !0,
    role: a = "dialog"
  } = t, s = (n = JG.get(a)) != null ? n : a, l = sg(), f = lg() != null, d = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => s === "tooltip" || a === "label" ? {
    ["aria-" + (a === "label" ? "labelledby" : "describedby")]: r ? i : void 0
  } : {
    "aria-expanded": r ? "true" : "false",
    "aria-haspopup": s === "alertdialog" ? "dialog" : s,
    "aria-controls": r ? i : void 0,
    ...s === "listbox" && {
      role: "combobox"
    },
    ...s === "menu" && {
      id: l
    },
    ...s === "menu" && f && {
      role: "menuitem"
    },
    ...a === "select" && {
      "aria-autocomplete": "none"
    },
    ...a === "combobox" && {
      "aria-autocomplete": "list"
    }
  }, [s, i, f, r, l, a]), p = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => {
    const y = {
      id: i,
      ...s && {
        role: s
      }
    };
    return s === "tooltip" || a === "label" ? y : {
      ...y,
      ...s === "menu" && {
        "aria-labelledby": l
      }
    };
  }, [s, i, l, a]), m = react__WEBPACK_IMPORTED_MODULE_1__.useCallback((y) => {
    let {
      active: g,
      selected: v
    } = y;
    const x = {
      role: "option",
      ...g && {
        id: i + "-option"
      }
    };
    switch (a) {
      case "select":
        return {
          ...x,
          "aria-selected": g && v
        };
      case "combobox":
        return {
          ...x,
          ...g && {
            "aria-selected": !0
          }
        };
    }
    return {};
  }, [i, a]);
  return react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => o ? {
    reference: d,
    floating: p,
    item: m
  } : {}, [o, d, p, m]);
}
const GT = (e) => e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (t, n) => (n ? "-" : "") + t.toLowerCase());
function wl(e, t) {
  return typeof e == "function" ? e(t) : e;
}
function QG(e, t) {
  const [n, r] = react__WEBPACK_IMPORTED_MODULE_1__.useState(e);
  return e && !n && r(!0), react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    if (!e && n) {
      const i = setTimeout(() => r(!1), t);
      return () => clearTimeout(i);
    }
  }, [e, n, t]), n;
}
function eY(e, t) {
  t === void 0 && (t = {});
  const {
    open: n,
    elements: {
      floating: r
    }
  } = e, {
    duration: i = 250
  } = t, a = (typeof i == "number" ? i : i.close) || 0, [s, l] = react__WEBPACK_IMPORTED_MODULE_1__.useState("unmounted"), c = QG(n, a);
  return !c && s === "close" && l("unmounted"), Nt(() => {
    if (r) {
      if (n) {
        l("initial");
        const f = requestAnimationFrame(() => {
          l("open");
        });
        return () => {
          cancelAnimationFrame(f);
        };
      }
      l("close");
    }
  }, [n, r]), {
    isMounted: c,
    status: s
  };
}
function ND(e, t) {
  t === void 0 && (t = {});
  const {
    initial: n = {
      opacity: 0
    },
    open: r,
    close: i,
    common: o,
    duration: a = 250
  } = t, s = e.placement, l = s.split("-")[0], c = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    side: l,
    placement: s
  }), [l, s]), f = typeof a == "number", d = (f ? a : a.open) || 0, p = (f ? a : a.close) || 0, [m, y] = react__WEBPACK_IMPORTED_MODULE_1__.useState(() => ({
    ...wl(o, c),
    ...wl(n, c)
  })), {
    isMounted: g,
    status: v
  } = eY(e, {
    duration: a
  }), x = Yn(n), w = Yn(r), S = Yn(i), A = Yn(o);
  return Nt(() => {
    const _ = wl(x.current, c), O = wl(S.current, c), P = wl(A.current, c), C = wl(w.current, c) || Object.keys(_).reduce((k, I) => (k[I] = "", k), {});
    if (v === "initial" && y((k) => ({
      transitionProperty: k.transitionProperty,
      ...P,
      ..._
    })), v === "open" && y({
      transitionProperty: Object.keys(C).map(GT).join(","),
      transitionDuration: d + "ms",
      ...P,
      ...C
    }), v === "close") {
      const k = O || _;
      y({
        transitionProperty: Object.keys(k).map(GT).join(","),
        transitionDuration: p + "ms",
        ...P,
        ...k
      });
    }
  }, [p, S, x, w, A, d, v, c]), {
    isMounted: g,
    styles: m
  };
}
function tY(e, t) {
  var n;
  const {
    open: r,
    dataRef: i
  } = e, {
    listRef: o,
    activeIndex: a,
    onMatch: s,
    onTypingChange: l,
    enabled: c = !0,
    findMatch: f = null,
    resetMs: d = 750,
    ignoreKeys: p = [],
    selectedIndex: m = null
  } = t, y = react__WEBPACK_IMPORTED_MODULE_1__.useRef(), g = react__WEBPACK_IMPORTED_MODULE_1__.useRef(""), v = react__WEBPACK_IMPORTED_MODULE_1__.useRef((n = m ?? a) != null ? n : -1), x = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null), w = Nn(s), S = Nn(l), A = Yn(f), _ = Yn(p);
  Nt(() => {
    r && (clearTimeout(y.current), x.current = null, g.current = "");
  }, [r]), Nt(() => {
    if (r && g.current === "") {
      var I;
      v.current = (I = m ?? a) != null ? I : -1;
    }
  }, [r, m, a]);
  const O = Nn((I) => {
    I ? i.current.typing || (i.current.typing = I, S(I)) : i.current.typing && (i.current.typing = I, S(I));
  }), P = Nn((I) => {
    function $(W, z, H) {
      const U = A.current ? A.current(z, H) : z.find((V) => (V == null ? void 0 : V.toLocaleLowerCase().indexOf(H.toLocaleLowerCase())) === 0);
      return U ? W.indexOf(U) : -1;
    }
    const N = o.current;
    if (g.current.length > 0 && g.current[0] !== " " && ($(N, N, g.current) === -1 ? O(!1) : I.key === " " && Un(I)), N == null || _.current.includes(I.key) || // Character key.
    I.key.length !== 1 || // Modifier key.
    I.ctrlKey || I.metaKey || I.altKey)
      return;
    r && I.key !== " " && (Un(I), O(!0)), N.every((W) => {
      var z, H;
      return W ? ((z = W[0]) == null ? void 0 : z.toLocaleLowerCase()) !== ((H = W[1]) == null ? void 0 : H.toLocaleLowerCase()) : !0;
    }) && g.current === I.key && (g.current = "", v.current = x.current), g.current += I.key, clearTimeout(y.current), y.current = setTimeout(() => {
      g.current = "", v.current = x.current, O(!1);
    }, d);
    const j = v.current, F = $(N, [...N.slice((j || 0) + 1), ...N.slice(0, (j || 0) + 1)], g.current);
    F !== -1 ? (w(F), x.current = F) : I.key !== " " && (g.current = "", O(!1));
  }), C = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    onKeyDown: P
  }), [P]), k = react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => ({
    onKeyDown: P,
    onKeyUp(I) {
      I.key === " " && O(!1);
    }
  }), [P, O]);
  return react__WEBPACK_IMPORTED_MODULE_1__.useMemo(() => c ? {
    reference: C,
    floating: k
  } : {}, [c, C, k]);
}
function YT(e, t) {
  const [n, r] = e;
  let i = !1;
  const o = t.length;
  for (let a = 0, s = o - 1; a < o; s = a++) {
    const [l, c] = t[a] || [0, 0], [f, d] = t[s] || [0, 0];
    c >= r != d >= r && n <= (f - l) * (r - c) / (d - c) + l && (i = !i);
  }
  return i;
}
function nY(e, t) {
  return e[0] >= t.x && e[0] <= t.x + t.width && e[1] >= t.y && e[1] <= t.y + t.height;
}
function rY(e) {
  e === void 0 && (e = {});
  const {
    buffer: t = 0.5,
    blockPointerEvents: n = !1,
    requireIntent: r = !0
  } = e;
  let i, o = !1, a = null, s = null, l = performance.now();
  function c(d, p) {
    const m = performance.now(), y = m - l;
    if (a === null || s === null || y === 0)
      return a = d, s = p, l = m, null;
    const g = d - a, v = p - s, w = Math.sqrt(g * g + v * v) / y;
    return a = d, s = p, l = m, w;
  }
  const f = (d) => {
    let {
      x: p,
      y: m,
      placement: y,
      elements: g,
      onClose: v,
      nodeId: x,
      tree: w
    } = d;
    return function(A) {
      function _() {
        clearTimeout(i), v();
      }
      if (clearTimeout(i), !g.domReference || !g.floating || y == null || p == null || m == null)
        return;
      const {
        clientX: O,
        clientY: P
      } = A, C = [O, P], k = Ao(A), I = A.type === "mouseleave", $ = hn(g.floating, k), N = hn(g.domReference, k), D = g.domReference.getBoundingClientRect(), j = g.floating.getBoundingClientRect(), F = y.split("-")[0], W = p > j.right - j.width / 2, z = m > j.bottom - j.height / 2, H = nY(C, D), U = j.width > D.width, V = j.height > D.height, Y = (U ? D : j).left, Q = (U ? D : j).right, ne = (V ? D : j).top, re = (V ? D : j).bottom;
      if ($ && (o = !0, !I))
        return;
      if (N && (o = !1), N && !I) {
        o = !0;
        return;
      }
      if (I && Ct(A.relatedTarget) && hn(g.floating, A.relatedTarget) || w && Cs(w.nodesRef.current, x).some((fe) => {
        let {
          context: ae
        } = fe;
        return ae == null ? void 0 : ae.open;
      }))
        return;
      if (F === "top" && m >= D.bottom - 1 || F === "bottom" && m <= D.top + 1 || F === "left" && p >= D.right - 1 || F === "right" && p <= D.left + 1)
        return _();
      let ce = [];
      switch (F) {
        case "top":
          ce = [[Y, D.top + 1], [Y, j.bottom - 1], [Q, j.bottom - 1], [Q, D.top + 1]];
          break;
        case "bottom":
          ce = [[Y, j.top + 1], [Y, D.bottom - 1], [Q, D.bottom - 1], [Q, j.top + 1]];
          break;
        case "left":
          ce = [[j.right - 1, re], [j.right - 1, ne], [D.left + 1, ne], [D.left + 1, re]];
          break;
        case "right":
          ce = [[D.right - 1, re], [D.right - 1, ne], [j.left + 1, ne], [j.left + 1, re]];
          break;
      }
      function oe(fe) {
        let [ae, ee] = fe;
        switch (F) {
          case "top": {
            const se = [U ? ae + t / 2 : W ? ae + t * 4 : ae - t * 4, ee + t + 1], ge = [U ? ae - t / 2 : W ? ae + t * 4 : ae - t * 4, ee + t + 1], X = [[j.left, W || U ? j.bottom - t : j.top], [j.right, W ? U ? j.bottom - t : j.top : j.bottom - t]];
            return [se, ge, ...X];
          }
          case "bottom": {
            const se = [U ? ae + t / 2 : W ? ae + t * 4 : ae - t * 4, ee - t], ge = [U ? ae - t / 2 : W ? ae + t * 4 : ae - t * 4, ee - t], X = [[j.left, W || U ? j.top + t : j.bottom], [j.right, W ? U ? j.top + t : j.bottom : j.top + t]];
            return [se, ge, ...X];
          }
          case "left": {
            const se = [ae + t + 1, V ? ee + t / 2 : z ? ee + t * 4 : ee - t * 4], ge = [ae + t + 1, V ? ee - t / 2 : z ? ee + t * 4 : ee - t * 4];
            return [...[[z || V ? j.right - t : j.left, j.top], [z ? V ? j.right - t : j.left : j.right - t, j.bottom]], se, ge];
          }
          case "right": {
            const se = [ae - t, V ? ee + t / 2 : z ? ee + t * 4 : ee - t * 4], ge = [ae - t, V ? ee - t / 2 : z ? ee + t * 4 : ee - t * 4], X = [[z || V ? j.left + t : j.right, j.top], [z ? V ? j.left + t : j.right : j.left + t, j.bottom]];
            return [se, ge, ...X];
          }
        }
      }
      if (!YT([O, P], ce)) {
        if (o && !H)
          return _();
        if (!I && r) {
          const fe = c(A.clientX, A.clientY);
          if (fe !== null && fe < 0.1)
            return _();
        }
        YT([O, P], oe([p, m])) ? !o && r && (i = window.setTimeout(_, 40)) : _();
      }
    };
  };
  return f.__options = {
    blockPointerEvents: n
  }, f;
}
const fd = "light", $D = "neutral", iY = "button", oY = ({
  theme: e = fd,
  variant: t = $D
}) => {
  let n = e === "light" ? "text-icon-secondary" : "text-icon-inverse";
  return n = {
    info: e === "light" ? "text-support-info" : "text-support-info-inverse",
    success: e === "light" ? "text-support-success" : "text-support-success-inverse",
    warning: e === "light" ? "text-support-warning" : "text-support-warning-inverse",
    error: e === "light" ? "text-support-error" : "text-support-error-inverse"
  }[t] || n, n;
}, wp = ({
  icon: e,
  theme: t = fd,
  variant: n = $D
}) => {
  var a;
  const r = "[&>svg]:h-5 [&>svg]:w-5", i = oY({ theme: t, variant: n });
  if (e && (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(e))
    return (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(e, {
      className: K(
        r,
        i,
        ((a = e == null ? void 0 : e.props) == null ? void 0 : a.className) ?? ""
      )
    });
  const o = {
    neutral: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(f0, { className: K(r, i) }),
    info: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(f0, { className: K(r, i) }),
    success: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(sd, { className: K(r, i) }),
    warning: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(iK, { className: K(r, i) }),
    error: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(nK, { className: K(r, i) })
  };
  return o[n] || o.neutral;
}, x0 = ({
  actionType: e = iY,
  onAction: t = () => {
  },
  actionLabel: n = "",
  theme: r = fd
}) => {
  const i = "focus:ring-0 focus:ring-offset-0 ring-offset-0 focus:outline-none";
  let o = "text-button-primary border-button-primary hover:border-button-primary hover:text-button-primary-hover";
  switch (r === "dark" && (o = "text-text-inverse border-text-inverse hover:border-text-inverse hover:text-text-inverse"), e) {
    case "button":
      return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        Hn,
        {
          variant: "outline",
          size: "xs",
          onClick: t,
          className: K(
            "rounded",
            i,
            o,
            r === "dark" ? "bg-transparent hover:bg-transparent" : "bg-white hover:bg-white"
          ),
          children: n
        }
      );
    case "link":
      return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        Hn,
        {
          variant: "link",
          size: "xs",
          onClick: t,
          className: K(i, o),
          children: n
        }
      );
    default:
      return null;
  }
}, _p = ({
  theme: e = fd,
  title: t = "",
  inline: n = !1
}) => t ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "span",
  {
    className: K(
      "block",
      {
        light: "text-text-primary",
        dark: "text-text-inverse"
      }[e],
      "text-sm leading-5 font-semibold",
      n ? "inline" : "block"
    ),
    children: t
  }
) : null, Sp = ({
  theme: e = fd,
  content: t = "",
  inline: n = !1
}) => t ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "span",
  {
    className: K(
      {
        light: "text-text-primary",
        dark: "text-text-inverse"
      }[e],
      "block text-sm [&_*]:text-sm leading-5 [&_*]:leading-5 font-normal",
      n ? "inline" : "block"
    ),
    children: t
  }
) : null, w0 = (...e) => (t) => {
  e.forEach((n) => {
    typeof n == "function" ? n(t) : n && (n.current = t);
  });
}, f1 = ({
  variant: e = "dark",
  // 'light' | 'dark';
  placement: t = "bottom",
  //  | 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
  title: n = "",
  content: r,
  arrow: i = !1,
  open: o,
  setOpen: a,
  children: s,
  className: l,
  tooltipPortalRoot: c,
  // Root element where the dropdown will be rendered.
  tooltipPortalId: f,
  // Id of the dropdown portal where the dropdown will be rendered.
  boundary: d = "clippingAncestors",
  strategy: p = "fixed",
  // 'fixed' | 'absolute';
  offset: m = 8,
  // Offset option or number value. Default is 8.
  triggers: y = ["hover", "focus"],
  // 'click' | 'hover' | 'focus';
  interactive: g = !1
}) => {
  const v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => typeof o == "boolean" && typeof a == "function",
    [o, a]
  ), [x, w] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), { refs: A, floatingStyles: _, context: O } = dg({
    open: v ? o : x,
    onOpenChange: v ? a : w,
    placement: t,
    strategy: p,
    middleware: [
      og(m),
      ag({ boundary: d }),
      // Ensure this is correctly cast
      _D({ boundary: d }),
      // Ensure this is correctly cast
      xG({ element: S })
    ],
    whileElementsMounted: ig
  }), P = c1(O, {
    enabled: !v && y.includes("click")
  }), C = IG(O, {
    move: !1,
    enabled: !v && y.includes("hover"),
    ...g && { handleClose: rY() }
  }), k = qG(O, {
    enabled: !v && y.includes("focus")
  }), I = fg(O), $ = u1(O, { role: "tooltip" }), { getReferenceProps: N, getFloatingProps: D } = hg([
    P,
    C,
    k,
    I,
    $
  ]), { isMounted: j, styles: F } = ND(O, {
    duration: 150,
    initial: { opacity: 0 },
    open: { opacity: 1 },
    close: { opacity: 0 }
  }), W = "absolute z-20 py-2 px-3 rounded-md text-xs leading-4 shadow-soft-shadow-lg", z = {
    light: "bg-tooltip-background-light text-text-primary",
    dark: "bg-tooltip-background-dark text-text-on-color"
  }[e], H = e === "dark" ? "text-tooltip-background-dark" : "text-tooltip-background-light";
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { children: [
    (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(s) && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { children: (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(s, {
      ref: w0(
        s.ref,
        A.setReference
      ),
      className: K(s.props.className),
      ...N()
    }) }, "tooltip-reference"),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ug, { id: f, root: c, children: j && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "div",
      {
        className: K(
          W,
          z,
          "max-w-80 w-fit",
          l
        ),
        ref: A.setFloating,
        style: {
          ..._,
          ...F
        },
        ...D(),
        children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [
            !!n && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              "span",
              {
                className: "font-semibold",
                children: n
              },
              "tooltip-title"
            ),
            !!r && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              "div",
              {
                className: "font-normal",
                children: r
              },
              "tooltip-content"
            )
          ] }),
          i && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            MG,
            {
              ref: S,
              context: O,
              className: K("fill-current", H)
            }
          )
        ]
      }
    ) })
  ] });
};
f1.displayName = "Tooltip";
const DD = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({}), ID = () => (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(DD), RD = ({
  children: e,
  name: t,
  style: n = "simple",
  size: r = "md",
  value: i,
  defaultValue: o,
  by: a = "id",
  as: s = "div",
  onChange: l,
  className: c,
  disableGroup: f = !1,
  vertical: d = !1,
  columns: p = 4,
  multiSelection: m = !1,
  gapClassName: y = "gap-2"
}) => {
  const g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => typeof i < "u", [i]), v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => t || `radio-button-group-${io()}`,
    [t]
  );
  let x;
  g ? x = i : m ? x = o ?? [] : x = o;
  const [w, S] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(x), A = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (P) => {
      if (m)
        S((C) => {
          const k = Array.isArray(C) && typeof P == "string" && C.includes(P);
          let I;
          return k ? I = C.filter(
            ($) => $ !== P
          ) : I = [
            ...Array.isArray(C) ? C : [],
            ...typeof P == "string" ? [P] : []
          ], typeof l == "function" && l(I), I;
        });
      else {
        if (g || S(P), typeof l != "function")
          return;
        l(P);
      }
    },
    [l]
  );
  c = K(
    "grid grid-cols-4",
    BH[p],
    y,
    n === "tile" && "gap-0",
    d && "grid-cols-1",
    c
  );
  const _ = K(
    n === "tile" ? "border border-border-subtle border-solid rounded-md shadow-sm" : "gap-6",
    c
  ), O = () => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    DD.Provider,
    {
      value: {
        name: v,
        value: g ? i : w,
        by: a,
        onChange: A,
        isControlled: g,
        disableAll: f,
        style: n,
        columns: p,
        multiSelection: m,
        size: r
      },
      children: react__WEBPACK_IMPORTED_MODULE_1__.Children.map(e, (P) => (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(P) ? P : null)
    }
  );
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: n === "tile" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: _, children: O() }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(s, { ...s === react__WEBPACK_IMPORTED_MODULE_1__.Fragment ? {} : { className: c }, children: O() }) });
};
RD.displayName = "RadioButton.Group";
const aY = ({
  id: e,
  label: t,
  value: n,
  children: r,
  disabled: i,
  icon: o = null,
  inlineIcon: a = !1,
  hideSelection: s = !1,
  reversePosition: l = !1,
  borderOn: c = !1,
  borderOnActive: f = !0,
  badgeItem: d = null,
  useSwitch: p = !1,
  info: m = void 0,
  minWidth: y = !0,
  ...g
}, v) => {
  var H, U;
  const { buttonWrapperClasses: x, ...w } = g, S = ID(), {
    name: A,
    value: _,
    by: O,
    onChange: P,
    disableAll: C,
    checked: k,
    multiSelection: I,
    size: $ = "md"
    // Default size to 'md' if not provided
  } = S, N = "primary", D = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => e || `radio-button-${io()}`, [e]), j = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => C || i,
    [C, i]
  ), F = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => I ? Array.isArray(_) && _.includes(n) : typeof k < "u" ? k : typeof _ != typeof n ? !1 : typeof _ == "string" ? _ === n : Array.isArray(_) ? _.includes(n) : _[O] === n[O], [_, n, k]), W = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(t) ? t : t != null && t.heading ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    "div",
    {
      className: K(
        !a && "space-y-1.5 mt-[2px]",
        l && (p ? "ml-10" : "ml-4"),
        a && "flex gap-2",
        a && !t.description && "items-center"
      ),
      children: [
        o && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: o }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: K("space-y-1.5"), children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            "p",
            {
              className: K(
                "text-text-primary font-medium m-0",
                sK[$],
                i && "text-text-disabled cursor-not-allowed"
              ),
              children: t.heading
            }
          ),
          t.description && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-text-tertiary text-sm font-normal leading-5 m-0", children: t.description })
        ] })
      ]
    }
  ) : null, [t]);
  if (S.style === "tile")
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      sY,
      {
        id: e,
        label: t,
        value: n,
        disabled: i,
        size: $,
        children: r
      }
    );
  const z = () => {
    j || (I ? p && P(n, !F) : P(n));
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    "label",
    {
      className: K(
        "inline-flex items-center relative cursor-pointer transition-all duration-300",
        !!t && "items-start justify-between",
        y && "min-w-[180px]",
        c && "border border-border-subtle border-solid rounded-md shadow-sm hover:ring-2 hover:ring-border-interactive",
        f && c && F && "ring-2 ring-border-interactive",
        $ === "sm" ? "px-3 py-3" : "px-4 py-4",
        "pr-12",
        j && "cursor-not-allowed opacity-40",
        x
      ),
      htmlFor: D,
      onClick: z,
      children: [
        !!t && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "label",
          {
            className: K(
              "cursor-pointer",
              j && "cursor-not-allowed"
            ),
            htmlFor: D,
            children: W()
          }
        ),
        !!m && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute mr-0.5 bottom-1.5 right-3", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(f1, { title: m == null ? void 0 : m.heading, content: m == null ? void 0 : m.description, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          f0,
          {
            className: K(
              "text-text-primary",
              (H = Uv[$]) == null ? void 0 : H.info
            )
          }
        ) }) }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
          "label",
          {
            className: K(
              "absolute mr-0.5 right-3 flex items-center cursor-pointer rounded-full gap-2",
              l && "left-0",
              j && "cursor-not-allowed",
              a && "mr-3",
              p ? wT[$].switch : wT[$].radio
            ),
            onClick: z,
            children: [
              !!d && d,
              !s && (p ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                J$,
                {
                  defaultValue: !1,
                  size: $,
                  onChange: () => {
                    I ? P(n, !F) : P(n);
                  },
                  checked: F,
                  ...w,
                  "aria-label": (t == null ? void 0 : t.heading) ?? "Switch"
                }
              ) }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "relative p-0.5", children: [
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                  "input",
                  {
                    ref: v,
                    id: D,
                    type: I ? "checkbox" : "radio",
                    className: K(
                      "peer flex relative cursor-pointer appearance-none transition-all m-0 before:content-[''] checked:before:content-[''] checked:before:hidden before:hidden !border-1.5 border-solid",
                      !I && "rounded-full",
                      bT[N].checkbox,
                      Uv[$].checkbox,
                      j && xT.checkbox
                    ),
                    name: A,
                    value: n,
                    onChange: (V) => P(V.target.value),
                    checked: F,
                    disabled: j,
                    ...w
                  }
                ),
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                  "span",
                  {
                    className: K(
                      "inline-flex items-center absolute top-2/4 left-2/4 -translate-y-2/4 -translate-x-2/4 text-white opacity-0 transition-opacity peer-checked:opacity-100",
                      bT[N].icon,
                      j && xT.icon
                    ),
                    children: I ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                      sd,
                      {
                        className: $ === "sm" ? "size-3" : "size-4"
                      }
                    ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                      "div",
                      {
                        className: K(
                          "rounded-full bg-current",
                          $ === "sm" && "mt-[0.5px]",
                          (U = Uv[$]) == null ? void 0 : U.icon
                        )
                      }
                    )
                  }
                )
              ] }))
            ]
          }
        )
      ]
    }
  );
}, _0 = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(aY);
_0.displayName = "RadioButton.Button";
const sY = ({
  id: e,
  children: t,
  value: n,
  disabled: r,
  size: i = "md",
  ...o
}) => {
  const a = ID(), {
    name: s,
    value: l,
    by: c,
    onChange: f,
    disableAll: d,
    checked: p
  } = a || {}, m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => e || `radio-button-${io()}`, [e]), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => d || r,
    [d, r]
  ), g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => typeof p < "u" ? p : typeof l != typeof n ? !1 : typeof l == "string" ? l === n : Array.isArray(l) ? l.includes(n) : l && c ? l[c] === n[c] : !1, [l, n, p, c]), v = () => {
    f && f(n);
  }, w = K(
    uK,
    fK,
    dK,
    y ? "text-text-disabled cursor-not-allowed" : "",
    lK[i],
    cK
  );
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    "button",
    {
      type: "button",
      id: m,
      "aria-label": "Radio Button",
      className: K(
        w,
        "first:rounded-tl first:rounded-bl first:border-0 first:border-r first:border-border-subtle last:rounded-tr last:rounded-br last:border-0",
        g && "bg-button-disabled"
      ),
      onClick: v,
      disabled: y,
      ...o,
      children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "input",
          {
            type: "hidden",
            value: n,
            name: s,
            checked: g,
            onChange: (S) => f == null ? void 0 : f(S.target.value)
          }
        ),
        t
      ]
    }
  ) });
}, KEe = Object.assign(_0, {
  Group: RD,
  Button: _0
}), mg = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
  ({
    label: e = "",
    size: t = "sm",
    // xxs, xs, sm, md, lg
    className: n = "",
    type: r = "pill",
    // pill, rounded
    variant: i = "neutral",
    // neutral, red, yellow, green, blue, inverse
    icon: o = null,
    disabled: a = !1,
    onClose: s = () => {
    },
    closable: l = !1,
    onMouseDown: c = () => {
    },
    disableHover: f = !1
  }, d) => {
    const p = "font-medium border-badge-border-gray flex items-center justify-center border border-solid box-border max-w-full transition-colors duration-150 ease-in-out", m = {
      xxs: "py-0.5 px-0.5 text-xs h-4",
      xs: "py-0.5 px-1 text-xs h-5",
      sm: "py-1 px-1.5 text-xs h-6",
      md: "py-1 px-1.5 text-sm h-7",
      lg: "py-1 px-1.5 text-base h-8"
    }, y = {
      pill: "rounded-full",
      rounded: "rounded"
    }, g = {
      neutral: "hover:bg-badge-hover-gray",
      red: "hover:bg-badge-hover-red",
      yellow: "hover:bg-badge-hover-yellow",
      green: "hover:bg-badge-hover-green",
      blue: "hover:bg-badge-hover-sky",
      inverse: "hover:bg-badge-hover-inverse",
      disabled: "hover:bg-badge-hover-disabled"
    }, v = {
      neutral: "bg-badge-background-gray text-badge-color-gray border-badge-border-gray",
      red: "bg-badge-background-red text-badge-color-red border-badge-border-red",
      yellow: "bg-badge-background-yellow text-badge-color-yellow border-badge-border-yellow",
      green: "bg-badge-background-green text-badge-color-green border-badge-border-green",
      blue: "bg-badge-background-sky text-badge-color-sky border-badge-border-sky",
      inverse: "bg-background-inverse text-text-inverse border-background-inverse",
      disabled: "bg-badge-background-disabled text-badge-color-disabled border-badge-border-disabled disabled cursor-not-allowed"
    };
    let x = "", w = "group relative justify-center flex items-center cursor-pointer";
    const S = {
      xxs: "[&>svg]:size-3",
      xs: "[&>svg]:size-3",
      sm: "[&>svg]:size-3",
      md: "[&>svg]:size-4",
      lg: "[&>svg]:size-5"
    };
    return a ? (x = v.disabled, w += " cursor-not-allowed disabled") : x = v[i], e ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "span",
      {
        className: K(
          p,
          m[t],
          y[r],
          "gap-0.5",
          x,
          !f && g[i],
          n
        ),
        ref: d,
        children: [
          o ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            "span",
            {
              className: K(
                "justify-center flex items-center",
                S[t]
              ),
              children: o
            }
          ) : null,
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-1 truncate inline-block", children: e }),
          l && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
            "span",
            {
              className: K(w, S[t]),
              onMouseDown: c,
              role: "button",
              tabIndex: 0,
              ...!a && {
                onClick: s
              },
              children: [
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "sr-only", children: `Remove ${e}` }),
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($a, {}),
                /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute -inset-1" })
              ]
            }
          )
        ]
      }
    ) : null;
  }
);
mg.displayName = "Badge";
const lY = ({
  id: e,
  defaultValue: t = "",
  value: n,
  size: r = "sm",
  // sm, md, lg
  className: i = "",
  disabled: o = !1,
  onChange: a = () => {
  },
  error: s = !1,
  onError: l = () => {
  },
  ...c
}, f) => {
  const d = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => e || `input-textarea-${io()}`, [e]), p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => typeof n < "u", [n]), [m, y] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(t), g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    () => p ? n : m,
    [p, n, m]
  ), v = (P) => {
    if (o)
      return;
    const C = P.target.value;
    p || y(C), typeof a == "function" && a(C);
  }, x = "py-2 rounded border border-solid border-border-subtle bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary focus:outline-none", w = {
    sm: "px-3 rounded text-xs",
    md: "px-3 rounded-md text-sm",
    lg: "px-4 rounded-lg text-base"
  }, S = o ? "hover:border-border-disabled" : "hover:border-border-strong", A = "focus:border-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2", _ = s ? "focus:border-focus-error-border focus:ring-field-color-error border-focus-error-border" : "";
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "textarea",
    {
      ref: f,
      id: d,
      className: K(
        x,
        o ? "border-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled" : "",
        w[r],
        A,
        S,
        _,
        i
      ),
      disabled: o,
      onChange: v,
      onInvalid: l,
      value: g(),
      ...c
    }
  );
}, cY = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(lY);
cY.displayName = "TextArea";
const GEe = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
  ({
    variant: e = "primary",
    size: t = "md",
    border: n = "subtle",
    src: r,
    alt: i,
    children: o,
    className: a,
    ...s
  }, l) => {
    const [c, f] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), d = r && n === "none" ? "subtle" : n, p = "rounded-full overflow-hidden flex items-center justify-center", m = {
      white: "text-text-primary bg-background-primary",
      gray: "text-text-primary bg-background-secondary",
      primary: "text-text-on-color bg-background-brand",
      "primary-light": "text-text-primary bg-brand-background-50",
      dark: "text-text-on-color bg-button-secondary"
    }[e], y = {
      xxs: "size-5 [&>svg]:size-3 text-xs",
      xs: "size-6 [&>svg]:size-4 text-sm",
      sm: "size-8 [&>svg]:size-5 text-base",
      md: "size-10 [&>svg]:size-6 text-lg",
      lg: "size-12 [&>svg]:size-12 text-lg"
    }[t], g = {
      none: "",
      subtle: "ring-1 ring-border-transparent-subtle",
      ring: "ring ring-border-subtle"
    }[d], v = r ? "object-cover object-center" : "", x = () => {
      var _, O, P;
      if (r && c) {
        if (i && typeof i == "string")
          return (_ = i == null ? void 0 : i[0]) == null ? void 0 : _.toUpperCase();
        if (o && typeof o == "string")
          return (O = o == null ? void 0 : o[0]) == null ? void 0 : O.toUpperCase();
        if (!o && !i)
          return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(oK, {});
      }
      return o ? typeof o == "string" ? (P = o == null ? void 0 : o[0]) == null ? void 0 : P.toUpperCase() : o : null;
    }, w = () => {
      f(!0);
    }, S = !r || c, A = S ? "div" : "img";
    return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
      f(!1);
    }, [r]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      A,
      {
        ref: l,
        className: K(
          p,
          S && m,
          y,
          g,
          v,
          a
        ),
        ...S ? { children: x() } : { src: r, alt: i, onError: w },
        ...s
      }
    );
  }
), uY = ({
  id: e,
  type: t = "text",
  defaultValue: n = "",
  value: r,
  size: i = "sm",
  // sm, md, lg
  className: o = "",
  disabled: a = !1,
  onChange: s = () => {
  },
  error: l = !1,
  onError: c = () => {
  },
  prefix: f = null,
  suffix: d = null,
  label: p = "",
  ...m
}, y) => {
  const g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => e || `input-${t}-${io()}`, [e]), x = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => typeof r < "u", [r]), [w, S] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(n), [A, _] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), O = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    () => x ? r : w,
    [x, r, w]
  ), P = (ae) => {
    if (a)
      return;
    let ee;
    t === "file" ? (ee = ae.target.files, ee && ee.length > 0 ? _(ee[0].name) : _(null)) : ee = ae.target.value, !x && t !== "file" && S(ee), typeof s == "function" && s(ee);
  }, C = () => {
    _(null), g.current && (g.current.value = ""), s(null);
  }, k = "bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary w-full outline outline-1 outline-border-subtle border-none transition-[color,box-shadow,outline] duration-200", I = {
    xs: "px-2 py-1 rounded",
    sm: "p-3 py-2 rounded",
    md: "p-3.5 py-2.5 rounded-md",
    lg: "p-4 py-3 rounded-lg"
  }, $ = {
    xs: "text-xs font-medium",
    sm: "text-sm font-medium",
    md: "text-sm font-medium",
    lg: "text-base font-medium"
  }, N = {
    xs: "text-xs",
    sm: "text-xs",
    md: "text-sm",
    lg: "text-base"
  }, D = {
    sm: f ? "pl-8" : "",
    md: f ? "pl-9" : "",
    lg: f ? "pl-10" : ""
  }, j = {
    sm: d ? "pr-8" : "",
    md: d ? "pr-9" : "",
    lg: d ? "pr-10" : ""
  }, F = a ? "hover:outline-border-disabled" : "hover:outline-border-strong", W = "focus:outline-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2", z = l ? "focus:outline-focus-error-border focus:ring-field-color-error outline-focus-error-border" : "", H = l ? "focus:outline-focus-error-border focus:ring-field-color-error outline-focus-error-border" : "", U = a ? "outline-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled" : "", V = a ? "outline-border-disabled cursor-not-allowed text-text-disabled file:text-text-tertiary" : "", Y = "font-normal placeholder-text-tertiary text-text-primary pointer-events-none absolute inset-y-0 flex flex-1 items-center [&>svg]:h-4 [&>svg]:w-4", Q = a ? "font-normal placeholder-text-tertiary text-icon-disabled pointer-events-none absolute inset-y-0 flex flex-1 items-center" : "font-normal placeholder-text-tertiary text-field-placeholder pointer-events-none absolute inset-y-0 flex flex-1 items-center", ne = {
    xs: "[&>svg]:size-4",
    sm: "[&>svg]:size-4",
    md: "[&>svg]:size-5",
    lg: "[&>svg]:size-6"
  }, re = () => f ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K(Y, "left-0 pl-3", N[i]), children: f }) : null, ce = () => t === "file" ? A ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        Q,
        "right-0 pr-3 cursor-pointer z-20 pointer-events-auto",
        ne[i]
      ),
      onClick: C,
      role: "button",
      tabIndex: 0,
      onKeyDown: (ae) => {
        (ae.key === "Enter" || ae.key === " ") && C();
      },
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($a, {})
    }
  ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        Q,
        "right-0 pr-3",
        ne[i]
      ),
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(vT, {})
    }
  ) : d ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K(Y, "right-0 pr-3", N[i]), children: d }) : null, oe = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => p ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    to,
    {
      className: K($[i]),
      htmlFor: v,
      ...(m == null ? void 0 : m.required) && { required: !0 },
      children: p
    }
  ) : null, [p, i, v]), fe = A ? "file:border-0 file:bg-transparent pr-10" : "text-text-tertiary file:border-0 file:bg-transparent pr-10";
  return t === "file" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-start gap-1.5 [&_*]:box-border box-border", children: [
    oe,
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "div",
      {
        className: K(
          "w-full relative flex focus-within:z-10",
          o
        ),
        children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            "input",
            {
              ref: w0(g, y),
              id: v,
              type: "file",
              className: K(
                k,
                V,
                I[i],
                N[i],
                W,
                F,
                H,
                fe
              ),
              disabled: a,
              onChange: P,
              onInvalid: c,
              ...m
            }
          ),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            "div",
            {
              className: K(
                Q,
                "right-0 pr-3",
                ne[i]
              ),
              children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(vT, {})
            }
          )
        ]
      }
    )
  ] }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-start gap-1.5 [&_*]:box-border box-border", children: [
    oe,
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "div",
      {
        className: K(
          "w-full relative flex focus-within:z-10",
          o
        ),
        children: [
          re(),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            "input",
            {
              ref: w0(g, y),
              id: v,
              type: t,
              className: K(
                k,
                U,
                I[i],
                N[i],
                D[i],
                j[i],
                W,
                F,
                z
              ),
              disabled: a,
              onChange: P,
              onInvalid: c,
              value: O(),
              ...m
            }
          ),
          ce()
        ]
      }
    )
  ] });
}, fY = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(uY);
fY.displayName = "Input";
const YEe = ({
  title: e = "",
  description: t = "",
  icon: n = null,
  iconPosition: r = "right",
  // left, right
  tag: i = "h2",
  // h1, h2, h3, h4, h5, h6
  size: o = "sm",
  // xs, sm, md, lg
  className: a = ""
}) => {
  const s = {
    xs: "gap-1 [&>svg]:size-3.5",
    sm: "gap-1 [&>svg]:size-4",
    md: "gap-1.5 [&>svg]:size-5",
    lg: "gap-1.5 [&>svg]:size-5"
  };
  if (!e)
    return null;
  const l = () => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(i, { className: K("font-semibold p-0 m-0", {
    xs: "text-base [&>*]:text-base gap-1",
    sm: "text-lg [&>*]:text-lg gap-1",
    md: "text-xl [&>*]:text-xl gap-1.5",
    lg: "text-2xl [&>*]:text-2xl gap-1.5"
  }[o]), children: e }), c = () => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "p",
    {
      className: K(
        "text-text-secondary font-normal my-0",
        {
          xs: "text-sm",
          sm: "text-sm",
          md: "text-base",
          lg: "text-base"
        }[o]
      ),
      children: t
    }
  );
  return t ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: a, children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [
      n && r === "left" && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: K("flex items-center", s[o]), children: [
        n,
        l()
      ] }),
      n && r === "right" && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: K("flex items-center", s[o]), children: [
        l(),
        n
      ] }),
      !n && l()
    ] }),
    c()
  ] }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: a, children: [
    n && r === "left" && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: K("flex items-center", s[o]), children: [
      n,
      l()
    ] }),
    n && r === "right" && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: K("flex items-center", s[o]), children: [
      l(),
      n
    ] }),
    !n && l()
  ] });
}, d1 = ({
  variant: e = "primary",
  // primary, secondary
  size: t = "md",
  // sm, md, lg, xl,
  icon: n = null,
  className: r = ""
}) => {
  const i = {
    primary: "text-brand-primary-600",
    secondary: "text-background-primary"
  }[e], o = {
    sm: "[&>svg]:size-4",
    md: "[&>svg]:size-5",
    lg: "[&>svg]:size-6",
    xl: "[&>svg]:size-8"
  }[t];
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "span",
    {
      className: K("flex", o, i, r),
      children: n || /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(QH, { className: "animate-spin shrink-0" })
    }
  );
}, qEe = ({
  progress: e = 0,
  // 0-100
  speed: t = 200,
  className: n = ""
}) => {
  let r = e;
  e < 0 && (r = 0), e > 100 && (r = 100);
  const i = `translateX(-${100 - r}%)`, o = `h-2 rounded-full bg-background-brand absolute left-0 top-0 w-full bottom-0 origin-left transition-transform duration-${t} ease-linear`;
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        "h-2 rounded-full bg-misc-progress-background overflow-hidden relative",
        n
      ),
      role: "progressbar",
      "aria-valuenow": r,
      "aria-valuemin": 0,
      "aria-valuemax": 100,
      "aria-label": "Progress Bar",
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        "div",
        {
          className: o,
          style: {
            transform: i
          }
        }
      )
    }
  );
}, jD = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({
  activeItem: null,
  onChange: () => {
  },
  size: "md",
  iconPosition: "left"
}), dY = ({
  children: e,
  activeItem: t = null,
  onChange: n,
  className: r,
  size: i = "md",
  iconPosition: o = "left"
}) => {
  const a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (l) => {
      n && n(l);
    },
    [n]
  ), s = K(
    "box-border flex border border-border-subtle border-solid rounded",
    r
  );
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: s, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    jD.Provider,
    {
      value: {
        activeItem: t,
        onChange: a,
        size: i,
        iconPosition: o
      },
      children: react__WEBPACK_IMPORTED_MODULE_1__.Children.map(e, (l, c) => {
        if (!(0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(l))
          return null;
        const f = c === 0, d = c === react__WEBPACK_IMPORTED_MODULE_1__.Children.count(e) - 1;
        return react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(l, {
          ...l.props,
          index: c,
          isFirstChild: f,
          isLastChild: d
        });
      })
    }
  ) });
}, hY = ({
  slug: e,
  text: t,
  icon: n,
  className: r,
  disabled: i = !1,
  isFirstChild: o,
  isLastChild: a,
  ...s
}, l) => {
  const c = react__WEBPACK_IMPORTED_MODULE_1__.useContext(jD);
  if (!c)
    throw new Error("Button should be used inside Button Group");
  const { activeItem: f, onChange: d, size: p, iconPosition: m } = c, y = {
    xs: "py-1 px-1 text-sm gap-0.5 [&>svg]:size-4",
    sm: "py-2 px-2 text-base gap-1 [&>svg]:size-4",
    md: "py-2.5 px-2.5 text-base gap-1 [&>svg]:size-5"
  }, g = "bg-background-primary text-primary cursor-pointer flex items-center justify-center", v = "hover:bg-button-tertiary-hover", x = "focus:outline-none", w = i ? "text-text-disabled cursor-not-allowed" : "", S = o ? "rounded-tl rounded-bl border-0 border-r border-border-subtle" : "", A = a ? "rounded-tr rounded-br border-0" : "", _ = "border-0 border-r border-border-subtle border-solid", O = f === e ? "bg-button-disabled" : "", P = K(
    g,
    v,
    x,
    w,
    y[p],
    _,
    O,
    S,
    A,
    r
  );
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    "button",
    {
      ref: l,
      className: P,
      disabled: i,
      onClick: (k) => {
        d({ event: k, value: { slug: e, text: t } });
      },
      ...s,
      children: [
        m === "left" && n && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "mr-1", children: n }),
        t,
        m === "right" && n && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-1", children: n })
      ]
    }
  );
}, LD = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(hY);
LD.displayName = "Button";
const XEe = {
  Group: dY,
  Button: LD
}, qT = /* @__PURE__ */ new Set();
function gg(e, t, n) {
  e || qT.has(t) || (console.warn(t), qT.add(t));
}
function pY(e) {
  if (typeof Proxy > "u")
    return e;
  const t = /* @__PURE__ */ new Map(), n = (...r) => ( true && gg(!1, "motion() is deprecated. Use motion.create() instead."), e(...r));
  return new Proxy(n, {
    /**
     * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
     * The prop name is passed through as `key` and we can use that to generate a `motion`
     * DOM component with that name.
     */
    get: (r, i) => i === "create" ? e : (t.has(i) || t.set(i, e(i)), t.get(i))
  });
}
function yg(e) {
  return e !== null && typeof e == "object" && typeof e.start == "function";
}
const S0 = (e) => Array.isArray(e);
function BD(e, t) {
  if (!Array.isArray(t))
    return !1;
  const n = t.length;
  if (n !== e.length)
    return !1;
  for (let r = 0; r < n; r++)
    if (t[r] !== e[r])
      return !1;
  return !0;
}
function pf(e) {
  return typeof e == "string" || Array.isArray(e);
}
function XT(e) {
  const t = [{}, {}];
  return e == null || e.values.forEach((n, r) => {
    t[0][r] = n.get(), t[1][r] = n.getVelocity();
  }), t;
}
function h1(e, t, n, r) {
  if (typeof t == "function") {
    const [i, o] = XT(r);
    t = t(n !== void 0 ? n : e.custom, i, o);
  }
  if (typeof t == "string" && (t = e.variants && e.variants[t]), typeof t == "function") {
    const [i, o] = XT(r);
    t = t(n !== void 0 ? n : e.custom, i, o);
  }
  return t;
}
function vg(e, t, n) {
  const r = e.getProps();
  return h1(r, t, n !== void 0 ? n : r.custom, e);
}
const p1 = [
  "animate",
  "whileInView",
  "whileFocus",
  "whileHover",
  "whileTap",
  "whileDrag",
  "exit"
], m1 = ["initial", ...p1], dd = [
  "transformPerspective",
  "x",
  "y",
  "z",
  "translateX",
  "translateY",
  "translateZ",
  "scale",
  "scaleX",
  "scaleY",
  "rotate",
  "rotateX",
  "rotateY",
  "rotateZ",
  "skew",
  "skewX",
  "skewY"
], Gs = new Set(dd), Gi = (e) => e * 1e3, No = (e) => e / 1e3, mY = {
  type: "spring",
  stiffness: 500,
  damping: 25,
  restSpeed: 10
}, gY = (e) => ({
  type: "spring",
  stiffness: 550,
  damping: e === 0 ? 2 * Math.sqrt(550) : 30,
  restSpeed: 10
}), yY = {
  type: "keyframes",
  duration: 0.8
}, vY = {
  type: "keyframes",
  ease: [0.25, 0.1, 0.35, 1],
  duration: 0.3
}, bY = (e, { keyframes: t }) => t.length > 2 ? yY : Gs.has(e) ? e.startsWith("scale") ? gY(t[1]) : mY : vY;
function g1(e, t) {
  return e ? e[t] || e.default || e : void 0;
}
const xY = {
  skipAnimations: !1,
  useManualTiming: !1
}, wY = (e) => e !== null;
function bg(e, { repeat: t, repeatType: n = "loop" }, r) {
  const i = e.filter(wY), o = t && n !== "loop" && t % 2 === 1 ? 0 : i.length - 1;
  return !o || r === void 0 ? i[o] : r;
}
const qn = (e) => e;
function _Y(e) {
  let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = !1, i = !1;
  const o = /* @__PURE__ */ new WeakSet();
  let a = {
    delta: 0,
    timestamp: 0,
    isProcessing: !1
  };
  function s(c) {
    o.has(c) && (l.schedule(c), e()), c(a);
  }
  const l = {
    /**
     * Schedule a process to run on the next frame.
     */
    schedule: (c, f = !1, d = !1) => {
      const m = d && r ? t : n;
      return f && o.add(c), m.has(c) || m.add(c), c;
    },
    /**
     * Cancel the provided callback from running on the next frame.
     */
    cancel: (c) => {
      n.delete(c), o.delete(c);
    },
    /**
     * Execute all schedule callbacks.
     */
    process: (c) => {
      if (a = c, r) {
        i = !0;
        return;
      }
      r = !0, [t, n] = [n, t], n.clear(), t.forEach(s), r = !1, i && (i = !1, l.process(c));
    }
  };
  return l;
}
const Eh = [
  "read",
  // Read
  "resolveKeyframes",
  // Write/Read/Write/Read
  "update",
  // Compute
  "preRender",
  // Compute
  "render",
  // Write
  "postRender"
  // Compute
], SY = 40;
function FD(e, t) {
  let n = !1, r = !0;
  const i = {
    delta: 0,
    timestamp: 0,
    isProcessing: !1
  }, o = () => n = !0, a = Eh.reduce((x, w) => (x[w] = _Y(o), x), {}), { read: s, resolveKeyframes: l, update: c, preRender: f, render: d, postRender: p } = a, m = () => {
    const x = performance.now();
    n = !1, i.delta = r ? 1e3 / 60 : Math.max(Math.min(x - i.timestamp, SY), 1), i.timestamp = x, i.isProcessing = !0, s.process(i), l.process(i), c.process(i), f.process(i), d.process(i), p.process(i), i.isProcessing = !1, n && t && (r = !1, e(m));
  }, y = () => {
    n = !0, r = !0, i.isProcessing || e(m);
  };
  return { schedule: Eh.reduce((x, w) => {
    const S = a[w];
    return x[w] = (A, _ = !1, O = !1) => (n || y(), S.schedule(A, _, O)), x;
  }, {}), cancel: (x) => {
    for (let w = 0; w < Eh.length; w++)
      a[Eh[w]].cancel(x);
  }, state: i, steps: a };
}
const { schedule: Tt, cancel: ja, state: zn, steps: eb } = FD(typeof requestAnimationFrame < "u" ? requestAnimationFrame : qn, !0), WD = (e, t, n) => (((1 - 3 * n + 3 * t) * e + (3 * n - 6 * t)) * e + 3 * t) * e, OY = 1e-7, AY = 12;
function TY(e, t, n, r, i) {
  let o, a, s = 0;
  do
    a = t + (n - t) / 2, o = WD(a, r, i) - e, o > 0 ? n = a : t = a;
  while (Math.abs(o) > OY && ++s < AY);
  return a;
}
function hd(e, t, n, r) {
  if (e === t && n === r)
    return qn;
  const i = (o) => TY(o, 0, 1, e, n);
  return (o) => o === 0 || o === 1 ? o : WD(i(o), t, r);
}
const zD = (e) => (t) => t <= 0.5 ? e(2 * t) / 2 : (2 - e(2 * (1 - t))) / 2, VD = (e) => (t) => 1 - e(1 - t), UD = /* @__PURE__ */ hd(0.33, 1.53, 0.69, 0.99), y1 = /* @__PURE__ */ VD(UD), HD = /* @__PURE__ */ zD(y1), KD = (e) => (e *= 2) < 1 ? 0.5 * y1(e) : 0.5 * (2 - Math.pow(2, -10 * (e - 1))), v1 = (e) => 1 - Math.sin(Math.acos(e)), GD = VD(v1), YD = zD(v1), qD = (e) => /^0[^.\s]+$/u.test(e);
function PY(e) {
  return typeof e == "number" ? e === 0 : e !== null ? e === "none" || e === "0" || qD(e) : !0;
}
let Ic = qn, Wo = qn;
 true && (Ic = (e, t) => {
  !e && typeof console < "u" && console.warn(t);
}, Wo = (e, t) => {
  if (!e)
    throw new Error(t);
});
const XD = (e) => /^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e), ZD = (e) => (t) => typeof t == "string" && t.startsWith(e), JD = /* @__PURE__ */ ZD("--"), CY = /* @__PURE__ */ ZD("var(--"), b1 = (e) => CY(e) ? EY.test(e.split("/*")[0].trim()) : !1, EY = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu, kY = (
  // eslint-disable-next-line redos-detector/no-unsafe-regex -- false positive, as it can match a lot of words
  /^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u
);
function MY(e) {
  const t = kY.exec(e);
  if (!t)
    return [,];
  const [, n, r, i] = t;
  return [`--${n ?? r}`, i];
}
const NY = 4;
function QD(e, t, n = 1) {
  Wo(n <= NY, `Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);
  const [r, i] = MY(e);
  if (!r)
    return;
  const o = window.getComputedStyle(t).getPropertyValue(r);
  if (o) {
    const a = o.trim();
    return XD(a) ? parseFloat(a) : a;
  }
  return b1(i) ? QD(i, t, n + 1) : i;
}
const La = (e, t, n) => n > t ? t : n < e ? e : n, Rc = {
  test: (e) => typeof e == "number",
  parse: parseFloat,
  transform: (e) => e
}, mf = {
  ...Rc,
  transform: (e) => La(0, 1, e)
}, kh = {
  ...Rc,
  default: 1
}, pd = (e) => ({
  test: (t) => typeof t == "string" && t.endsWith(e) && t.split(" ").length === 1,
  parse: parseFloat,
  transform: (t) => `${t}${e}`
}), va = /* @__PURE__ */ pd("deg"), Yi = /* @__PURE__ */ pd("%"), Be = /* @__PURE__ */ pd("px"), $Y = /* @__PURE__ */ pd("vh"), DY = /* @__PURE__ */ pd("vw"), ZT = {
  ...Yi,
  parse: (e) => Yi.parse(e) / 100,
  transform: (e) => Yi.transform(e * 100)
}, IY = /* @__PURE__ */ new Set([
  "width",
  "height",
  "top",
  "left",
  "right",
  "bottom",
  "x",
  "y",
  "translateX",
  "translateY"
]), JT = (e) => e === Rc || e === Be, QT = (e, t) => parseFloat(e.split(", ")[t]), eP = (e, t) => (n, { transform: r }) => {
  if (r === "none" || !r)
    return 0;
  const i = r.match(/^matrix3d\((.+)\)$/u);
  if (i)
    return QT(i[1], t);
  {
    const o = r.match(/^matrix\((.+)\)$/u);
    return o ? QT(o[1], e) : 0;
  }
}, RY = /* @__PURE__ */ new Set(["x", "y", "z"]), jY = dd.filter((e) => !RY.has(e));
function LY(e) {
  const t = [];
  return jY.forEach((n) => {
    const r = e.getValue(n);
    r !== void 0 && (t.push([n, r.get()]), r.set(n.startsWith("scale") ? 1 : 0));
  }), t;
}
const Ql = {
  // Dimensions
  width: ({ x: e }, { paddingLeft: t = "0", paddingRight: n = "0" }) => e.max - e.min - parseFloat(t) - parseFloat(n),
  height: ({ y: e }, { paddingTop: t = "0", paddingBottom: n = "0" }) => e.max - e.min - parseFloat(t) - parseFloat(n),
  top: (e, { top: t }) => parseFloat(t),
  left: (e, { left: t }) => parseFloat(t),
  bottom: ({ y: e }, { top: t }) => parseFloat(t) + (e.max - e.min),
  right: ({ x: e }, { left: t }) => parseFloat(t) + (e.max - e.min),
  // Transform
  x: eP(4, 13),
  y: eP(5, 14)
};
Ql.translateX = Ql.x;
Ql.translateY = Ql.y;
const eI = (e) => (t) => t.test(e), BY = {
  test: (e) => e === "auto",
  parse: (e) => e
}, tI = [Rc, Be, Yi, va, DY, $Y, BY], tP = (e) => tI.find(eI(e)), Es = /* @__PURE__ */ new Set();
let O0 = !1, A0 = !1;
function nI() {
  if (A0) {
    const e = Array.from(Es).filter((r) => r.needsMeasurement), t = new Set(e.map((r) => r.element)), n = /* @__PURE__ */ new Map();
    t.forEach((r) => {
      const i = LY(r);
      i.length && (n.set(r, i), r.render());
    }), e.forEach((r) => r.measureInitialState()), t.forEach((r) => {
      r.render();
      const i = n.get(r);
      i && i.forEach(([o, a]) => {
        var s;
        (s = r.getValue(o)) === null || s === void 0 || s.set(a);
      });
    }), e.forEach((r) => r.measureEndState()), e.forEach((r) => {
      r.suspendedScrollY !== void 0 && window.scrollTo(0, r.suspendedScrollY);
    });
  }
  A0 = !1, O0 = !1, Es.forEach((e) => e.complete()), Es.clear();
}
function rI() {
  Es.forEach((e) => {
    e.readKeyframes(), e.needsMeasurement && (A0 = !0);
  });
}
function FY() {
  rI(), nI();
}
class x1 {
  constructor(t, n, r, i, o, a = !1) {
    this.isComplete = !1, this.isAsync = !1, this.needsMeasurement = !1, this.isScheduled = !1, this.unresolvedKeyframes = [...t], this.onComplete = n, this.name = r, this.motionValue = i, this.element = o, this.isAsync = a;
  }
  scheduleResolve() {
    this.isScheduled = !0, this.isAsync ? (Es.add(this), O0 || (O0 = !0, Tt.read(rI), Tt.resolveKeyframes(nI))) : (this.readKeyframes(), this.complete());
  }
  readKeyframes() {
    const { unresolvedKeyframes: t, name: n, element: r, motionValue: i } = this;
    for (let o = 0; o < t.length; o++)
      if (t[o] === null)
        if (o === 0) {
          const a = i == null ? void 0 : i.get(), s = t[t.length - 1];
          if (a !== void 0)
            t[0] = a;
          else if (r && n) {
            const l = r.readValue(n, s);
            l != null && (t[0] = l);
          }
          t[0] === void 0 && (t[0] = s), i && a === void 0 && i.set(t[0]);
        } else
          t[o] = t[o - 1];
  }
  setFinalKeyframe() {
  }
  measureInitialState() {
  }
  renderEndStyles() {
  }
  measureEndState() {
  }
  complete() {
    this.isComplete = !0, this.onComplete(this.unresolvedKeyframes, this.finalKeyframe), Es.delete(this);
  }
  cancel() {
    this.isComplete || (this.isScheduled = !1, Es.delete(this));
  }
  resume() {
    this.isComplete || this.scheduleResolve();
  }
}
const Ku = (e) => Math.round(e * 1e5) / 1e5, w1 = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu;
function WY(e) {
  return e == null;
}
const zY = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu, _1 = (e, t) => (n) => !!(typeof n == "string" && zY.test(n) && n.startsWith(e) || t && !WY(n) && Object.prototype.hasOwnProperty.call(n, t)), iI = (e, t, n) => (r) => {
  if (typeof r != "string")
    return r;
  const [i, o, a, s] = r.match(w1);
  return {
    [e]: parseFloat(i),
    [t]: parseFloat(o),
    [n]: parseFloat(a),
    alpha: s !== void 0 ? parseFloat(s) : 1
  };
}, VY = (e) => La(0, 255, e), tb = {
  ...Rc,
  transform: (e) => Math.round(VY(e))
}, ws = {
  test: /* @__PURE__ */ _1("rgb", "red"),
  parse: /* @__PURE__ */ iI("red", "green", "blue"),
  transform: ({ red: e, green: t, blue: n, alpha: r = 1 }) => "rgba(" + tb.transform(e) + ", " + tb.transform(t) + ", " + tb.transform(n) + ", " + Ku(mf.transform(r)) + ")"
};
function UY(e) {
  let t = "", n = "", r = "", i = "";
  return e.length > 5 ? (t = e.substring(1, 3), n = e.substring(3, 5), r = e.substring(5, 7), i = e.substring(7, 9)) : (t = e.substring(1, 2), n = e.substring(2, 3), r = e.substring(3, 4), i = e.substring(4, 5), t += t, n += n, r += r, i += i), {
    red: parseInt(t, 16),
    green: parseInt(n, 16),
    blue: parseInt(r, 16),
    alpha: i ? parseInt(i, 16) / 255 : 1
  };
}
const T0 = {
  test: /* @__PURE__ */ _1("#"),
  parse: UY,
  transform: ws.transform
}, Ml = {
  test: /* @__PURE__ */ _1("hsl", "hue"),
  parse: /* @__PURE__ */ iI("hue", "saturation", "lightness"),
  transform: ({ hue: e, saturation: t, lightness: n, alpha: r = 1 }) => "hsla(" + Math.round(e) + ", " + Yi.transform(Ku(t)) + ", " + Yi.transform(Ku(n)) + ", " + Ku(mf.transform(r)) + ")"
}, er = {
  test: (e) => ws.test(e) || T0.test(e) || Ml.test(e),
  parse: (e) => ws.test(e) ? ws.parse(e) : Ml.test(e) ? Ml.parse(e) : T0.parse(e),
  transform: (e) => typeof e == "string" ? e : e.hasOwnProperty("red") ? ws.transform(e) : Ml.transform(e)
}, HY = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;
function KY(e) {
  var t, n;
  return isNaN(e) && typeof e == "string" && (((t = e.match(w1)) === null || t === void 0 ? void 0 : t.length) || 0) + (((n = e.match(HY)) === null || n === void 0 ? void 0 : n.length) || 0) > 0;
}
const oI = "number", aI = "color", GY = "var", YY = "var(", nP = "${}", qY = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
function gf(e) {
  const t = e.toString(), n = [], r = {
    color: [],
    number: [],
    var: []
  }, i = [];
  let o = 0;
  const s = t.replace(qY, (l) => (er.test(l) ? (r.color.push(o), i.push(aI), n.push(er.parse(l))) : l.startsWith(YY) ? (r.var.push(o), i.push(GY), n.push(l)) : (r.number.push(o), i.push(oI), n.push(parseFloat(l))), ++o, nP)).split(nP);
  return { values: n, split: s, indexes: r, types: i };
}
function sI(e) {
  return gf(e).values;
}
function lI(e) {
  const { split: t, types: n } = gf(e), r = t.length;
  return (i) => {
    let o = "";
    for (let a = 0; a < r; a++)
      if (o += t[a], i[a] !== void 0) {
        const s = n[a];
        s === oI ? o += Ku(i[a]) : s === aI ? o += er.transform(i[a]) : o += i[a];
      }
    return o;
  };
}
const XY = (e) => typeof e == "number" ? 0 : e;
function ZY(e) {
  const t = sI(e);
  return lI(e)(t.map(XY));
}
const Ba = {
  test: KY,
  parse: sI,
  createTransformer: lI,
  getAnimatableNone: ZY
}, JY = /* @__PURE__ */ new Set(["brightness", "contrast", "saturate", "opacity"]);
function QY(e) {
  const [t, n] = e.slice(0, -1).split("(");
  if (t === "drop-shadow")
    return e;
  const [r] = n.match(w1) || [];
  if (!r)
    return e;
  const i = n.replace(r, "");
  let o = JY.has(t) ? 1 : 0;
  return r !== n && (o *= 100), t + "(" + o + i + ")";
}
const eq = /\b([a-z-]*)\(.*?\)/gu, P0 = {
  ...Ba,
  getAnimatableNone: (e) => {
    const t = e.match(eq);
    return t ? t.map(QY).join(" ") : e;
  }
}, tq = {
  // Border props
  borderWidth: Be,
  borderTopWidth: Be,
  borderRightWidth: Be,
  borderBottomWidth: Be,
  borderLeftWidth: Be,
  borderRadius: Be,
  radius: Be,
  borderTopLeftRadius: Be,
  borderTopRightRadius: Be,
  borderBottomRightRadius: Be,
  borderBottomLeftRadius: Be,
  // Positioning props
  width: Be,
  maxWidth: Be,
  height: Be,
  maxHeight: Be,
  top: Be,
  right: Be,
  bottom: Be,
  left: Be,
  // Spacing props
  padding: Be,
  paddingTop: Be,
  paddingRight: Be,
  paddingBottom: Be,
  paddingLeft: Be,
  margin: Be,
  marginTop: Be,
  marginRight: Be,
  marginBottom: Be,
  marginLeft: Be,
  // Misc
  backgroundPositionX: Be,
  backgroundPositionY: Be
}, nq = {
  rotate: va,
  rotateX: va,
  rotateY: va,
  rotateZ: va,
  scale: kh,
  scaleX: kh,
  scaleY: kh,
  scaleZ: kh,
  skew: va,
  skewX: va,
  skewY: va,
  distance: Be,
  translateX: Be,
  translateY: Be,
  translateZ: Be,
  x: Be,
  y: Be,
  z: Be,
  perspective: Be,
  transformPerspective: Be,
  opacity: mf,
  originX: ZT,
  originY: ZT,
  originZ: Be
}, rP = {
  ...Rc,
  transform: Math.round
}, S1 = {
  ...tq,
  ...nq,
  zIndex: rP,
  size: Be,
  // SVG
  fillOpacity: mf,
  strokeOpacity: mf,
  numOctaves: rP
}, rq = {
  ...S1,
  // Color props
  color: er,
  backgroundColor: er,
  outlineColor: er,
  fill: er,
  stroke: er,
  // Border props
  borderColor: er,
  borderTopColor: er,
  borderRightColor: er,
  borderBottomColor: er,
  borderLeftColor: er,
  filter: P0,
  WebkitFilter: P0
}, O1 = (e) => rq[e];
function cI(e, t) {
  let n = O1(e);
  return n !== P0 && (n = Ba), n.getAnimatableNone ? n.getAnimatableNone(t) : void 0;
}
const iq = /* @__PURE__ */ new Set(["auto", "none", "0"]);
function oq(e, t, n) {
  let r = 0, i;
  for (; r < e.length && !i; ) {
    const o = e[r];
    typeof o == "string" && !iq.has(o) && gf(o).values.length && (i = e[r]), r++;
  }
  if (i && n)
    for (const o of t)
      e[o] = cI(n, i);
}
class uI extends x1 {
  constructor(t, n, r, i, o) {
    super(t, n, r, i, o, !0);
  }
  readKeyframes() {
    const { unresolvedKeyframes: t, element: n, name: r } = this;
    if (!n || !n.current)
      return;
    super.readKeyframes();
    for (let l = 0; l < t.length; l++) {
      let c = t[l];
      if (typeof c == "string" && (c = c.trim(), b1(c))) {
        const f = QD(c, n.current);
        f !== void 0 && (t[l] = f), l === t.length - 1 && (this.finalKeyframe = c);
      }
    }
    if (this.resolveNoneKeyframes(), !IY.has(r) || t.length !== 2)
      return;
    const [i, o] = t, a = tP(i), s = tP(o);
    if (a !== s)
      if (JT(a) && JT(s))
        for (let l = 0; l < t.length; l++) {
          const c = t[l];
          typeof c == "string" && (t[l] = parseFloat(c));
        }
      else
        this.needsMeasurement = !0;
  }
  resolveNoneKeyframes() {
    const { unresolvedKeyframes: t, name: n } = this, r = [];
    for (let i = 0; i < t.length; i++)
      PY(t[i]) && r.push(i);
    r.length && oq(t, r, n);
  }
  measureInitialState() {
    const { element: t, unresolvedKeyframes: n, name: r } = this;
    if (!t || !t.current)
      return;
    r === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = Ql[r](t.measureViewportBox(), window.getComputedStyle(t.current)), n[0] = this.measuredOrigin;
    const i = n[n.length - 1];
    i !== void 0 && t.getValue(r, i).jump(i, !1);
  }
  measureEndState() {
    var t;
    const { element: n, name: r, unresolvedKeyframes: i } = this;
    if (!n || !n.current)
      return;
    const o = n.getValue(r);
    o && o.jump(this.measuredOrigin, !1);
    const a = i.length - 1, s = i[a];
    i[a] = Ql[r](n.measureViewportBox(), window.getComputedStyle(n.current)), s !== null && this.finalKeyframe === void 0 && (this.finalKeyframe = s), !((t = this.removedTransforms) === null || t === void 0) && t.length && this.removedTransforms.forEach(([l, c]) => {
      n.getValue(l).set(c);
    }), this.resolveNoneKeyframes();
  }
}
function A1(e) {
  return typeof e == "function";
}
let ap;
function aq() {
  ap = void 0;
}
const qi = {
  now: () => (ap === void 0 && qi.set(zn.isProcessing || xY.useManualTiming ? zn.timestamp : performance.now()), ap),
  set: (e) => {
    ap = e, queueMicrotask(aq);
  }
}, iP = (e, t) => t === "zIndex" ? !1 : !!(typeof e == "number" || Array.isArray(e) || typeof e == "string" && // It's animatable if we have a string
(Ba.test(e) || e === "0") && // And it contains numbers and/or colors
!e.startsWith("url("));
function sq(e) {
  const t = e[0];
  if (e.length === 1)
    return !0;
  for (let n = 0; n < e.length; n++)
    if (e[n] !== t)
      return !0;
}
function lq(e, t, n, r) {
  const i = e[0];
  if (i === null)
    return !1;
  if (t === "display" || t === "visibility")
    return !0;
  const o = e[e.length - 1], a = iP(i, t), s = iP(o, t);
  return Ic(a === s, `You are trying to animate ${t} from "${i}" to "${o}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${o} via the \`style\` property.`), !a || !s ? !1 : sq(e) || (n === "spring" || A1(n)) && r;
}
const cq = 40;
class fI {
  constructor({ autoplay: t = !0, delay: n = 0, type: r = "keyframes", repeat: i = 0, repeatDelay: o = 0, repeatType: a = "loop", ...s }) {
    this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt = qi.now(), this.options = {
      autoplay: t,
      delay: n,
      type: r,
      repeat: i,
      repeatDelay: o,
      repeatType: a,
      ...s
    }, this.updateFinishedPromise();
  }
  /**
   * This method uses the createdAt and resolvedAt to calculate the
   * animation startTime. *Ideally*, we would use the createdAt time as t=0
   * as the following frame would then be the first frame of the animation in
   * progress, which would feel snappier.
   *
   * However, if there's a delay (main thread work) between the creation of
   * the animation and the first commited frame, we prefer to use resolvedAt
   * to avoid a sudden jump into the animation.
   */
  calcStartTime() {
    return this.resolvedAt ? this.resolvedAt - this.createdAt > cq ? this.resolvedAt : this.createdAt : this.createdAt;
  }
  /**
   * A getter for resolved data. If keyframes are not yet resolved, accessing
   * this.resolved will synchronously flush all pending keyframe resolvers.
   * This is a deoptimisation, but at its worst still batches read/writes.
   */
  get resolved() {
    return !this._resolved && !this.hasAttemptedResolve && FY(), this._resolved;
  }
  /**
   * A method to be called when the keyframes resolver completes. This method
   * will check if its possible to run the animation and, if not, skip it.
   * Otherwise, it will call initPlayback on the implementing class.
   */
  onKeyframesResolved(t, n) {
    this.resolvedAt = qi.now(), this.hasAttemptedResolve = !0;
    const { name: r, type: i, velocity: o, delay: a, onComplete: s, onUpdate: l, isGenerator: c } = this.options;
    if (!c && !lq(t, r, i, o))
      if (a)
        this.options.duration = 0;
      else {
        l == null || l(bg(t, this.options, n)), s == null || s(), this.resolveFinishedPromise();
        return;
      }
    const f = this.initPlayback(t, n);
    f !== !1 && (this._resolved = {
      keyframes: t,
      finalKeyframe: n,
      ...f
    }, this.onPostResolved());
  }
  onPostResolved() {
  }
  /**
   * Allows the returned animation to be awaited or promise-chained. Currently
   * resolves when the animation finishes at all but in a future update could/should
   * reject if its cancels.
   */
  then(t, n) {
    return this.currentFinishedPromise.then(t, n);
  }
  flatten() {
    this.options.type = "keyframes", this.options.ease = "linear";
  }
  updateFinishedPromise() {
    this.currentFinishedPromise = new Promise((t) => {
      this.resolveFinishedPromise = t;
    });
  }
}
function dI(e, t) {
  return t ? e * (1e3 / t) : 0;
}
const uq = 5;
function hI(e, t, n) {
  const r = Math.max(t - uq, 0);
  return dI(n - e(r), t - r);
}
const nb = 1e-3, fq = 0.01, oP = 10, dq = 0.05, hq = 1;
function pq({ duration: e = 800, bounce: t = 0.25, velocity: n = 0, mass: r = 1 }) {
  let i, o;
  Ic(e <= Gi(oP), "Spring duration must be 10 seconds or less");
  let a = 1 - t;
  a = La(dq, hq, a), e = La(fq, oP, No(e)), a < 1 ? (i = (c) => {
    const f = c * a, d = f * e, p = f - n, m = C0(c, a), y = Math.exp(-d);
    return nb - p / m * y;
  }, o = (c) => {
    const d = c * a * e, p = d * n + n, m = Math.pow(a, 2) * Math.pow(c, 2) * e, y = Math.exp(-d), g = C0(Math.pow(c, 2), a);
    return (-i(c) + nb > 0 ? -1 : 1) * ((p - m) * y) / g;
  }) : (i = (c) => {
    const f = Math.exp(-c * e), d = (c - n) * e + 1;
    return -nb + f * d;
  }, o = (c) => {
    const f = Math.exp(-c * e), d = (n - c) * (e * e);
    return f * d;
  });
  const s = 5 / e, l = gq(i, o, s);
  if (e = Gi(e), isNaN(l))
    return {
      stiffness: 100,
      damping: 10,
      duration: e
    };
  {
    const c = Math.pow(l, 2) * r;
    return {
      stiffness: c,
      damping: a * 2 * Math.sqrt(r * c),
      duration: e
    };
  }
}
const mq = 12;
function gq(e, t, n) {
  let r = n;
  for (let i = 1; i < mq; i++)
    r = r - e(r) / t(r);
  return r;
}
function C0(e, t) {
  return e * Math.sqrt(1 - t * t);
}
const yq = ["duration", "bounce"], vq = ["stiffness", "damping", "mass"];
function aP(e, t) {
  return t.some((n) => e[n] !== void 0);
}
function bq(e) {
  let t = {
    velocity: 0,
    stiffness: 100,
    damping: 10,
    mass: 1,
    isResolvedFromDuration: !1,
    ...e
  };
  if (!aP(e, vq) && aP(e, yq)) {
    const n = pq(e);
    t = {
      ...t,
      ...n,
      mass: 1
    }, t.isResolvedFromDuration = !0;
  }
  return t;
}
function pI({ keyframes: e, restDelta: t, restSpeed: n, ...r }) {
  const i = e[0], o = e[e.length - 1], a = { done: !1, value: i }, { stiffness: s, damping: l, mass: c, duration: f, velocity: d, isResolvedFromDuration: p } = bq({
    ...r,
    velocity: -No(r.velocity || 0)
  }), m = d || 0, y = l / (2 * Math.sqrt(s * c)), g = o - i, v = No(Math.sqrt(s / c)), x = Math.abs(g) < 5;
  n || (n = x ? 0.01 : 2), t || (t = x ? 5e-3 : 0.5);
  let w;
  if (y < 1) {
    const S = C0(v, y);
    w = (A) => {
      const _ = Math.exp(-y * v * A);
      return o - _ * ((m + y * v * g) / S * Math.sin(S * A) + g * Math.cos(S * A));
    };
  } else if (y === 1)
    w = (S) => o - Math.exp(-v * S) * (g + (m + v * g) * S);
  else {
    const S = v * Math.sqrt(y * y - 1);
    w = (A) => {
      const _ = Math.exp(-y * v * A), O = Math.min(S * A, 300);
      return o - _ * ((m + y * v * g) * Math.sinh(O) + S * g * Math.cosh(O)) / S;
    };
  }
  return {
    calculatedDuration: p && f || null,
    next: (S) => {
      const A = w(S);
      if (p)
        a.done = S >= f;
      else {
        let _ = 0;
        y < 1 && (_ = S === 0 ? Gi(m) : hI(w, S, A));
        const O = Math.abs(_) <= n, P = Math.abs(o - A) <= t;
        a.done = O && P;
      }
      return a.value = a.done ? o : A, a;
    }
  };
}
function sP({ keyframes: e, velocity: t = 0, power: n = 0.8, timeConstant: r = 325, bounceDamping: i = 10, bounceStiffness: o = 500, modifyTarget: a, min: s, max: l, restDelta: c = 0.5, restSpeed: f }) {
  const d = e[0], p = {
    done: !1,
    value: d
  }, m = (C) => s !== void 0 && C < s || l !== void 0 && C > l, y = (C) => s === void 0 ? l : l === void 0 || Math.abs(s - C) < Math.abs(l - C) ? s : l;
  let g = n * t;
  const v = d + g, x = a === void 0 ? v : a(v);
  x !== v && (g = x - d);
  const w = (C) => -g * Math.exp(-C / r), S = (C) => x + w(C), A = (C) => {
    const k = w(C), I = S(C);
    p.done = Math.abs(k) <= c, p.value = p.done ? x : I;
  };
  let _, O;
  const P = (C) => {
    m(p.value) && (_ = C, O = pI({
      keyframes: [p.value, y(p.value)],
      velocity: hI(S, C, p.value),
      // TODO: This should be passing * 1000
      damping: i,
      stiffness: o,
      restDelta: c,
      restSpeed: f
    }));
  };
  return P(0), {
    calculatedDuration: null,
    next: (C) => {
      let k = !1;
      return !O && _ === void 0 && (k = !0, A(C), P(C)), _ !== void 0 && C >= _ ? O.next(C - _) : (!k && A(C), p);
    }
  };
}
const xq = /* @__PURE__ */ hd(0.42, 0, 1, 1), wq = /* @__PURE__ */ hd(0, 0, 0.58, 1), mI = /* @__PURE__ */ hd(0.42, 0, 0.58, 1), _q = (e) => Array.isArray(e) && typeof e[0] != "number", T1 = (e) => Array.isArray(e) && typeof e[0] == "number", lP = {
  linear: qn,
  easeIn: xq,
  easeInOut: mI,
  easeOut: wq,
  circIn: v1,
  circInOut: YD,
  circOut: GD,
  backIn: y1,
  backInOut: HD,
  backOut: UD,
  anticipate: KD
}, cP = (e) => {
  if (T1(e)) {
    Wo(e.length === 4, "Cubic bezier arrays must contain four numerical values.");
    const [t, n, r, i] = e;
    return hd(t, n, r, i);
  } else if (typeof e == "string")
    return Wo(lP[e] !== void 0, `Invalid easing type '${e}'`), lP[e];
  return e;
}, Sq = (e, t) => (n) => t(e(n)), $o = (...e) => e.reduce(Sq), ec = (e, t, n) => {
  const r = t - e;
  return r === 0 ? 1 : (n - e) / r;
}, Qt = (e, t, n) => e + (t - e) * n;
function rb(e, t, n) {
  return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
}
function Oq({ hue: e, saturation: t, lightness: n, alpha: r }) {
  e /= 360, t /= 100, n /= 100;
  let i = 0, o = 0, a = 0;
  if (!t)
    i = o = a = n;
  else {
    const s = n < 0.5 ? n * (1 + t) : n + t - n * t, l = 2 * n - s;
    i = rb(l, s, e + 1 / 3), o = rb(l, s, e), a = rb(l, s, e - 1 / 3);
  }
  return {
    red: Math.round(i * 255),
    green: Math.round(o * 255),
    blue: Math.round(a * 255),
    alpha: r
  };
}
function Op(e, t) {
  return (n) => n > 0 ? t : e;
}
const ib = (e, t, n) => {
  const r = e * e, i = n * (t * t - r) + r;
  return i < 0 ? 0 : Math.sqrt(i);
}, Aq = [T0, ws, Ml], Tq = (e) => Aq.find((t) => t.test(e));
function uP(e) {
  const t = Tq(e);
  if (Ic(!!t, `'${e}' is not an animatable color. Use the equivalent color code instead.`), !t)
    return !1;
  let n = t.parse(e);
  return t === Ml && (n = Oq(n)), n;
}
const fP = (e, t) => {
  const n = uP(e), r = uP(t);
  if (!n || !r)
    return Op(e, t);
  const i = { ...n };
  return (o) => (i.red = ib(n.red, r.red, o), i.green = ib(n.green, r.green, o), i.blue = ib(n.blue, r.blue, o), i.alpha = Qt(n.alpha, r.alpha, o), ws.transform(i));
}, E0 = /* @__PURE__ */ new Set(["none", "hidden"]);
function Pq(e, t) {
  return E0.has(e) ? (n) => n <= 0 ? e : t : (n) => n >= 1 ? t : e;
}
function Cq(e, t) {
  return (n) => Qt(e, t, n);
}
function P1(e) {
  return typeof e == "number" ? Cq : typeof e == "string" ? b1(e) ? Op : er.test(e) ? fP : Mq : Array.isArray(e) ? gI : typeof e == "object" ? er.test(e) ? fP : Eq : Op;
}
function gI(e, t) {
  const n = [...e], r = n.length, i = e.map((o, a) => P1(o)(o, t[a]));
  return (o) => {
    for (let a = 0; a < r; a++)
      n[a] = i[a](o);
    return n;
  };
}
function Eq(e, t) {
  const n = { ...e, ...t }, r = {};
  for (const i in n)
    e[i] !== void 0 && t[i] !== void 0 && (r[i] = P1(e[i])(e[i], t[i]));
  return (i) => {
    for (const o in r)
      n[o] = r[o](i);
    return n;
  };
}
function kq(e, t) {
  var n;
  const r = [], i = { color: 0, var: 0, number: 0 };
  for (let o = 0; o < t.values.length; o++) {
    const a = t.types[o], s = e.indexes[a][i[a]], l = (n = e.values[s]) !== null && n !== void 0 ? n : 0;
    r[o] = l, i[a]++;
  }
  return r;
}
const Mq = (e, t) => {
  const n = Ba.createTransformer(t), r = gf(e), i = gf(t);
  return r.indexes.var.length === i.indexes.var.length && r.indexes.color.length === i.indexes.color.length && r.indexes.number.length >= i.indexes.number.length ? E0.has(e) && !i.values.length || E0.has(t) && !r.values.length ? Pq(e, t) : $o(gI(kq(r, i), i.values), n) : (Ic(!0, `Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`), Op(e, t));
};
function yI(e, t, n) {
  return typeof e == "number" && typeof t == "number" && typeof n == "number" ? Qt(e, t, n) : P1(e)(e, t);
}
function Nq(e, t, n) {
  const r = [], i = n || yI, o = e.length - 1;
  for (let a = 0; a < o; a++) {
    let s = i(e[a], e[a + 1]);
    if (t) {
      const l = Array.isArray(t) ? t[a] || qn : t;
      s = $o(l, s);
    }
    r.push(s);
  }
  return r;
}
function $q(e, t, { clamp: n = !0, ease: r, mixer: i } = {}) {
  const o = e.length;
  if (Wo(o === t.length, "Both input and output ranges must be the same length"), o === 1)
    return () => t[0];
  if (o === 2 && e[0] === e[1])
    return () => t[1];
  e[0] > e[o - 1] && (e = [...e].reverse(), t = [...t].reverse());
  const a = Nq(t, r, i), s = a.length, l = (c) => {
    let f = 0;
    if (s > 1)
      for (; f < e.length - 2 && !(c < e[f + 1]); f++)
        ;
    const d = ec(e[f], e[f + 1], c);
    return a[f](d);
  };
  return n ? (c) => l(La(e[0], e[o - 1], c)) : l;
}
function Dq(e, t) {
  const n = e[e.length - 1];
  for (let r = 1; r <= t; r++) {
    const i = ec(0, t, r);
    e.push(Qt(n, 1, i));
  }
}
function Iq(e) {
  const t = [0];
  return Dq(t, e.length - 1), t;
}
function Rq(e, t) {
  return e.map((n) => n * t);
}
function jq(e, t) {
  return e.map(() => t || mI).splice(0, e.length - 1);
}
function Ap({ duration: e = 300, keyframes: t, times: n, ease: r = "easeInOut" }) {
  const i = _q(r) ? r.map(cP) : cP(r), o = {
    done: !1,
    value: t[0]
  }, a = Rq(
    // Only use the provided offsets if they're the correct length
    // TODO Maybe we should warn here if there's a length mismatch
    n && n.length === t.length ? n : Iq(t),
    e
  ), s = $q(a, t, {
    ease: Array.isArray(i) ? i : jq(t, i)
  });
  return {
    calculatedDuration: e,
    next: (l) => (o.value = s(l), o.done = l >= e, o)
  };
}
const dP = 2e4;
function Lq(e) {
  let t = 0;
  const n = 50;
  let r = e.next(t);
  for (; !r.done && t < dP; )
    t += n, r = e.next(t);
  return t >= dP ? 1 / 0 : t;
}
const Bq = (e) => {
  const t = ({ timestamp: n }) => e(n);
  return {
    start: () => Tt.update(t, !0),
    stop: () => ja(t),
    /**
     * If we're processing this frame we can use the
     * framelocked timestamp to keep things in sync.
     */
    now: () => zn.isProcessing ? zn.timestamp : qi.now()
  };
}, Fq = {
  decay: sP,
  inertia: sP,
  tween: Ap,
  keyframes: Ap,
  spring: pI
}, Wq = (e) => e / 100;
class C1 extends fI {
  constructor(t) {
    super(t), this.holdTime = null, this.cancelTime = null, this.currentTime = 0, this.playbackSpeed = 1, this.pendingPlayState = "running", this.startTime = null, this.state = "idle", this.stop = () => {
      if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
        return;
      this.teardown();
      const { onStop: l } = this.options;
      l && l();
    };
    const { name: n, motionValue: r, element: i, keyframes: o } = this.options, a = (i == null ? void 0 : i.KeyframeResolver) || x1, s = (l, c) => this.onKeyframesResolved(l, c);
    this.resolver = new a(o, s, n, r, i), this.resolver.scheduleResolve();
  }
  flatten() {
    super.flatten(), this._resolved && Object.assign(this._resolved, this.initPlayback(this._resolved.keyframes));
  }
  initPlayback(t) {
    const { type: n = "keyframes", repeat: r = 0, repeatDelay: i = 0, repeatType: o, velocity: a = 0 } = this.options, s = A1(n) ? n : Fq[n] || Ap;
    let l, c;
    s !== Ap && typeof t[0] != "number" && ( true && Wo(t.length === 2, `Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`), l = $o(Wq, yI(t[0], t[1])), t = [0, 100]);
    const f = s({ ...this.options, keyframes: t });
    o === "mirror" && (c = s({
      ...this.options,
      keyframes: [...t].reverse(),
      velocity: -a
    })), f.calculatedDuration === null && (f.calculatedDuration = Lq(f));
    const { calculatedDuration: d } = f, p = d + i, m = p * (r + 1) - i;
    return {
      generator: f,
      mirroredGenerator: c,
      mapPercentToKeyframes: l,
      calculatedDuration: d,
      resolvedDuration: p,
      totalDuration: m
    };
  }
  onPostResolved() {
    const { autoplay: t = !0 } = this.options;
    this.play(), this.pendingPlayState === "paused" || !t ? this.pause() : this.state = this.pendingPlayState;
  }
  tick(t, n = !1) {
    const { resolved: r } = this;
    if (!r) {
      const { keyframes: C } = this.options;
      return { done: !0, value: C[C.length - 1] };
    }
    const { finalKeyframe: i, generator: o, mirroredGenerator: a, mapPercentToKeyframes: s, keyframes: l, calculatedDuration: c, totalDuration: f, resolvedDuration: d } = r;
    if (this.startTime === null)
      return o.next(0);
    const { delay: p, repeat: m, repeatType: y, repeatDelay: g, onUpdate: v } = this.options;
    this.speed > 0 ? this.startTime = Math.min(this.startTime, t) : this.speed < 0 && (this.startTime = Math.min(t - f / this.speed, this.startTime)), n ? this.currentTime = t : this.holdTime !== null ? this.currentTime = this.holdTime : this.currentTime = Math.round(t - this.startTime) * this.speed;
    const x = this.currentTime - p * (this.speed >= 0 ? 1 : -1), w = this.speed >= 0 ? x < 0 : x > f;
    this.currentTime = Math.max(x, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = f);
    let S = this.currentTime, A = o;
    if (m) {
      const C = Math.min(this.currentTime, f) / d;
      let k = Math.floor(C), I = C % 1;
      !I && C >= 1 && (I = 1), I === 1 && k--, k = Math.min(k, m + 1), !!(k % 2) && (y === "reverse" ? (I = 1 - I, g && (I -= g / d)) : y === "mirror" && (A = a)), S = La(0, 1, I) * d;
    }
    const _ = w ? { done: !1, value: l[0] } : A.next(S);
    s && (_.value = s(_.value));
    let { done: O } = _;
    !w && c !== null && (O = this.speed >= 0 ? this.currentTime >= f : this.currentTime <= 0);
    const P = this.holdTime === null && (this.state === "finished" || this.state === "running" && O);
    return P && i !== void 0 && (_.value = bg(l, this.options, i)), v && v(_.value), P && this.finish(), _;
  }
  get duration() {
    const { resolved: t } = this;
    return t ? No(t.calculatedDuration) : 0;
  }
  get time() {
    return No(this.currentTime);
  }
  set time(t) {
    t = Gi(t), this.currentTime = t, this.holdTime !== null || this.speed === 0 ? this.holdTime = t : this.driver && (this.startTime = this.driver.now() - t / this.speed);
  }
  get speed() {
    return this.playbackSpeed;
  }
  set speed(t) {
    const n = this.playbackSpeed !== t;
    this.playbackSpeed = t, n && (this.time = No(this.currentTime));
  }
  play() {
    if (this.resolver.isScheduled || this.resolver.resume(), !this._resolved) {
      this.pendingPlayState = "running";
      return;
    }
    if (this.isStopped)
      return;
    const { driver: t = Bq, onPlay: n, startTime: r } = this.options;
    this.driver || (this.driver = t((o) => this.tick(o))), n && n();
    const i = this.driver.now();
    this.holdTime !== null ? this.startTime = i - this.holdTime : this.startTime ? this.state === "finished" && (this.startTime = i) : this.startTime = r ?? this.calcStartTime(), this.state === "finished" && this.updateFinishedPromise(), this.cancelTime = this.startTime, this.holdTime = null, this.state = "running", this.driver.start();
  }
  pause() {
    var t;
    if (!this._resolved) {
      this.pendingPlayState = "paused";
      return;
    }
    this.state = "paused", this.holdTime = (t = this.currentTime) !== null && t !== void 0 ? t : 0;
  }
  complete() {
    this.state !== "running" && this.play(), this.pendingPlayState = this.state = "finished", this.holdTime = null;
  }
  finish() {
    this.teardown(), this.state = "finished";
    const { onComplete: t } = this.options;
    t && t();
  }
  cancel() {
    this.cancelTime !== null && this.tick(this.cancelTime), this.teardown(), this.updateFinishedPromise();
  }
  teardown() {
    this.state = "idle", this.stopDriver(), this.resolveFinishedPromise(), this.updateFinishedPromise(), this.startTime = this.cancelTime = null, this.resolver.cancel();
  }
  stopDriver() {
    this.driver && (this.driver.stop(), this.driver = void 0);
  }
  sample(t) {
    return this.startTime = 0, this.tick(t, !0);
  }
}
const zq = /* @__PURE__ */ new Set([
  "opacity",
  "clipPath",
  "filter",
  "transform"
  // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
  // or until we implement support for linear() easing.
  // "background-color"
]), Vq = 10, Uq = (e, t) => {
  let n = "";
  const r = Math.max(Math.round(t / Vq), 2);
  for (let i = 0; i < r; i++)
    n += e(ec(0, r - 1, i)) + ", ";
  return `linear(${n.substring(0, n.length - 2)})`;
};
function E1(e) {
  let t;
  return () => (t === void 0 && (t = e()), t);
}
const Hq = {
  linearEasing: void 0
};
function Kq(e, t) {
  const n = E1(e);
  return () => {
    var r;
    return (r = Hq[t]) !== null && r !== void 0 ? r : n();
  };
}
const Tp = /* @__PURE__ */ Kq(() => {
  try {
    document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
  } catch {
    return !1;
  }
  return !0;
}, "linearEasing");
function vI(e) {
  return !!(typeof e == "function" && Tp() || !e || typeof e == "string" && (e in k0 || Tp()) || T1(e) || Array.isArray(e) && e.every(vI));
}
const Lu = ([e, t, n, r]) => `cubic-bezier(${e}, ${t}, ${n}, ${r})`, k0 = {
  linear: "linear",
  ease: "ease",
  easeIn: "ease-in",
  easeOut: "ease-out",
  easeInOut: "ease-in-out",
  circIn: /* @__PURE__ */ Lu([0, 0.65, 0.55, 1]),
  circOut: /* @__PURE__ */ Lu([0.55, 0, 1, 0.45]),
  backIn: /* @__PURE__ */ Lu([0.31, 0.01, 0.66, -0.59]),
  backOut: /* @__PURE__ */ Lu([0.33, 1.53, 0.69, 0.99])
};
function bI(e, t) {
  if (e)
    return typeof e == "function" && Tp() ? Uq(e, t) : T1(e) ? Lu(e) : Array.isArray(e) ? e.map((n) => bI(n, t) || k0.easeOut) : k0[e];
}
function Gq(e, t, n, { delay: r = 0, duration: i = 300, repeat: o = 0, repeatType: a = "loop", ease: s = "easeInOut", times: l } = {}) {
  const c = { [t]: n };
  l && (c.offset = l);
  const f = bI(s, i);
  return Array.isArray(f) && (c.easing = f), e.animate(c, {
    delay: r,
    duration: i,
    easing: Array.isArray(f) ? "linear" : f,
    fill: "both",
    iterations: o + 1,
    direction: a === "reverse" ? "alternate" : "normal"
  });
}
function hP(e, t) {
  e.timeline = t, e.onfinish = null;
}
const Yq = /* @__PURE__ */ E1(() => Object.hasOwnProperty.call(Element.prototype, "animate")), Pp = 10, qq = 2e4;
function Xq(e) {
  return A1(e.type) || e.type === "spring" || !vI(e.ease);
}
function Zq(e, t) {
  const n = new C1({
    ...t,
    keyframes: e,
    repeat: 0,
    delay: 0,
    isGenerator: !0
  });
  let r = { done: !1, value: e[0] };
  const i = [];
  let o = 0;
  for (; !r.done && o < qq; )
    r = n.sample(o), i.push(r.value), o += Pp;
  return {
    times: void 0,
    keyframes: i,
    duration: o - Pp,
    ease: "linear"
  };
}
const xI = {
  anticipate: KD,
  backInOut: HD,
  circInOut: YD
};
function Jq(e) {
  return e in xI;
}
class pP extends fI {
  constructor(t) {
    super(t);
    const { name: n, motionValue: r, element: i, keyframes: o } = this.options;
    this.resolver = new uI(o, (a, s) => this.onKeyframesResolved(a, s), n, r, i), this.resolver.scheduleResolve();
  }
  initPlayback(t, n) {
    var r;
    let { duration: i = 300, times: o, ease: a, type: s, motionValue: l, name: c, startTime: f } = this.options;
    if (!(!((r = l.owner) === null || r === void 0) && r.current))
      return !1;
    if (typeof a == "string" && Tp() && Jq(a) && (a = xI[a]), Xq(this.options)) {
      const { onComplete: p, onUpdate: m, motionValue: y, element: g, ...v } = this.options, x = Zq(t, v);
      t = x.keyframes, t.length === 1 && (t[1] = t[0]), i = x.duration, o = x.times, a = x.ease, s = "keyframes";
    }
    const d = Gq(l.owner.current, c, t, { ...this.options, duration: i, times: o, ease: a });
    return d.startTime = f ?? this.calcStartTime(), this.pendingTimeline ? (hP(d, this.pendingTimeline), this.pendingTimeline = void 0) : d.onfinish = () => {
      const { onComplete: p } = this.options;
      l.set(bg(t, this.options, n)), p && p(), this.cancel(), this.resolveFinishedPromise();
    }, {
      animation: d,
      duration: i,
      times: o,
      type: s,
      ease: a,
      keyframes: t
    };
  }
  get duration() {
    const { resolved: t } = this;
    if (!t)
      return 0;
    const { duration: n } = t;
    return No(n);
  }
  get time() {
    const { resolved: t } = this;
    if (!t)
      return 0;
    const { animation: n } = t;
    return No(n.currentTime || 0);
  }
  set time(t) {
    const { resolved: n } = this;
    if (!n)
      return;
    const { animation: r } = n;
    r.currentTime = Gi(t);
  }
  get speed() {
    const { resolved: t } = this;
    if (!t)
      return 1;
    const { animation: n } = t;
    return n.playbackRate;
  }
  set speed(t) {
    const { resolved: n } = this;
    if (!n)
      return;
    const { animation: r } = n;
    r.playbackRate = t;
  }
  get state() {
    const { resolved: t } = this;
    if (!t)
      return "idle";
    const { animation: n } = t;
    return n.playState;
  }
  get startTime() {
    const { resolved: t } = this;
    if (!t)
      return null;
    const { animation: n } = t;
    return n.startTime;
  }
  /**
   * Replace the default DocumentTimeline with another AnimationTimeline.
   * Currently used for scroll animations.
   */
  attachTimeline(t) {
    if (!this._resolved)
      this.pendingTimeline = t;
    else {
      const { resolved: n } = this;
      if (!n)
        return qn;
      const { animation: r } = n;
      hP(r, t);
    }
    return qn;
  }
  play() {
    if (this.isStopped)
      return;
    const { resolved: t } = this;
    if (!t)
      return;
    const { animation: n } = t;
    n.playState === "finished" && this.updateFinishedPromise(), n.play();
  }
  pause() {
    const { resolved: t } = this;
    if (!t)
      return;
    const { animation: n } = t;
    n.pause();
  }
  stop() {
    if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
      return;
    this.resolveFinishedPromise(), this.updateFinishedPromise();
    const { resolved: t } = this;
    if (!t)
      return;
    const { animation: n, keyframes: r, duration: i, type: o, ease: a, times: s } = t;
    if (n.playState === "idle" || n.playState === "finished")
      return;
    if (this.time) {
      const { motionValue: c, onUpdate: f, onComplete: d, element: p, ...m } = this.options, y = new C1({
        ...m,
        keyframes: r,
        duration: i,
        type: o,
        ease: a,
        times: s,
        isGenerator: !0
      }), g = Gi(this.time);
      c.setWithVelocity(y.sample(g - Pp).value, y.sample(g).value, Pp);
    }
    const { onStop: l } = this.options;
    l && l(), this.cancel();
  }
  complete() {
    const { resolved: t } = this;
    t && t.animation.finish();
  }
  cancel() {
    const { resolved: t } = this;
    t && t.animation.cancel();
  }
  static supports(t) {
    const { motionValue: n, name: r, repeatDelay: i, repeatType: o, damping: a, type: s } = t;
    return Yq() && r && zq.has(r) && n && n.owner && n.owner.current instanceof HTMLElement && /**
     * If we're outputting values to onUpdate then we can't use WAAPI as there's
     * no way to read the value from WAAPI every frame.
     */
    !n.owner.getProps().onUpdate && !i && o !== "mirror" && a !== 0 && s !== "inertia";
  }
}
const Qq = E1(() => window.ScrollTimeline !== void 0);
class e9 {
  constructor(t) {
    this.stop = () => this.runAll("stop"), this.animations = t.filter(Boolean);
  }
  then(t, n) {
    return Promise.all(this.animations).then(t).catch(n);
  }
  /**
   * TODO: Filter out cancelled or stopped animations before returning
   */
  getAll(t) {
    return this.animations[0][t];
  }
  setAll(t, n) {
    for (let r = 0; r < this.animations.length; r++)
      this.animations[r][t] = n;
  }
  attachTimeline(t, n) {
    const r = this.animations.map((i) => Qq() && i.attachTimeline ? i.attachTimeline(t) : n(i));
    return () => {
      r.forEach((i, o) => {
        i && i(), this.animations[o].stop();
      });
    };
  }
  get time() {
    return this.getAll("time");
  }
  set time(t) {
    this.setAll("time", t);
  }
  get speed() {
    return this.getAll("speed");
  }
  set speed(t) {
    this.setAll("speed", t);
  }
  get startTime() {
    return this.getAll("startTime");
  }
  get duration() {
    let t = 0;
    for (let n = 0; n < this.animations.length; n++)
      t = Math.max(t, this.animations[n].duration);
    return t;
  }
  runAll(t) {
    this.animations.forEach((n) => n[t]());
  }
  flatten() {
    this.runAll("flatten");
  }
  play() {
    this.runAll("play");
  }
  pause() {
    this.runAll("pause");
  }
  cancel() {
    this.runAll("cancel");
  }
  complete() {
    this.runAll("complete");
  }
}
function t9({ when: e, delay: t, delayChildren: n, staggerChildren: r, staggerDirection: i, repeat: o, repeatType: a, repeatDelay: s, from: l, elapsed: c, ...f }) {
  return !!Object.keys(f).length;
}
const k1 = (e, t, n, r = {}, i, o) => (a) => {
  const s = g1(r, e) || {}, l = s.delay || r.delay || 0;
  let { elapsed: c = 0 } = r;
  c = c - Gi(l);
  let f = {
    keyframes: Array.isArray(n) ? n : [null, n],
    ease: "easeOut",
    velocity: t.getVelocity(),
    ...s,
    delay: -c,
    onUpdate: (p) => {
      t.set(p), s.onUpdate && s.onUpdate(p);
    },
    onComplete: () => {
      a(), s.onComplete && s.onComplete();
    },
    name: e,
    motionValue: t,
    element: o ? void 0 : i
  };
  t9(s) || (f = {
    ...f,
    ...bY(e, f)
  }), f.duration && (f.duration = Gi(f.duration)), f.repeatDelay && (f.repeatDelay = Gi(f.repeatDelay)), f.from !== void 0 && (f.keyframes[0] = f.from);
  let d = !1;
  if ((f.type === !1 || f.duration === 0 && !f.repeatDelay) && (f.duration = 0, f.delay === 0 && (d = !0)), d && !o && t.get() !== void 0) {
    const p = bg(f.keyframes, s);
    if (p !== void 0)
      return Tt.update(() => {
        f.onUpdate(p), f.onComplete();
      }), new e9([]);
  }
  return !o && pP.supports(f) ? new pP(f) : new C1(f);
}, n9 = (e) => !!(e && typeof e == "object" && e.mix && e.toValue), r9 = (e) => S0(e) ? e[e.length - 1] || 0 : e;
function M1(e, t) {
  e.indexOf(t) === -1 && e.push(t);
}
function N1(e, t) {
  const n = e.indexOf(t);
  n > -1 && e.splice(n, 1);
}
class $1 {
  constructor() {
    this.subscriptions = [];
  }
  add(t) {
    return M1(this.subscriptions, t), () => N1(this.subscriptions, t);
  }
  notify(t, n, r) {
    const i = this.subscriptions.length;
    if (i)
      if (i === 1)
        this.subscriptions[0](t, n, r);
      else
        for (let o = 0; o < i; o++) {
          const a = this.subscriptions[o];
          a && a(t, n, r);
        }
  }
  getSize() {
    return this.subscriptions.length;
  }
  clear() {
    this.subscriptions.length = 0;
  }
}
const mP = 30, i9 = (e) => !isNaN(parseFloat(e));
class o9 {
  /**
   * @param init - The initiating value
   * @param config - Optional configuration options
   *
   * -  `transformer`: A function to transform incoming values with.
   *
   * @internal
   */
  constructor(t, n = {}) {
    this.version = "11.11.17", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (r, i = !0) => {
      const o = qi.now();
      this.updatedAt !== o && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(r), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), i && this.events.renderRequest && this.events.renderRequest.notify(this.current);
    }, this.hasAnimated = !1, this.setCurrent(t), this.owner = n.owner;
  }
  setCurrent(t) {
    this.current = t, this.updatedAt = qi.now(), this.canTrackVelocity === null && t !== void 0 && (this.canTrackVelocity = i9(this.current));
  }
  setPrevFrameValue(t = this.current) {
    this.prevFrameValue = t, this.prevUpdatedAt = this.updatedAt;
  }
  /**
   * Adds a function that will be notified when the `MotionValue` is updated.
   *
   * It returns a function that, when called, will cancel the subscription.
   *
   * When calling `onChange` inside a React component, it should be wrapped with the
   * `useEffect` hook. As it returns an unsubscribe function, this should be returned
   * from the `useEffect` function to ensure you don't add duplicate subscribers..
   *
   * ```jsx
   * export const MyComponent = () => {
   *   const x = useMotionValue(0)
   *   const y = useMotionValue(0)
   *   const opacity = useMotionValue(1)
   *
   *   useEffect(() => {
   *     function updateOpacity() {
   *       const maxXY = Math.max(x.get(), y.get())
   *       const newOpacity = transform(maxXY, [0, 100], [1, 0])
   *       opacity.set(newOpacity)
   *     }
   *
   *     const unsubscribeX = x.on("change", updateOpacity)
   *     const unsubscribeY = y.on("change", updateOpacity)
   *
   *     return () => {
   *       unsubscribeX()
   *       unsubscribeY()
   *     }
   *   }, [])
   *
   *   return <motion.div style={{ x }} />
   * }
   * ```
   *
   * @param subscriber - A function that receives the latest value.
   * @returns A function that, when called, will cancel this subscription.
   *
   * @deprecated
   */
  onChange(t) {
    return  true && gg(!1, 'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'), this.on("change", t);
  }
  on(t, n) {
    this.events[t] || (this.events[t] = new $1());
    const r = this.events[t].add(n);
    return t === "change" ? () => {
      r(), Tt.read(() => {
        this.events.change.getSize() || this.stop();
      });
    } : r;
  }
  clearListeners() {
    for (const t in this.events)
      this.events[t].clear();
  }
  /**
   * Attaches a passive effect to the `MotionValue`.
   *
   * @internal
   */
  attach(t, n) {
    this.passiveEffect = t, this.stopPassiveEffect = n;
  }
  /**
   * Sets the state of the `MotionValue`.
   *
   * @remarks
   *
   * ```jsx
   * const x = useMotionValue(0)
   * x.set(10)
   * ```
   *
   * @param latest - Latest value to set.
   * @param render - Whether to notify render subscribers. Defaults to `true`
   *
   * @public
   */
  set(t, n = !0) {
    !n || !this.passiveEffect ? this.updateAndNotify(t, n) : this.passiveEffect(t, this.updateAndNotify);
  }
  setWithVelocity(t, n, r) {
    this.set(n), this.prev = void 0, this.prevFrameValue = t, this.prevUpdatedAt = this.updatedAt - r;
  }
  /**
   * Set the state of the `MotionValue`, stopping any active animations,
   * effects, and resets velocity to `0`.
   */
  jump(t, n = !0) {
    this.updateAndNotify(t), this.prev = t, this.prevUpdatedAt = this.prevFrameValue = void 0, n && this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
  }
  /**
   * Returns the latest state of `MotionValue`
   *
   * @returns - The latest state of `MotionValue`
   *
   * @public
   */
  get() {
    return this.current;
  }
  /**
   * @public
   */
  getPrevious() {
    return this.prev;
  }
  /**
   * Returns the latest velocity of `MotionValue`
   *
   * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical.
   *
   * @public
   */
  getVelocity() {
    const t = qi.now();
    if (!this.canTrackVelocity || this.prevFrameValue === void 0 || t - this.updatedAt > mP)
      return 0;
    const n = Math.min(this.updatedAt - this.prevUpdatedAt, mP);
    return dI(parseFloat(this.current) - parseFloat(this.prevFrameValue), n);
  }
  /**
   * Registers a new animation to control this `MotionValue`. Only one
   * animation can drive a `MotionValue` at one time.
   *
   * ```jsx
   * value.start()
   * ```
   *
   * @param animation - A function that starts the provided animation
   *
   * @internal
   */
  start(t) {
    return this.stop(), new Promise((n) => {
      this.hasAnimated = !0, this.animation = t(n), this.events.animationStart && this.events.animationStart.notify();
    }).then(() => {
      this.events.animationComplete && this.events.animationComplete.notify(), this.clearAnimation();
    });
  }
  /**
   * Stop the currently active animation.
   *
   * @public
   */
  stop() {
    this.animation && (this.animation.stop(), this.events.animationCancel && this.events.animationCancel.notify()), this.clearAnimation();
  }
  /**
   * Returns `true` if this value is currently animating.
   *
   * @public
   */
  isAnimating() {
    return !!this.animation;
  }
  clearAnimation() {
    delete this.animation;
  }
  /**
   * Destroy and clean up subscribers to this `MotionValue`.
   *
   * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically
   * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually
   * created a `MotionValue` via the `motionValue` function.
   *
   * @public
   */
  destroy() {
    this.clearListeners(), this.stop(), this.stopPassiveEffect && this.stopPassiveEffect();
  }
}
function yf(e, t) {
  return new o9(e, t);
}
function a9(e, t, n) {
  e.hasValue(t) ? e.getValue(t).set(n) : e.addValue(t, yf(n));
}
function s9(e, t) {
  const n = vg(e, t);
  let { transitionEnd: r = {}, transition: i = {}, ...o } = n || {};
  o = { ...o, ...r };
  for (const a in o) {
    const s = r9(o[a]);
    a9(e, a, s);
  }
}
const D1 = (e) => e.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), l9 = "framerAppearId", wI = "data-" + D1(l9);
function _I(e) {
  return e.props[wI];
}
const rr = (e) => !!(e && e.getVelocity);
function c9(e) {
  return !!(rr(e) && e.add);
}
function M0(e, t) {
  const n = e.getValue("willChange");
  if (c9(n))
    return n.add(t);
}
function u9({ protectedKeys: e, needsAnimating: t }, n) {
  const r = e.hasOwnProperty(n) && t[n] !== !0;
  return t[n] = !1, r;
}
function SI(e, t, { delay: n = 0, transitionOverride: r, type: i } = {}) {
  var o;
  let { transition: a = e.getDefaultTransition(), transitionEnd: s, ...l } = t;
  r && (a = r);
  const c = [], f = i && e.animationState && e.animationState.getState()[i];
  for (const d in l) {
    const p = e.getValue(d, (o = e.latestValues[d]) !== null && o !== void 0 ? o : null), m = l[d];
    if (m === void 0 || f && u9(f, d))
      continue;
    const y = {
      delay: n,
      ...g1(a || {}, d)
    };
    let g = !1;
    if (window.MotionHandoffAnimation) {
      const x = _I(e);
      if (x) {
        const w = window.MotionHandoffAnimation(x, d, Tt);
        w !== null && (y.startTime = w, g = !0);
      }
    }
    M0(e, d), p.start(k1(d, p, m, e.shouldReduceMotion && Gs.has(d) ? { type: !1 } : y, e, g));
    const v = p.animation;
    v && c.push(v);
  }
  return s && Promise.all(c).then(() => {
    Tt.update(() => {
      s && s9(e, s);
    });
  }), c;
}
function N0(e, t, n = {}) {
  var r;
  const i = vg(e, t, n.type === "exit" ? (r = e.presenceContext) === null || r === void 0 ? void 0 : r.custom : void 0);
  let { transition: o = e.getDefaultTransition() || {} } = i || {};
  n.transitionOverride && (o = n.transitionOverride);
  const a = i ? () => Promise.all(SI(e, i, n)) : () => Promise.resolve(), s = e.variantChildren && e.variantChildren.size ? (c = 0) => {
    const { delayChildren: f = 0, staggerChildren: d, staggerDirection: p } = o;
    return f9(e, t, f + c, d, p, n);
  } : () => Promise.resolve(), { when: l } = o;
  if (l) {
    const [c, f] = l === "beforeChildren" ? [a, s] : [s, a];
    return c().then(() => f());
  } else
    return Promise.all([a(), s(n.delay)]);
}
function f9(e, t, n = 0, r = 0, i = 1, o) {
  const a = [], s = (e.variantChildren.size - 1) * r, l = i === 1 ? (c = 0) => c * r : (c = 0) => s - c * r;
  return Array.from(e.variantChildren).sort(d9).forEach((c, f) => {
    c.notify("AnimationStart", t), a.push(N0(c, t, {
      ...o,
      delay: n + l(f)
    }).then(() => c.notify("AnimationComplete", t)));
  }), Promise.all(a);
}
function d9(e, t) {
  return e.sortNodePosition(t);
}
function h9(e, t, n = {}) {
  e.notify("AnimationStart", t);
  let r;
  if (Array.isArray(t)) {
    const i = t.map((o) => N0(e, o, n));
    r = Promise.all(i);
  } else if (typeof t == "string")
    r = N0(e, t, n);
  else {
    const i = typeof t == "function" ? vg(e, t, n.custom) : t;
    r = Promise.all(SI(e, i, n));
  }
  return r.then(() => {
    e.notify("AnimationComplete", t);
  });
}
const p9 = m1.length;
function OI(e) {
  if (!e)
    return;
  if (!e.isControllingVariants) {
    const n = e.parent ? OI(e.parent) || {} : {};
    return e.props.initial !== void 0 && (n.initial = e.props.initial), n;
  }
  const t = {};
  for (let n = 0; n < p9; n++) {
    const r = m1[n], i = e.props[r];
    (pf(i) || i === !1) && (t[r] = i);
  }
  return t;
}
const m9 = [...p1].reverse(), g9 = p1.length;
function y9(e) {
  return (t) => Promise.all(t.map(({ animation: n, options: r }) => h9(e, n, r)));
}
function v9(e) {
  let t = y9(e), n = gP(), r = !0;
  const i = (l) => (c, f) => {
    var d;
    const p = vg(e, f, l === "exit" ? (d = e.presenceContext) === null || d === void 0 ? void 0 : d.custom : void 0);
    if (p) {
      const { transition: m, transitionEnd: y, ...g } = p;
      c = { ...c, ...g, ...y };
    }
    return c;
  };
  function o(l) {
    t = l(e);
  }
  function a(l) {
    const { props: c } = e, f = OI(e.parent) || {}, d = [], p = /* @__PURE__ */ new Set();
    let m = {}, y = 1 / 0;
    for (let v = 0; v < g9; v++) {
      const x = m9[v], w = n[x], S = c[x] !== void 0 ? c[x] : f[x], A = pf(S), _ = x === l ? w.isActive : null;
      _ === !1 && (y = v);
      let O = S === f[x] && S !== c[x] && A;
      if (O && r && e.manuallyAnimateOnMount && (O = !1), w.protectedKeys = { ...m }, // If it isn't active and hasn't *just* been set as inactive
      !w.isActive && _ === null || // If we didn't and don't have any defined prop for this animation type
      !S && !w.prevProp || // Or if the prop doesn't define an animation
      yg(S) || typeof S == "boolean")
        continue;
      const P = b9(w.prevProp, S);
      let C = P || // If we're making this variant active, we want to always make it active
      x === l && w.isActive && !O && A || // If we removed a higher-priority variant (i is in reverse order)
      v > y && A, k = !1;
      const I = Array.isArray(S) ? S : [S];
      let $ = I.reduce(i(x), {});
      _ === !1 && ($ = {});
      const { prevResolvedValues: N = {} } = w, D = {
        ...N,
        ...$
      }, j = (z) => {
        C = !0, p.has(z) && (k = !0, p.delete(z)), w.needsAnimating[z] = !0;
        const H = e.getValue(z);
        H && (H.liveStyle = !1);
      };
      for (const z in D) {
        const H = $[z], U = N[z];
        if (m.hasOwnProperty(z))
          continue;
        let V = !1;
        S0(H) && S0(U) ? V = !BD(H, U) : V = H !== U, V ? H != null ? j(z) : p.add(z) : H !== void 0 && p.has(z) ? j(z) : w.protectedKeys[z] = !0;
      }
      w.prevProp = S, w.prevResolvedValues = $, w.isActive && (m = { ...m, ...$ }), r && e.blockInitialAnimation && (C = !1), C && (!(O && P) || k) && d.push(...I.map((z) => ({
        animation: z,
        options: { type: x }
      })));
    }
    if (p.size) {
      const v = {};
      p.forEach((x) => {
        const w = e.getBaseTarget(x), S = e.getValue(x);
        S && (S.liveStyle = !0), v[x] = w ?? null;
      }), d.push({ animation: v });
    }
    let g = !!d.length;
    return r && (c.initial === !1 || c.initial === c.animate) && !e.manuallyAnimateOnMount && (g = !1), r = !1, g ? t(d) : Promise.resolve();
  }
  function s(l, c) {
    var f;
    if (n[l].isActive === c)
      return Promise.resolve();
    (f = e.variantChildren) === null || f === void 0 || f.forEach((p) => {
      var m;
      return (m = p.animationState) === null || m === void 0 ? void 0 : m.setActive(l, c);
    }), n[l].isActive = c;
    const d = a(l);
    for (const p in n)
      n[p].protectedKeys = {};
    return d;
  }
  return {
    animateChanges: a,
    setActive: s,
    setAnimateFunction: o,
    getState: () => n,
    reset: () => {
      n = gP(), r = !0;
    }
  };
}
function b9(e, t) {
  return typeof t == "string" ? t !== e : Array.isArray(t) ? !BD(t, e) : !1;
}
function ss(e = !1) {
  return {
    isActive: e,
    protectedKeys: {},
    needsAnimating: {},
    prevResolvedValues: {}
  };
}
function gP() {
  return {
    animate: ss(!0),
    whileInView: ss(),
    whileHover: ss(),
    whileTap: ss(),
    whileDrag: ss(),
    whileFocus: ss(),
    exit: ss()
  };
}
class Va {
  constructor(t) {
    this.isMounted = !1, this.node = t;
  }
  update() {
  }
}
class x9 extends Va {
  /**
   * We dynamically generate the AnimationState manager as it contains a reference
   * to the underlying animation library. We only want to load that if we load this,
   * so people can optionally code split it out using the `m` component.
   */
  constructor(t) {
    super(t), t.animationState || (t.animationState = v9(t));
  }
  updateAnimationControlsSubscription() {
    const { animate: t } = this.node.getProps();
    yg(t) && (this.unmountControls = t.subscribe(this.node));
  }
  /**
   * Subscribe any provided AnimationControls to the component's VisualElement
   */
  mount() {
    this.updateAnimationControlsSubscription();
  }
  update() {
    const { animate: t } = this.node.getProps(), { animate: n } = this.node.prevProps || {};
    t !== n && this.updateAnimationControlsSubscription();
  }
  unmount() {
    var t;
    this.node.animationState.reset(), (t = this.unmountControls) === null || t === void 0 || t.call(this);
  }
}
let w9 = 0;
class _9 extends Va {
  constructor() {
    super(...arguments), this.id = w9++;
  }
  update() {
    if (!this.node.presenceContext)
      return;
    const { isPresent: t, onExitComplete: n } = this.node.presenceContext, { isPresent: r } = this.node.prevPresenceContext || {};
    if (!this.node.animationState || t === r)
      return;
    const i = this.node.animationState.setActive("exit", !t);
    n && !t && i.then(() => n(this.id));
  }
  mount() {
    const { register: t } = this.node.presenceContext || {};
    t && (this.unmount = t(this.id));
  }
  unmount() {
  }
}
const S9 = {
  animation: {
    Feature: x9
  },
  exit: {
    Feature: _9
  }
}, AI = (e) => e.pointerType === "mouse" ? typeof e.button != "number" || e.button <= 0 : e.isPrimary !== !1;
function xg(e, t = "page") {
  return {
    point: {
      x: e[`${t}X`],
      y: e[`${t}Y`]
    }
  };
}
const O9 = (e) => (t) => AI(t) && e(t, xg(t));
function To(e, t, n, r = { passive: !0 }) {
  return e.addEventListener(t, n, r), () => e.removeEventListener(t, n);
}
function Do(e, t, n, r) {
  return To(e, t, O9(n), r);
}
const yP = (e, t) => Math.abs(e - t);
function A9(e, t) {
  const n = yP(e.x, t.x), r = yP(e.y, t.y);
  return Math.sqrt(n ** 2 + r ** 2);
}
class TI {
  constructor(t, n, { transformPagePoint: r, contextWindow: i, dragSnapToOrigin: o = !1 } = {}) {
    if (this.startEvent = null, this.lastMoveEvent = null, this.lastMoveEventInfo = null, this.handlers = {}, this.contextWindow = window, this.updatePoint = () => {
      if (!(this.lastMoveEvent && this.lastMoveEventInfo))
        return;
      const d = ab(this.lastMoveEventInfo, this.history), p = this.startEvent !== null, m = A9(d.offset, { x: 0, y: 0 }) >= 3;
      if (!p && !m)
        return;
      const { point: y } = d, { timestamp: g } = zn;
      this.history.push({ ...y, timestamp: g });
      const { onStart: v, onMove: x } = this.handlers;
      p || (v && v(this.lastMoveEvent, d), this.startEvent = this.lastMoveEvent), x && x(this.lastMoveEvent, d);
    }, this.handlePointerMove = (d, p) => {
      this.lastMoveEvent = d, this.lastMoveEventInfo = ob(p, this.transformPagePoint), Tt.update(this.updatePoint, !0);
    }, this.handlePointerUp = (d, p) => {
      this.end();
      const { onEnd: m, onSessionEnd: y, resumeAnimation: g } = this.handlers;
      if (this.dragSnapToOrigin && g && g(), !(this.lastMoveEvent && this.lastMoveEventInfo))
        return;
      const v = ab(d.type === "pointercancel" ? this.lastMoveEventInfo : ob(p, this.transformPagePoint), this.history);
      this.startEvent && m && m(d, v), y && y(d, v);
    }, !AI(t))
      return;
    this.dragSnapToOrigin = o, this.handlers = n, this.transformPagePoint = r, this.contextWindow = i || window;
    const a = xg(t), s = ob(a, this.transformPagePoint), { point: l } = s, { timestamp: c } = zn;
    this.history = [{ ...l, timestamp: c }];
    const { onSessionStart: f } = n;
    f && f(t, ab(s, this.history)), this.removeListeners = $o(Do(this.contextWindow, "pointermove", this.handlePointerMove), Do(this.contextWindow, "pointerup", this.handlePointerUp), Do(this.contextWindow, "pointercancel", this.handlePointerUp));
  }
  updateHandlers(t) {
    this.handlers = t;
  }
  end() {
    this.removeListeners && this.removeListeners(), ja(this.updatePoint);
  }
}
function ob(e, t) {
  return t ? { point: t(e.point) } : e;
}
function vP(e, t) {
  return { x: e.x - t.x, y: e.y - t.y };
}
function ab({ point: e }, t) {
  return {
    point: e,
    delta: vP(e, PI(t)),
    offset: vP(e, T9(t)),
    velocity: P9(t, 0.1)
  };
}
function T9(e) {
  return e[0];
}
function PI(e) {
  return e[e.length - 1];
}
function P9(e, t) {
  if (e.length < 2)
    return { x: 0, y: 0 };
  let n = e.length - 1, r = null;
  const i = PI(e);
  for (; n >= 0 && (r = e[n], !(i.timestamp - r.timestamp > Gi(t))); )
    n--;
  if (!r)
    return { x: 0, y: 0 };
  const o = No(i.timestamp - r.timestamp);
  if (o === 0)
    return { x: 0, y: 0 };
  const a = {
    x: (i.x - r.x) / o,
    y: (i.y - r.y) / o
  };
  return a.x === 1 / 0 && (a.x = 0), a.y === 1 / 0 && (a.y = 0), a;
}
function CI(e) {
  let t = null;
  return () => {
    const n = () => {
      t = null;
    };
    return t === null ? (t = e, n) : !1;
  };
}
const bP = CI("dragHorizontal"), xP = CI("dragVertical");
function EI(e) {
  let t = !1;
  if (e === "y")
    t = xP();
  else if (e === "x")
    t = bP();
  else {
    const n = bP(), r = xP();
    n && r ? t = () => {
      n(), r();
    } : (n && n(), r && r());
  }
  return t;
}
function kI() {
  const e = EI(!0);
  return e ? (e(), !1) : !0;
}
function Nl(e) {
  return e && typeof e == "object" && Object.prototype.hasOwnProperty.call(e, "current");
}
const MI = 1e-4, C9 = 1 - MI, E9 = 1 + MI, NI = 0.01, k9 = 0 - NI, M9 = 0 + NI;
function Kr(e) {
  return e.max - e.min;
}
function N9(e, t, n) {
  return Math.abs(e - t) <= n;
}
function wP(e, t, n, r = 0.5) {
  e.origin = r, e.originPoint = Qt(t.min, t.max, e.origin), e.scale = Kr(n) / Kr(t), e.translate = Qt(n.min, n.max, e.origin) - e.originPoint, (e.scale >= C9 && e.scale <= E9 || isNaN(e.scale)) && (e.scale = 1), (e.translate >= k9 && e.translate <= M9 || isNaN(e.translate)) && (e.translate = 0);
}
function Gu(e, t, n, r) {
  wP(e.x, t.x, n.x, r ? r.originX : void 0), wP(e.y, t.y, n.y, r ? r.originY : void 0);
}
function _P(e, t, n) {
  e.min = n.min + t.min, e.max = e.min + Kr(t);
}
function $9(e, t, n) {
  _P(e.x, t.x, n.x), _P(e.y, t.y, n.y);
}
function SP(e, t, n) {
  e.min = t.min - n.min, e.max = e.min + Kr(t);
}
function Yu(e, t, n) {
  SP(e.x, t.x, n.x), SP(e.y, t.y, n.y);
}
function D9(e, { min: t, max: n }, r) {
  return t !== void 0 && e < t ? e = r ? Qt(t, e, r.min) : Math.max(e, t) : n !== void 0 && e > n && (e = r ? Qt(n, e, r.max) : Math.min(e, n)), e;
}
function OP(e, t, n) {
  return {
    min: t !== void 0 ? e.min + t : void 0,
    max: n !== void 0 ? e.max + n - (e.max - e.min) : void 0
  };
}
function I9(e, { top: t, left: n, bottom: r, right: i }) {
  return {
    x: OP(e.x, n, i),
    y: OP(e.y, t, r)
  };
}
function AP(e, t) {
  let n = t.min - e.min, r = t.max - e.max;
  return t.max - t.min < e.max - e.min && ([n, r] = [r, n]), { min: n, max: r };
}
function R9(e, t) {
  return {
    x: AP(e.x, t.x),
    y: AP(e.y, t.y)
  };
}
function j9(e, t) {
  let n = 0.5;
  const r = Kr(e), i = Kr(t);
  return i > r ? n = ec(t.min, t.max - r, e.min) : r > i && (n = ec(e.min, e.max - i, t.min)), La(0, 1, n);
}
function L9(e, t) {
  const n = {};
  return t.min !== void 0 && (n.min = t.min - e.min), t.max !== void 0 && (n.max = t.max - e.min), n;
}
const $0 = 0.35;
function B9(e = $0) {
  return e === !1 ? e = 0 : e === !0 && (e = $0), {
    x: TP(e, "left", "right"),
    y: TP(e, "top", "bottom")
  };
}
function TP(e, t, n) {
  return {
    min: PP(e, t),
    max: PP(e, n)
  };
}
function PP(e, t) {
  return typeof e == "number" ? e : e[t] || 0;
}
const CP = () => ({
  translate: 0,
  scale: 1,
  origin: 0,
  originPoint: 0
}), $l = () => ({
  x: CP(),
  y: CP()
}), EP = () => ({ min: 0, max: 0 }), ln = () => ({
  x: EP(),
  y: EP()
});
function ci(e) {
  return [e("x"), e("y")];
}
function $I({ top: e, left: t, right: n, bottom: r }) {
  return {
    x: { min: t, max: n },
    y: { min: e, max: r }
  };
}
function F9({ x: e, y: t }) {
  return { top: t.min, right: e.max, bottom: t.max, left: e.min };
}
function W9(e, t) {
  if (!t)
    return e;
  const n = t({ x: e.left, y: e.top }), r = t({ x: e.right, y: e.bottom });
  return {
    top: n.y,
    left: n.x,
    bottom: r.y,
    right: r.x
  };
}
function sb(e) {
  return e === void 0 || e === 1;
}
function D0({ scale: e, scaleX: t, scaleY: n }) {
  return !sb(e) || !sb(t) || !sb(n);
}
function ps(e) {
  return D0(e) || DI(e) || e.z || e.rotate || e.rotateX || e.rotateY || e.skewX || e.skewY;
}
function DI(e) {
  return kP(e.x) || kP(e.y);
}
function kP(e) {
  return e && e !== "0%";
}
function Cp(e, t, n) {
  const r = e - n, i = t * r;
  return n + i;
}
function MP(e, t, n, r, i) {
  return i !== void 0 && (e = Cp(e, i, r)), Cp(e, n, r) + t;
}
function I0(e, t = 0, n = 1, r, i) {
  e.min = MP(e.min, t, n, r, i), e.max = MP(e.max, t, n, r, i);
}
function II(e, { x: t, y: n }) {
  I0(e.x, t.translate, t.scale, t.originPoint), I0(e.y, n.translate, n.scale, n.originPoint);
}
const NP = 0.999999999999, $P = 1.0000000000001;
function z9(e, t, n, r = !1) {
  const i = n.length;
  if (!i)
    return;
  t.x = t.y = 1;
  let o, a;
  for (let s = 0; s < i; s++) {
    o = n[s], a = o.projectionDelta;
    const { visualElement: l } = o.options;
    l && l.props.style && l.props.style.display === "contents" || (r && o.options.layoutScroll && o.scroll && o !== o.root && Il(e, {
      x: -o.scroll.offset.x,
      y: -o.scroll.offset.y
    }), a && (t.x *= a.x.scale, t.y *= a.y.scale, II(e, a)), r && ps(o.latestValues) && Il(e, o.latestValues));
  }
  t.x < $P && t.x > NP && (t.x = 1), t.y < $P && t.y > NP && (t.y = 1);
}
function Dl(e, t) {
  e.min = e.min + t, e.max = e.max + t;
}
function DP(e, t, n, r, i = 0.5) {
  const o = Qt(e.min, e.max, i);
  I0(e, t, n, o, r);
}
function Il(e, t) {
  DP(e.x, t.x, t.scaleX, t.scale, t.originX), DP(e.y, t.y, t.scaleY, t.scale, t.originY);
}
function RI(e, t) {
  return $I(W9(e.getBoundingClientRect(), t));
}
function V9(e, t, n) {
  const r = RI(e, n), { scroll: i } = t;
  return i && (Dl(r.x, i.offset.x), Dl(r.y, i.offset.y)), r;
}
const jI = ({ current: e }) => e ? e.ownerDocument.defaultView : null, U9 = /* @__PURE__ */ new WeakMap();
class H9 {
  constructor(t) {
    this.openGlobalLock = null, this.isDragging = !1, this.currentDirection = null, this.originPoint = { x: 0, y: 0 }, this.constraints = !1, this.hasMutatedConstraints = !1, this.elastic = ln(), this.visualElement = t;
  }
  start(t, { snapToCursor: n = !1 } = {}) {
    const { presenceContext: r } = this.visualElement;
    if (r && r.isPresent === !1)
      return;
    const i = (f) => {
      const { dragSnapToOrigin: d } = this.getProps();
      d ? this.pauseAnimation() : this.stopAnimation(), n && this.snapToCursor(xg(f, "page").point);
    }, o = (f, d) => {
      const { drag: p, dragPropagation: m, onDragStart: y } = this.getProps();
      if (p && !m && (this.openGlobalLock && this.openGlobalLock(), this.openGlobalLock = EI(p), !this.openGlobalLock))
        return;
      this.isDragging = !0, this.currentDirection = null, this.resolveConstraints(), this.visualElement.projection && (this.visualElement.projection.isAnimationBlocked = !0, this.visualElement.projection.target = void 0), ci((v) => {
        let x = this.getAxisMotionValue(v).get() || 0;
        if (Yi.test(x)) {
          const { projection: w } = this.visualElement;
          if (w && w.layout) {
            const S = w.layout.layoutBox[v];
            S && (x = Kr(S) * (parseFloat(x) / 100));
          }
        }
        this.originPoint[v] = x;
      }), y && Tt.postRender(() => y(f, d)), M0(this.visualElement, "transform");
      const { animationState: g } = this.visualElement;
      g && g.setActive("whileDrag", !0);
    }, a = (f, d) => {
      const { dragPropagation: p, dragDirectionLock: m, onDirectionLock: y, onDrag: g } = this.getProps();
      if (!p && !this.openGlobalLock)
        return;
      const { offset: v } = d;
      if (m && this.currentDirection === null) {
        this.currentDirection = K9(v), this.currentDirection !== null && y && y(this.currentDirection);
        return;
      }
      this.updateAxis("x", d.point, v), this.updateAxis("y", d.point, v), this.visualElement.render(), g && g(f, d);
    }, s = (f, d) => this.stop(f, d), l = () => ci((f) => {
      var d;
      return this.getAnimationState(f) === "paused" && ((d = this.getAxisMotionValue(f).animation) === null || d === void 0 ? void 0 : d.play());
    }), { dragSnapToOrigin: c } = this.getProps();
    this.panSession = new TI(t, {
      onSessionStart: i,
      onStart: o,
      onMove: a,
      onSessionEnd: s,
      resumeAnimation: l
    }, {
      transformPagePoint: this.visualElement.getTransformPagePoint(),
      dragSnapToOrigin: c,
      contextWindow: jI(this.visualElement)
    });
  }
  stop(t, n) {
    const r = this.isDragging;
    if (this.cancel(), !r)
      return;
    const { velocity: i } = n;
    this.startAnimation(i);
    const { onDragEnd: o } = this.getProps();
    o && Tt.postRender(() => o(t, n));
  }
  cancel() {
    this.isDragging = !1;
    const { projection: t, animationState: n } = this.visualElement;
    t && (t.isAnimationBlocked = !1), this.panSession && this.panSession.end(), this.panSession = void 0;
    const { dragPropagation: r } = this.getProps();
    !r && this.openGlobalLock && (this.openGlobalLock(), this.openGlobalLock = null), n && n.setActive("whileDrag", !1);
  }
  updateAxis(t, n, r) {
    const { drag: i } = this.getProps();
    if (!r || !Mh(t, i, this.currentDirection))
      return;
    const o = this.getAxisMotionValue(t);
    let a = this.originPoint[t] + r[t];
    this.constraints && this.constraints[t] && (a = D9(a, this.constraints[t], this.elastic[t])), o.set(a);
  }
  resolveConstraints() {
    var t;
    const { dragConstraints: n, dragElastic: r } = this.getProps(), i = this.visualElement.projection && !this.visualElement.projection.layout ? this.visualElement.projection.measure(!1) : (t = this.visualElement.projection) === null || t === void 0 ? void 0 : t.layout, o = this.constraints;
    n && Nl(n) ? this.constraints || (this.constraints = this.resolveRefConstraints()) : n && i ? this.constraints = I9(i.layoutBox, n) : this.constraints = !1, this.elastic = B9(r), o !== this.constraints && i && this.constraints && !this.hasMutatedConstraints && ci((a) => {
      this.constraints !== !1 && this.getAxisMotionValue(a) && (this.constraints[a] = L9(i.layoutBox[a], this.constraints[a]));
    });
  }
  resolveRefConstraints() {
    const { dragConstraints: t, onMeasureDragConstraints: n } = this.getProps();
    if (!t || !Nl(t))
      return !1;
    const r = t.current;
    Wo(r !== null, "If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");
    const { projection: i } = this.visualElement;
    if (!i || !i.layout)
      return !1;
    const o = V9(r, i.root, this.visualElement.getTransformPagePoint());
    let a = R9(i.layout.layoutBox, o);
    if (n) {
      const s = n(F9(a));
      this.hasMutatedConstraints = !!s, s && (a = $I(s));
    }
    return a;
  }
  startAnimation(t) {
    const { drag: n, dragMomentum: r, dragElastic: i, dragTransition: o, dragSnapToOrigin: a, onDragTransitionEnd: s } = this.getProps(), l = this.constraints || {}, c = ci((f) => {
      if (!Mh(f, n, this.currentDirection))
        return;
      let d = l && l[f] || {};
      a && (d = { min: 0, max: 0 });
      const p = i ? 200 : 1e6, m = i ? 40 : 1e7, y = {
        type: "inertia",
        velocity: r ? t[f] : 0,
        bounceStiffness: p,
        bounceDamping: m,
        timeConstant: 750,
        restDelta: 1,
        restSpeed: 10,
        ...o,
        ...d
      };
      return this.startAxisValueAnimation(f, y);
    });
    return Promise.all(c).then(s);
  }
  startAxisValueAnimation(t, n) {
    const r = this.getAxisMotionValue(t);
    return M0(this.visualElement, t), r.start(k1(t, r, 0, n, this.visualElement, !1));
  }
  stopAnimation() {
    ci((t) => this.getAxisMotionValue(t).stop());
  }
  pauseAnimation() {
    ci((t) => {
      var n;
      return (n = this.getAxisMotionValue(t).animation) === null || n === void 0 ? void 0 : n.pause();
    });
  }
  getAnimationState(t) {
    var n;
    return (n = this.getAxisMotionValue(t).animation) === null || n === void 0 ? void 0 : n.state;
  }
  /**
   * Drag works differently depending on which props are provided.
   *
   * - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
   * - Otherwise, we apply the delta to the x/y motion values.
   */
  getAxisMotionValue(t) {
    const n = `_drag${t.toUpperCase()}`, r = this.visualElement.getProps(), i = r[n];
    return i || this.visualElement.getValue(t, (r.initial ? r.initial[t] : void 0) || 0);
  }
  snapToCursor(t) {
    ci((n) => {
      const { drag: r } = this.getProps();
      if (!Mh(n, r, this.currentDirection))
        return;
      const { projection: i } = this.visualElement, o = this.getAxisMotionValue(n);
      if (i && i.layout) {
        const { min: a, max: s } = i.layout.layoutBox[n];
        o.set(t[n] - Qt(a, s, 0.5));
      }
    });
  }
  /**
   * When the viewport resizes we want to check if the measured constraints
   * have changed and, if so, reposition the element within those new constraints
   * relative to where it was before the resize.
   */
  scalePositionWithinConstraints() {
    if (!this.visualElement.current)
      return;
    const { drag: t, dragConstraints: n } = this.getProps(), { projection: r } = this.visualElement;
    if (!Nl(n) || !r || !this.constraints)
      return;
    this.stopAnimation();
    const i = { x: 0, y: 0 };
    ci((a) => {
      const s = this.getAxisMotionValue(a);
      if (s && this.constraints !== !1) {
        const l = s.get();
        i[a] = j9({ min: l, max: l }, this.constraints[a]);
      }
    });
    const { transformTemplate: o } = this.visualElement.getProps();
    this.visualElement.current.style.transform = o ? o({}, "") : "none", r.root && r.root.updateScroll(), r.updateLayout(), this.resolveConstraints(), ci((a) => {
      if (!Mh(a, t, null))
        return;
      const s = this.getAxisMotionValue(a), { min: l, max: c } = this.constraints[a];
      s.set(Qt(l, c, i[a]));
    });
  }
  addListeners() {
    if (!this.visualElement.current)
      return;
    U9.set(this.visualElement, this);
    const t = this.visualElement.current, n = Do(t, "pointerdown", (l) => {
      const { drag: c, dragListener: f = !0 } = this.getProps();
      c && f && this.start(l);
    }), r = () => {
      const { dragConstraints: l } = this.getProps();
      Nl(l) && l.current && (this.constraints = this.resolveRefConstraints());
    }, { projection: i } = this.visualElement, o = i.addEventListener("measure", r);
    i && !i.layout && (i.root && i.root.updateScroll(), i.updateLayout()), Tt.read(r);
    const a = To(window, "resize", () => this.scalePositionWithinConstraints()), s = i.addEventListener("didUpdate", ({ delta: l, hasLayoutChanged: c }) => {
      this.isDragging && c && (ci((f) => {
        const d = this.getAxisMotionValue(f);
        d && (this.originPoint[f] += l[f].translate, d.set(d.get() + l[f].translate));
      }), this.visualElement.render());
    });
    return () => {
      a(), n(), o(), s && s();
    };
  }
  getProps() {
    const t = this.visualElement.getProps(), { drag: n = !1, dragDirectionLock: r = !1, dragPropagation: i = !1, dragConstraints: o = !1, dragElastic: a = $0, dragMomentum: s = !0 } = t;
    return {
      ...t,
      drag: n,
      dragDirectionLock: r,
      dragPropagation: i,
      dragConstraints: o,
      dragElastic: a,
      dragMomentum: s
    };
  }
}
function Mh(e, t, n) {
  return (t === !0 || t === e) && (n === null || n === e);
}
function K9(e, t = 10) {
  let n = null;
  return Math.abs(e.y) > t ? n = "y" : Math.abs(e.x) > t && (n = "x"), n;
}
class G9 extends Va {
  constructor(t) {
    super(t), this.removeGroupControls = qn, this.removeListeners = qn, this.controls = new H9(t);
  }
  mount() {
    const { dragControls: t } = this.node.getProps();
    t && (this.removeGroupControls = t.subscribe(this.controls)), this.removeListeners = this.controls.addListeners() || qn;
  }
  unmount() {
    this.removeGroupControls(), this.removeListeners();
  }
}
const IP = (e) => (t, n) => {
  e && Tt.postRender(() => e(t, n));
};
class Y9 extends Va {
  constructor() {
    super(...arguments), this.removePointerDownListener = qn;
  }
  onPointerDown(t) {
    this.session = new TI(t, this.createPanHandlers(), {
      transformPagePoint: this.node.getTransformPagePoint(),
      contextWindow: jI(this.node)
    });
  }
  createPanHandlers() {
    const { onPanSessionStart: t, onPanStart: n, onPan: r, onPanEnd: i } = this.node.getProps();
    return {
      onSessionStart: IP(t),
      onStart: IP(n),
      onMove: r,
      onEnd: (o, a) => {
        delete this.session, i && Tt.postRender(() => i(o, a));
      }
    };
  }
  mount() {
    this.removePointerDownListener = Do(this.node.current, "pointerdown", (t) => this.onPointerDown(t));
  }
  update() {
    this.session && this.session.updateHandlers(this.createPanHandlers());
  }
  unmount() {
    this.removePointerDownListener(), this.session && this.session.end();
  }
}
const wg = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(null);
function q9() {
  const e = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(wg);
  if (e === null)
    return [!0, null];
  const { isPresent: t, onExitComplete: n, register: r } = e, i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useId)();
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => r(i), []);
  const o = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => n && n(i), [i, n]);
  return !t && n ? [!1, o] : [!0];
}
const vf = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({}), LI = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({}), sp = {
  /**
   * Global flag as to whether the tree has animated since the last time
   * we resized the window
   */
  hasAnimatedSinceResize: !0,
  /**
   * We set this to true once, on the first update. Any nodes added to the tree beyond that
   * update will be given a `data-projection-id` attribute.
   */
  hasEverUpdated: !1
};
function RP(e, t) {
  return t.max === t.min ? 0 : e / (t.max - t.min) * 100;
}
const wu = {
  correct: (e, t) => {
    if (!t.target)
      return e;
    if (typeof e == "string")
      if (Be.test(e))
        e = parseFloat(e);
      else
        return e;
    const n = RP(e, t.target.x), r = RP(e, t.target.y);
    return `${n}% ${r}%`;
  }
}, X9 = {
  correct: (e, { treeScale: t, projectionDelta: n }) => {
    const r = e, i = Ba.parse(e);
    if (i.length > 5)
      return r;
    const o = Ba.createTransformer(e), a = typeof i[0] != "number" ? 1 : 0, s = n.x.scale * t.x, l = n.y.scale * t.y;
    i[0 + a] /= s, i[1 + a] /= l;
    const c = Qt(s, l, 0.5);
    return typeof i[2 + a] == "number" && (i[2 + a] /= c), typeof i[3 + a] == "number" && (i[3 + a] /= c), o(i);
  }
}, Ep = {};
function Z9(e) {
  Object.assign(Ep, e);
}
const { schedule: I1, cancel: ZEe } = FD(queueMicrotask, !1);
class J9 extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
  /**
   * This only mounts projection nodes for components that
   * need measuring, we might want to do it for all components
   * in order to incorporate transforms
   */
  componentDidMount() {
    const { visualElement: t, layoutGroup: n, switchLayoutGroup: r, layoutId: i } = this.props, { projection: o } = t;
    Z9(Q9), o && (n.group && n.group.add(o), r && r.register && i && r.register(o), o.root.didUpdate(), o.addEventListener("animationComplete", () => {
      this.safeToRemove();
    }), o.setOptions({
      ...o.options,
      onExitComplete: () => this.safeToRemove()
    })), sp.hasEverUpdated = !0;
  }
  getSnapshotBeforeUpdate(t) {
    const { layoutDependency: n, visualElement: r, drag: i, isPresent: o } = this.props, a = r.projection;
    return a && (a.isPresent = o, i || t.layoutDependency !== n || n === void 0 ? a.willUpdate() : this.safeToRemove(), t.isPresent !== o && (o ? a.promote() : a.relegate() || Tt.postRender(() => {
      const s = a.getStack();
      (!s || !s.members.length) && this.safeToRemove();
    }))), null;
  }
  componentDidUpdate() {
    const { projection: t } = this.props.visualElement;
    t && (t.root.didUpdate(), I1.postRender(() => {
      !t.currentAnimation && t.isLead() && this.safeToRemove();
    }));
  }
  componentWillUnmount() {
    const { visualElement: t, layoutGroup: n, switchLayoutGroup: r } = this.props, { projection: i } = t;
    i && (i.scheduleCheckAfterUnmount(), n && n.group && n.group.remove(i), r && r.deregister && r.deregister(i));
  }
  safeToRemove() {
    const { safeToRemove: t } = this.props;
    t && t();
  }
  render() {
    return null;
  }
}
function BI(e) {
  const [t, n] = q9(), r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(vf);
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(J9, { ...e, layoutGroup: r, switchLayoutGroup: (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(LI), isPresent: t, safeToRemove: n });
}
const Q9 = {
  borderRadius: {
    ...wu,
    applyTo: [
      "borderTopLeftRadius",
      "borderTopRightRadius",
      "borderBottomLeftRadius",
      "borderBottomRightRadius"
    ]
  },
  borderTopLeftRadius: wu,
  borderTopRightRadius: wu,
  borderBottomLeftRadius: wu,
  borderBottomRightRadius: wu,
  boxShadow: X9
}, FI = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], e7 = FI.length, jP = (e) => typeof e == "string" ? parseFloat(e) : e, LP = (e) => typeof e == "number" || Be.test(e);
function t7(e, t, n, r, i, o) {
  i ? (e.opacity = Qt(
    0,
    // TODO Reinstate this if only child
    n.opacity !== void 0 ? n.opacity : 1,
    n7(r)
  ), e.opacityExit = Qt(t.opacity !== void 0 ? t.opacity : 1, 0, r7(r))) : o && (e.opacity = Qt(t.opacity !== void 0 ? t.opacity : 1, n.opacity !== void 0 ? n.opacity : 1, r));
  for (let a = 0; a < e7; a++) {
    const s = `border${FI[a]}Radius`;
    let l = BP(t, s), c = BP(n, s);
    if (l === void 0 && c === void 0)
      continue;
    l || (l = 0), c || (c = 0), l === 0 || c === 0 || LP(l) === LP(c) ? (e[s] = Math.max(Qt(jP(l), jP(c), r), 0), (Yi.test(c) || Yi.test(l)) && (e[s] += "%")) : e[s] = c;
  }
  (t.rotate || n.rotate) && (e.rotate = Qt(t.rotate || 0, n.rotate || 0, r));
}
function BP(e, t) {
  return e[t] !== void 0 ? e[t] : e.borderRadius;
}
const n7 = /* @__PURE__ */ WI(0, 0.5, GD), r7 = /* @__PURE__ */ WI(0.5, 0.95, qn);
function WI(e, t, n) {
  return (r) => r < e ? 0 : r > t ? 1 : n(ec(e, t, r));
}
function FP(e, t) {
  e.min = t.min, e.max = t.max;
}
function oi(e, t) {
  FP(e.x, t.x), FP(e.y, t.y);
}
function WP(e, t) {
  e.translate = t.translate, e.scale = t.scale, e.originPoint = t.originPoint, e.origin = t.origin;
}
function zP(e, t, n, r, i) {
  return e -= t, e = Cp(e, 1 / n, r), i !== void 0 && (e = Cp(e, 1 / i, r)), e;
}
function i7(e, t = 0, n = 1, r = 0.5, i, o = e, a = e) {
  if (Yi.test(t) && (t = parseFloat(t), t = Qt(a.min, a.max, t / 100) - a.min), typeof t != "number")
    return;
  let s = Qt(o.min, o.max, r);
  e === o && (s -= t), e.min = zP(e.min, t, n, s, i), e.max = zP(e.max, t, n, s, i);
}
function VP(e, t, [n, r, i], o, a) {
  i7(e, t[n], t[r], t[i], t.scale, o, a);
}
const o7 = ["x", "scaleX", "originX"], a7 = ["y", "scaleY", "originY"];
function UP(e, t, n, r) {
  VP(e.x, t, o7, n ? n.x : void 0, r ? r.x : void 0), VP(e.y, t, a7, n ? n.y : void 0, r ? r.y : void 0);
}
function HP(e) {
  return e.translate === 0 && e.scale === 1;
}
function zI(e) {
  return HP(e.x) && HP(e.y);
}
function KP(e, t) {
  return e.min === t.min && e.max === t.max;
}
function s7(e, t) {
  return KP(e.x, t.x) && KP(e.y, t.y);
}
function GP(e, t) {
  return Math.round(e.min) === Math.round(t.min) && Math.round(e.max) === Math.round(t.max);
}
function VI(e, t) {
  return GP(e.x, t.x) && GP(e.y, t.y);
}
function YP(e) {
  return Kr(e.x) / Kr(e.y);
}
function qP(e, t) {
  return e.translate === t.translate && e.scale === t.scale && e.originPoint === t.originPoint;
}
class l7 {
  constructor() {
    this.members = [];
  }
  add(t) {
    M1(this.members, t), t.scheduleRender();
  }
  remove(t) {
    if (N1(this.members, t), t === this.prevLead && (this.prevLead = void 0), t === this.lead) {
      const n = this.members[this.members.length - 1];
      n && this.promote(n);
    }
  }
  relegate(t) {
    const n = this.members.findIndex((i) => t === i);
    if (n === 0)
      return !1;
    let r;
    for (let i = n; i >= 0; i--) {
      const o = this.members[i];
      if (o.isPresent !== !1) {
        r = o;
        break;
      }
    }
    return r ? (this.promote(r), !0) : !1;
  }
  promote(t, n) {
    const r = this.lead;
    if (t !== r && (this.prevLead = r, this.lead = t, t.show(), r)) {
      r.instance && r.scheduleRender(), t.scheduleRender(), t.resumeFrom = r, n && (t.resumeFrom.preserveOpacity = !0), r.snapshot && (t.snapshot = r.snapshot, t.snapshot.latestValues = r.animationValues || r.latestValues), t.root && t.root.isUpdating && (t.isLayoutDirty = !0);
      const { crossfade: i } = t.options;
      i === !1 && r.hide();
    }
  }
  exitAnimationComplete() {
    this.members.forEach((t) => {
      const { options: n, resumingFrom: r } = t;
      n.onExitComplete && n.onExitComplete(), r && r.options.onExitComplete && r.options.onExitComplete();
    });
  }
  scheduleRender() {
    this.members.forEach((t) => {
      t.instance && t.scheduleRender(!1);
    });
  }
  /**
   * Clear any leads that have been removed this render to prevent them from being
   * used in future animations and to prevent memory leaks
   */
  removeLeadSnapshot() {
    this.lead && this.lead.snapshot && (this.lead.snapshot = void 0);
  }
}
function c7(e, t, n) {
  let r = "";
  const i = e.x.translate / t.x, o = e.y.translate / t.y, a = (n == null ? void 0 : n.z) || 0;
  if ((i || o || a) && (r = `translate3d(${i}px, ${o}px, ${a}px) `), (t.x !== 1 || t.y !== 1) && (r += `scale(${1 / t.x}, ${1 / t.y}) `), n) {
    const { transformPerspective: c, rotate: f, rotateX: d, rotateY: p, skewX: m, skewY: y } = n;
    c && (r = `perspective(${c}px) ${r}`), f && (r += `rotate(${f}deg) `), d && (r += `rotateX(${d}deg) `), p && (r += `rotateY(${p}deg) `), m && (r += `skewX(${m}deg) `), y && (r += `skewY(${y}deg) `);
  }
  const s = e.x.scale * t.x, l = e.y.scale * t.y;
  return (s !== 1 || l !== 1) && (r += `scale(${s}, ${l})`), r || "none";
}
const u7 = (e, t) => e.depth - t.depth;
class f7 {
  constructor() {
    this.children = [], this.isDirty = !1;
  }
  add(t) {
    M1(this.children, t), this.isDirty = !0;
  }
  remove(t) {
    N1(this.children, t), this.isDirty = !0;
  }
  forEach(t) {
    this.isDirty && this.children.sort(u7), this.isDirty = !1, this.children.forEach(t);
  }
}
function lp(e) {
  const t = rr(e) ? e.get() : e;
  return n9(t) ? t.toValue() : t;
}
function d7(e, t) {
  const n = qi.now(), r = ({ timestamp: i }) => {
    const o = i - n;
    o >= t && (ja(r), e(o - t));
  };
  return Tt.read(r, !0), () => ja(r);
}
function h7(e) {
  return e instanceof SVGElement && e.tagName !== "svg";
}
function p7(e, t, n) {
  const r = rr(e) ? e : yf(e);
  return r.start(k1("", r, t, n)), r.animation;
}
const ms = {
  type: "projectionFrame",
  totalNodes: 0,
  resolvedTargetDeltas: 0,
  recalculatedProjection: 0
}, Bu = typeof window < "u" && window.MotionDebug !== void 0, lb = ["", "X", "Y", "Z"], m7 = { visibility: "hidden" }, XP = 1e3;
let g7 = 0;
function cb(e, t, n, r) {
  const { latestValues: i } = t;
  i[e] && (n[e] = i[e], t.setStaticValue(e, 0), r && (r[e] = 0));
}
function UI(e) {
  if (e.hasCheckedOptimisedAppear = !0, e.root === e)
    return;
  const { visualElement: t } = e.options;
  if (!t)
    return;
  const n = _I(t);
  if (window.MotionHasOptimisedAnimation(n, "transform")) {
    const { layout: i, layoutId: o } = e.options;
    window.MotionCancelOptimisedAnimation(n, "transform", Tt, !(i || o));
  }
  const { parent: r } = e;
  r && !r.hasCheckedOptimisedAppear && UI(r);
}
function HI({ attachResizeListener: e, defaultParent: t, measureScroll: n, checkIsScrollRoot: r, resetTransform: i }) {
  return class {
    constructor(a = {}, s = t == null ? void 0 : t()) {
      this.id = g7++, this.animationId = 0, this.children = /* @__PURE__ */ new Set(), this.options = {}, this.isTreeAnimating = !1, this.isAnimationBlocked = !1, this.isLayoutDirty = !1, this.isProjectionDirty = !1, this.isSharedProjectionDirty = !1, this.isTransformDirty = !1, this.updateManuallyBlocked = !1, this.updateBlockedByResize = !1, this.isUpdating = !1, this.isSVG = !1, this.needsReset = !1, this.shouldResetTransform = !1, this.hasCheckedOptimisedAppear = !1, this.treeScale = { x: 1, y: 1 }, this.eventHandlers = /* @__PURE__ */ new Map(), this.hasTreeAnimated = !1, this.updateScheduled = !1, this.scheduleUpdate = () => this.update(), this.projectionUpdateScheduled = !1, this.checkUpdateFailed = () => {
        this.isUpdating && (this.isUpdating = !1, this.clearAllSnapshots());
      }, this.updateProjection = () => {
        this.projectionUpdateScheduled = !1, Bu && (ms.totalNodes = ms.resolvedTargetDeltas = ms.recalculatedProjection = 0), this.nodes.forEach(b7), this.nodes.forEach(O7), this.nodes.forEach(A7), this.nodes.forEach(x7), Bu && window.MotionDebug.record(ms);
      }, this.resolvedRelativeTargetAt = 0, this.hasProjected = !1, this.isVisible = !0, this.animationProgress = 0, this.sharedNodes = /* @__PURE__ */ new Map(), this.latestValues = a, this.root = s ? s.root || s : this, this.path = s ? [...s.path, s] : [], this.parent = s, this.depth = s ? s.depth + 1 : 0;
      for (let l = 0; l < this.path.length; l++)
        this.path[l].shouldResetTransform = !0;
      this.root === this && (this.nodes = new f7());
    }
    addEventListener(a, s) {
      return this.eventHandlers.has(a) || this.eventHandlers.set(a, new $1()), this.eventHandlers.get(a).add(s);
    }
    notifyListeners(a, ...s) {
      const l = this.eventHandlers.get(a);
      l && l.notify(...s);
    }
    hasListeners(a) {
      return this.eventHandlers.has(a);
    }
    /**
     * Lifecycles
     */
    mount(a, s = this.root.hasTreeAnimated) {
      if (this.instance)
        return;
      this.isSVG = h7(a), this.instance = a;
      const { layoutId: l, layout: c, visualElement: f } = this.options;
      if (f && !f.current && f.mount(a), this.root.nodes.add(this), this.parent && this.parent.children.add(this), s && (c || l) && (this.isLayoutDirty = !0), e) {
        let d;
        const p = () => this.root.updateBlockedByResize = !1;
        e(a, () => {
          this.root.updateBlockedByResize = !0, d && d(), d = d7(p, 250), sp.hasAnimatedSinceResize && (sp.hasAnimatedSinceResize = !1, this.nodes.forEach(JP));
        });
      }
      l && this.root.registerSharedNode(l, this), this.options.animate !== !1 && f && (l || c) && this.addEventListener("didUpdate", ({ delta: d, hasLayoutChanged: p, hasRelativeTargetChanged: m, layout: y }) => {
        if (this.isTreeAnimationBlocked()) {
          this.target = void 0, this.relativeTarget = void 0;
          return;
        }
        const g = this.options.transition || f.getDefaultTransition() || k7, { onLayoutAnimationStart: v, onLayoutAnimationComplete: x } = f.getProps(), w = !this.targetLayout || !VI(this.targetLayout, y) || m, S = !p && m;
        if (this.options.layoutRoot || this.resumeFrom && this.resumeFrom.instance || S || p && (w || !this.currentAnimation)) {
          this.resumeFrom && (this.resumingFrom = this.resumeFrom, this.resumingFrom.resumingFrom = void 0), this.setAnimationOrigin(d, S);
          const A = {
            ...g1(g, "layout"),
            onPlay: v,
            onComplete: x
          };
          (f.shouldReduceMotion || this.options.layoutRoot) && (A.delay = 0, A.type = !1), this.startAnimation(A);
        } else
          p || JP(this), this.isLead() && this.options.onExitComplete && this.options.onExitComplete();
        this.targetLayout = y;
      });
    }
    unmount() {
      this.options.layoutId && this.willUpdate(), this.root.nodes.remove(this);
      const a = this.getStack();
      a && a.remove(this), this.parent && this.parent.children.delete(this), this.instance = void 0, ja(this.updateProjection);
    }
    // only on the root
    blockUpdate() {
      this.updateManuallyBlocked = !0;
    }
    unblockUpdate() {
      this.updateManuallyBlocked = !1;
    }
    isUpdateBlocked() {
      return this.updateManuallyBlocked || this.updateBlockedByResize;
    }
    isTreeAnimationBlocked() {
      return this.isAnimationBlocked || this.parent && this.parent.isTreeAnimationBlocked() || !1;
    }
    // Note: currently only running on root node
    startUpdate() {
      this.isUpdateBlocked() || (this.isUpdating = !0, this.nodes && this.nodes.forEach(T7), this.animationId++);
    }
    getTransformTemplate() {
      const { visualElement: a } = this.options;
      return a && a.getProps().transformTemplate;
    }
    willUpdate(a = !0) {
      if (this.root.hasTreeAnimated = !0, this.root.isUpdateBlocked()) {
        this.options.onExitComplete && this.options.onExitComplete();
        return;
      }
      if (window.MotionCancelOptimisedAnimation && !this.hasCheckedOptimisedAppear && UI(this), !this.root.isUpdating && this.root.startUpdate(), this.isLayoutDirty)
        return;
      this.isLayoutDirty = !0;
      for (let f = 0; f < this.path.length; f++) {
        const d = this.path[f];
        d.shouldResetTransform = !0, d.updateScroll("snapshot"), d.options.layoutRoot && d.willUpdate(!1);
      }
      const { layoutId: s, layout: l } = this.options;
      if (s === void 0 && !l)
        return;
      const c = this.getTransformTemplate();
      this.prevTransformTemplateValue = c ? c(this.latestValues, "") : void 0, this.updateSnapshot(), a && this.notifyListeners("willUpdate");
    }
    update() {
      if (this.updateScheduled = !1, this.isUpdateBlocked()) {
        this.unblockUpdate(), this.clearAllSnapshots(), this.nodes.forEach(ZP);
        return;
      }
      this.isUpdating || this.nodes.forEach(_7), this.isUpdating = !1, this.nodes.forEach(S7), this.nodes.forEach(y7), this.nodes.forEach(v7), this.clearAllSnapshots();
      const s = qi.now();
      zn.delta = La(0, 1e3 / 60, s - zn.timestamp), zn.timestamp = s, zn.isProcessing = !0, eb.update.process(zn), eb.preRender.process(zn), eb.render.process(zn), zn.isProcessing = !1;
    }
    didUpdate() {
      this.updateScheduled || (this.updateScheduled = !0, I1.read(this.scheduleUpdate));
    }
    clearAllSnapshots() {
      this.nodes.forEach(w7), this.sharedNodes.forEach(P7);
    }
    scheduleUpdateProjection() {
      this.projectionUpdateScheduled || (this.projectionUpdateScheduled = !0, Tt.preRender(this.updateProjection, !1, !0));
    }
    scheduleCheckAfterUnmount() {
      Tt.postRender(() => {
        this.isLayoutDirty ? this.root.didUpdate() : this.root.checkUpdateFailed();
      });
    }
    /**
     * Update measurements
     */
    updateSnapshot() {
      this.snapshot || !this.instance || (this.snapshot = this.measure());
    }
    updateLayout() {
      if (!this.instance || (this.updateScroll(), !(this.options.alwaysMeasureLayout && this.isLead()) && !this.isLayoutDirty))
        return;
      if (this.resumeFrom && !this.resumeFrom.instance)
        for (let l = 0; l < this.path.length; l++)
          this.path[l].updateScroll();
      const a = this.layout;
      this.layout = this.measure(!1), this.layoutCorrected = ln(), this.isLayoutDirty = !1, this.projectionDelta = void 0, this.notifyListeners("measure", this.layout.layoutBox);
      const { visualElement: s } = this.options;
      s && s.notify("LayoutMeasure", this.layout.layoutBox, a ? a.layoutBox : void 0);
    }
    updateScroll(a = "measure") {
      let s = !!(this.options.layoutScroll && this.instance);
      if (this.scroll && this.scroll.animationId === this.root.animationId && this.scroll.phase === a && (s = !1), s) {
        const l = r(this.instance);
        this.scroll = {
          animationId: this.root.animationId,
          phase: a,
          isRoot: l,
          offset: n(this.instance),
          wasRoot: this.scroll ? this.scroll.isRoot : l
        };
      }
    }
    resetTransform() {
      if (!i)
        return;
      const a = this.isLayoutDirty || this.shouldResetTransform || this.options.alwaysMeasureLayout, s = this.projectionDelta && !zI(this.projectionDelta), l = this.getTransformTemplate(), c = l ? l(this.latestValues, "") : void 0, f = c !== this.prevTransformTemplateValue;
      a && (s || ps(this.latestValues) || f) && (i(this.instance, c), this.shouldResetTransform = !1, this.scheduleRender());
    }
    measure(a = !0) {
      const s = this.measurePageBox();
      let l = this.removeElementScroll(s);
      return a && (l = this.removeTransform(l)), M7(l), {
        animationId: this.root.animationId,
        measuredBox: s,
        layoutBox: l,
        latestValues: {},
        source: this.id
      };
    }
    measurePageBox() {
      var a;
      const { visualElement: s } = this.options;
      if (!s)
        return ln();
      const l = s.measureViewportBox();
      if (!(((a = this.scroll) === null || a === void 0 ? void 0 : a.wasRoot) || this.path.some(N7))) {
        const { scroll: f } = this.root;
        f && (Dl(l.x, f.offset.x), Dl(l.y, f.offset.y));
      }
      return l;
    }
    removeElementScroll(a) {
      var s;
      const l = ln();
      if (oi(l, a), !((s = this.scroll) === null || s === void 0) && s.wasRoot)
        return l;
      for (let c = 0; c < this.path.length; c++) {
        const f = this.path[c], { scroll: d, options: p } = f;
        f !== this.root && d && p.layoutScroll && (d.wasRoot && oi(l, a), Dl(l.x, d.offset.x), Dl(l.y, d.offset.y));
      }
      return l;
    }
    applyTransform(a, s = !1) {
      const l = ln();
      oi(l, a);
      for (let c = 0; c < this.path.length; c++) {
        const f = this.path[c];
        !s && f.options.layoutScroll && f.scroll && f !== f.root && Il(l, {
          x: -f.scroll.offset.x,
          y: -f.scroll.offset.y
        }), ps(f.latestValues) && Il(l, f.latestValues);
      }
      return ps(this.latestValues) && Il(l, this.latestValues), l;
    }
    removeTransform(a) {
      const s = ln();
      oi(s, a);
      for (let l = 0; l < this.path.length; l++) {
        const c = this.path[l];
        if (!c.instance || !ps(c.latestValues))
          continue;
        D0(c.latestValues) && c.updateSnapshot();
        const f = ln(), d = c.measurePageBox();
        oi(f, d), UP(s, c.latestValues, c.snapshot ? c.snapshot.layoutBox : void 0, f);
      }
      return ps(this.latestValues) && UP(s, this.latestValues), s;
    }
    setTargetDelta(a) {
      this.targetDelta = a, this.root.scheduleUpdateProjection(), this.isProjectionDirty = !0;
    }
    setOptions(a) {
      this.options = {
        ...this.options,
        ...a,
        crossfade: a.crossfade !== void 0 ? a.crossfade : !0
      };
    }
    clearMeasurements() {
      this.scroll = void 0, this.layout = void 0, this.snapshot = void 0, this.prevTransformTemplateValue = void 0, this.targetDelta = void 0, this.target = void 0, this.isLayoutDirty = !1;
    }
    forceRelativeParentToResolveTarget() {
      this.relativeParent && this.relativeParent.resolvedRelativeTargetAt !== zn.timestamp && this.relativeParent.resolveTargetDelta(!0);
    }
    resolveTargetDelta(a = !1) {
      var s;
      const l = this.getLead();
      this.isProjectionDirty || (this.isProjectionDirty = l.isProjectionDirty), this.isTransformDirty || (this.isTransformDirty = l.isTransformDirty), this.isSharedProjectionDirty || (this.isSharedProjectionDirty = l.isSharedProjectionDirty);
      const c = !!this.resumingFrom || this !== l;
      if (!(a || c && this.isSharedProjectionDirty || this.isProjectionDirty || !((s = this.parent) === null || s === void 0) && s.isProjectionDirty || this.attemptToResolveRelativeTarget || this.root.updateBlockedByResize))
        return;
      const { layout: d, layoutId: p } = this.options;
      if (!(!this.layout || !(d || p))) {
        if (this.resolvedRelativeTargetAt = zn.timestamp, !this.targetDelta && !this.relativeTarget) {
          const m = this.getClosestProjectingParent();
          m && m.layout && this.animationProgress !== 1 ? (this.relativeParent = m, this.forceRelativeParentToResolveTarget(), this.relativeTarget = ln(), this.relativeTargetOrigin = ln(), Yu(this.relativeTargetOrigin, this.layout.layoutBox, m.layout.layoutBox), oi(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
        }
        if (!(!this.relativeTarget && !this.targetDelta)) {
          if (this.target || (this.target = ln(), this.targetWithTransforms = ln()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), $9(this.target, this.relativeTarget, this.relativeParent.target)) : this.targetDelta ? (this.resumingFrom ? this.target = this.applyTransform(this.layout.layoutBox) : oi(this.target, this.layout.layoutBox), II(this.target, this.targetDelta)) : oi(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget) {
            this.attemptToResolveRelativeTarget = !1;
            const m = this.getClosestProjectingParent();
            m && !!m.resumingFrom == !!this.resumingFrom && !m.options.layoutScroll && m.target && this.animationProgress !== 1 ? (this.relativeParent = m, this.forceRelativeParentToResolveTarget(), this.relativeTarget = ln(), this.relativeTargetOrigin = ln(), Yu(this.relativeTargetOrigin, this.target, m.target), oi(this.relativeTarget, this.relativeTargetOrigin)) : this.relativeParent = this.relativeTarget = void 0;
          }
          Bu && ms.resolvedTargetDeltas++;
        }
      }
    }
    getClosestProjectingParent() {
      if (!(!this.parent || D0(this.parent.latestValues) || DI(this.parent.latestValues)))
        return this.parent.isProjecting() ? this.parent : this.parent.getClosestProjectingParent();
    }
    isProjecting() {
      return !!((this.relativeTarget || this.targetDelta || this.options.layoutRoot) && this.layout);
    }
    calcProjection() {
      var a;
      const s = this.getLead(), l = !!this.resumingFrom || this !== s;
      let c = !0;
      if ((this.isProjectionDirty || !((a = this.parent) === null || a === void 0) && a.isProjectionDirty) && (c = !1), l && (this.isSharedProjectionDirty || this.isTransformDirty) && (c = !1), this.resolvedRelativeTargetAt === zn.timestamp && (c = !1), c)
        return;
      const { layout: f, layoutId: d } = this.options;
      if (this.isTreeAnimating = !!(this.parent && this.parent.isTreeAnimating || this.currentAnimation || this.pendingAnimation), this.isTreeAnimating || (this.targetDelta = this.relativeTarget = void 0), !this.layout || !(f || d))
        return;
      oi(this.layoutCorrected, this.layout.layoutBox);
      const p = this.treeScale.x, m = this.treeScale.y;
      z9(this.layoutCorrected, this.treeScale, this.path, l), s.layout && !s.target && (this.treeScale.x !== 1 || this.treeScale.y !== 1) && (s.target = s.layout.layoutBox, s.targetWithTransforms = ln());
      const { target: y } = s;
      if (!y) {
        this.prevProjectionDelta && (this.createProjectionDeltas(), this.scheduleRender());
        return;
      }
      !this.projectionDelta || !this.prevProjectionDelta ? this.createProjectionDeltas() : (WP(this.prevProjectionDelta.x, this.projectionDelta.x), WP(this.prevProjectionDelta.y, this.projectionDelta.y)), Gu(this.projectionDelta, this.layoutCorrected, y, this.latestValues), (this.treeScale.x !== p || this.treeScale.y !== m || !qP(this.projectionDelta.x, this.prevProjectionDelta.x) || !qP(this.projectionDelta.y, this.prevProjectionDelta.y)) && (this.hasProjected = !0, this.scheduleRender(), this.notifyListeners("projectionUpdate", y)), Bu && ms.recalculatedProjection++;
    }
    hide() {
      this.isVisible = !1;
    }
    show() {
      this.isVisible = !0;
    }
    scheduleRender(a = !0) {
      var s;
      if ((s = this.options.visualElement) === null || s === void 0 || s.scheduleRender(), a) {
        const l = this.getStack();
        l && l.scheduleRender();
      }
      this.resumingFrom && !this.resumingFrom.instance && (this.resumingFrom = void 0);
    }
    createProjectionDeltas() {
      this.prevProjectionDelta = $l(), this.projectionDelta = $l(), this.projectionDeltaWithTransform = $l();
    }
    setAnimationOrigin(a, s = !1) {
      const l = this.snapshot, c = l ? l.latestValues : {}, f = { ...this.latestValues }, d = $l();
      (!this.relativeParent || !this.relativeParent.options.layoutRoot) && (this.relativeTarget = this.relativeTargetOrigin = void 0), this.attemptToResolveRelativeTarget = !s;
      const p = ln(), m = l ? l.source : void 0, y = this.layout ? this.layout.source : void 0, g = m !== y, v = this.getStack(), x = !v || v.members.length <= 1, w = !!(g && !x && this.options.crossfade === !0 && !this.path.some(E7));
      this.animationProgress = 0;
      let S;
      this.mixTargetDelta = (A) => {
        const _ = A / 1e3;
        QP(d.x, a.x, _), QP(d.y, a.y, _), this.setTargetDelta(d), this.relativeTarget && this.relativeTargetOrigin && this.layout && this.relativeParent && this.relativeParent.layout && (Yu(p, this.layout.layoutBox, this.relativeParent.layout.layoutBox), C7(this.relativeTarget, this.relativeTargetOrigin, p, _), S && s7(this.relativeTarget, S) && (this.isProjectionDirty = !1), S || (S = ln()), oi(S, this.relativeTarget)), g && (this.animationValues = f, t7(f, c, this.latestValues, _, w, x)), this.root.scheduleUpdateProjection(), this.scheduleRender(), this.animationProgress = _;
      }, this.mixTargetDelta(this.options.layoutRoot ? 1e3 : 0);
    }
    startAnimation(a) {
      this.notifyListeners("animationStart"), this.currentAnimation && this.currentAnimation.stop(), this.resumingFrom && this.resumingFrom.currentAnimation && this.resumingFrom.currentAnimation.stop(), this.pendingAnimation && (ja(this.pendingAnimation), this.pendingAnimation = void 0), this.pendingAnimation = Tt.update(() => {
        sp.hasAnimatedSinceResize = !0, this.currentAnimation = p7(0, XP, {
          ...a,
          onUpdate: (s) => {
            this.mixTargetDelta(s), a.onUpdate && a.onUpdate(s);
          },
          onComplete: () => {
            a.onComplete && a.onComplete(), this.completeAnimation();
          }
        }), this.resumingFrom && (this.resumingFrom.currentAnimation = this.currentAnimation), this.pendingAnimation = void 0;
      });
    }
    completeAnimation() {
      this.resumingFrom && (this.resumingFrom.currentAnimation = void 0, this.resumingFrom.preserveOpacity = void 0);
      const a = this.getStack();
      a && a.exitAnimationComplete(), this.resumingFrom = this.currentAnimation = this.animationValues = void 0, this.notifyListeners("animationComplete");
    }
    finishAnimation() {
      this.currentAnimation && (this.mixTargetDelta && this.mixTargetDelta(XP), this.currentAnimation.stop()), this.completeAnimation();
    }
    applyTransformsToTarget() {
      const a = this.getLead();
      let { targetWithTransforms: s, target: l, layout: c, latestValues: f } = a;
      if (!(!s || !l || !c)) {
        if (this !== a && this.layout && c && KI(this.options.animationType, this.layout.layoutBox, c.layoutBox)) {
          l = this.target || ln();
          const d = Kr(this.layout.layoutBox.x);
          l.x.min = a.target.x.min, l.x.max = l.x.min + d;
          const p = Kr(this.layout.layoutBox.y);
          l.y.min = a.target.y.min, l.y.max = l.y.min + p;
        }
        oi(s, l), Il(s, f), Gu(this.projectionDeltaWithTransform, this.layoutCorrected, s, f);
      }
    }
    registerSharedNode(a, s) {
      this.sharedNodes.has(a) || this.sharedNodes.set(a, new l7()), this.sharedNodes.get(a).add(s);
      const c = s.options.initialPromotionConfig;
      s.promote({
        transition: c ? c.transition : void 0,
        preserveFollowOpacity: c && c.shouldPreserveFollowOpacity ? c.shouldPreserveFollowOpacity(s) : void 0
      });
    }
    isLead() {
      const a = this.getStack();
      return a ? a.lead === this : !0;
    }
    getLead() {
      var a;
      const { layoutId: s } = this.options;
      return s ? ((a = this.getStack()) === null || a === void 0 ? void 0 : a.lead) || this : this;
    }
    getPrevLead() {
      var a;
      const { layoutId: s } = this.options;
      return s ? (a = this.getStack()) === null || a === void 0 ? void 0 : a.prevLead : void 0;
    }
    getStack() {
      const { layoutId: a } = this.options;
      if (a)
        return this.root.sharedNodes.get(a);
    }
    promote({ needsReset: a, transition: s, preserveFollowOpacity: l } = {}) {
      const c = this.getStack();
      c && c.promote(this, l), a && (this.projectionDelta = void 0, this.needsReset = !0), s && this.setOptions({ transition: s });
    }
    relegate() {
      const a = this.getStack();
      return a ? a.relegate(this) : !1;
    }
    resetSkewAndRotation() {
      const { visualElement: a } = this.options;
      if (!a)
        return;
      let s = !1;
      const { latestValues: l } = a;
      if ((l.z || l.rotate || l.rotateX || l.rotateY || l.rotateZ || l.skewX || l.skewY) && (s = !0), !s)
        return;
      const c = {};
      l.z && cb("z", a, c, this.animationValues);
      for (let f = 0; f < lb.length; f++)
        cb(`rotate${lb[f]}`, a, c, this.animationValues), cb(`skew${lb[f]}`, a, c, this.animationValues);
      a.render();
      for (const f in c)
        a.setStaticValue(f, c[f]), this.animationValues && (this.animationValues[f] = c[f]);
      a.scheduleRender();
    }
    getProjectionStyles(a) {
      var s, l;
      if (!this.instance || this.isSVG)
        return;
      if (!this.isVisible)
        return m7;
      const c = {
        visibility: ""
      }, f = this.getTransformTemplate();
      if (this.needsReset)
        return this.needsReset = !1, c.opacity = "", c.pointerEvents = lp(a == null ? void 0 : a.pointerEvents) || "", c.transform = f ? f(this.latestValues, "") : "none", c;
      const d = this.getLead();
      if (!this.projectionDelta || !this.layout || !d.target) {
        const g = {};
        return this.options.layoutId && (g.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1, g.pointerEvents = lp(a == null ? void 0 : a.pointerEvents) || ""), this.hasProjected && !ps(this.latestValues) && (g.transform = f ? f({}, "") : "none", this.hasProjected = !1), g;
      }
      const p = d.animationValues || d.latestValues;
      this.applyTransformsToTarget(), c.transform = c7(this.projectionDeltaWithTransform, this.treeScale, p), f && (c.transform = f(p, c.transform));
      const { x: m, y } = this.projectionDelta;
      c.transformOrigin = `${m.origin * 100}% ${y.origin * 100}% 0`, d.animationValues ? c.opacity = d === this ? (l = (s = p.opacity) !== null && s !== void 0 ? s : this.latestValues.opacity) !== null && l !== void 0 ? l : 1 : this.preserveOpacity ? this.latestValues.opacity : p.opacityExit : c.opacity = d === this ? p.opacity !== void 0 ? p.opacity : "" : p.opacityExit !== void 0 ? p.opacityExit : 0;
      for (const g in Ep) {
        if (p[g] === void 0)
          continue;
        const { correct: v, applyTo: x } = Ep[g], w = c.transform === "none" ? p[g] : v(p[g], d);
        if (x) {
          const S = x.length;
          for (let A = 0; A < S; A++)
            c[x[A]] = w;
        } else
          c[g] = w;
      }
      return this.options.layoutId && (c.pointerEvents = d === this ? lp(a == null ? void 0 : a.pointerEvents) || "" : "none"), c;
    }
    clearSnapshot() {
      this.resumeFrom = this.snapshot = void 0;
    }
    // Only run on root
    resetTree() {
      this.root.nodes.forEach((a) => {
        var s;
        return (s = a.currentAnimation) === null || s === void 0 ? void 0 : s.stop();
      }), this.root.nodes.forEach(ZP), this.root.sharedNodes.clear();
    }
  };
}
function y7(e) {
  e.updateLayout();
}
function v7(e) {
  var t;
  const n = ((t = e.resumeFrom) === null || t === void 0 ? void 0 : t.snapshot) || e.snapshot;
  if (e.isLead() && e.layout && n && e.hasListeners("didUpdate")) {
    const { layoutBox: r, measuredBox: i } = e.layout, { animationType: o } = e.options, a = n.source !== e.layout.source;
    o === "size" ? ci((d) => {
      const p = a ? n.measuredBox[d] : n.layoutBox[d], m = Kr(p);
      p.min = r[d].min, p.max = p.min + m;
    }) : KI(o, n.layoutBox, r) && ci((d) => {
      const p = a ? n.measuredBox[d] : n.layoutBox[d], m = Kr(r[d]);
      p.max = p.min + m, e.relativeTarget && !e.currentAnimation && (e.isProjectionDirty = !0, e.relativeTarget[d].max = e.relativeTarget[d].min + m);
    });
    const s = $l();
    Gu(s, r, n.layoutBox);
    const l = $l();
    a ? Gu(l, e.applyTransform(i, !0), n.measuredBox) : Gu(l, r, n.layoutBox);
    const c = !zI(s);
    let f = !1;
    if (!e.resumeFrom) {
      const d = e.getClosestProjectingParent();
      if (d && !d.resumeFrom) {
        const { snapshot: p, layout: m } = d;
        if (p && m) {
          const y = ln();
          Yu(y, n.layoutBox, p.layoutBox);
          const g = ln();
          Yu(g, r, m.layoutBox), VI(y, g) || (f = !0), d.options.layoutRoot && (e.relativeTarget = g, e.relativeTargetOrigin = y, e.relativeParent = d);
        }
      }
    }
    e.notifyListeners("didUpdate", {
      layout: r,
      snapshot: n,
      delta: l,
      layoutDelta: s,
      hasLayoutChanged: c,
      hasRelativeTargetChanged: f
    });
  } else if (e.isLead()) {
    const { onExitComplete: r } = e.options;
    r && r();
  }
  e.options.transition = void 0;
}
function b7(e) {
  Bu && ms.totalNodes++, e.parent && (e.isProjecting() || (e.isProjectionDirty = e.parent.isProjectionDirty), e.isSharedProjectionDirty || (e.isSharedProjectionDirty = !!(e.isProjectionDirty || e.parent.isProjectionDirty || e.parent.isSharedProjectionDirty)), e.isTransformDirty || (e.isTransformDirty = e.parent.isTransformDirty));
}
function x7(e) {
  e.isProjectionDirty = e.isSharedProjectionDirty = e.isTransformDirty = !1;
}
function w7(e) {
  e.clearSnapshot();
}
function ZP(e) {
  e.clearMeasurements();
}
function _7(e) {
  e.isLayoutDirty = !1;
}
function S7(e) {
  const { visualElement: t } = e.options;
  t && t.getProps().onBeforeLayoutMeasure && t.notify("BeforeLayoutMeasure"), e.resetTransform();
}
function JP(e) {
  e.finishAnimation(), e.targetDelta = e.relativeTarget = e.target = void 0, e.isProjectionDirty = !0;
}
function O7(e) {
  e.resolveTargetDelta();
}
function A7(e) {
  e.calcProjection();
}
function T7(e) {
  e.resetSkewAndRotation();
}
function P7(e) {
  e.removeLeadSnapshot();
}
function QP(e, t, n) {
  e.translate = Qt(t.translate, 0, n), e.scale = Qt(t.scale, 1, n), e.origin = t.origin, e.originPoint = t.originPoint;
}
function eC(e, t, n, r) {
  e.min = Qt(t.min, n.min, r), e.max = Qt(t.max, n.max, r);
}
function C7(e, t, n, r) {
  eC(e.x, t.x, n.x, r), eC(e.y, t.y, n.y, r);
}
function E7(e) {
  return e.animationValues && e.animationValues.opacityExit !== void 0;
}
const k7 = {
  duration: 0.45,
  ease: [0.4, 0, 0.1, 1]
}, tC = (e) => typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().includes(e), nC = tC("applewebkit/") && !tC("chrome/") ? Math.round : qn;
function rC(e) {
  e.min = nC(e.min), e.max = nC(e.max);
}
function M7(e) {
  rC(e.x), rC(e.y);
}
function KI(e, t, n) {
  return e === "position" || e === "preserve-aspect" && !N9(YP(t), YP(n), 0.2);
}
function N7(e) {
  var t;
  return e !== e.root && ((t = e.scroll) === null || t === void 0 ? void 0 : t.wasRoot);
}
const $7 = HI({
  attachResizeListener: (e, t) => To(e, "resize", t),
  measureScroll: () => ({
    x: document.documentElement.scrollLeft || document.body.scrollLeft,
    y: document.documentElement.scrollTop || document.body.scrollTop
  }),
  checkIsScrollRoot: () => !0
}), ub = {
  current: void 0
}, GI = HI({
  measureScroll: (e) => ({
    x: e.scrollLeft,
    y: e.scrollTop
  }),
  defaultParent: () => {
    if (!ub.current) {
      const e = new $7({});
      e.mount(window), e.setOptions({ layoutScroll: !0 }), ub.current = e;
    }
    return ub.current;
  },
  resetTransform: (e, t) => {
    e.style.transform = t !== void 0 ? t : "none";
  },
  checkIsScrollRoot: (e) => window.getComputedStyle(e).position === "fixed"
}), D7 = {
  pan: {
    Feature: Y9
  },
  drag: {
    Feature: G9,
    ProjectionNode: GI,
    MeasureLayout: BI
  }
};
function iC(e, t) {
  const n = t ? "pointerenter" : "pointerleave", r = t ? "onHoverStart" : "onHoverEnd", i = (o, a) => {
    if (o.pointerType === "touch" || kI())
      return;
    const s = e.getProps();
    e.animationState && s.whileHover && e.animationState.setActive("whileHover", t);
    const l = s[r];
    l && Tt.postRender(() => l(o, a));
  };
  return Do(e.current, n, i, {
    passive: !e.getProps()[r]
  });
}
class I7 extends Va {
  mount() {
    this.unmount = $o(iC(this.node, !0), iC(this.node, !1));
  }
  unmount() {
  }
}
class R7 extends Va {
  constructor() {
    super(...arguments), this.isActive = !1;
  }
  onFocus() {
    let t = !1;
    try {
      t = this.node.current.matches(":focus-visible");
    } catch {
      t = !0;
    }
    !t || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
  }
  onBlur() {
    !this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
  }
  mount() {
    this.unmount = $o(To(this.node.current, "focus", () => this.onFocus()), To(this.node.current, "blur", () => this.onBlur()));
  }
  unmount() {
  }
}
const YI = (e, t) => t ? e === t ? !0 : YI(e, t.parentElement) : !1;
function fb(e, t) {
  if (!t)
    return;
  const n = new PointerEvent("pointer" + e);
  t(n, xg(n));
}
class j7 extends Va {
  constructor() {
    super(...arguments), this.removeStartListeners = qn, this.removeEndListeners = qn, this.removeAccessibleListeners = qn, this.startPointerPress = (t, n) => {
      if (this.isPressing)
        return;
      this.removeEndListeners();
      const r = this.node.getProps(), o = Do(window, "pointerup", (s, l) => {
        if (!this.checkPressEnd())
          return;
        const { onTap: c, onTapCancel: f, globalTapTarget: d } = this.node.getProps(), p = !d && !YI(this.node.current, s.target) ? f : c;
        p && Tt.update(() => p(s, l));
      }, {
        passive: !(r.onTap || r.onPointerUp)
      }), a = Do(window, "pointercancel", (s, l) => this.cancelPress(s, l), {
        passive: !(r.onTapCancel || r.onPointerCancel)
      });
      this.removeEndListeners = $o(o, a), this.startPress(t, n);
    }, this.startAccessiblePress = () => {
      const t = (o) => {
        if (o.key !== "Enter" || this.isPressing)
          return;
        const a = (s) => {
          s.key !== "Enter" || !this.checkPressEnd() || fb("up", (l, c) => {
            const { onTap: f } = this.node.getProps();
            f && Tt.postRender(() => f(l, c));
          });
        };
        this.removeEndListeners(), this.removeEndListeners = To(this.node.current, "keyup", a), fb("down", (s, l) => {
          this.startPress(s, l);
        });
      }, n = To(this.node.current, "keydown", t), r = () => {
        this.isPressing && fb("cancel", (o, a) => this.cancelPress(o, a));
      }, i = To(this.node.current, "blur", r);
      this.removeAccessibleListeners = $o(n, i);
    };
  }
  startPress(t, n) {
    this.isPressing = !0;
    const { onTapStart: r, whileTap: i } = this.node.getProps();
    i && this.node.animationState && this.node.animationState.setActive("whileTap", !0), r && Tt.postRender(() => r(t, n));
  }
  checkPressEnd() {
    return this.removeEndListeners(), this.isPressing = !1, this.node.getProps().whileTap && this.node.animationState && this.node.animationState.setActive("whileTap", !1), !kI();
  }
  cancelPress(t, n) {
    if (!this.checkPressEnd())
      return;
    const { onTapCancel: r } = this.node.getProps();
    r && Tt.postRender(() => r(t, n));
  }
  mount() {
    const t = this.node.getProps(), n = Do(t.globalTapTarget ? window : this.node.current, "pointerdown", this.startPointerPress, {
      passive: !(t.onTapStart || t.onPointerStart)
    }), r = To(this.node.current, "focus", this.startAccessiblePress);
    this.removeStartListeners = $o(n, r);
  }
  unmount() {
    this.removeStartListeners(), this.removeEndListeners(), this.removeAccessibleListeners();
  }
}
const R0 = /* @__PURE__ */ new WeakMap(), db = /* @__PURE__ */ new WeakMap(), L7 = (e) => {
  const t = R0.get(e.target);
  t && t(e);
}, B7 = (e) => {
  e.forEach(L7);
};
function F7({ root: e, ...t }) {
  const n = e || document;
  db.has(n) || db.set(n, {});
  const r = db.get(n), i = JSON.stringify(t);
  return r[i] || (r[i] = new IntersectionObserver(B7, { root: e, ...t })), r[i];
}
function W7(e, t, n) {
  const r = F7(t);
  return R0.set(e, n), r.observe(e), () => {
    R0.delete(e), r.unobserve(e);
  };
}
const z7 = {
  some: 0,
  all: 1
};
class V7 extends Va {
  constructor() {
    super(...arguments), this.hasEnteredView = !1, this.isInView = !1;
  }
  startObserver() {
    this.unmount();
    const { viewport: t = {} } = this.node.getProps(), { root: n, margin: r, amount: i = "some", once: o } = t, a = {
      root: n ? n.current : void 0,
      rootMargin: r,
      threshold: typeof i == "number" ? i : z7[i]
    }, s = (l) => {
      const { isIntersecting: c } = l;
      if (this.isInView === c || (this.isInView = c, o && !c && this.hasEnteredView))
        return;
      c && (this.hasEnteredView = !0), this.node.animationState && this.node.animationState.setActive("whileInView", c);
      const { onViewportEnter: f, onViewportLeave: d } = this.node.getProps(), p = c ? f : d;
      p && p(l);
    };
    return W7(this.node.current, a, s);
  }
  mount() {
    this.startObserver();
  }
  update() {
    if (typeof IntersectionObserver > "u")
      return;
    const { props: t, prevProps: n } = this.node;
    ["amount", "margin", "root"].some(U7(t, n)) && this.startObserver();
  }
  unmount() {
  }
}
function U7({ viewport: e = {} }, { viewport: t = {} } = {}) {
  return (n) => e[n] !== t[n];
}
const H7 = {
  inView: {
    Feature: V7
  },
  tap: {
    Feature: j7
  },
  focus: {
    Feature: R7
  },
  hover: {
    Feature: I7
  }
}, K7 = {
  layout: {
    ProjectionNode: GI,
    MeasureLayout: BI
  }
}, R1 = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({
  transformPagePoint: (e) => e,
  isStatic: !1,
  reducedMotion: "never"
}), _g = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({}), j1 = typeof window < "u", L1 = j1 ? react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_1__.useEffect, qI = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({ strict: !1 });
function G7(e, t, n, r, i) {
  var o, a;
  const { visualElement: s } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_g), l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(qI), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(wg), f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(R1).reducedMotion, d = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
  r = r || l.renderer, !d.current && r && (d.current = r(e, {
    visualState: t,
    parent: s,
    props: n,
    presenceContext: c,
    blockInitialAnimation: c ? c.initial === !1 : !1,
    reducedMotionConfig: f
  }));
  const p = d.current, m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(LI);
  p && !p.projection && i && (p.type === "html" || p.type === "svg") && Y7(d.current, n, i, m);
  const y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useInsertionEffect)(() => {
    p && y.current && p.update(n, c);
  });
  const g = n[wI], v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!!g && !(!((o = window.MotionHandoffIsComplete) === null || o === void 0) && o.call(window, g)) && ((a = window.MotionHasOptimisedAnimation) === null || a === void 0 ? void 0 : a.call(window, g)));
  return L1(() => {
    p && (y.current = !0, window.MotionIsMounted = !0, p.updateFeatures(), I1.render(p.render), v.current && p.animationState && p.animationState.animateChanges());
  }), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    p && (!v.current && p.animationState && p.animationState.animateChanges(), v.current && (queueMicrotask(() => {
      var x;
      (x = window.MotionHandoffMarkAsComplete) === null || x === void 0 || x.call(window, g);
    }), v.current = !1));
  }), p;
}
function Y7(e, t, n, r) {
  const { layoutId: i, layout: o, drag: a, dragConstraints: s, layoutScroll: l, layoutRoot: c } = t;
  e.projection = new n(e.latestValues, t["data-framer-portal-id"] ? void 0 : XI(e.parent)), e.projection.setOptions({
    layoutId: i,
    layout: o,
    alwaysMeasureLayout: !!a || s && Nl(s),
    visualElement: e,
    /**
     * TODO: Update options in an effect. This could be tricky as it'll be too late
     * to update by the time layout animations run.
     * We also need to fix this safeToRemove by linking it up to the one returned by usePresence,
     * ensuring it gets called if there's no potential layout animations.
     *
     */
    animationType: typeof o == "string" ? o : "both",
    initialPromotionConfig: r,
    layoutScroll: l,
    layoutRoot: c
  });
}
function XI(e) {
  if (e)
    return e.options.allowProjection !== !1 ? e.projection : XI(e.parent);
}
function q7(e, t, n) {
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (r) => {
      r && e.mount && e.mount(r), t && (r ? t.mount(r) : t.unmount()), n && (typeof n == "function" ? n(r) : Nl(n) && (n.current = r));
    },
    /**
     * Only pass a new ref callback to React if we've received a visual element
     * factory. Otherwise we'll be mounting/remounting every time externalRef
     * or other dependencies change.
     */
    [t]
  );
}
function Sg(e) {
  return yg(e.animate) || m1.some((t) => pf(e[t]));
}
function ZI(e) {
  return !!(Sg(e) || e.variants);
}
function X7(e, t) {
  if (Sg(e)) {
    const { initial: n, animate: r } = e;
    return {
      initial: n === !1 || pf(n) ? n : void 0,
      animate: pf(r) ? r : void 0
    };
  }
  return e.inherit !== !1 ? t : {};
}
function Z7(e) {
  const { initial: t, animate: n } = X7(e, (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_g));
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({ initial: t, animate: n }), [oC(t), oC(n)]);
}
function oC(e) {
  return Array.isArray(e) ? e.join(" ") : e;
}
const aC = {
  animation: [
    "animate",
    "variants",
    "whileHover",
    "whileTap",
    "exit",
    "whileInView",
    "whileFocus",
    "whileDrag"
  ],
  exit: ["exit"],
  drag: ["drag", "dragControls"],
  focus: ["whileFocus"],
  hover: ["whileHover", "onHoverStart", "onHoverEnd"],
  tap: ["whileTap", "onTap", "onTapStart", "onTapCancel"],
  pan: ["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"],
  inView: ["whileInView", "onViewportEnter", "onViewportLeave"],
  layout: ["layout", "layoutId"]
}, tc = {};
for (const e in aC)
  tc[e] = {
    isEnabled: (t) => aC[e].some((n) => !!t[n])
  };
function J7(e) {
  for (const t in e)
    tc[t] = {
      ...tc[t],
      ...e[t]
    };
}
const Q7 = Symbol.for("motionComponentSymbol");
function eX({ preloadedFeatures: e, createVisualElement: t, useRender: n, useVisualState: r, Component: i }) {
  e && J7(e);
  function o(s, l) {
    let c;
    const f = {
      ...(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(R1),
      ...s,
      layoutId: tX(s)
    }, { isStatic: d } = f, p = Z7(s), m = r(s, d);
    if (!d && j1) {
      nX(f, e);
      const y = rX(f);
      c = y.MeasureLayout, p.visualElement = G7(i, m, f, t, y.ProjectionNode);
    }
    return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_g.Provider, { value: p, children: [c && p.visualElement ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(c, { visualElement: p.visualElement, ...f }) : null, n(i, s, q7(m, p.visualElement, l), m, d, p.visualElement)] });
  }
  const a = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(o);
  return a[Q7] = i, a;
}
function tX({ layoutId: e }) {
  const t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(vf).id;
  return t && e !== void 0 ? t + "-" + e : e;
}
function nX(e, t) {
  const n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(qI).strict;
  if ( true && t && n) {
    const r = "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";
    e.ignoreStrict ? Ic(!1, r) : Wo(!1, r);
  }
}
function rX(e) {
  const { drag: t, layout: n } = tc;
  if (!t && !n)
    return {};
  const r = { ...t, ...n };
  return {
    MeasureLayout: t != null && t.isEnabled(e) || n != null && n.isEnabled(e) ? r.MeasureLayout : void 0,
    ProjectionNode: r.ProjectionNode
  };
}
const iX = [
  "animate",
  "circle",
  "defs",
  "desc",
  "ellipse",
  "g",
  "image",
  "line",
  "filter",
  "marker",
  "mask",
  "metadata",
  "path",
  "pattern",
  "polygon",
  "polyline",
  "rect",
  "stop",
  "switch",
  "symbol",
  "svg",
  "text",
  "tspan",
  "use",
  "view"
];
function B1(e) {
  return (
    /**
     * If it's not a string, it's a custom React component. Currently we only support
     * HTML custom React components.
     */
    typeof e != "string" || /**
     * If it contains a dash, the element is a custom HTML webcomponent.
     */
    e.includes("-") ? !1 : (
      /**
       * If it's in our list of lowercase SVG tags, it's an SVG component
       */
      !!(iX.indexOf(e) > -1 || /**
       * If it contains a capital letter, it's an SVG component
       */
      /[A-Z]/u.test(e))
    )
  );
}
function JI(e, { style: t, vars: n }, r, i) {
  Object.assign(e.style, t, i && i.getProjectionStyles(r));
  for (const o in n)
    e.style.setProperty(o, n[o]);
}
const QI = /* @__PURE__ */ new Set([
  "baseFrequency",
  "diffuseConstant",
  "kernelMatrix",
  "kernelUnitLength",
  "keySplines",
  "keyTimes",
  "limitingConeAngle",
  "markerHeight",
  "markerWidth",
  "numOctaves",
  "targetX",
  "targetY",
  "surfaceScale",
  "specularConstant",
  "specularExponent",
  "stdDeviation",
  "tableValues",
  "viewBox",
  "gradientTransform",
  "pathLength",
  "startOffset",
  "textLength",
  "lengthAdjust"
]);
function eR(e, t, n, r) {
  JI(e, t, void 0, r);
  for (const i in t.attrs)
    e.setAttribute(QI.has(i) ? i : D1(i), t.attrs[i]);
}
function tR(e, { layout: t, layoutId: n }) {
  return Gs.has(e) || e.startsWith("origin") || (t || n !== void 0) && (!!Ep[e] || e === "opacity");
}
function F1(e, t, n) {
  var r;
  const { style: i } = e, o = {};
  for (const a in i)
    (rr(i[a]) || t.style && rr(t.style[a]) || tR(a, e) || ((r = n == null ? void 0 : n.getValue(a)) === null || r === void 0 ? void 0 : r.liveStyle) !== void 0) && (o[a] = i[a]);
  return o;
}
function nR(e, t, n) {
  const r = F1(e, t, n);
  for (const i in e)
    if (rr(e[i]) || rr(t[i])) {
      const o = dd.indexOf(i) !== -1 ? "attr" + i.charAt(0).toUpperCase() + i.substring(1) : i;
      r[o] = e[i];
    }
  return r;
}
function W1(e) {
  const t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
  return t.current === null && (t.current = e()), t.current;
}
function oX({ scrapeMotionValuesFromProps: e, createRenderState: t, onMount: n }, r, i, o) {
  const a = {
    latestValues: aX(r, i, o, e),
    renderState: t()
  };
  return n && (a.mount = (s) => n(r, s, a)), a;
}
const rR = (e) => (t, n) => {
  const r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_g), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(wg), o = () => oX(e, t, r, i);
  return n ? o() : W1(o);
};
function aX(e, t, n, r) {
  const i = {}, o = r(e, {});
  for (const p in o)
    i[p] = lp(o[p]);
  let { initial: a, animate: s } = e;
  const l = Sg(e), c = ZI(e);
  t && c && !l && e.inherit !== !1 && (a === void 0 && (a = t.initial), s === void 0 && (s = t.animate));
  let f = n ? n.initial === !1 : !1;
  f = f || a === !1;
  const d = f ? s : a;
  if (d && typeof d != "boolean" && !yg(d)) {
    const p = Array.isArray(d) ? d : [d];
    for (let m = 0; m < p.length; m++) {
      const y = h1(e, p[m]);
      if (y) {
        const { transitionEnd: g, transition: v, ...x } = y;
        for (const w in x) {
          let S = x[w];
          if (Array.isArray(S)) {
            const A = f ? S.length - 1 : 0;
            S = S[A];
          }
          S !== null && (i[w] = S);
        }
        for (const w in g)
          i[w] = g[w];
      }
    }
  }
  return i;
}
const z1 = () => ({
  style: {},
  transform: {},
  transformOrigin: {},
  vars: {}
}), iR = () => ({
  ...z1(),
  attrs: {}
}), oR = (e, t) => t && typeof e == "number" ? t.transform(e) : e, sX = {
  x: "translateX",
  y: "translateY",
  z: "translateZ",
  transformPerspective: "perspective"
}, lX = dd.length;
function cX(e, t, n) {
  let r = "", i = !0;
  for (let o = 0; o < lX; o++) {
    const a = dd[o], s = e[a];
    if (s === void 0)
      continue;
    let l = !0;
    if (typeof s == "number" ? l = s === (a.startsWith("scale") ? 1 : 0) : l = parseFloat(s) === 0, !l || n) {
      const c = oR(s, S1[a]);
      if (!l) {
        i = !1;
        const f = sX[a] || a;
        r += `${f}(${c}) `;
      }
      n && (t[a] = c);
    }
  }
  return r = r.trim(), n ? r = n(t, i ? "" : r) : i && (r = "none"), r;
}
function V1(e, t, n) {
  const { style: r, vars: i, transformOrigin: o } = e;
  let a = !1, s = !1;
  for (const l in t) {
    const c = t[l];
    if (Gs.has(l)) {
      a = !0;
      continue;
    } else if (JD(l)) {
      i[l] = c;
      continue;
    } else {
      const f = oR(c, S1[l]);
      l.startsWith("origin") ? (s = !0, o[l] = f) : r[l] = f;
    }
  }
  if (t.transform || (a || n ? r.transform = cX(t, e.transform, n) : r.transform && (r.transform = "none")), s) {
    const { originX: l = "50%", originY: c = "50%", originZ: f = 0 } = o;
    r.transformOrigin = `${l} ${c} ${f}`;
  }
}
function sC(e, t, n) {
  return typeof e == "string" ? e : Be.transform(t + n * e);
}
function uX(e, t, n) {
  const r = sC(t, e.x, e.width), i = sC(n, e.y, e.height);
  return `${r} ${i}`;
}
const fX = {
  offset: "stroke-dashoffset",
  array: "stroke-dasharray"
}, dX = {
  offset: "strokeDashoffset",
  array: "strokeDasharray"
};
function hX(e, t, n = 1, r = 0, i = !0) {
  e.pathLength = 1;
  const o = i ? fX : dX;
  e[o.offset] = Be.transform(-r);
  const a = Be.transform(t), s = Be.transform(n);
  e[o.array] = `${a} ${s}`;
}
function U1(e, {
  attrX: t,
  attrY: n,
  attrScale: r,
  originX: i,
  originY: o,
  pathLength: a,
  pathSpacing: s = 1,
  pathOffset: l = 0,
  // This is object creation, which we try to avoid per-frame.
  ...c
}, f, d) {
  if (V1(e, c, d), f) {
    e.style.viewBox && (e.attrs.viewBox = e.style.viewBox);
    return;
  }
  e.attrs = e.style, e.style = {};
  const { attrs: p, style: m, dimensions: y } = e;
  p.transform && (y && (m.transform = p.transform), delete p.transform), y && (i !== void 0 || o !== void 0 || m.transform) && (m.transformOrigin = uX(y, i !== void 0 ? i : 0.5, o !== void 0 ? o : 0.5)), t !== void 0 && (p.x = t), n !== void 0 && (p.y = n), r !== void 0 && (p.scale = r), a !== void 0 && hX(p, a, s, l, !1);
}
const H1 = (e) => typeof e == "string" && e.toLowerCase() === "svg", pX = {
  useVisualState: rR({
    scrapeMotionValuesFromProps: nR,
    createRenderState: iR,
    onMount: (e, t, { renderState: n, latestValues: r }) => {
      Tt.read(() => {
        try {
          n.dimensions = typeof t.getBBox == "function" ? t.getBBox() : t.getBoundingClientRect();
        } catch {
          n.dimensions = {
            x: 0,
            y: 0,
            width: 0,
            height: 0
          };
        }
      }), Tt.render(() => {
        U1(n, r, H1(t.tagName), e.transformTemplate), eR(t, n);
      });
    }
  })
}, mX = {
  useVisualState: rR({
    scrapeMotionValuesFromProps: F1,
    createRenderState: z1
  })
};
function aR(e, t, n) {
  for (const r in t)
    !rr(t[r]) && !tR(r, n) && (e[r] = t[r]);
}
function gX({ transformTemplate: e }, t) {
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    const n = z1();
    return V1(n, t, e), Object.assign({}, n.vars, n.style);
  }, [t]);
}
function yX(e, t) {
  const n = e.style || {}, r = {};
  return aR(r, n, e), Object.assign(r, gX(e, t)), r;
}
function vX(e, t) {
  const n = {}, r = yX(e, t);
  return e.drag && e.dragListener !== !1 && (n.draggable = !1, r.userSelect = r.WebkitUserSelect = r.WebkitTouchCallout = "none", r.touchAction = e.drag === !0 ? "none" : `pan-${e.drag === "x" ? "y" : "x"}`), e.tabIndex === void 0 && (e.onTap || e.onTapStart || e.whileTap) && (n.tabIndex = 0), n.style = r, n;
}
const bX = /* @__PURE__ */ new Set([
  "animate",
  "exit",
  "variants",
  "initial",
  "style",
  "values",
  "variants",
  "transition",
  "transformTemplate",
  "custom",
  "inherit",
  "onBeforeLayoutMeasure",
  "onAnimationStart",
  "onAnimationComplete",
  "onUpdate",
  "onDragStart",
  "onDrag",
  "onDragEnd",
  "onMeasureDragConstraints",
  "onDirectionLock",
  "onDragTransitionEnd",
  "_dragX",
  "_dragY",
  "onHoverStart",
  "onHoverEnd",
  "onViewportEnter",
  "onViewportLeave",
  "globalTapTarget",
  "ignoreStrict",
  "viewport"
]);
function kp(e) {
  return e.startsWith("while") || e.startsWith("drag") && e !== "draggable" || e.startsWith("layout") || e.startsWith("onTap") || e.startsWith("onPan") || e.startsWith("onLayout") || bX.has(e);
}
let sR = (e) => !kp(e);
function xX(e) {
  e && (sR = (t) => t.startsWith("on") ? !kp(t) : e(t));
}
try {
  xX(require("@emotion/is-prop-valid").default);
} catch {
}
function wX(e, t, n) {
  const r = {};
  for (const i in e)
    i === "values" && typeof e.values == "object" || (sR(i) || n === !0 && kp(i) || !t && !kp(i) || // If trying to use native HTML drag events, forward drag listeners
    e.draggable && i.startsWith("onDrag")) && (r[i] = e[i]);
  return r;
}
function _X(e, t, n, r) {
  const i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    const o = iR();
    return U1(o, t, H1(r), e.transformTemplate), {
      ...o.attrs,
      style: { ...o.style }
    };
  }, [t]);
  if (e.style) {
    const o = {};
    aR(o, e.style, e), i.style = { ...o, ...i.style };
  }
  return i;
}
function SX(e = !1) {
  return (n, r, i, { latestValues: o }, a) => {
    const l = (B1(n) ? _X : vX)(r, o, a, n), c = wX(r, typeof n == "string", e), f = n !== react__WEBPACK_IMPORTED_MODULE_1__.Fragment ? { ...c, ...l, ref: i } : {}, { children: d } = r, p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => rr(d) ? d.get() : d, [d]);
    return (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(n, {
      ...f,
      children: p
    });
  };
}
function OX(e, t) {
  return function(r, { forwardMotionProps: i } = { forwardMotionProps: !1 }) {
    const a = {
      ...B1(r) ? pX : mX,
      preloadedFeatures: e,
      useRender: SX(i),
      createVisualElement: t,
      Component: r
    };
    return eX(a);
  };
}
const j0 = { current: null }, lR = { current: !1 };
function AX() {
  if (lR.current = !0, !!j1)
    if (window.matchMedia) {
      const e = window.matchMedia("(prefers-reduced-motion)"), t = () => j0.current = e.matches;
      e.addListener(t), t();
    } else
      j0.current = !1;
}
function TX(e, t, n) {
  for (const r in t) {
    const i = t[r], o = n[r];
    if (rr(i))
      e.addValue(r, i),  true && gg(i.version === "11.11.17", `Attempting to mix Motion versions ${i.version} with 11.11.17 may not work as expected.`);
    else if (rr(o))
      e.addValue(r, yf(i, { owner: e }));
    else if (o !== i)
      if (e.hasValue(r)) {
        const a = e.getValue(r);
        a.liveStyle === !0 ? a.jump(i) : a.hasAnimated || a.set(i);
      } else {
        const a = e.getStaticValue(r);
        e.addValue(r, yf(a !== void 0 ? a : i, { owner: e }));
      }
  }
  for (const r in n)
    t[r] === void 0 && e.removeValue(r);
  return t;
}
const lC = /* @__PURE__ */ new WeakMap(), PX = [...tI, er, Ba], CX = (e) => PX.find(eI(e)), cC = [
  "AnimationStart",
  "AnimationComplete",
  "Update",
  "BeforeLayoutMeasure",
  "LayoutMeasure",
  "LayoutAnimationStart",
  "LayoutAnimationComplete"
];
class EX {
  /**
   * This method takes React props and returns found MotionValues. For example, HTML
   * MotionValues will be found within the style prop, whereas for Three.js within attribute arrays.
   *
   * This isn't an abstract method as it needs calling in the constructor, but it is
   * intended to be one.
   */
  scrapeMotionValuesFromProps(t, n, r) {
    return {};
  }
  constructor({ parent: t, props: n, presenceContext: r, reducedMotionConfig: i, blockInitialAnimation: o, visualState: a }, s = {}) {
    this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = x1, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
      this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
    }, this.renderScheduledAt = 0, this.scheduleRender = () => {
      const p = qi.now();
      this.renderScheduledAt < p && (this.renderScheduledAt = p, Tt.render(this.render, !1, !0));
    };
    const { latestValues: l, renderState: c } = a;
    this.latestValues = l, this.baseTarget = { ...l }, this.initialValues = n.initial ? { ...l } : {}, this.renderState = c, this.parent = t, this.props = n, this.presenceContext = r, this.depth = t ? t.depth + 1 : 0, this.reducedMotionConfig = i, this.options = s, this.blockInitialAnimation = !!o, this.isControllingVariants = Sg(n), this.isVariantNode = ZI(n), this.isVariantNode && (this.variantChildren = /* @__PURE__ */ new Set()), this.manuallyAnimateOnMount = !!(t && t.current);
    const { willChange: f, ...d } = this.scrapeMotionValuesFromProps(n, {}, this);
    for (const p in d) {
      const m = d[p];
      l[p] !== void 0 && rr(m) && m.set(l[p], !1);
    }
  }
  mount(t) {
    this.current = t, lC.set(t, this), this.projection && !this.projection.instance && this.projection.mount(t), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((n, r) => this.bindToMotionValue(r, n)), lR.current || AX(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : j0.current,  true && gg(this.shouldReduceMotion !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected."), this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
  }
  unmount() {
    lC.delete(this.current), this.projection && this.projection.unmount(), ja(this.notifyUpdate), ja(this.render), this.valueSubscriptions.forEach((t) => t()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
    for (const t in this.events)
      this.events[t].clear();
    for (const t in this.features) {
      const n = this.features[t];
      n && (n.unmount(), n.isMounted = !1);
    }
    this.current = null;
  }
  bindToMotionValue(t, n) {
    this.valueSubscriptions.has(t) && this.valueSubscriptions.get(t)();
    const r = Gs.has(t), i = n.on("change", (s) => {
      this.latestValues[t] = s, this.props.onUpdate && Tt.preRender(this.notifyUpdate), r && this.projection && (this.projection.isTransformDirty = !0);
    }), o = n.on("renderRequest", this.scheduleRender);
    let a;
    window.MotionCheckAppearSync && (a = window.MotionCheckAppearSync(this, t, n)), this.valueSubscriptions.set(t, () => {
      i(), o(), a && a(), n.owner && n.stop();
    });
  }
  sortNodePosition(t) {
    return !this.current || !this.sortInstanceNodePosition || this.type !== t.type ? 0 : this.sortInstanceNodePosition(this.current, t.current);
  }
  updateFeatures() {
    let t = "animation";
    for (t in tc) {
      const n = tc[t];
      if (!n)
        continue;
      const { isEnabled: r, Feature: i } = n;
      if (!this.features[t] && i && r(this.props) && (this.features[t] = new i(this)), this.features[t]) {
        const o = this.features[t];
        o.isMounted ? o.update() : (o.mount(), o.isMounted = !0);
      }
    }
  }
  triggerBuild() {
    this.build(this.renderState, this.latestValues, this.props);
  }
  /**
   * Measure the current viewport box with or without transforms.
   * Only measures axis-aligned boxes, rotate and skew must be manually
   * removed with a re-render to work.
   */
  measureViewportBox() {
    return this.current ? this.measureInstanceViewportBox(this.current, this.props) : ln();
  }
  getStaticValue(t) {
    return this.latestValues[t];
  }
  setStaticValue(t, n) {
    this.latestValues[t] = n;
  }
  /**
   * Update the provided props. Ensure any newly-added motion values are
   * added to our map, old ones removed, and listeners updated.
   */
  update(t, n) {
    (t.transformTemplate || this.props.transformTemplate) && this.scheduleRender(), this.prevProps = this.props, this.props = t, this.prevPresenceContext = this.presenceContext, this.presenceContext = n;
    for (let r = 0; r < cC.length; r++) {
      const i = cC[r];
      this.propEventSubscriptions[i] && (this.propEventSubscriptions[i](), delete this.propEventSubscriptions[i]);
      const o = "on" + i, a = t[o];
      a && (this.propEventSubscriptions[i] = this.on(i, a));
    }
    this.prevMotionValues = TX(this, this.scrapeMotionValuesFromProps(t, this.prevProps, this), this.prevMotionValues), this.handleChildMotionValue && this.handleChildMotionValue();
  }
  getProps() {
    return this.props;
  }
  /**
   * Returns the variant definition with a given name.
   */
  getVariant(t) {
    return this.props.variants ? this.props.variants[t] : void 0;
  }
  /**
   * Returns the defined default transition on this component.
   */
  getDefaultTransition() {
    return this.props.transition;
  }
  getTransformPagePoint() {
    return this.props.transformPagePoint;
  }
  getClosestVariantNode() {
    return this.isVariantNode ? this : this.parent ? this.parent.getClosestVariantNode() : void 0;
  }
  /**
   * Add a child visual element to our set of children.
   */
  addVariantChild(t) {
    const n = this.getClosestVariantNode();
    if (n)
      return n.variantChildren && n.variantChildren.add(t), () => n.variantChildren.delete(t);
  }
  /**
   * Add a motion value and bind it to this visual element.
   */
  addValue(t, n) {
    const r = this.values.get(t);
    n !== r && (r && this.removeValue(t), this.bindToMotionValue(t, n), this.values.set(t, n), this.latestValues[t] = n.get());
  }
  /**
   * Remove a motion value and unbind any active subscriptions.
   */
  removeValue(t) {
    this.values.delete(t);
    const n = this.valueSubscriptions.get(t);
    n && (n(), this.valueSubscriptions.delete(t)), delete this.latestValues[t], this.removeValueFromRenderState(t, this.renderState);
  }
  /**
   * Check whether we have a motion value for this key
   */
  hasValue(t) {
    return this.values.has(t);
  }
  getValue(t, n) {
    if (this.props.values && this.props.values[t])
      return this.props.values[t];
    let r = this.values.get(t);
    return r === void 0 && n !== void 0 && (r = yf(n === null ? void 0 : n, { owner: this }), this.addValue(t, r)), r;
  }
  /**
   * If we're trying to animate to a previously unencountered value,
   * we need to check for it in our state and as a last resort read it
   * directly from the instance (which might have performance implications).
   */
  readValue(t, n) {
    var r;
    let i = this.latestValues[t] !== void 0 || !this.current ? this.latestValues[t] : (r = this.getBaseTargetFromProps(this.props, t)) !== null && r !== void 0 ? r : this.readValueFromInstance(this.current, t, this.options);
    return i != null && (typeof i == "string" && (XD(i) || qD(i)) ? i = parseFloat(i) : !CX(i) && Ba.test(n) && (i = cI(t, n)), this.setBaseTarget(t, rr(i) ? i.get() : i)), rr(i) ? i.get() : i;
  }
  /**
   * Set the base target to later animate back to. This is currently
   * only hydrated on creation and when we first read a value.
   */
  setBaseTarget(t, n) {
    this.baseTarget[t] = n;
  }
  /**
   * Find the base target for a value thats been removed from all animation
   * props.
   */
  getBaseTarget(t) {
    var n;
    const { initial: r } = this.props;
    let i;
    if (typeof r == "string" || typeof r == "object") {
      const a = h1(this.props, r, (n = this.presenceContext) === null || n === void 0 ? void 0 : n.custom);
      a && (i = a[t]);
    }
    if (r && i !== void 0)
      return i;
    const o = this.getBaseTargetFromProps(this.props, t);
    return o !== void 0 && !rr(o) ? o : this.initialValues[t] !== void 0 && i === void 0 ? void 0 : this.baseTarget[t];
  }
  on(t, n) {
    return this.events[t] || (this.events[t] = new $1()), this.events[t].add(n);
  }
  notify(t, ...n) {
    this.events[t] && this.events[t].notify(...n);
  }
}
class cR extends EX {
  constructor() {
    super(...arguments), this.KeyframeResolver = uI;
  }
  sortInstanceNodePosition(t, n) {
    return t.compareDocumentPosition(n) & 2 ? 1 : -1;
  }
  getBaseTargetFromProps(t, n) {
    return t.style ? t.style[n] : void 0;
  }
  removeValueFromRenderState(t, { vars: n, style: r }) {
    delete n[t], delete r[t];
  }
}
function kX(e) {
  return window.getComputedStyle(e);
}
class MX extends cR {
  constructor() {
    super(...arguments), this.type = "html", this.renderInstance = JI;
  }
  readValueFromInstance(t, n) {
    if (Gs.has(n)) {
      const r = O1(n);
      return r && r.default || 0;
    } else {
      const r = kX(t), i = (JD(n) ? r.getPropertyValue(n) : r[n]) || 0;
      return typeof i == "string" ? i.trim() : i;
    }
  }
  measureInstanceViewportBox(t, { transformPagePoint: n }) {
    return RI(t, n);
  }
  build(t, n, r) {
    V1(t, n, r.transformTemplate);
  }
  scrapeMotionValuesFromProps(t, n, r) {
    return F1(t, n, r);
  }
  handleChildMotionValue() {
    this.childSubscription && (this.childSubscription(), delete this.childSubscription);
    const { children: t } = this.props;
    rr(t) && (this.childSubscription = t.on("change", (n) => {
      this.current && (this.current.textContent = `${n}`);
    }));
  }
}
class NX extends cR {
  constructor() {
    super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = ln;
  }
  getBaseTargetFromProps(t, n) {
    return t[n];
  }
  readValueFromInstance(t, n) {
    if (Gs.has(n)) {
      const r = O1(n);
      return r && r.default || 0;
    }
    return n = QI.has(n) ? n : D1(n), t.getAttribute(n);
  }
  scrapeMotionValuesFromProps(t, n, r) {
    return nR(t, n, r);
  }
  build(t, n, r) {
    U1(t, n, this.isSVGTag, r.transformTemplate);
  }
  renderInstance(t, n, r, i) {
    eR(t, n, r, i);
  }
  mount(t) {
    this.isSVGTag = H1(t.tagName), super.mount(t);
  }
}
const $X = (e, t) => B1(e) ? new NX(t) : new MX(t, {
  allowProjection: e !== react__WEBPACK_IMPORTED_MODULE_1__.Fragment
}), DX = /* @__PURE__ */ OX({
  ...S9,
  ...H7,
  ...D7,
  ...K7
}, $X), An = /* @__PURE__ */ pY(DX);
class IX extends react__WEBPACK_IMPORTED_MODULE_1__.Component {
  getSnapshotBeforeUpdate(t) {
    const n = this.props.childRef.current;
    if (n && t.isPresent && !this.props.isPresent) {
      const r = this.props.sizeRef.current;
      r.height = n.offsetHeight || 0, r.width = n.offsetWidth || 0, r.top = n.offsetTop, r.left = n.offsetLeft;
    }
    return null;
  }
  /**
   * Required with getSnapshotBeforeUpdate to stop React complaining.
   */
  componentDidUpdate() {
  }
  render() {
    return this.props.children;
  }
}
function RX({ children: e, isPresent: t }) {
  const n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useId)(), r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)({
    width: 0,
    height: 0,
    top: 0,
    left: 0
  }), { nonce: o } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(R1);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useInsertionEffect)(() => {
    const { width: a, height: s, top: l, left: c } = i.current;
    if (t || !r.current || !a || !s)
      return;
    r.current.dataset.motionPopId = n;
    const f = document.createElement("style");
    return o && (f.nonce = o), document.head.appendChild(f), f.sheet && f.sheet.insertRule(`
          [data-motion-pop-id="${n}"] {
            position: absolute !important;
            width: ${a}px !important;
            height: ${s}px !important;
            top: ${l}px !important;
            left: ${c}px !important;
          }
        `), () => {
      document.head.removeChild(f);
    };
  }, [t]), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(IX, { isPresent: t, childRef: r, sizeRef: i, children: react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(e, { ref: r }) });
}
const jX = ({ children: e, initial: t, isPresent: n, onExitComplete: r, custom: i, presenceAffectsLayout: o, mode: a }) => {
  const s = W1(LX), l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useId)(), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((d) => {
    s.set(d, !0);
    for (const p of s.values())
      if (!p)
        return;
    r && r();
  }, [s, r]), f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => ({
      id: l,
      initial: t,
      isPresent: n,
      custom: i,
      onExitComplete: c,
      register: (d) => (s.set(d, !1), () => s.delete(d))
    }),
    /**
     * If the presence of a child affects the layout of the components around it,
     * we want to make a new context value to ensure they get re-rendered
     * so they can detect that layout change.
     */
    o ? [Math.random(), c] : [n, c]
  );
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    s.forEach((d, p) => s.set(p, !1));
  }, [n]), react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    !n && !s.size && r && r();
  }, [n]), a === "popLayout" && (e = (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(RX, { isPresent: n, children: e })), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(wg.Provider, { value: f, children: e });
};
function LX() {
  return /* @__PURE__ */ new Map();
}
const Nh = (e) => e.key || "";
function uC(e) {
  const t = [];
  return react__WEBPACK_IMPORTED_MODULE_1__.Children.forEach(e, (n) => {
    (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(n) && t.push(n);
  }), t;
}
const Ys = ({ children: e, exitBeforeEnter: t, custom: n, initial: r = !0, onExitComplete: i, presenceAffectsLayout: o = !0, mode: a = "sync" }) => {
  Wo(!t, "Replace exitBeforeEnter with mode='wait'");
  const s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => uC(e), [e]), l = s.map(Nh), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!0), f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(s), d = W1(() => /* @__PURE__ */ new Map()), [p, m] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(s), [y, g] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(s);
  L1(() => {
    c.current = !1, f.current = s;
    for (let w = 0; w < y.length; w++) {
      const S = Nh(y[w]);
      l.includes(S) ? d.delete(S) : d.get(S) !== !0 && d.set(S, !1);
    }
  }, [y, l.length, l.join("-")]);
  const v = [];
  if (s !== p) {
    let w = [...s];
    for (let S = 0; S < y.length; S++) {
      const A = y[S], _ = Nh(A);
      l.includes(_) || (w.splice(S, 0, A), v.push(A));
    }
    a === "wait" && v.length && (w = v), g(uC(w)), m(s);
    return;
  }
   true && a === "wait" && y.length > 1 && console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);
  const { forceRender: x } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(vf);
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: y.map((w) => {
    const S = Nh(w), A = s === y || l.includes(S), _ = () => {
      if (d.has(S))
        d.set(S, !0);
      else
        return;
      let O = !0;
      d.forEach((P) => {
        P || (O = !1);
      }), O && (x == null || x(), g(f.current), i && i());
    };
    return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(jX, { isPresent: A, initial: !c.current || r ? void 0 : !1, custom: A ? void 0 : n, presenceAffectsLayout: o, mode: a, onExitComplete: A ? void 0 : _, children: w }, S);
  }) });
}, BX = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(null);
function FX() {
  const e = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1);
  return L1(() => (e.current = !0, () => {
    e.current = !1;
  }), []), e;
}
function WX() {
  const e = FX(), [t, n] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0), r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    e.current && n(t + 1);
  }, [t]);
  return [(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => Tt.postRender(r), [r]), t];
}
const zX = (e) => !e.isLayoutDirty && e.willUpdate(!1);
function fC() {
  const e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new WeakMap(), n = () => e.forEach(zX);
  return {
    add: (r) => {
      e.add(r), t.set(r, r.addEventListener("willUpdate", n));
    },
    remove: (r) => {
      e.delete(r);
      const i = t.get(r);
      i && (i(), t.delete(r)), n();
    },
    dirty: n
  };
}
const uR = (e) => e === !0, VX = (e) => uR(e === !0) || e === "id", UX = ({ children: e, id: t, inherit: n = !0 }) => {
  const r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(vf), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(BX), [o, a] = WX(), s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), l = r.id || i;
  s.current === null && (VX(n) && l && (t = t ? l + "-" + t : l), s.current = {
    id: t,
    group: uR(n) && r.group || fC()
  });
  const c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({ ...s.current, forceRender: o }), [a]);
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(vf.Provider, { value: c, children: e });
}, HX = (e, t, n) => {
  const r = t - e;
  return ((n - e) % r + r) % r + e;
};
function KX(...e) {
  const t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(0), [n, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(e[t.current]), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (o) => {
      t.current = typeof o != "number" ? HX(0, e.length, t.current + 1) : o, r(e[t.current]);
    },
    // The array will change on each call, but by putting items.length at
    // the front of this array, we guarantee the dependency comparison will match up
    // eslint-disable-next-line react-hooks/exhaustive-deps
    [e.length, ...e]
  );
  return [n, i];
}
const fR = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({}), dR = () => (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(fR), hR = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(null), GX = () => (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(hR), pR = ({
  children: e,
  activeItem: t = null,
  // The currently active item in the group.
  onChange: n,
  // Callback when the active item changes.
  className: r,
  // Additional class names for styling.
  size: i = "sm",
  // Size of the tabs in the group ('xs', 'sm', 'md', 'lg').
  orientation: o = "horizontal",
  // Orientation of the tabs ('horizontal', 'vertical').
  variant: a = "pill",
  // Style variant of the tabs ('pill', 'rounded', 'underline').
  iconPosition: s = "left",
  // Position of the icon in the tab ('left' or 'right').
  width: l = "full"
  // Width of the tabs ('auto' or 'full').
}) => {
  const c = io(), f = dR(), d = (f == null ? void 0 : f.activeItem) || t, p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (O, P) => {
      n && n({ event: O, value: P });
    },
    [n]
  );
  let m = "rounded-full", y = "p-1", g, v = "ring-1 ring-tab-border";
  o === "vertical" ? g = "gap-0.5" : (a === "rounded" || a === "pill") && (i === "xs" || i === "sm" ? g = "gap-0.5" : (i === "md" || i === "lg") && (g = "gap-1")), a === "rounded" || o === "vertical" ? m = "rounded-md" : a === "underline" && (m = "rounded-none", y = "p-0", v = "border-t-0 border-r-0 border-l-0 border-b border-solid border-tab-border", i === "xs" ? g = "gap-0" : i === "sm" ? g = "gap-2.5" : (i === "md" || i === "lg") && (g = "gap-3"));
  const _ = K(
    `box-border [&>*]:box-border flex items-center ${l === "full" ? "w-full" : ""} ${o === "vertical" ? "flex-col" : ""}`,
    m,
    y,
    g,
    v,
    a !== "underline" ? "bg-tab-background" : "",
    r
  );
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: _, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    hR.Provider,
    {
      value: {
        activeItem: d,
        onChange: p,
        size: i,
        variant: a,
        orientation: o,
        iconPosition: s,
        width: l
      },
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(UX, { id: c, children: react__WEBPACK_IMPORTED_MODULE_1__.Children.map(e, (O) => (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(O) ? react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(O) : null) })
    }
  ) });
};
pR.displayName = "Tabs.Group";
const mR = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
  ({
    slug: e,
    text: t,
    icon: n,
    className: r,
    disabled: i = !1,
    badge: o = null,
    ...a
  }, s) => {
    const l = GX();
    if (!l)
      throw new Error("Tab should be used inside Tabs Group");
    const {
      activeItem: c,
      onChange: f,
      size: d,
      variant: p,
      orientation: m,
      iconPosition: y,
      width: g
    } = l, v = {
      xs: "px-1.5 py-0.5 text-xs [&_svg]:size-3",
      sm: p === "underline" ? "py-1.5 text-sm [&_svg]:size-4" : "px-3 py-1.5 text-sm [&_svg]:size-4",
      md: p === "underline" ? "py-2 text-base [&_svg]:size-5" : "px-3.5 py-1.5 text-base [&_svg]:size-5",
      lg: p === "underline" ? "p-2.5 text-lg [&_svg]:size-6" : "px-3.5 py-1.5 text-lg [&_svg]:size-6"
    }[d], S = K(
      "relative border-none bg-transparent text-text-secondary cursor-pointer flex items-center justify-center transition-[box-shadow,color,background-color] duration-200",
      g === "full" ? "flex-1" : "",
      m === "vertical" ? "w-full justify-between" : ""
    ), A = "border-none";
    let _ = "rounded-full";
    p === "rounded" ? _ = "rounded-md" : p === "underline" && (_ = "rounded-none");
    const I = K(
      S,
      A,
      _,
      "hover:text-text-primary group",
      "focus:outline-none",
      v,
      c === e ? "bg-background-primary text-text-primary shadow-sm" : "",
      i ? "text-text-disabled cursor-not-allowed hover:text-text-disabled" : "",
      r
    ), $ = K(
      "flex items-center gap-1 group-hover:text-text-primary",
      i && "group-hover:text-text-disabled"
    ), N = (D) => {
      f(D, { slug: e, text: t });
    };
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      An.button,
      {
        ref: s,
        className: I,
        disabled: i,
        onClick: N,
        ...a,
        layoutRoot: !0,
        children: [
          c === e && p === "underline" && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            An.span,
            {
              layoutId: "underline",
              layoutDependency: c,
              className: "absolute right-0 left-0 -bottom-px h-px bg-border-interactive"
            }
          ),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: $, children: [
            y === "left" && n && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "mr-1 contents center-center transition duration-150", children: n }),
            t,
            y === "right" && n && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-1 contents center-center transition duration-150", children: n })
          ] }),
          o && (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(o) && o
        ]
      }
    );
  }
);
mR.displayName = "Tabs.Tab";
const K1 = ({ activeItem: e, children: t }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(fR.Provider, { value: { activeItem: e }, children: t }), gR = ({ slug: e, children: t }) => {
  const n = dR();
  if (!n)
    throw new Error("TabPanel should be used inside Tabs");
  return e === n.activeItem ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: t }) : null;
};
gR.displayName = "Tabs.Panel";
K1.Group = pR;
K1.Tab = mR;
K1.Panel = gR;
const ui = {
  sm: {
    icon: "[&>svg]:size-4",
    searchIcon: "[&>svg]:size-4",
    selectButton: "px-2.5 py-2 rounded text-sm font-medium leading-4 min-h-[2rem]",
    multiSelect: "pl-2 pr-2 py-1.5",
    displaySelected: "text-sm font-normal",
    dropdown: "rounded-md",
    dropdownItemsWrapper: "p-1.5",
    searchbarWrapper: "p-3 flex items-center gap-0.5",
    searchbar: "font-medium text-sm",
    searchbarIcon: "size-4",
    label: "text-sm font-medium"
  },
  md: {
    icon: "[&>svg]:size-5",
    searchIcon: "[&>svg]:size-5",
    selectButton: "px-3.5 py-2.5 rounded-md text-xs font-medium leading-4 min-h-[2.5rem]",
    multiSelect: "pl-2 pr-2.5 py-2",
    displaySelected: "text-sm font-normal",
    dropdown: "rounded-lg",
    dropdownItemsWrapper: "p-2",
    searchbarWrapper: "p-2.5 flex items-center gap-1",
    searchbar: "font-medium text-sm",
    searchbarIcon: "size-5",
    label: "text-sm font-medium"
  },
  lg: {
    icon: "[&>svg]:size-6",
    searchIcon: "[&>svg]:size-5",
    selectButton: "px-4 py-3 rounded-lg text-sm font-medium leading-5 min-h-[3rem]",
    multiSelect: "pl-2.5 pr-3 py-2.5",
    displaySelected: "text-base font-normal",
    dropdown: "rounded-lg",
    dropdownItemsWrapper: "p-2",
    searchbarWrapper: "p-2.5 flex items-center gap-1",
    searchbar: "font-medium text-sm",
    searchbarIcon: "size-5",
    label: "text-base font-medium"
  }
}, $h = {
  selectButton: "group disabled:outline-field-border-disabled [&:hover:has(:disabled)]:outline-field-border-disabled disabled:cursor-default",
  icon: "group-disabled:text-icon-disabled",
  text: "group-disabled:text-field-color-disabled"
}, YX = "h-px my-2 w-full border-border-subtle border-b border-t-0 border-solid", qX = {
  sm: "w-[calc(100%+0.75rem)] translate-x-[-0.375rem]",
  md: "w-[calc(100%+1rem)] translate-x-[-0.5rem]",
  lg: "w-[calc(100%+1rem)] translate-x-[-0.5rem]"
}, cp = (e) => {
  var t;
  return typeof e == "string" ? e : typeof e == "object" && "textContent" in e ? ((t = e.textContent) == null ? void 0 : t.toString().toLowerCase()) || "" : typeof e == "object" && "children" in e ? cp(e.children) : "";
}, XX = (e, t = 500) => {
  const n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (...r) => {
      n.current && clearTimeout(n.current), n.current = setTimeout(
        () => e(...r),
        t
      );
    },
    [e, t]
  );
}, yR = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(
  {}
), Og = () => (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(yR);
function vR({
  children: e,
  icon: t = null,
  // Icon to show in the select button.
  placeholder: n = "Select an option",
  // Placeholder text.
  optionIcon: r = null,
  // Icon to show in the selected option.
  render: i,
  label: o,
  // Label for the select component.
  className: a,
  ...s
}) {
  var k, I;
  const {
    sizeValue: l,
    getReferenceProps: c,
    getValues: f,
    selectId: d,
    refs: p,
    isOpen: m,
    multiple: y,
    combobox: g,
    setSelected: v,
    onChange: x,
    isControlled: w,
    disabled: S,
    by: A
  } = Og(), _ = {
    sm: "xs",
    md: "sm",
    lg: "md"
  }[l], O = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    if (t)
      return t;
    const $ = "text-field-placeholder " + $h.icon;
    return g ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(YH, { className: $ }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Xw, { className: $ });
  }, [t]), P = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    const $ = f();
    if (!$)
      return null;
    if (y)
      return $.map(
        (D, j) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          mg,
          {
            className: "cursor-default",
            icon: r,
            type: "rounded",
            size: _,
            onMouseDown: C(D),
            label: typeof i == "function" ? i(D) : D.toString(),
            closable: !0,
            disabled: S
          },
          j
        )
      );
    let N = typeof $ == "string" ? $ : "";
    if (typeof i == "function" && (N = i($)), typeof e == "function" && typeof i != "function") {
      const D = {
        value: $,
        ...y ? {
          onClose: C(
            $
          )
        } : {}
      };
      N = e(D);
    }
    return ((0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(e) || typeof e == "string") && typeof i != "function" && (N = e), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      "span",
      {
        className: K(
          "truncate",
          ui[l].displaySelected,
          $h.text
        ),
        children: N
      }
    );
  }, [f, S]), C = ($) => (N) => {
    N == null || N.preventDefault(), N == null || N.stopPropagation();
    const D = [
      ...f() ?? []
    ], j = D.findIndex((F) => F !== null && $ !== null && typeof F == "object" ? F[A] === $[A] : F === $);
    j !== -1 && (D.splice(j, 1), w || v(D), typeof x == "function" && x(D));
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "w-full flex flex-col items-start gap-1.5 [&_*]:box-border box-border", children: [
    !!o && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      "label",
      {
        className: K(
          (k = ui[l]) == null ? void 0 : k.label,
          "text-field-label"
        ),
        htmlFor: d,
        children: o
      }
    ),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "button",
      {
        id: d,
        ref: p.setReference,
        className: K(
          "flex items-center justify-between w-full box-border transition-[outline,background-color,color,box-shadow] duration-200 bg-white",
          "outline outline-1 outline-field-border border-none cursor-pointer",
          !m && "focus:ring-2 focus:ring-offset-2 focus:outline-focus-border focus:ring-focus [&:hover:not(:focus):not(:disabled)]:outline-border-strong",
          ui[l].selectButton,
          y && ui[l].multiSelect,
          $h.selectButton,
          a
        ),
        tabIndex: 0,
        disabled: S,
        ...s,
        ...c(),
        children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
            "div",
            {
              className: K(
                "flex-1 grid items-center justify-start gap-1.5 overflow-hidden",
                f() && "flex flex-wrap"
              ),
              children: [
                P(),
                (y ? !((I = f()) != null && I.length) : !f()) && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                  "div",
                  {
                    className: K(
                      "[grid-area:1/1/2/3] text-field-input px-1",
                      ui[l].displaySelected,
                      $h.text
                    ),
                    children: n
                  }
                )
              ]
            }
          ),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            "div",
            {
              className: K(
                "flex items-center [&>svg]:shrink-0",
                ui[l].icon
              ),
              children: O()
            }
          )
        ]
      }
    )
  ] });
}
function Rl({
  label: e,
  children: t,
  className: n,
  ...r
}) {
  const { index: i, totalGroups: o } = r, { sizeValue: a } = Og();
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col", role: "group", "aria-label": e, children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        "div",
        {
          className: K(
            "p-2 font-normal text-text-tertiary",
            {
              sm: "text-xs",
              md: "text-xs",
              lg: "text-sm"
            }[a],
            n
          ),
          id: `group-${e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-")}`,
          children: e
        }
      ),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        "div",
        {
          className: "flex flex-col",
          role: "presentation",
          "aria-labelledby": `group-${e == null ? void 0 : e.toLowerCase().replace(/\s+/g, "-")}`,
          children: t
        }
      )
    ] }),
    i < o && !!(t && react__WEBPACK_IMPORTED_MODULE_1__.Children.count(t) > 0) && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      "hr",
      {
        className: K(
          YX,
          qX[a]
        )
      }
    )
  ] });
}
function bR({
  children: e,
  className: t
  // Additional class name for the dropdown.
}) {
  const {
    isOpen: n,
    context: r,
    refs: i,
    combobox: o,
    floatingStyles: a,
    getFloatingProps: s,
    sizeValue: l,
    setSearchKeyword: c,
    setActiveIndex: f,
    setSelectedIndex: d,
    value: p,
    selected: m,
    getValues: y,
    searchKeyword: g,
    listContentRef: v,
    by: x,
    searchPlaceholder: w,
    activeIndex: S,
    searchFn: A,
    debounceDelay: _
  } = Og(), O = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    const D = y();
    let j = -1;
    if (D) {
      let F = react__WEBPACK_IMPORTED_MODULE_1__.Children.toArray(e);
      F.length > 0 && (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(F[0]) && F[0].type === Rl && (F = react__WEBPACK_IMPORTED_MODULE_1__.Children.toArray(e).map(
        (W) => (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(W) ? react__WEBPACK_IMPORTED_MODULE_1__.Children.toArray(W.props.children) : []
      ).flat()), j = F.findIndex((W) => {
        if (!(0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(W))
          return !1;
        const z = W.props.value;
        return typeof z == "object" && typeof D == "object" ? z[x] === D[x] : z === D;
      });
    }
    return j;
  }, [p, m, e, x]);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => {
    n || (f(O), d(O));
  }, [O, n]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => {
    n && (o && [-1, null].includes(S) || f(-1));
  }, [g, n]);
  const P = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    let D = 0, j = 0;
    react__WEBPACK_IMPORTED_MODULE_1__.Children.forEach(e, (H) => {
      (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(H) && H.type === Rl && react__WEBPACK_IMPORTED_MODULE_1__.Children.toArray(
        H.props.children
      ).some((V) => {
        var Y;
        if (!(0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(V))
          return !1;
        if (g && !A) {
          const Q = (Y = cp(
            V.props.children
          )) == null ? void 0 : Y.toLowerCase(), ne = g.toLowerCase();
          return Q.includes(ne);
        }
        return !0;
      }) && D++;
    }), j = Math.max(0, D - 1);
    let F = 0, W = 0;
    const z = (H) => {
      var U, V;
      if (!(0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(H))
        return null;
      if (H.type === Rl) {
        const Y = react__WEBPACK_IMPORTED_MODULE_1__.Children.map(
          H.props.children,
          z
        );
        if (!(Y == null ? void 0 : Y.some((re) => re !== null)))
          return null;
        const ne = {
          ...H.props,
          children: Y,
          index: W,
          totalGroups: j
        };
        return W++, (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(H, ne);
      }
      if (g && !A) {
        const Y = (V = cp(
          (U = H.props) == null ? void 0 : U.children
        )) == null ? void 0 : V.toLowerCase(), Q = g.toLowerCase();
        if (!(Y == null ? void 0 : Y.includes(Q)))
          return null;
      }
      return (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(H, {
        ...H.props,
        index: F++
      });
    };
    return react__WEBPACK_IMPORTED_MODULE_1__.Children.map(e, z);
  }, [g, p, m, e, A]), C = react__WEBPACK_IMPORTED_MODULE_1__.Children.count(P);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    v.current = [];
    let D = react__WEBPACK_IMPORTED_MODULE_1__.Children.toArray(e);
    D && (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(D[0]) && D[0].type === Rl && (D = react__WEBPACK_IMPORTED_MODULE_1__.Children.toArray(D).map(
      (j) => (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(j) ? j.props.children : null
    ).filter(Boolean)), react__WEBPACK_IMPORTED_MODULE_1__.Children.forEach(D, (j) => {
      var W, z;
      if (!(0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(j))
        return;
      const F = (z = cp(
        (W = j.props) == null ? void 0 : W.children
      )) == null ? void 0 : z.toLowerCase();
      if (g && !A) {
        const H = g.toLowerCase();
        if (!(F == null ? void 0 : F.includes(H)))
          return;
      }
      v.current.push(F);
    });
  }, [g, A]);
  const [k, I] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), $ = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    if (!(!A || typeof A != "function" || k)) {
      I(!0);
      try {
        await A(g);
      } catch (D) {
        console.error(D);
      } finally {
        I(!1);
      }
    }
  }, [g]), N = XX($, _);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    typeof A == "function" && N();
  }, [N]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: n && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(HG, { context: r, modal: !1, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    "div",
    {
      ref: i.setFloating,
      className: K(
        "box-border [&_*]:box-border w-full bg-white outline-none shadow-lg outline outline-1 outline-border-subtle",
        o && "grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",
        ui[l].dropdown,
        !o && "h-auto",
        o ? "overflow-hidden" : "overflow-y-auto overflow-x-hidden",
        t
      ),
      style: {
        ...a
      },
      ...s(),
      children: [
        o && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
          "div",
          {
            className: K(
              ui[l].searchbarWrapper
            ),
            children: [
              k ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                d1,
                {
                  className: ui[l].searchbarIcon
                }
              ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                rD,
                {
                  className: K(
                    "text-icon-secondary shrink-0",
                    ui[l].searchbarIcon
                  )
                }
              ),
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                "input",
                {
                  className: K(
                    "px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",
                    ui[l].searchbar
                  ),
                  type: "search",
                  name: "keyword",
                  placeholder: w,
                  onChange: (D) => c(D.target.value),
                  value: g,
                  autoComplete: "off"
                }
              )
            ]
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
          "div",
          {
            className: K(
              "overflow-y-auto overflow-x-hidden",
              !o && "w-full h-full",
              ui[l].dropdownItemsWrapper
            ),
            children: [
              !!C && P,
              !C && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-2 text-center text-base font-medium text-field-placeholder", children: "No items found" })
            ]
          }
        )
      ]
    }
  ) }) }) });
}
function xR({ children: e, root: t, id: n }) {
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ug, { id: n, root: t, children: e });
}
function wR({
  value: e,
  selected: t,
  children: n,
  className: r,
  ...i
}) {
  const {
    sizeValue: o,
    getItemProps: a,
    onKeyDownItem: s,
    onClickItem: l,
    activeIndex: c,
    selectedIndex: f,
    updateListRef: d,
    getValues: p,
    by: m,
    multiple: y
  } = Og(), { index: g } = i, v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(g), x = {
    sm: "py-1.5 px-2 text-sm font-normal",
    md: "p-2 text-sm font-normal",
    lg: "p-2 text-base font-normal"
  }, w = {
    sm: "size-4",
    md: "size-4",
    lg: "size-5"
  }, S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    if (!y)
      return !1;
    const _ = p();
    return _ ? _.some((O) => O !== null && e !== null && typeof O == "object" ? O[m] === e[m] : O === e) : !1;
  }, [e, p]), A = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => typeof t == "boolean" ? t : y ? S : g === f, [S, f, t]);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    "div",
    {
      className: K(
        "w-full flex items-center justify-between text-text-primary hover:bg-button-tertiary-hover rounded-md transition-all duration-150 cursor-pointer focus:outline-none focus-within:outline-none outline-none",
        x[o],
        g === c && "bg-button-tertiary-hover",
        r
      ),
      ref: (_) => {
        d(g, _);
      },
      role: "option",
      tabIndex: g === c ? 0 : -1,
      "aria-selected": A && g === c,
      ...a({
        // Handle pointer select.
        onClick() {
          l(v.current, e);
        },
        // Handle keyboard select.
        onKeyDown(_) {
          s(
            _,
            v.current,
            e
          );
        }
      }),
      children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-full truncate", children: n }),
        A && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          sd,
          {
            className: K(
              "text-icon-on-color-disabled",
              w[o]
            )
          }
        )
      ]
    }
  );
}
const _R = ({
  id: e,
  size: t = "md",
  // sm, md, lg
  value: n,
  // Value of the select (for controlled component).
  defaultValue: r,
  // Default value of the select (for uncontrolled component).
  onChange: i,
  // Callback function to handle the change event.
  by: o = "id",
  // Used to identify the select component. Default is 'id'.
  children: a,
  multiple: s = !1,
  // If true, it will allow multiple selection.
  combobox: l = !1,
  // If true, it will show a search box.
  disabled: c = !1,
  // If true, it will disable the select component.
  searchPlaceholder: f = "Search...",
  // Placeholder text for search box.
  searchFn: d,
  // Function to handle the search.
  debounceDelay: p = 500
  // Debounce delay for the search.
}) => {
  const m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => e || `select-${io()}`, [e]), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => typeof n < "u", [n]), [g, v] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(r), [x, w] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => y ? n : g, [y, n, g]), [A, _] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [O, P] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), [C, k] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), I = {
    sm: l ? 256 : 172,
    md: l ? 256 : 216,
    lg: l ? 256 : 216
  }, { refs: $, floatingStyles: N, context: D } = dg({
    placement: "bottom-start",
    open: A,
    onOpenChange: _,
    whileElementsMounted: ig,
    middleware: [
      og(5),
      ag({ padding: 10 }),
      SD({
        apply({ rects: se, elements: ge, availableHeight: X }) {
          Object.assign(ge.floating.style, {
            maxHeight: `min(${X}px, ${I[t]}px)`,
            maxWidth: `${se.reference.width}px`
          });
        },
        padding: 10
      })
    ]
  }), j = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)([]), F = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)([]), W = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), z = c1(D, { event: "mousedown" }), H = fg(D), U = u1(D, { role: "listbox" }), V = ZG(D, {
    listRef: j,
    activeIndex: O,
    selectedIndex: C,
    onNavigate: P,
    // This is a large list, allow looping.
    loop: !0
  }), Y = tY(D, {
    listRef: F,
    activeIndex: O,
    selectedIndex: C,
    onMatch: A ? P : k,
    onTypingChange(se) {
      W.current = se;
    }
  }), { getReferenceProps: Q, getFloatingProps: ne, getItemProps: re } = hg([
    H,
    U,
    V,
    z,
    ...l ? [] : [Y]
  ]), ce = (se, ge) => {
    const X = [
      ...S() ?? []
    ];
    X.findIndex((de) => de !== null && ge !== null && typeof de == "object" ? de[o] === ge[o] : de === ge) === -1 && (X.push(ge), y || v(X), k(se), $.reference.current.focus(), _(!1), w(""), typeof i == "function" && i(X));
  }, oe = (se, ge) => {
    if (s)
      return ce(se, ge);
    k(se), y || v(ge), $.reference.current.focus(), _(!1), w(""), typeof i == "function" && i(ge);
  }, fe = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((se, ge) => {
    j.current[se] = ge;
  }, []), ae = (se, ge) => {
    oe(se, ge);
  }, ee = (se, ge, X) => {
    se.key === "Enter" && (se.preventDefault(), oe(ge, X)), se.key === " " && !W.current && (se.preventDefault(), oe(ge, X));
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    yR.Provider,
    {
      value: {
        selectedIndex: C,
        setSelectedIndex: k,
        activeIndex: O,
        setActiveIndex: P,
        selected: g,
        setSelected: v,
        handleSelect: oe,
        combobox: l,
        sizeValue: t,
        multiple: s,
        onChange: i,
        isTypingRef: W,
        getItemProps: re,
        onClickItem: ae,
        onKeyDownItem: ee,
        getValues: S,
        selectId: m,
        getReferenceProps: Q,
        isOpen: A,
        value: n,
        updateListRef: fe,
        refs: $,
        listContentRef: F,
        by: o,
        getFloatingProps: ne,
        floatingStyles: N,
        context: D,
        searchKeyword: x,
        setSearchKeyword: w,
        disabled: c,
        isControlled: y,
        searchPlaceholder: f,
        searchFn: d,
        debounceDelay: p
      },
      children: a
    }
  );
};
_R.displayName = "Select";
const QEe = Object.assign((0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(_R), {
  Portal: (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(xR),
  Button: (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(vR),
  Options: (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(bR),
  Option: (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(wR),
  OptionGroup: (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(Rl)
});
xR.displayName = "Select.Portal";
vR.displayName = "Select.Button";
bR.displayName = "Select.Options";
wR.displayName = "Select.Option";
Rl.displayName = "Select.OptionGroup";
let ZX = 1;
var xr, Fi;
class JX {
  constructor() {
    zv(this, xr);
    zv(this, Fi);
    as(this, xr, []), as(this, Fi, []);
  }
  // Subscriber pattern.
  subscribe(t) {
    return Dr(this, Fi).push(t), () => {
      as(this, Fi, Dr(this, Fi).filter(
        (n) => n !== t
      ));
    };
  }
  // Publish a new toast.
  publish(t) {
    Dr(this, Fi).forEach((n) => n(t));
  }
  // Add a new toast.
  add(t) {
    Dr(this, xr).push(t), this.publish(t);
  }
  // Remove a toast.
  remove(t) {
    return as(this, xr, Dr(this, xr).filter((n) => n.id !== t)), t;
  }
  // Create a new toast.
  create(t) {
    const {
      id: n = void 0,
      message: r = "",
      jsx: i = void 0,
      ...o
    } = t;
    if (!r && typeof i != "function")
      return;
    const a = typeof n == "number" ? n : ZX++;
    return Dr(this, xr).find((l) => l.id === a) && as(this, xr, Dr(this, xr).map((l) => l.id === a ? (this.publish({
      ...l,
      title: r,
      jsx: i,
      ...o
    }), { ...l, title: r, jsx: i, ...o }) : l)), this.add({ id: a, title: r, jsx: i, ...o }), a;
  }
  // Update a toast.
  update(t, n) {
    const { render: r = void 0 } = n;
    let i = n;
    switch (typeof r) {
      case "function":
        i = {
          jsx: r,
          ...n
        };
        break;
      case "string":
        i = {
          title: r,
          ...n
        };
        break;
    }
    as(this, xr, Dr(this, xr).map((o) => o.id === t ? (this.publish({ ...o, ...i }), { ...o, ...i }) : o));
  }
  // Dismiss toast.
  dismiss(t) {
    return t || Dr(this, xr).forEach(
      (n) => Dr(this, Fi).forEach(
        (r) => r({ id: n.id, dismiss: !0 })
      )
    ), Dr(this, Fi).forEach(
      (n) => n({ id: t, dismiss: !0 })
    ), t;
  }
  // History of toasts.
  history() {
    return Dr(this, xr);
  }
  // Types of toasts.
  // Default toast.
  default(t = "", n = {}) {
    return this.create({ message: t, type: "neutral", ...n });
  }
  // Success toast.
  success(t = "", n = {}) {
    return this.create({ message: t, type: "success", ...n });
  }
  // Error toast.
  error(t = "", n = {}) {
    return this.create({ message: t, type: "error", ...n });
  }
  // Warning toast.
  warning(t = "", n = {}) {
    return this.create({ message: t, type: "warning", ...n });
  }
  // Info toast
  info(t = "", n = {}) {
    return this.create({ message: t, type: "info", ...n });
  }
  // Custom toast.
  custom(t, n = {}) {
    return this.create({
      jsx: t,
      type: "custom",
      ...n
    });
  }
}
xr = new WeakMap(), Fi = new WeakMap();
const kn = new JX(), QX = (e, t) => kn.default(e, t), eke = Object.seal(
  Object.assign(
    QX,
    {
      success: kn.success.bind(kn),
      error: kn.error.bind(kn),
      warning: kn.warning.bind(kn),
      info: kn.info.bind(kn),
      custom: kn.custom.bind(kn),
      dismiss: kn.dismiss.bind(kn),
      update: kn.update.bind(kn)
    },
    {
      getHistory: kn.history.bind(kn)
    }
  )
);
let dC = !1;
const eZ = (e) => (0,react__WEBPACK_IMPORTED_MODULE_1__.memo)((n) => {
  const r = n.singleTon;
  return dC && r ? null : (dC = !0, /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(e, { ...n }));
}), hC = {
  "top-left": "top-0 bottom-0 left-0 justify-start items-start",
  "top-right": "top-0 bottom-0 right-0 justify-start items-end",
  "bottom-left": "top-0 bottom-0 left-0 justify-end items-start",
  "bottom-right": "top-0 bottom-0 right-0 justify-end items-end"
}, pC = {
  stack: "w-[22.5rem]",
  inline: "lg:w-[47.5rem] w-full"
}, Dh = {
  light: {
    neutral: "border-alert-border-neutral bg-alert-background-neutral",
    custom: "border-alert-border-neutral bg-alert-background-neutral",
    info: "border-alert-border-info bg-alert-background-info",
    success: "border-alert-border-green bg-alert-background-green",
    warning: "border-alert-border-warning bg-alert-background-warning",
    error: "border-alert-border-danger bg-alert-background-danger"
  },
  dark: "bg-background-inverse border-background-inverse"
}, Ih = {
  light: "text-icon-secondary",
  dark: "text-icon-inverse"
}, tZ = ({
  position: e = "top-right",
  // top-right/top-left/bottom-right/bottom-left
  design: t = "stack",
  // stack/inline
  theme: n = "light",
  // light/dark
  className: r = "",
  autoDismiss: i = !0,
  // Auto dismiss the toast after a certain time.
  dismissAfter: o = 5e3
  // Time in milliseconds after which the toast will be dismissed.
}) => {
  const [a, s] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    kn.subscribe((c) => {
      if (c != null && c.dismiss) {
        s(
          (f) => f.map(
            (d) => d.id === c.id ? { ...d, dismiss: !0 } : d
          )
        );
        return;
      }
      setTimeout(() => {
        (0,react_dom__WEBPACK_IMPORTED_MODULE_2__.flushSync)(
          () => s((f) => f.findIndex(
            (p) => p.id === c.id
          ) !== -1 ? f.map((p) => p.id === c.id ? { ...p, ...c } : p) : [...f, c])
        );
      });
    });
  }, []);
  const l = (c) => {
    s((f) => f.filter((d) => d.id !== c));
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "ul",
    {
      className: K(
        "fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3",
        hC[e] ?? hC["top-right"],
        r
      ),
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ys, { initial: !1, children: a.map((c) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        An.li,
        {
          initial: { opacity: 0, y: 50, scale: 0.7 },
          animate: { opacity: 1, y: 0, scale: 1 },
          exit: {
            opacity: 0,
            scale: 0.6,
            transition: { duration: 0.15 }
          },
          layoutId: `toast-${c.id}`,
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            nZ,
            {
              toastItem: c,
              title: c.title,
              content: c == null ? void 0 : c.description,
              icon: (c == null ? void 0 : c.icon) ?? void 0,
              design: (c == null ? void 0 : c.design) ?? t,
              autoDismiss: (c == null ? void 0 : c.autoDismiss) ?? i,
              dismissAfter: (c == null ? void 0 : c.dismissAfter) ?? o,
              removeToast: l,
              variant: c.type,
              theme: (c == null ? void 0 : c.theme) ?? n
            }
          )
        },
        c.id
      )) })
    }
  );
}, nZ = ({
  toastItem: e,
  title: t = "",
  content: n = "",
  autoDismiss: r = !0,
  dismissAfter: i = 5e3,
  theme: o = "light",
  // light/dark
  design: a = "stack",
  // inline/stack
  icon: s,
  variant: l = "neutral",
  // neutral/info/success/warning/danger
  removeToast: c
  // Function to remove the toast.
}) => {
  var w, S, A, _, O, P, C;
  const f = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(0), d = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(0), p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), m = (k, I = i) => {
    if (!(!r || i < 0))
      return f.current = (/* @__PURE__ */ new Date()).getTime(), setTimeout(() => {
        typeof c == "function" && c(k.id);
      }, I);
  }, y = () => {
    clearTimeout(p.current), d.current = (/* @__PURE__ */ new Date()).getTime();
  }, g = () => {
    p.current = m(
      e,
      i - (d.current - f.current)
    );
  };
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const k = i;
    return p.current = m(e, k), () => {
      clearTimeout(p.current);
    };
  }, []), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    !(e != null && e.dismiss) || typeof c != "function" || c(e.id);
  }, [e]);
  const v = () => {
    var k, I;
    typeof c == "function" && ((I = (k = e == null ? void 0 : e.action) == null ? void 0 : k.onClick) == null || I.call(k, () => c(e.id)));
  };
  let x = null;
  return a === "stack" && (x = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        "flex items-center justify-start p-4 gap-2 relative border border-solid rounded-md shadow-lg",
        o === "dark" ? Dh.dark : (w = Dh.light) == null ? void 0 : w[l],
        pC.stack
      ),
      onMouseEnter: y,
      onMouseLeave: g,
      children: e.type !== "custom" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "self-start flex items-center justify-center [&_svg]:size-5 shrink-0", children: wp({ variant: l, icon: s, theme: o }) }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-start justify-start gap-0.5 mr-6", children: [
          _p({ title: t, theme: o }),
          Sp({ content: n, theme: o }),
          ((S = e == null ? void 0 : e.action) == null ? void 0 : S.label) && typeof ((A = e == null ? void 0 : e.action) == null ? void 0 : A.onClick) == "function" && /* eslint-disable */
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-2.5", children: x0({
            actionLabel: (_ = e == null ? void 0 : e.action) == null ? void 0 : _.label,
            actionType: ((O = e == null ? void 0 : e.action) == null ? void 0 : O.type) ?? "button",
            onAction: v,
            theme: o
          }) })
        ] }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute right-4 top-4 [&_svg]:size-5", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "button",
          {
            className: K(
              "bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",
              Ih[o] ?? Ih.light
            ),
            onClick: () => {
              typeof c == "function" && c(e.id);
            },
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($a, {})
          }
        ) })
      ] }) : (P = e == null ? void 0 : e.jsx) == null ? void 0 : P.call(e, {
        close: () => c(e.id),
        action: e != null && e.action ? { ...e == null ? void 0 : e.action, onClick: v } : null
      })
    }
  )), a === "inline" && (x = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    "div",
    {
      className: K(
        "flex items-center justify-start p-3 gap-2 relative border border-solid rounded-md shadow-lg",
        o === "dark" ? Dh.dark : (C = Dh.light) == null ? void 0 : C[l],
        pC.inline
      ),
      children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "self-start flex items-center justify-center [&_svg]:size-5 shrink-0", children: wp({ variant: l, icon: s, theme: o }) }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-start gap-1 mr-10 [&>span:first-child]:shrink-0", children: [
          _p({ title: t, theme: o }),
          Sp({ content: n, theme: o })
        ] }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute right-3 top-3 [&_svg]:size-5", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "button",
          {
            className: K(
              "bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",
              Ih[o] ?? Ih.light
            ),
            onClick: () => c(e.id),
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($a, {})
          }
        ) })
      ]
    }
  )), x;
}, tke = eZ(tZ), rZ = {
  sm: {
    1: "grid-cols-1",
    2: "grid-cols-2",
    3: "grid-cols-3",
    4: "grid-cols-4",
    5: "grid-cols-5",
    6: "grid-cols-6",
    7: "grid-cols-7",
    8: "grid-cols-8",
    9: "grid-cols-9",
    10: "grid-cols-10",
    11: "grid-cols-11",
    12: "grid-cols-12"
  },
  md: {
    1: "md:grid-cols-1",
    2: "md:grid-cols-2",
    3: "md:grid-cols-3",
    4: "md:grid-cols-4",
    5: "md:grid-cols-5",
    6: "md:grid-cols-6",
    7: "md:grid-cols-7",
    8: "md:grid-cols-8",
    9: "md:grid-cols-9",
    10: "md:grid-cols-10",
    11: "md:grid-cols-11",
    12: "md:grid-cols-12"
  },
  lg: {
    1: "lg:grid-cols-1",
    2: "lg:grid-cols-2",
    3: "lg:grid-cols-3",
    4: "lg:grid-cols-4",
    5: "lg:grid-cols-5",
    6: "lg:grid-cols-6",
    7: "lg:grid-cols-7",
    8: "lg:grid-cols-8",
    9: "lg:grid-cols-9",
    10: "lg:grid-cols-10",
    11: "lg:grid-cols-11",
    12: "lg:grid-cols-12"
  }
}, SR = {
  sm: {
    xs: "gap-2",
    sm: "gap-4",
    md: "gap-5",
    lg: "gap-6",
    xl: "gap-6",
    "2xl": "gap-8"
  },
  md: {
    xs: "md:gap-2",
    sm: "md:gap-4",
    md: "md:gap-5",
    lg: "md:gap-6",
    xl: "md:gap-6",
    "2xl": "md:gap-8"
  },
  lg: {
    xs: "lg:gap-2",
    sm: "lg:gap-4",
    md: "lg:gap-5",
    lg: "lg:gap-6",
    xl: "lg:gap-6",
    "2xl": "lg:gap-8"
  }
}, OR = {
  sm: {
    xs: "gap-x-2",
    sm: "gap-x-4",
    md: "gap-x-5",
    lg: "gap-x-6",
    xl: "gap-x-6",
    "2xl": "gap-x-8"
  },
  md: {
    xs: "md:gap-x-2",
    sm: "md:gap-x-4",
    md: "md:gap-x-5",
    lg: "md:gap-x-6",
    xl: "md:gap-x-6",
    "2xl": "md:gap-x-8"
  },
  lg: {
    xs: "lg:gap-x-2",
    sm: "lg:gap-x-4",
    md: "lg:gap-x-5",
    lg: "lg:gap-x-6",
    xl: "lg:gap-x-6",
    "2xl": "lg:gap-x-8"
  }
}, AR = {
  sm: {
    xs: "gap-y-2",
    sm: "gap-y-4",
    md: "gap-y-5",
    lg: "gap-y-6",
    xl: "gap-y-6",
    "2xl": "gap-y-8"
  },
  md: {
    xs: "md:gap-y-2",
    sm: "md:gap-y-4",
    md: "md:gap-y-5",
    lg: "md:gap-y-6",
    xl: "md:gap-y-6",
    "2xl": "md:gap-y-8"
  },
  lg: {
    xs: "lg:gap-y-2",
    sm: "lg:gap-y-4",
    md: "lg:gap-y-5",
    lg: "lg:gap-y-6",
    xl: "lg:gap-y-6",
    "2xl": "lg:gap-y-8"
  }
}, iZ = {
  sm: {
    1: "col-span-1",
    2: "col-span-2",
    3: "col-span-3",
    4: "col-span-4",
    5: "col-span-5",
    6: "col-span-6",
    7: "col-span-7",
    8: "col-span-8",
    9: "col-span-9",
    10: "col-span-10",
    11: "col-span-11",
    12: "col-span-12"
  },
  md: {
    1: "md:col-span-1",
    2: "md:col-span-2",
    3: "md:col-span-3",
    4: "md:col-span-4",
    5: "md:col-span-5",
    6: "md:col-span-6",
    7: "md:col-span-7",
    8: "md:col-span-8",
    9: "md:col-span-9",
    10: "md:col-span-10",
    11: "md:col-span-11",
    12: "md:col-span-12"
  },
  lg: {
    1: "lg:col-span-1",
    2: "lg:col-span-2",
    3: "lg:col-span-3",
    4: "lg:col-span-4",
    5: "lg:col-span-5",
    6: "lg:col-span-6",
    7: "lg:col-span-7",
    8: "lg:col-span-8",
    9: "lg:col-span-9",
    10: "lg:col-span-10",
    11: "lg:col-span-11",
    12: "lg:col-span-12"
  }
}, oZ = {
  sm: {
    1: "col-start-1",
    2: "col-start-2",
    3: "col-start-3",
    4: "col-start-4",
    5: "col-start-5",
    6: "col-start-6",
    7: "col-start-7",
    8: "col-start-8",
    9: "col-start-9",
    10: "col-start-10",
    11: "col-start-11",
    12: "col-start-12"
  },
  md: {
    1: "md:col-start-1",
    2: "md:col-start-2",
    3: "md:col-start-3",
    4: "md:col-start-4",
    5: "md:col-start-5",
    6: "md:col-start-6",
    7: "md:col-start-7",
    8: "md:col-start-8",
    9: "md:col-start-9",
    10: "md:col-start-10",
    11: "md:col-start-11",
    12: "md:col-start-12"
  },
  lg: {
    1: "lg:col-start-1",
    2: "lg:col-start-2",
    3: "lg:col-start-3",
    4: "lg:col-start-4",
    5: "lg:col-start-5",
    6: "lg:col-start-6",
    7: "lg:col-start-7",
    8: "lg:col-start-8",
    9: "lg:col-start-9",
    10: "lg:col-start-10",
    11: "lg:col-start-11",
    12: "lg:col-start-12"
  }
}, aZ = {
  sm: {
    row: "grid-flow-row",
    column: "grid-flow-col",
    "row-dense": "grid-flow-row-dense",
    "column-dense": "grid-flow-col-dense"
  },
  md: {
    row: "md:grid-flow-row",
    column: "md:grid-flow-col",
    "row-dense": "md:grid-flow-row-dense",
    "column-dense": "md:grid-flow-col-dense"
  },
  lg: {
    row: "lg:grid-flow-row",
    column: "lg:grid-flow-col",
    "row-dense": "lg:grid-flow-row-dense",
    "column-dense": "lg:grid-flow-col-dense"
  }
}, TR = {
  sm: {
    normal: "justify-normal",
    start: "justify-start",
    end: "justify-end",
    center: "justify-center",
    between: "justify-between",
    around: "justify-around",
    evenly: "justify-evenly",
    stretch: "justify-stretch"
  },
  md: {
    normal: "md:justify-normal",
    start: "md:justify-start",
    end: "md:justify-end",
    center: "md:justify-center",
    between: "md:justify-between",
    around: "md:justify-around",
    evenly: "md:justify-evenly",
    stretch: "md:justify-stretch"
  },
  lg: {
    normal: "lg:justify-normal",
    start: "lg:justify-start",
    end: "lg:justify-end",
    center: "lg:justify-center",
    between: "lg:justify-between",
    around: "lg:justify-around",
    evenly: "lg:justify-evenly",
    stretch: "lg:justify-stretch"
  }
}, PR = {
  sm: {
    start: "items-start",
    end: "items-end",
    center: "items-center",
    baseline: "items-baseline",
    stretch: "items-stretch"
  },
  md: {
    start: "md:items-start",
    end: "md:items-end",
    center: "md:items-center",
    baseline: "md:items-baseline",
    stretch: "md:items-stretch"
  },
  lg: {
    start: "lg:items-start",
    end: "lg:items-end",
    center: "lg:items-center",
    baseline: "lg:items-baseline",
    stretch: "lg:items-stretch"
  }
}, CR = {
  sm: {
    start: "self-start",
    end: "self-end",
    center: "self-center",
    baseline: "self-baseline",
    stretch: "self-stretch"
  },
  md: {
    start: "md:self-start",
    end: "md:self-end",
    center: "md:self-center",
    baseline: "md:self-baseline",
    stretch: "md:self-stretch"
  },
  lg: {
    start: "lg:self-start",
    end: "lg:self-end",
    center: "lg:self-center",
    baseline: "lg:self-baseline",
    stretch: "lg:self-stretch"
  }
}, ER = {
  sm: {
    auto: "justify-self-auto",
    start: "justify-self-start",
    end: "justify-self-end",
    center: "justify-self-center",
    baseline: "justify-self-baseline",
    stretch: "justify-self-stretch"
  },
  md: {
    auto: "md:justify-self-auto",
    start: "md:justify-self-start",
    end: "md:justify-self-end",
    center: "md:justify-self-center",
    baseline: "md:justify-self-baseline",
    stretch: "md:justify-self-stretch"
  },
  lg: {
    auto: "lg:justify-self-auto",
    start: "lg:justify-self-start",
    end: "lg:justify-self-end",
    center: "lg:justify-self-center",
    baseline: "lg:justify-self-baseline",
    stretch: "lg:justify-self-stretch"
  }
}, sZ = {
  sm: {
    row: "flex-row",
    "row-reverse": "flex-row-reverse",
    column: "flex-col",
    "column-reverse": "flex-col-reverse"
  },
  md: {
    row: "md:flex-row",
    "row-reverse": "md:flex-row-reverse",
    column: "md:flex-col",
    "column-reverse": "md:flex-col-reverse"
  },
  lg: {
    row: "lg:flex-row",
    "row-reverse": "lg:flex-row-reverse",
    column: "lg:flex-col",
    "column-reverse": "lg:flex-col-reverse"
  }
}, lZ = {
  sm: {
    wrap: "flex-wrap",
    "wrap-reverse": "flex-wrap-reverse",
    nowrap: "flex-nowrap"
  },
  md: {
    wrap: "md:flex-wrap",
    "wrap-reverse": "md:flex-wrap-reverse",
    nowrap: "md:flex-nowrap"
  },
  lg: {
    wrap: "lg:flex-wrap",
    "wrap-reverse": "lg:flex-wrap-reverse",
    nowrap: "lg:flex-nowrap"
  }
}, cZ = {
  sm: {
    1: "w-full",
    2: "w-1/2",
    3: "w-1/3",
    4: "w-1/4",
    5: "w-1/5",
    6: "w-1/6",
    7: "w-1/7",
    8: "w-1/8",
    9: "w-1/9",
    10: "w-1/10",
    11: "w-1/11",
    12: "w-1/12"
  },
  md: {
    1: "md:w-full",
    2: "md:w-1/2",
    3: "md:w-1/3",
    4: "md:w-1/4",
    5: "md:w-1/5",
    6: "md:w-1/6",
    7: "md:w-1/7",
    8: "md:w-1/8",
    9: "md:w-1/9",
    10: "md:w-1/10",
    11: "md:w-1/11",
    12: "md:w-1/12"
  },
  lg: {
    1: "lg:w-full",
    2: "lg:w-1/2",
    3: "lg:w-1/3",
    4: "lg:w-1/4",
    5: "lg:w-1/5",
    6: "lg:w-1/6",
    7: "lg:w-1/7",
    8: "lg:w-1/8",
    9: "lg:w-1/9",
    10: "lg:w-1/10",
    11: "lg:w-1/11",
    12: "lg:w-1/12"
  }
}, uZ = {
  sm: {
    1: "order-1",
    2: "order-2",
    3: "order-3",
    4: "order-4",
    5: "order-5",
    6: "order-6",
    7: "order-7",
    8: "order-8",
    9: "order-9",
    10: "order-10",
    11: "order-11",
    12: "order-12",
    first: "order-first",
    last: "order-last",
    none: "order-none"
  },
  md: {
    1: "md:order-1",
    2: "md:order-2",
    3: "md:order-3",
    4: "md:order-4",
    5: "md:order-5",
    6: "md:order-6",
    7: "md:order-7",
    8: "md:order-8",
    9: "md:order-9",
    10: "md:order-10",
    11: "md:order-11",
    12: "md:order-12",
    first: "md:order-first",
    last: "md:order-last",
    none: "md:order-none"
  },
  lg: {
    1: "lg:order-1",
    2: "lg:order-2",
    3: "lg:order-3",
    4: "lg:order-4",
    5: "lg:order-5",
    6: "lg:order-6",
    7: "lg:order-7",
    8: "lg:order-8",
    9: "lg:order-9",
    10: "lg:order-10",
    11: "lg:order-11",
    12: "lg:order-12",
    first: "lg:order-first",
    last: "lg:order-last",
    none: "lg:order-none"
  }
}, fZ = {
  sm: {
    0: "grow-0",
    1: "grow"
  },
  md: {
    0: "md:grow-0",
    1: "md:grow"
  },
  lg: {
    0: "lg:grow-0",
    1: "lg:grow"
  }
}, dZ = {
  sm: {
    0: "shrink-0",
    1: "shrink"
  },
  md: {
    0: "md:shrink-0",
    1: "md:shrink"
  },
  lg: {
    0: "lg:shrink-0",
    1: "lg:shrink"
  }
}, qt = (e, t, n, r = "sm") => {
  var o, a, s, l, c;
  const i = [];
  switch (typeof e) {
    case "object":
      for (const [d, p] of Object.entries(e))
        t[d] && i.push(
          ((o = t == null ? void 0 : t[d]) == null ? void 0 : o[p]) ?? ((a = t == null ? void 0 : t[d]) == null ? void 0 : a[n == null ? void 0 : n[d]]) ?? ""
        );
      break;
    case "string":
    case "number":
      const f = r;
      i.push(
        ((s = t == null ? void 0 : t[f]) == null ? void 0 : s[e]) ?? ((l = t == null ? void 0 : t[f]) == null ? void 0 : l[n == null ? void 0 : n[f]]) ?? ""
      );
      break;
    default:
      if (e === void 0)
        break;
      i.push(
        ((c = t == null ? void 0 : t[r]) == null ? void 0 : c[n]) ?? ""
      );
      break;
  }
  return i.join(" ");
}, Mp = ({
  className: e,
  cols: t,
  gap: n,
  gapX: r,
  gapY: i,
  align: o,
  justify: a,
  gridFlow: s,
  colsSubGrid: l = !1,
  rowsSubGrid: c = !1,
  autoRows: f = !1,
  autoCols: d = !1,
  children: p,
  ...m
}) => {
  const y = qt(t, rZ, 1), g = qt(n, SR, "sm"), v = qt(r, OR, ""), x = qt(i, AR, ""), w = qt(o, PR, ""), S = qt(a, TR, ""), A = qt(s, aZ, "");
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        "grid",
        {
          "grid-cols-subgrid": l,
          "grid-rows-subgrid": c,
          "auto-cols-auto": d,
          "auto-rows-auto": f
        },
        y,
        g,
        v,
        x,
        w,
        S,
        A,
        e
      ),
      ...m,
      children: p
    }
  );
}, hZ = ({
  className: e,
  children: t,
  colSpan: n,
  colStart: r,
  alignSelf: i,
  justifySelf: o,
  ...a
}) => {
  const s = qt(n, iZ, 0), l = qt(
    r,
    oZ,
    0
  ), c = qt(
    i,
    CR,
    ""
  ), f = qt(
    o,
    ER,
    ""
  );
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        s,
        l,
        c,
        f,
        e
      ),
      ...a,
      children: t
    }
  );
};
Mp.Item = hZ;
const L0 = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({}), pZ = () => (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(L0), kR = ({
  containerType: e = "flex",
  // flex, (grid - functionality not implemented)
  gap: t = "sm",
  // xs, sm, md, lg, xl, 2xl
  gapX: n,
  gapY: r,
  direction: i,
  // row, row-reverse, column, column reverse
  justify: o,
  // justify-content (normal, start, end, center, between, around, evenly, stretch)
  align: a,
  // align-items (start, end, center, baseline, stretch)
  wrap: s,
  // nowrap, wrap, wrap-reverse
  cols: l,
  className: c,
  children: f,
  ...d
}) => {
  if (e === "grid")
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      L0.Provider,
      {
        value: {
          containerType: e
        },
        children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Mp,
          {
            className: c,
            gap: t,
            gapX: n,
            gapY: r,
            cols: l,
            children: f,
            align: a,
            justify: o,
            ...d
          }
        )
      }
    );
  const p = qt(s, lZ, ""), m = qt(t, SR, "sm"), y = qt(n, OR, ""), g = qt(r, AR, ""), v = qt(
    i,
    sZ,
    ""
  ), x = qt(
    o,
    TR,
    ""
  ), w = qt(a, PR, ""), S = K(
    "flex",
    p,
    m,
    y,
    g,
    v,
    x,
    w,
    c
  ), A = () => e === "flex" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: S, children: f }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Mp,
    {
      className: c,
      gap: t,
      gapX: n,
      gapY: r,
      cols: l,
      children: f,
      align: a,
      justify: o,
      ...d
    }
  );
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    L0.Provider,
    {
      value: {
        containerType: e,
        cols: l
      },
      children: A()
    }
  );
}, MR = ({
  grow: e,
  shrink: t,
  order: n,
  alignSelf: r,
  justifySelf: i,
  className: o,
  children: a,
  ...s
}) => {
  const { containerType: l, cols: c } = pZ();
  if (l === "grid")
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Mp.Item,
      {
        className: o,
        alignSelf: r,
        justifySelf: i,
        children: a,
        ...s
      }
    );
  const f = qt(
    r,
    CR,
    ""
  ), d = qt(
    i,
    ER,
    ""
  ), p = qt(e, fZ, 0), m = qt(t, dZ, 0), y = qt(n, uZ, 0), g = qt(c, cZ, 1);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        "box-border",
        p,
        m,
        y,
        f,
        d,
        g,
        o
      ),
      children: a
    }
  );
};
kR.Item = MR;
kR.displayName = "Container";
MR.displayName = "Container.Item";
const nke = ({
  design: e = "inline",
  // stack/inline
  theme: t = "light",
  // light/dark
  variant: n = "neutral",
  className: r = "",
  title: i = "",
  content: o = "",
  icon: a = null,
  onClose: s,
  action: l = {
    label: "",
    onClick: () => {
    },
    type: "link"
  }
}) => {
  var m, y;
  const c = () => {
    typeof s == "function" && s();
  }, f = {
    light: {
      neutral: "ring-alert-border-neutral bg-alert-background-neutral",
      custom: "ring-alert-border-neutral bg-alert-background-neutral",
      info: "ring-alert-border-info bg-alert-background-info",
      success: "ring-alert-border-green bg-alert-background-green",
      warning: "ring-alert-border-warning bg-alert-background-warning",
      error: "ring-alert-border-danger bg-alert-background-danger"
    },
    dark: "bg-background-inverse ring-background-inverse"
  }, d = {
    light: "text-icon-secondary",
    dark: "text-icon-inverse"
  }, p = () => {
    var g;
    (g = l == null ? void 0 : l.onClick) == null || g.call(l, c);
  };
  return e === "stack" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        "flex items-center justify-start p-4 gap-2 relative ring-1 rounded-md shadow-lg",
        t === "dark" ? f.dark : (m = f.light) == null ? void 0 : m[n],
        r
      ),
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "self-start flex items-center justify-center [&_svg]:size-5 shrink-0", children: wp({ variant: n, icon: a, theme: t }) }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-start justify-start gap-0.5 mr-7", children: [
          _p({ title: i, theme: t }),
          Sp({ content: o, theme: t }),
          (l == null ? void 0 : l.label) && typeof (l == null ? void 0 : l.onClick) == "function" && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-2.5", children: x0({
            actionLabel: l == null ? void 0 : l.label,
            actionType: (l == null ? void 0 : l.type) ?? "button",
            onAction: p,
            theme: t
          }) })
        ] }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute right-4 top-4 [&_svg]:size-5", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "button",
          {
            className: K(
              "bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",
              d[t] ?? d.light
            ),
            onClick: () => c(),
            "aria-label": "Close alert",
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($a, {})
          }
        ) })
      ] })
    }
  ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    "div",
    {
      className: K(
        "flex items-center justify-between p-3 gap-2 relative ring-1 rounded-lg shadow-lg",
        t === "dark" ? f.dark : (y = f.light) == null ? void 0 : y[n],
        r
      ),
      children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-start gap-2", children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "self-start flex items-center justify-center [&_svg]:size-5 shrink-0", children: wp({ variant: n, icon: a, theme: t }) }),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "content-start space-x-1 my-0 mr-10 px-1", children: [
            _p({ title: i, theme: t, inline: !0 }),
            Sp({ content: o, theme: t, inline: !0 })
          ] })
        ] }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex h-full justify-start gap-4 [&_svg]:size-4", children: [
          (l == null ? void 0 : l.label) && typeof (l == null ? void 0 : l.onClick) == "function" && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "self-center flex h-5", children: x0({
            actionLabel: l == null ? void 0 : l.label,
            actionType: (l == null ? void 0 : l.type) ?? "button",
            onAction: p,
            theme: t
          }) }),
          typeof s == "function" && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            "button",
            {
              className: K(
                "self-start bg-transparent m-0 border-none p-0.5 focus:outline-none active:outline-none cursor-pointer size-5",
                d[t] ?? d.light
              ),
              onClick: () => c(),
              "aria-label": "Close alert",
              children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($a, {})
            }
          )
        ] })
      ]
    }
  );
};
function mZ(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var gZ = mZ(function(e) {
  const t = new URLSearchParams();
  t.append("code", e);
  for (let n = 1; n < arguments.length; n++) t.append("v", arguments[n]);
  throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
});
const NR = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(null);
function yZ(e, t) {
  return { getTheme: function() {
    return t ?? null;
  } };
}
function Gr() {
  const e = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(NR);
  return e == null && gZ(8), e;
}
function vZ({ defaultSelection: e }) {
  const [t] = Gr();
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    t.focus(() => {
      const n = document.activeElement, r = t.getRootElement();
      r === null || n !== null && r.contains(n) || r.focus({ preventScroll: !0 });
    }, { defaultSelection: e });
  }, [e, t]), null;
}
function bZ(e) {
  return {};
}
const G1 = {}, xZ = {}, ks = {}, Hl = {}, B0 = {}, Kl = {}, Y1 = {}, F0 = {}, bf = {}, xf = {}, _s = {}, q1 = {}, X1 = {}, $R = {}, Z1 = {}, wZ = {}, J1 = {}, _Z = {}, DR = {}, IR = {}, wf = {}, SZ = {}, Q1 = {}, RR = {}, jR = {}, LR = {}, BR = {}, FR = {}, OZ = {}, AZ = {}, e_ = {}, t_ = {}, W0 = {}, TZ = {}, PZ = {}, Rh = {}, jh = {}, CZ = {}, EZ = {}, kZ = {}, Di = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, MZ = Di && "documentMode" in document ? document.documentMode : null, _i = Di && /Mac|iPod|iPhone|iPad/.test(navigator.platform), Ma = Di && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), Np = !(!Di || !("InputEvent" in window) || MZ) && "getTargetRanges" in new window.InputEvent("input"), n_ = Di && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Ag = Di && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, NZ = Di && /Android/.test(navigator.userAgent), WR = Di && /^(?=.*Chrome).*/i.test(navigator.userAgent), $Z = Di && NZ && WR, r_ = Di && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !WR, md = 1, Ua = 3, Ls = 0, zR = 1, nc = 2, DZ = 0, IZ = 1, RZ = 2, $p = 4, Dp = 8, i_ = 128, jZ = 112 | (3 | $p | Dp) | i_, o_ = 1, a_ = 2, s_ = 3, l_ = 4, c_ = 5, u_ = 6, Tg = n_ || Ag || r_ ? " " : "​", zo = `

`, LZ = Ma ? " " : Tg, VR = "֑-߿יִ-﷽ﹰ-ﻼ", UR = "A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-", BZ = new RegExp("^[^" + UR + "]*[" + VR + "]"), FZ = new RegExp("^[^" + VR + "]*[" + UR + "]"), Io = { bold: 1, code: 16, highlight: i_, italic: 2, strikethrough: $p, subscript: 32, superscript: 64, underline: Dp }, WZ = { directionless: 1, unmergeable: 2 }, mC = { center: a_, end: u_, justify: l_, left: o_, right: s_, start: c_ }, zZ = { [a_]: "center", [u_]: "end", [l_]: "justify", [o_]: "left", [s_]: "right", [c_]: "start" }, VZ = { normal: 0, segmented: 2, token: 1 }, UZ = { [DZ]: "normal", [RZ]: "segmented", [IZ]: "token" };
function HZ(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var _e = HZ(function(e) {
  const t = new URLSearchParams();
  t.append("code", e);
  for (let n = 1; n < arguments.length; n++) t.append("v", arguments[n]);
  throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
});
function Ip(...e) {
  const t = [];
  for (const n of e) if (n && typeof n == "string") for (const [r] of n.matchAll(/\S+/g)) t.push(r);
  return t;
}
const KZ = 100;
let z0 = !1, f_ = 0;
function GZ(e) {
  f_ = e.timeStamp;
}
function hb(e, t, n) {
  return t.__lexicalLineBreak === e || e[`__lexicalKey_${n._key}`] !== void 0;
}
function YZ(e, t, n) {
  const r = no(n._window);
  let i = null, o = null;
  r !== null && r.anchorNode === e && (i = r.anchorOffset, o = r.focusOffset);
  const a = e.nodeValue;
  a !== null && m_(t, a, i, o, !1);
}
function qZ(e, t, n) {
  if (we(e)) {
    const r = e.anchor.getNode();
    if (r.is(n) && e.format !== r.getFormat()) return !1;
  }
  return t.nodeType === Ua && n.isAttached();
}
function HR(e, t, n) {
  z0 = !0;
  const r = performance.now() - f_ > KZ;
  try {
    Fr(e, () => {
      const i = Ne() || function(p) {
        return p.getEditorState().read(() => {
          const m = Ne();
          return m !== null ? m.clone() : null;
        });
      }(e), o = /* @__PURE__ */ new Map(), a = e.getRootElement(), s = e._editorState, l = e._blockCursorElement;
      let c = !1, f = "";
      for (let p = 0; p < t.length; p++) {
        const m = t[p], y = m.type, g = m.target;
        let v = Eg(g, s);
        if (!(v === null && g !== a || Ht(v))) {
          if (y === "characterData") r && Se(v) && qZ(i, g, v) && YZ(g, v, e);
          else if (y === "childList") {
            c = !0;
            const x = m.addedNodes;
            for (let A = 0; A < x.length; A++) {
              const _ = x[A], O = XR(_), P = _.parentNode;
              if (P != null && _ !== l && O === null && (_.nodeName !== "BR" || !hb(_, P, e))) {
                if (Ma) {
                  const C = _.innerText || _.nodeValue;
                  C && (f += C);
                }
                P.removeChild(_);
              }
            }
            const w = m.removedNodes, S = w.length;
            if (S > 0) {
              let A = 0;
              for (let _ = 0; _ < S; _++) {
                const O = w[_];
                (O.nodeName === "BR" && hb(O, g, e) || l === O) && (g.appendChild(O), A++);
              }
              S !== A && (g === a && (v = JR(s)), o.set(g, v));
            }
          }
        }
      }
      if (o.size > 0) for (const [p, m] of o) if (ve(m)) {
        const y = m.getChildrenKeys();
        let g = p.firstChild;
        for (let v = 0; v < y.length; v++) {
          const x = y[v], w = e.getElementByKey(x);
          w !== null && (g == null ? (p.appendChild(w), g = w) : g !== w && p.replaceChild(w, g), g = g.nextSibling);
        }
      } else Se(m) && m.markDirty();
      const d = n.takeRecords();
      if (d.length > 0) {
        for (let p = 0; p < d.length; p++) {
          const m = d[p], y = m.addedNodes, g = m.target;
          for (let v = 0; v < y.length; v++) {
            const x = y[v], w = x.parentNode;
            w == null || x.nodeName !== "BR" || hb(x, g, e) || w.removeChild(x);
          }
        }
        n.takeRecords();
      }
      i !== null && (c && (i.dirty = !0, Vo(i)), Ma && n2(e) && i.insertRawText(f));
    });
  } finally {
    z0 = !1;
  }
}
function KR(e) {
  const t = e._observer;
  t !== null && HR(e, t.takeRecords(), t);
}
function GR(e) {
  (function(t) {
    f_ === 0 && Ng(t).addEventListener("textInput", GZ, !0);
  })(e), e._observer = new MutationObserver((t, n) => {
    HR(e, t, n);
  });
}
function gC(e, t) {
  const n = e.__mode, r = e.__format, i = e.__style, o = t.__mode, a = t.__format, s = t.__style;
  return !(n !== null && n !== o || r !== null && r !== a || i !== null && i !== s);
}
function yC(e, t) {
  const n = e.mergeWithSibling(t), r = mn()._normalizedNodes;
  return r.add(e.__key), r.add(t.__key), n;
}
function vC(e) {
  let t, n, r = e;
  if (r.__text !== "" || !r.isSimpleText() || r.isUnmergeable()) {
    for (; (t = r.getPreviousSibling()) !== null && Se(t) && t.isSimpleText() && !t.isUnmergeable(); ) {
      if (t.__text !== "") {
        if (gC(t, r)) {
          r = yC(t, r);
          break;
        }
        break;
      }
      t.remove();
    }
    for (; (n = r.getNextSibling()) !== null && Se(n) && n.isSimpleText() && !n.isUnmergeable(); ) {
      if (n.__text !== "") {
        if (gC(r, n)) {
          r = yC(r, n);
          break;
        }
        break;
      }
      n.remove();
    }
  } else r.remove();
}
function XZ(e) {
  return bC(e.anchor), bC(e.focus), e;
}
function bC(e) {
  for (; e.type === "element"; ) {
    const t = e.getNode(), n = e.offset;
    let r, i;
    if (n === t.getChildrenSize() ? (r = t.getChildAtIndex(n - 1), i = !0) : (r = t.getChildAtIndex(n), i = !1), Se(r)) {
      e.set(r.__key, i ? r.getTextContentSize() : 0, "text");
      break;
    }
    if (!ve(r)) break;
    e.set(r.__key, i ? r.getChildrenSize() : 0, "element");
  }
}
let ZZ = 1;
const JZ = typeof queueMicrotask == "function" ? queueMicrotask : (e) => {
  Promise.resolve().then(e);
};
function YR(e) {
  const t = document.activeElement;
  if (t === null) return !1;
  const n = t.nodeName;
  return Ht(Eg(e)) && (n === "INPUT" || n === "TEXTAREA" || t.contentEditable === "true" && Cg(t) == null);
}
function Pg(e, t, n) {
  const r = e.getRootElement();
  try {
    return r !== null && r.contains(t) && r.contains(n) && t !== null && !YR(t) && qR(t) === e;
  } catch {
    return !1;
  }
}
function d_(e) {
  return e instanceof Fg;
}
function qR(e) {
  let t = e;
  for (; t != null; ) {
    const n = Cg(t);
    if (d_(n)) return n;
    t = Mg(t);
  }
  return null;
}
function Cg(e) {
  return e ? e.__lexicalEditor : null;
}
function Pl(e) {
  return e.isToken() || e.isSegmented();
}
function QZ(e) {
  return e.nodeType === Ua;
}
function Rp(e) {
  let t = e;
  for (; t != null; ) {
    if (QZ(t)) return t;
    t = t.firstChild;
  }
  return null;
}
function V0(e, t, n) {
  const r = Io[t];
  if (n !== null && (e & r) == (n & r)) return e;
  let i = e ^ r;
  return t === "subscript" ? i &= ~Io.superscript : t === "superscript" && (i &= ~Io.subscript), i;
}
function eJ(e, t) {
  if (t != null) return void (e.__key = t);
  wr(), A2();
  const n = mn(), r = qo(), i = "" + ZZ++;
  r._nodeMap.set(i, e), ve(e) ? n._dirtyElements.set(i, !0) : n._dirtyLeaves.add(i), n._cloneNotNeeded.add(i), n._dirtyType = zR, e.__key = i;
}
function Ms(e) {
  const t = e.getParent();
  if (t !== null) {
    const n = e.getWritable(), r = t.getWritable(), i = e.getPreviousSibling(), o = e.getNextSibling();
    if (i === null) if (o !== null) {
      const a = o.getWritable();
      r.__first = o.__key, a.__prev = null;
    } else r.__first = null;
    else {
      const a = i.getWritable();
      if (o !== null) {
        const s = o.getWritable();
        s.__prev = a.__key, a.__next = s.__key;
      } else a.__next = null;
      n.__prev = null;
    }
    if (o === null) if (i !== null) {
      const a = i.getWritable();
      r.__last = i.__key, a.__next = null;
    } else r.__last = null;
    else {
      const a = o.getWritable();
      if (i !== null) {
        const s = i.getWritable();
        s.__next = a.__key, a.__prev = s.__key;
      } else a.__prev = null;
      n.__next = null;
    }
    r.__size--, n.__parent = null;
  }
}
function jp(e) {
  A2();
  const t = e.getLatest(), n = t.__parent, r = qo(), i = mn(), o = r._nodeMap, a = i._dirtyElements;
  n !== null && function(l, c, f) {
    let d = l;
    for (; d !== null; ) {
      if (f.has(d)) return;
      const p = c.get(d);
      if (p === void 0) break;
      f.set(d, !1), d = p.__parent;
    }
  }(n, o, a);
  const s = t.__key;
  i._dirtyType = zR, ve(e) ? a.set(s, !0) : i._dirtyLeaves.add(s);
}
function Gn(e) {
  wr();
  const t = mn(), n = t._compositionKey;
  if (e !== n) {
    if (t._compositionKey = e, n !== null) {
      const r = $n(n);
      r !== null && r.getWritable();
    }
    if (e !== null) {
      const r = $n(e);
      r !== null && r.getWritable();
    }
  }
}
function Oa() {
  return bd() ? null : mn()._compositionKey;
}
function $n(e, t) {
  const n = (t || qo())._nodeMap.get(e);
  return n === void 0 ? null : n;
}
function XR(e, t) {
  const n = e[`__lexicalKey_${mn()._key}`];
  return n !== void 0 ? $n(n, t) : null;
}
function Eg(e, t) {
  let n = e;
  for (; n != null; ) {
    const r = XR(n, t);
    if (r !== null) return r;
    n = Mg(n);
  }
  return null;
}
function ZR(e) {
  const t = e._decorators, n = Object.assign({}, t);
  return e._pendingDecorators = n, n;
}
function xC(e) {
  return e.read(() => ir().getTextContent());
}
function ir() {
  return JR(qo());
}
function JR(e) {
  return e._nodeMap.get("root");
}
function Vo(e) {
  wr();
  const t = qo();
  e !== null && (e.dirty = !0, e.setCachedNodes(null)), t._selection = e;
}
function jl(e) {
  const t = mn(), n = function(r, i) {
    let o = r;
    for (; o != null; ) {
      const a = o[`__lexicalKey_${i._key}`];
      if (a !== void 0) return a;
      o = Mg(o);
    }
    return null;
  }(e, t);
  return n === null ? e === t.getRootElement() ? $n("root") : null : $n(n);
}
function wC(e, t) {
  return t ? e.getTextContentSize() : 0;
}
function QR(e) {
  return /[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e);
}
function h_(e) {
  const t = [];
  let n = e;
  for (; n !== null; ) t.push(n), n = n._parentEditor;
  return t;
}
function e2() {
  return Math.random().toString(36).replace(/[^a-z]+/g, "").substr(0, 5);
}
function t2(e) {
  return e.nodeType === Ua ? e.nodeValue : null;
}
function p_(e, t, n) {
  const r = no(t._window);
  if (r === null) return;
  const i = r.anchorNode;
  let { anchorOffset: o, focusOffset: a } = r;
  if (i !== null) {
    let s = t2(i);
    const l = Eg(i);
    if (s !== null && Se(l)) {
      if (s === Tg && n) {
        const c = n.length;
        s = n, o = c, a = c;
      }
      s !== null && m_(l, s, o, a, e);
    }
  }
}
function m_(e, t, n, r, i) {
  let o = e;
  if (o.isAttached() && (i || !o.isDirty())) {
    const a = o.isComposing();
    let s = t;
    (a || i) && t[t.length - 1] === Tg && (s = t.slice(0, -1));
    const l = o.getTextContent();
    if (i || s !== l) {
      if (s === "") {
        if (Gn(null), n_ || Ag || r_) o.remove();
        else {
          const g = mn();
          setTimeout(() => {
            g.update(() => {
              o.isAttached() && o.remove();
            });
          }, 20);
        }
        return;
      }
      const c = o.getParent(), f = jg(), d = o.getTextContentSize(), p = Oa(), m = o.getKey();
      if (o.isToken() || p !== null && m === p && !a || we(f) && (c !== null && !c.canInsertTextBefore() && f.anchor.offset === 0 || f.anchor.key === e.__key && f.anchor.offset === 0 && !o.canInsertTextBefore() && !a || f.focus.key === e.__key && f.focus.offset === d && !o.canInsertTextAfter() && !a)) return void o.markDirty();
      const y = Ne();
      if (!we(y) || n === null || r === null) return void o.setTextContent(s);
      if (y.setTextNodeRange(o, n, o, r), o.isSegmented()) {
        const g = Vn(o.getTextContent());
        o.replace(g), o = g;
      }
      o.setTextContent(s);
    }
  }
}
function tJ(e, t) {
  if (t.isSegmented()) return !0;
  if (!e.isCollapsed()) return !1;
  const n = e.anchor.offset, r = t.getParentOrThrow(), i = t.isToken();
  return n === 0 ? !t.canInsertTextBefore() || !r.canInsertTextBefore() && !t.isComposing() || i || function(o) {
    const a = o.getPreviousSibling();
    return (Se(a) || ve(a) && a.isInline()) && !a.canInsertTextAfter();
  }(t) : n === t.getTextContentSize() && (!t.canInsertTextAfter() || !r.canInsertTextAfter() && !t.isComposing() || i);
}
function _C(e) {
  return e === "ArrowLeft";
}
function SC(e) {
  return e === "ArrowRight";
}
function Fu(e, t) {
  return _i ? e : t;
}
function OC(e) {
  return e === "Enter";
}
function _u(e) {
  return e === "Backspace";
}
function Su(e) {
  return e === "Delete";
}
function AC(e, t, n) {
  return e.toLowerCase() === "a" && Fu(t, n);
}
function nJ() {
  const e = ir();
  Vo(XZ(e.select(0, e.getChildrenSize())));
}
function qu(e, t) {
  e.__lexicalClassNameCache === void 0 && (e.__lexicalClassNameCache = {});
  const n = e.__lexicalClassNameCache, r = n[t];
  if (r !== void 0) return r;
  const i = e[t];
  if (typeof i == "string") {
    const o = Ip(i);
    return n[t] = o, o;
  }
  return i;
}
function g_(e, t, n, r, i) {
  if (n.size === 0) return;
  const o = r.__type, a = r.__key, s = t.get(o);
  s === void 0 && _e(33, o);
  const l = s.klass;
  let c = e.get(l);
  c === void 0 && (c = /* @__PURE__ */ new Map(), e.set(l, c));
  const f = c.get(a), d = f === "destroyed" && i === "created";
  (f === void 0 || d) && c.set(a, d ? "updated" : i);
}
function TC(e, t, n) {
  const r = e.getParent();
  let i = n, o = e;
  return r !== null && (t && n === 0 ? (i = o.getIndexWithinParent(), o = r) : t || n !== o.getChildrenSize() || (i = o.getIndexWithinParent() + 1, o = r)), o.getChildAtIndex(t ? i - 1 : i);
}
function U0(e, t) {
  const n = e.offset;
  if (e.type === "element")
    return TC(e.getNode(), t, n);
  {
    const r = e.getNode();
    if (t && n === 0 || !t && n === r.getTextContentSize()) {
      const i = t ? r.getPreviousSibling() : r.getNextSibling();
      return i === null ? TC(r.getParentOrThrow(), t, r.getIndexWithinParent() + (t ? 0 : 1)) : i;
    }
  }
  return null;
}
function n2(e) {
  const t = Ng(e).event, n = t && t.inputType;
  return n === "insertFromPaste" || n === "insertFromPasteAsQuotation";
}
function Ae(e, t, n) {
  return C2(e, t, n);
}
function kg(e) {
  return !ur(e) && !e.isLastChild() && !e.isInline();
}
function Lp(e, t) {
  const n = e._keyToDOMMap.get(t);
  return n === void 0 && _e(75, t), n;
}
function Mg(e) {
  const t = e.assignedSlot || e.parentElement;
  return t !== null && t.nodeType === 11 ? t.host : t;
}
function H0(e, t) {
  let n = e.getParent();
  for (; n !== null; ) {
    if (n.is(t)) return !0;
    n = n.getParent();
  }
  return !1;
}
function Ng(e) {
  const t = e._window;
  return t === null && _e(78), t;
}
function rJ(e) {
  let t = e.getParentOrThrow();
  for (; t !== null; ) {
    if (gd(t)) return t;
    t = t.getParentOrThrow();
  }
  return t;
}
function gd(e) {
  return ur(e) || ve(e) && e.isShadowRoot();
}
function $g(e) {
  const t = mn(), n = e.constructor.getType(), r = t._nodes.get(n);
  r === void 0 && _e(97);
  const i = r.replace;
  if (i !== null) {
    const o = i(e);
    return o instanceof e.constructor || _e(98), o;
  }
  return e;
}
function pb(e, t) {
  !ur(e.getParent()) || ve(t) || Ht(t) || _e(99);
}
function mb(e) {
  return (Ht(e) || ve(e) && !e.canBeEmpty()) && !e.isInline();
}
function y_(e, t, n) {
  n.style.removeProperty("caret-color"), t._blockCursorElement = null;
  const r = e.parentElement;
  r !== null && r.removeChild(e);
}
function iJ(e, t, n) {
  let r = e._blockCursorElement;
  if (we(n) && n.isCollapsed() && n.anchor.type === "element" && t.contains(document.activeElement)) {
    const i = n.anchor, o = i.getNode(), a = i.offset;
    let s = !1, l = null;
    if (a === o.getChildrenSize())
      mb(o.getChildAtIndex(a - 1)) && (s = !0);
    else {
      const c = o.getChildAtIndex(a);
      if (mb(c)) {
        const f = c.getPreviousSibling();
        (f === null || mb(f)) && (s = !0, l = e.getElementByKey(c.__key));
      }
    }
    if (s) {
      const c = e.getElementByKey(o.__key);
      return r === null && (e._blockCursorElement = r = function(f) {
        const d = f.theme, p = document.createElement("div");
        p.contentEditable = "false", p.setAttribute("data-lexical-cursor", "true");
        let m = d.blockCursor;
        if (m !== void 0) {
          if (typeof m == "string") {
            const y = Ip(m);
            m = d.blockCursor = y;
          }
          m !== void 0 && p.classList.add(...m);
        }
        return p;
      }(e._config)), t.style.caretColor = "transparent", void (l === null ? c.appendChild(r) : c.insertBefore(r, l));
    }
  }
  r !== null && y_(r, e, t);
}
function no(e) {
  return Di ? (e || window).getSelection() : null;
}
function v_(e) {
  return e.nodeType === 1;
}
function oJ(e) {
  const t = new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/, "i");
  return e.nodeName.match(t) !== null;
}
function PC(e) {
  const t = new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/, "i");
  return e.nodeName.match(t) !== null;
}
function Cl(e) {
  if (ur(e) || Ht(e) && !e.isInline()) return !0;
  if (!ve(e) || gd(e)) return !1;
  const t = e.getFirstChild(), n = t === null || Ju(t) || Se(t) || t.isInline();
  return !e.isInline() && e.canBeEmpty() !== !1 && n;
}
function gb(e, t) {
  let n = e;
  for (; n !== null && n.getParent() !== null && !t(n); ) n = n.getParentOrThrow();
  return t(n) ? n : null;
}
const CC = /* @__PURE__ */ new WeakMap(), aJ = /* @__PURE__ */ new Map();
function sJ(e) {
  if (!e._readOnly && e.isEmpty()) return aJ;
  e._readOnly || _e(192);
  let t = CC.get(e);
  if (!t) {
    t = /* @__PURE__ */ new Map(), CC.set(e, t);
    for (const [n, r] of e._nodeMap) {
      const i = r.__type;
      let o = t.get(i);
      o || (o = /* @__PURE__ */ new Map(), t.set(i, o)), o.set(n, r);
    }
  }
  return t;
}
function r2(e) {
  const t = e.constructor.clone(e);
  return t.afterCloneFrom(e), t;
}
function i2(e, t, n, r, i, o) {
  let a = e.getFirstChild();
  for (; a !== null; ) {
    const s = a.__key;
    a.__parent === t && (ve(a) && i2(a, s, n, r, i, o), n.has(s) || o.delete(s), i.push(s)), a = a.getNextSibling();
  }
}
let Fa, pr, _f, Dg, K0, G0, Bs, ki, Y0, Sf, wn = "", cr = "", Bi = null, Si = "", So = "", o2 = !1, Of = !1, up = null;
function Bp(e, t) {
  const n = Bs.get(e);
  if (t !== null) {
    const r = Z0(e);
    r.parentNode === t && t.removeChild(r);
  }
  if (ki.has(e) || pr._keyToDOMMap.delete(e), ve(n)) {
    const r = Wp(n, Bs);
    q0(r, 0, r.length - 1, null);
  }
  n !== void 0 && g_(Sf, _f, Dg, n, "destroyed");
}
function q0(e, t, n, r) {
  let i = t;
  for (; i <= n; ++i) {
    const o = e[i];
    o !== void 0 && Bp(o, r);
  }
}
function ls(e, t) {
  e.setProperty("text-align", t);
}
const lJ = "40px";
function a2(e, t) {
  const n = Fa.theme.indent;
  if (typeof n == "string") {
    const i = e.classList.contains(n);
    t > 0 && !i ? e.classList.add(n) : t < 1 && i && e.classList.remove(n);
  }
  const r = getComputedStyle(e).getPropertyValue("--lexical-indent-base-value") || lJ;
  e.style.setProperty("padding-inline-start", t === 0 ? "" : `calc(${t} * ${r})`);
}
function s2(e, t) {
  const n = e.style;
  t === 0 ? ls(n, "") : t === o_ ? ls(n, "left") : t === a_ ? ls(n, "center") : t === s_ ? ls(n, "right") : t === l_ ? ls(n, "justify") : t === c_ ? ls(n, "start") : t === u_ && ls(n, "end");
}
function Fp(e, t, n) {
  const r = ki.get(e);
  r === void 0 && _e(60);
  const i = r.createDOM(Fa, pr);
  if (function(o, a, s) {
    const l = s._keyToDOMMap;
    a["__lexicalKey_" + s._key] = o, l.set(o, a);
  }(e, i, pr), Se(r) ? i.setAttribute("data-lexical-text", "true") : Ht(r) && i.setAttribute("data-lexical-decorator", "true"), ve(r)) {
    const o = r.__indent, a = r.__size;
    if (o !== 0 && a2(i, o), a !== 0) {
      const l = a - 1;
      (function(c, f, d, p) {
        const m = cr;
        cr = "", X0(c, d, 0, f, p, null), c2(d, p), cr = m;
      })(Wp(r, ki), l, r, i);
    }
    const s = r.__format;
    s !== 0 && s2(i, s), r.isInline() || l2(null, r, i), kg(r) && (wn += zo, So += zo);
  } else {
    const o = r.getTextContent();
    if (Ht(r)) {
      const a = r.decorate(pr, Fa);
      a !== null && u2(e, a), i.contentEditable = "false";
    } else Se(r) && (r.isDirectionless() || (cr += o));
    wn += o, So += o;
  }
  if (t !== null) if (n != null) t.insertBefore(i, n);
  else {
    const o = t.__lexicalLineBreak;
    o != null ? t.insertBefore(i, o) : t.appendChild(i);
  }
  return g_(Sf, _f, Dg, r, "created"), i;
}
function X0(e, t, n, r, i, o) {
  const a = wn;
  wn = "";
  let s = n;
  for (; s <= r; ++s) {
    Fp(e[s], i, o);
    const l = ki.get(e[s]);
    l !== null && Se(l) && (Bi === null && (Bi = l.getFormat()), Si === "" && (Si = l.getStyle()));
  }
  kg(t) && (wn += zo), i.__lexicalTextContent = wn, wn = a + wn;
}
function EC(e, t) {
  const n = t.get(e);
  return Ju(n) || Ht(n) && n.isInline();
}
function l2(e, t, n) {
  const r = e !== null && (e.__size === 0 || EC(e.__last, Bs)), i = t.__size === 0 || EC(t.__last, ki);
  if (r) {
    if (!i) {
      const o = n.__lexicalLineBreak;
      if (o != null) try {
        n.removeChild(o);
      } catch (a) {
        if (typeof a == "object" && a != null) {
          const s = `${a.toString()} Parent: ${n.tagName}, child: ${o.tagName}.`;
          throw new Error(s);
        }
        throw a;
      }
      n.__lexicalLineBreak = null;
    }
  } else if (i) {
    const o = document.createElement("br");
    n.__lexicalLineBreak = o, n.appendChild(o);
  }
}
function c2(e, t) {
  const n = t.__lexicalDirTextContent, r = t.__lexicalDir;
  if (n !== cr || r !== up) {
    const o = cr === "", a = o ? up : (i = cr, BZ.test(i) ? "rtl" : FZ.test(i) ? "ltr" : null);
    if (a !== r) {
      const s = t.classList, l = Fa.theme;
      let c = r !== null ? l[r] : void 0, f = a !== null ? l[a] : void 0;
      if (c !== void 0) {
        if (typeof c == "string") {
          const d = Ip(c);
          c = l[r] = d;
        }
        s.remove(...c);
      }
      if (a === null || o && a === "ltr") t.removeAttribute("dir");
      else {
        if (f !== void 0) {
          if (typeof f == "string") {
            const d = Ip(f);
            f = l[a] = d;
          }
          f !== void 0 && s.add(...f);
        }
        t.dir = a;
      }
      Of || (e.getWritable().__dir = a);
    }
    up = a, t.__lexicalDirTextContent = cr, t.__lexicalDir = a;
  }
  var i;
}
function cJ(e, t, n) {
  const r = cr;
  var i;
  cr = "", Bi = null, Si = "", function(o, a, s) {
    const l = wn, c = o.__size, f = a.__size;
    if (wn = "", c === 1 && f === 1) {
      const d = o.__first, p = a.__first;
      if (d === p) Wu(d, s);
      else {
        const y = Z0(d), g = Fp(p, null, null);
        try {
          s.replaceChild(g, y);
        } catch (v) {
          if (typeof v == "object" && v != null) {
            const x = `${v.toString()} Parent: ${s.tagName}, new child: {tag: ${g.tagName} key: ${p}}, old child: {tag: ${y.tagName}, key: ${d}}.`;
            throw new Error(x);
          }
          throw v;
        }
        Bp(d, null);
      }
      const m = ki.get(p);
      Se(m) && (Bi === null && (Bi = m.getFormat()), Si === "" && (Si = m.getStyle()));
    } else {
      const d = Wp(o, Bs), p = Wp(a, ki);
      if (c === 0) f !== 0 && X0(p, a, 0, f - 1, s, null);
      else if (f === 0) {
        if (c !== 0) {
          const m = s.__lexicalLineBreak == null;
          q0(d, 0, c - 1, m ? null : s), m && (s.textContent = "");
        }
      } else (function(m, y, g, v, x, w) {
        const S = v - 1, A = x - 1;
        let _, O, P = (I = w, I.firstChild), C = 0, k = 0;
        for (var I; C <= S && k <= A; ) {
          const D = y[C], j = g[k];
          if (D === j) P = yb(Wu(j, w)), C++, k++;
          else {
            _ === void 0 && (_ = new Set(y)), O === void 0 && (O = new Set(g));
            const W = O.has(D), z = _.has(j);
            if (W) if (z) {
              const H = Lp(pr, j);
              H === P ? P = yb(Wu(j, w)) : (P != null ? w.insertBefore(H, P) : w.appendChild(H), Wu(j, w)), C++, k++;
            } else Fp(j, w, P), k++;
            else P = yb(Z0(D)), Bp(D, w), C++;
          }
          const F = ki.get(j);
          F !== null && Se(F) && (Bi === null && (Bi = F.getFormat()), Si === "" && (Si = F.getStyle()));
        }
        const $ = C > S, N = k > A;
        if ($ && !N) {
          const D = g[A + 1];
          X0(g, m, k, A, w, D === void 0 ? null : pr.getElementByKey(D));
        } else N && !$ && q0(y, C, S, w);
      })(a, d, p, c, f, s);
    }
    kg(a) && (wn += zo), s.__lexicalTextContent = wn, wn = l + wn;
  }(e, t, n), c2(t, n), ix(i = t) && Bi != null && Bi !== i.__textFormat && !Of && (i.setTextFormat(Bi), i.setTextStyle(Si)), function(o) {
    ix(o) && Si !== "" && Si !== o.__textStyle && !Of && o.setTextStyle(Si);
  }(t), cr = r;
}
function Wp(e, t) {
  const n = [];
  let r = e.__first;
  for (; r !== null; ) {
    const i = t.get(r);
    i === void 0 && _e(101), n.push(r), r = i.__next;
  }
  return n;
}
function Wu(e, t) {
  const n = Bs.get(e);
  let r = ki.get(e);
  n !== void 0 && r !== void 0 || _e(61);
  const i = o2 || G0.has(e) || K0.has(e), o = Lp(pr, e);
  if (n === r && !i) {
    if (ve(n)) {
      const a = o.__lexicalTextContent;
      a !== void 0 && (wn += a, So += a);
      const s = o.__lexicalDirTextContent;
      s !== void 0 && (cr += s);
    } else {
      const a = n.getTextContent();
      Se(n) && !n.isDirectionless() && (cr += a), So += a, wn += a;
    }
    return o;
  }
  if (n !== r && i && g_(Sf, _f, Dg, r, "updated"), r.updateDOM(n, o, Fa)) {
    const a = Fp(e, null, null);
    return t === null && _e(62), t.replaceChild(a, o), Bp(e, null), a;
  }
  if (ve(n) && ve(r)) {
    const a = r.__indent;
    a !== n.__indent && a2(o, a);
    const s = r.__format;
    s !== n.__format && s2(o, s), i && (cJ(n, r, o), ur(r) || r.isInline() || l2(n, r, o)), kg(r) && (wn += zo, So += zo);
  } else {
    const a = r.getTextContent();
    if (Ht(r)) {
      const s = r.decorate(pr, Fa);
      s !== null && u2(e, s);
    } else Se(r) && !r.isDirectionless() && (cr += a);
    wn += a, So += a;
  }
  if (!Of && ur(r) && r.__cachedText !== So) {
    const a = r.getWritable();
    a.__cachedText = So, r = a;
  }
  return o;
}
function u2(e, t) {
  let n = pr._pendingDecorators;
  const r = pr._decorators;
  if (n === null) {
    if (r[e] === t) return;
    n = ZR(pr);
  }
  n[e] = t;
}
function yb(e) {
  let t = e.nextSibling;
  return t !== null && t === pr._blockCursorElement && (t = t.nextSibling), t;
}
function uJ(e, t, n, r, i, o) {
  wn = "", So = "", cr = "", o2 = r === nc, up = null, pr = n, Fa = n._config, _f = n._nodes, Dg = pr._listeners.mutation, K0 = i, G0 = o, Bs = e._nodeMap, ki = t._nodeMap, Of = t._readOnly, Y0 = new Map(n._keyToDOMMap);
  const a = /* @__PURE__ */ new Map();
  return Sf = a, Wu("root", null), pr = void 0, _f = void 0, K0 = void 0, G0 = void 0, Bs = void 0, ki = void 0, Fa = void 0, Y0 = void 0, Sf = void 0, a;
}
function Z0(e) {
  const t = Y0.get(e);
  return t === void 0 && _e(75, e), t;
}
const xo = Object.freeze({}), J0 = 30, Q0 = [["keydown", function(e, t) {
  if (Xu = e.timeStamp, f2 = e.key, t.isComposing()) return;
  const { key: n, shiftKey: r, ctrlKey: i, metaKey: o, altKey: a } = e;
  Ae(t, $R, e) || n != null && (function(s, l, c, f) {
    return SC(s) && !l && !f && !c;
  }(n, i, a, o) ? Ae(t, Z1, e) : function(s, l, c, f, d) {
    return SC(s) && !f && !c && (l || d);
  }(n, i, r, a, o) ? Ae(t, wZ, e) : function(s, l, c, f) {
    return _C(s) && !l && !f && !c;
  }(n, i, a, o) ? Ae(t, J1, e) : function(s, l, c, f, d) {
    return _C(s) && !f && !c && (l || d);
  }(n, i, r, a, o) ? Ae(t, _Z, e) : /* @__PURE__ */ function(s, l, c) {
    return /* @__PURE__ */ function(f) {
      return f === "ArrowUp";
    }(s) && !l && !c;
  }(n, i, o) ? Ae(t, DR, e) : /* @__PURE__ */ function(s, l, c) {
    return /* @__PURE__ */ function(f) {
      return f === "ArrowDown";
    }(s) && !l && !c;
  }(n, i, o) ? Ae(t, IR, e) : function(s, l) {
    return OC(s) && l;
  }(n, r) ? (Zu = !0, Ae(t, wf, e)) : /* @__PURE__ */ function(s) {
    return s === " ";
  }(n) ? Ae(t, SZ, e) : function(s, l) {
    return _i && l && s.toLowerCase() === "o";
  }(n, i) ? (e.preventDefault(), Zu = !0, Ae(t, Hl, !0)) : function(s, l) {
    return OC(s) && !l;
  }(n, r) ? (Zu = !1, Ae(t, wf, e)) : function(s, l, c, f) {
    return _i ? !l && !c && (_u(s) || s.toLowerCase() === "h" && f) : !(f || l || c) && _u(s);
  }(n, a, o, i) ? _u(n) ? Ae(t, Q1, e) : (e.preventDefault(), Ae(t, ks, !0)) : /* @__PURE__ */ function(s) {
    return s === "Escape";
  }(n) ? Ae(t, RR, e) : function(s, l, c, f, d) {
    return _i ? !(c || f || d) && (Su(s) || s.toLowerCase() === "d" && l) : !(l || f || d) && Su(s);
  }(n, i, r, a, o) ? Su(n) ? Ae(t, jR, e) : (e.preventDefault(), Ae(t, ks, !1)) : function(s, l, c) {
    return _u(s) && (_i ? l : c);
  }(n, a, i) ? (e.preventDefault(), Ae(t, bf, !0)) : function(s, l, c) {
    return Su(s) && (_i ? l : c);
  }(n, a, i) ? (e.preventDefault(), Ae(t, bf, !1)) : function(s, l) {
    return _i && l && _u(s);
  }(n, o) ? (e.preventDefault(), Ae(t, xf, !0)) : function(s, l) {
    return _i && l && Su(s);
  }(n, o) ? (e.preventDefault(), Ae(t, xf, !1)) : function(s, l, c, f) {
    return s.toLowerCase() === "b" && !l && Fu(c, f);
  }(n, a, o, i) ? (e.preventDefault(), Ae(t, _s, "bold")) : function(s, l, c, f) {
    return s.toLowerCase() === "u" && !l && Fu(c, f);
  }(n, a, o, i) ? (e.preventDefault(), Ae(t, _s, "underline")) : function(s, l, c, f) {
    return s.toLowerCase() === "i" && !l && Fu(c, f);
  }(n, a, o, i) ? (e.preventDefault(), Ae(t, _s, "italic")) : /* @__PURE__ */ function(s, l, c, f) {
    return s === "Tab" && !l && !c && !f;
  }(n, a, i, o) ? Ae(t, LR, e) : function(s, l, c, f) {
    return s.toLowerCase() === "z" && !l && Fu(c, f);
  }(n, r, o, i) ? (e.preventDefault(), Ae(t, q1, void 0)) : function(s, l, c, f) {
    return _i ? s.toLowerCase() === "z" && c && l : s.toLowerCase() === "y" && f || s.toLowerCase() === "z" && f && l;
  }(n, r, o, i) ? (e.preventDefault(), Ae(t, X1, void 0)) : Rg(t._editorState._selection) ? function(s, l, c, f) {
    return !l && s.toLowerCase() === "c" && (_i ? c : f);
  }(n, r, o, i) ? (e.preventDefault(), Ae(t, e_, e)) : function(s, l, c, f) {
    return !l && s.toLowerCase() === "x" && (_i ? c : f);
  }(n, r, o, i) ? (e.preventDefault(), Ae(t, t_, e)) : AC(n, o, i) && (e.preventDefault(), Ae(t, W0, e)) : !Ma && AC(n, o, i) && (e.preventDefault(), Ae(t, W0, e)), /* @__PURE__ */ function(s, l, c, f) {
    return s || l || c || f;
  }(i, r, a, o) && Ae(t, kZ, e));
}], ["pointerdown", function(e, t) {
  const n = e.target, r = e.pointerType;
  n instanceof Node && r !== "touch" && Fr(t, () => {
    Ht(Eg(n)) || (tx = !0);
  });
}], ["compositionstart", function(e, t) {
  Fr(t, () => {
    const n = Ne();
    if (we(n) && !t.isComposing()) {
      const r = n.anchor, i = n.anchor.getNode();
      Gn(r.key), (e.timeStamp < Xu + J0 || r.type === "element" || !n.isCollapsed() || i.getFormat() !== n.format || Se(i) && i.getStyle() !== n.style) && Ae(t, Kl, LZ);
    }
  });
}], ["compositionend", function(e, t) {
  Ma ? Ou = !0 : Fr(t, () => {
    vb(t, e.data);
  });
}], ["input", function(e, t) {
  e.stopPropagation(), Fr(t, () => {
    const n = Ne(), r = e.data, i = m2(e);
    if (r != null && we(n) && p2(n, i, r, e.timeStamp, !1)) {
      Ou && (vb(t, r), Ou = !1);
      const o = n.anchor.getNode(), a = no(t._window);
      if (a === null) return;
      const s = n.isBackward(), l = s ? n.anchor.offset : n.focus.offset, c = s ? n.focus.offset : n.anchor.offset;
      Np && !n.isCollapsed() && Se(o) && a.anchorNode !== null && o.getTextContent().slice(0, l) + r + o.getTextContent().slice(l + c) === t2(a.anchorNode) || Ae(t, Kl, r);
      const f = r.length;
      Ma && f > 1 && e.inputType === "insertCompositionText" && !t.isComposing() && (n.anchor.offset -= f), n_ || Ag || r_ || !t.isComposing() || (Xu = 0, Gn(null));
    } else
      p_(!1, t, r !== null ? r : void 0), Ou && (vb(t, r || void 0), Ou = !1);
    wr(), KR(mn());
  }), El = null;
}], ["click", function(e, t) {
  Fr(t, () => {
    const n = Ne(), r = no(t._window), i = jg();
    if (r) {
      if (we(n)) {
        const o = n.anchor, a = o.getNode();
        o.type === "element" && o.offset === 0 && n.isCollapsed() && !ur(a) && ir().getChildrenSize() === 1 && a.getTopLevelElementOrThrow().isEmpty() && i !== null && n.is(i) ? (r.removeAllRanges(), n.dirty = !0) : e.detail === 3 && !n.isCollapsed() && a !== n.focus.getNode() && (ve(a) ? a.select(0) : a.getParentOrThrow().select(0));
      } else if (e.pointerType === "touch") {
        const o = r.anchorNode;
        if (o !== null) {
          const a = o.nodeType;
          (a === md || a === Ua) && Vo(w_(i, r, t, e));
        }
      }
    }
    Ae(t, xZ, e);
  });
}], ["cut", xo], ["copy", xo], ["dragstart", xo], ["dragover", xo], ["dragend", xo], ["paste", xo], ["focus", xo], ["blur", xo], ["drop", xo]];
Np && Q0.push(["beforeinput", (e, t) => function(n, r) {
  const i = n.inputType, o = m2(n);
  i === "deleteCompositionText" || Ma && n2(r) || i !== "insertCompositionText" && Fr(r, () => {
    const a = Ne();
    if (i === "deleteContentBackward") {
      if (a === null) {
        const m = jg();
        if (!we(m)) return;
        Vo(m.clone());
      }
      if (we(a)) {
        const m = a.anchor.key === a.focus.key;
        if (s = n.timeStamp, f2 === "MediaLast" && s < Xu + J0 && r.isComposing() && m) {
          if (Gn(null), Xu = 0, setTimeout(() => {
            Fr(r, () => {
              Gn(null);
            });
          }, J0), we(a)) {
            const y = a.anchor.getNode();
            y.markDirty(), a.format = y.getFormat(), Se(y) || _e(142), a.style = y.getStyle();
          }
        } else {
          Gn(null), n.preventDefault();
          const y = a.anchor.getNode().getTextContent(), g = a.anchor.offset === 0 && a.focus.offset === y.length;
          $Z && m && !g || Ae(r, ks, !0);
        }
        return;
      }
    }
    var s;
    if (!we(a)) return;
    const l = n.data;
    El !== null && p_(!1, r, El), a.dirty && El === null || !a.isCollapsed() || ur(a.anchor.getNode()) || o === null || a.applyDOMRange(o), El = null;
    const c = a.anchor, f = a.focus, d = c.getNode(), p = f.getNode();
    if (i !== "insertText" && i !== "insertTranspose") switch (n.preventDefault(), i) {
      case "insertFromYank":
      case "insertFromDrop":
      case "insertReplacementText":
        Ae(r, Kl, n);
        break;
      case "insertFromComposition":
        Gn(null), Ae(r, Kl, n);
        break;
      case "insertLineBreak":
        Gn(null), Ae(r, Hl, !1);
        break;
      case "insertParagraph":
        Gn(null), Zu && !Ag ? (Zu = !1, Ae(r, Hl, !1)) : Ae(r, B0, void 0);
        break;
      case "insertFromPaste":
      case "insertFromPasteAsQuotation":
        Ae(r, Y1, n);
        break;
      case "deleteByComposition":
        (function(m, y) {
          return m !== y || ve(m) || ve(y) || !m.isToken() || !y.isToken();
        })(d, p) && Ae(r, F0, n);
        break;
      case "deleteByDrag":
      case "deleteByCut":
        Ae(r, F0, n);
        break;
      case "deleteContent":
        Ae(r, ks, !1);
        break;
      case "deleteWordBackward":
        Ae(r, bf, !0);
        break;
      case "deleteWordForward":
        Ae(r, bf, !1);
        break;
      case "deleteHardLineBackward":
      case "deleteSoftLineBackward":
        Ae(r, xf, !0);
        break;
      case "deleteContentForward":
      case "deleteHardLineForward":
      case "deleteSoftLineForward":
        Ae(r, xf, !1);
        break;
      case "formatStrikeThrough":
        Ae(r, _s, "strikethrough");
        break;
      case "formatBold":
        Ae(r, _s, "bold");
        break;
      case "formatItalic":
        Ae(r, _s, "italic");
        break;
      case "formatUnderline":
        Ae(r, _s, "underline");
        break;
      case "historyUndo":
        Ae(r, q1, void 0);
        break;
      case "historyRedo":
        Ae(r, X1, void 0);
    }
    else {
      if (l === `
`) n.preventDefault(), Ae(r, Hl, !1);
      else if (l === zo) n.preventDefault(), Ae(r, B0, void 0);
      else if (l == null && n.dataTransfer) {
        const m = n.dataTransfer.getData("text/plain");
        n.preventDefault(), a.insertRawText(m);
      } else l != null && p2(a, o, l, n.timeStamp, !0) ? (n.preventDefault(), Ae(r, Kl, l)) : El = l;
      d2 = n.timeStamp;
    }
  });
}(e, t)]);
let Xu = 0, f2 = null, d2 = 0, El = null;
const zp = /* @__PURE__ */ new WeakMap();
let ex = !1, tx = !1, Zu = !1, Ou = !1, h2 = [0, "", 0, "root", 0];
function p2(e, t, n, r, i) {
  const o = e.anchor, a = e.focus, s = o.getNode(), l = mn(), c = no(l._window), f = c !== null ? c.anchorNode : null, d = o.key, p = l.getElementByKey(d), m = n.length;
  return d !== a.key || !Se(s) || (!i && (!Np || d2 < r + 50) || s.isDirty() && m < 2 || QR(n)) && o.offset !== a.offset && !s.isComposing() || Pl(s) || s.isDirty() && m > 1 || (i || !Np) && p !== null && !s.isComposing() && f !== Rp(p) || c !== null && t !== null && (!t.collapsed || t.startContainer !== c.anchorNode || t.startOffset !== c.anchorOffset) || s.getFormat() !== e.format || s.getStyle() !== e.style || tJ(e, s);
}
function kC(e, t) {
  return e !== null && e.nodeValue !== null && e.nodeType === Ua && t !== 0 && t !== e.nodeValue.length;
}
function MC(e, t, n) {
  const { anchorNode: r, anchorOffset: i, focusNode: o, focusOffset: a } = e;
  ex && (ex = !1, kC(r, i) && kC(o, a)) || Fr(t, () => {
    if (!n) return void Vo(null);
    if (!Pg(t, r, o)) return;
    const s = Ne();
    if (we(s)) {
      const l = s.anchor, c = l.getNode();
      if (s.isCollapsed()) {
        e.type === "Range" && e.anchorNode === e.focusNode && (s.dirty = !0);
        const f = Ng(t).event, d = f ? f.timeStamp : performance.now(), [p, m, y, g, v] = h2, x = ir(), w = t.isComposing() === !1 && x.getTextContent() === "";
        if (d < v + 200 && l.offset === y && l.key === g) s.format = p, s.style = m;
        else if (l.type === "text") Se(c) || _e(141), s.format = c.getFormat(), s.style = c.getStyle();
        else if (l.type === "element" && !w) {
          const S = l.getNode();
          s.style = "", S instanceof Lc && S.getChildrenSize() === 0 ? (s.format = S.getTextFormat(), s.style = S.getTextStyle()) : s.format = 0;
        }
      } else {
        const f = l.key, d = s.focus.key, p = s.getNodes(), m = p.length, y = s.isBackward(), g = y ? a : i, v = y ? i : a, x = y ? d : f, w = y ? f : d;
        let S = jZ, A = !1;
        for (let _ = 0; _ < m; _++) {
          const O = p[_], P = O.getTextContentSize();
          if (Se(O) && P !== 0 && !(_ === 0 && O.__key === x && g === P || _ === m - 1 && O.__key === w && v === 0) && (A = !0, S &= O.getFormat(), S === 0)) break;
        }
        s.format = A ? S : 0;
      }
    }
    Ae(t, G1, void 0);
  });
}
function m2(e) {
  if (!e.getTargetRanges) return null;
  const t = e.getTargetRanges();
  return t.length === 0 ? null : t[0];
}
function vb(e, t) {
  const n = e._compositionKey;
  if (Gn(null), n !== null && t != null) {
    if (t === "") {
      const r = $n(n), i = Rp(e.getElementByKey(n));
      return void (i !== null && i.nodeValue !== null && Se(r) && m_(r, i.nodeValue, null, null, !0));
    }
    if (t[t.length - 1] === `
`) {
      const r = Ne();
      if (we(r)) {
        const i = r.focus;
        return r.anchor.set(i.key, i.offset, i.type), void Ae(e, wf, null);
      }
    }
  }
  p_(!0, e, t);
}
function g2(e) {
  let t = e.__lexicalEventHandles;
  return t === void 0 && (t = [], e.__lexicalEventHandles = t), t;
}
const Gl = /* @__PURE__ */ new Map();
function y2(e) {
  const t = e.target, n = no(t == null ? null : t.nodeType === 9 ? t.defaultView : t.ownerDocument.defaultView);
  if (n === null) return;
  const r = qR(n.anchorNode);
  if (r === null) return;
  tx && (tx = !1, Fr(r, () => {
    const c = jg(), f = n.anchorNode;
    if (f === null) return;
    const d = f.nodeType;
    d !== md && d !== Ua || Vo(w_(c, n, r, e));
  }));
  const i = h_(r), o = i[i.length - 1], a = o._key, s = Gl.get(a), l = s || o;
  l !== r && MC(n, l, !1), MC(n, r, !0), r !== o ? Gl.set(a, r) : s && Gl.delete(a);
}
function NC(e) {
  e._lexicalHandled = !0;
}
function $C(e) {
  return e._lexicalHandled === !0;
}
function fJ(e) {
  const t = e.ownerDocument, n = zp.get(t);
  n === void 0 && _e(162);
  const r = n - 1;
  r >= 0 || _e(164), zp.set(t, r), r === 0 && t.removeEventListener("selectionchange", y2);
  const i = Cg(e);
  d_(i) ? (function(a) {
    if (a._parentEditor !== null) {
      const s = h_(a), l = s[s.length - 1]._key;
      Gl.get(l) === a && Gl.delete(l);
    } else Gl.delete(a._key);
  }(i), e.__lexicalEditor = null) : i && _e(198);
  const o = g2(e);
  for (let a = 0; a < o.length; a++) o[a]();
  e.__lexicalEventHandles = [];
}
function nx(e, t, n) {
  wr();
  const r = e.__key, i = e.getParent();
  if (i === null) return;
  const o = function(s) {
    const l = Ne();
    if (!we(l) || !ve(s)) return l;
    const { anchor: c, focus: f } = l, d = c.getNode(), p = f.getNode();
    return H0(d, s) && c.set(s.__key, 0, "element"), H0(p, s) && f.set(s.__key, 0, "element"), l;
  }(e);
  let a = !1;
  if (we(o) && t) {
    const s = o.anchor, l = o.focus;
    s.key === r && (Up(s, e, i, e.getPreviousSibling(), e.getNextSibling()), a = !0), l.key === r && (Up(l, e, i, e.getPreviousSibling(), e.getNextSibling()), a = !0);
  } else Rg(o) && t && e.isSelected() && e.selectPrevious();
  if (we(o) && t && !a) {
    const s = e.getIndexWithinParent();
    Ms(e), Vp(o, i, s, -1);
  } else Ms(e);
  n || gd(i) || i.canBeEmpty() || !i.isEmpty() || nx(i, t), t && ur(i) && i.isEmpty() && i.selectEnd();
}
class Ig {
  static getType() {
    _e(64, this.name);
  }
  static clone(t) {
    _e(65, this.name);
  }
  afterCloneFrom(t) {
    this.__parent = t.__parent, this.__next = t.__next, this.__prev = t.__prev;
  }
  constructor(t) {
    this.__type = this.constructor.getType(), this.__parent = null, this.__prev = null, this.__next = null, eJ(this, t);
  }
  getType() {
    return this.__type;
  }
  isInline() {
    _e(137, this.constructor.name);
  }
  isAttached() {
    let t = this.__key;
    for (; t !== null; ) {
      if (t === "root") return !0;
      const n = $n(t);
      if (n === null) break;
      t = n.__parent;
    }
    return !1;
  }
  isSelected(t) {
    const n = t || Ne();
    if (n == null) return !1;
    const r = n.getNodes().some((i) => i.__key === this.__key);
    if (Se(this)) return r;
    if (we(n) && n.anchor.type === "element" && n.focus.type === "element") {
      if (n.isCollapsed()) return !1;
      const i = this.getParent();
      if (Ht(this) && this.isInline() && i) {
        const o = n.isBackward() ? n.focus : n.anchor, a = o.getNode();
        if (o.offset === a.getChildrenSize() && a.is(i) && a.getLastChildOrThrow().is(this)) return !1;
      }
    }
    return r;
  }
  getKey() {
    return this.__key;
  }
  getIndexWithinParent() {
    const t = this.getParent();
    if (t === null) return -1;
    let n = t.getFirstChild(), r = 0;
    for (; n !== null; ) {
      if (this.is(n)) return r;
      r++, n = n.getNextSibling();
    }
    return -1;
  }
  getParent() {
    const t = this.getLatest().__parent;
    return t === null ? null : $n(t);
  }
  getParentOrThrow() {
    const t = this.getParent();
    return t === null && _e(66, this.__key), t;
  }
  getTopLevelElement() {
    let t = this;
    for (; t !== null; ) {
      const n = t.getParent();
      if (gd(n)) return ve(t) || t === this && Ht(t) || _e(194), t;
      t = n;
    }
    return null;
  }
  getTopLevelElementOrThrow() {
    const t = this.getTopLevelElement();
    return t === null && _e(67, this.__key), t;
  }
  getParents() {
    const t = [];
    let n = this.getParent();
    for (; n !== null; ) t.push(n), n = n.getParent();
    return t;
  }
  getParentKeys() {
    const t = [];
    let n = this.getParent();
    for (; n !== null; ) t.push(n.__key), n = n.getParent();
    return t;
  }
  getPreviousSibling() {
    const t = this.getLatest().__prev;
    return t === null ? null : $n(t);
  }
  getPreviousSiblings() {
    const t = [], n = this.getParent();
    if (n === null) return t;
    let r = n.getFirstChild();
    for (; r !== null && !r.is(this); ) t.push(r), r = r.getNextSibling();
    return t;
  }
  getNextSibling() {
    const t = this.getLatest().__next;
    return t === null ? null : $n(t);
  }
  getNextSiblings() {
    const t = [];
    let n = this.getNextSibling();
    for (; n !== null; ) t.push(n), n = n.getNextSibling();
    return t;
  }
  getCommonAncestor(t) {
    const n = this.getParents(), r = t.getParents();
    ve(this) && n.unshift(this), ve(t) && r.unshift(t);
    const i = n.length, o = r.length;
    if (i === 0 || o === 0 || n[i - 1] !== r[o - 1]) return null;
    const a = new Set(r);
    for (let s = 0; s < i; s++) {
      const l = n[s];
      if (a.has(l)) return l;
    }
    return null;
  }
  is(t) {
    return t != null && this.__key === t.__key;
  }
  isBefore(t) {
    if (this === t) return !1;
    if (t.isParentOf(this)) return !0;
    if (this.isParentOf(t)) return !1;
    const n = this.getCommonAncestor(t);
    let r = 0, i = 0, o = this;
    for (; ; ) {
      const a = o.getParentOrThrow();
      if (a === n) {
        r = o.getIndexWithinParent();
        break;
      }
      o = a;
    }
    for (o = t; ; ) {
      const a = o.getParentOrThrow();
      if (a === n) {
        i = o.getIndexWithinParent();
        break;
      }
      o = a;
    }
    return r < i;
  }
  isParentOf(t) {
    const n = this.__key;
    if (n === t.__key) return !1;
    let r = t;
    for (; r !== null; ) {
      if (r.__key === n) return !0;
      r = r.getParent();
    }
    return !1;
  }
  getNodesBetween(t) {
    const n = this.isBefore(t), r = [], i = /* @__PURE__ */ new Set();
    let o = this;
    for (; o !== null; ) {
      const a = o.__key;
      if (i.has(a) || (i.add(a), r.push(o)), o === t) break;
      const s = ve(o) ? n ? o.getFirstChild() : o.getLastChild() : null;
      if (s !== null) {
        o = s;
        continue;
      }
      const l = n ? o.getNextSibling() : o.getPreviousSibling();
      if (l !== null) {
        o = l;
        continue;
      }
      const c = o.getParentOrThrow();
      if (i.has(c.__key) || r.push(c), c === t) break;
      let f = null, d = c;
      do {
        if (d === null && _e(68), f = n ? d.getNextSibling() : d.getPreviousSibling(), d = d.getParent(), d === null) break;
        f !== null || i.has(d.__key) || r.push(d);
      } while (f === null);
      o = f;
    }
    return n || r.reverse(), r;
  }
  isDirty() {
    const t = mn()._dirtyLeaves;
    return t !== null && t.has(this.__key);
  }
  getLatest() {
    const t = $n(this.__key);
    return t === null && _e(113), t;
  }
  getWritable() {
    wr();
    const t = qo(), n = mn(), r = t._nodeMap, i = this.__key, o = this.getLatest(), a = n._cloneNotNeeded, s = Ne();
    if (s !== null && s.setCachedNodes(null), a.has(i)) return jp(o), o;
    const l = r2(o);
    return a.add(i), jp(l), r.set(i, l), l;
  }
  getTextContent() {
    return "";
  }
  getTextContentSize() {
    return this.getTextContent().length;
  }
  createDOM(t, n) {
    _e(70);
  }
  updateDOM(t, n, r) {
    _e(71);
  }
  exportDOM(t) {
    return { element: this.createDOM(t._config, t) };
  }
  exportJSON() {
    _e(72);
  }
  static importJSON(t) {
    _e(18, this.name);
  }
  static transform() {
    return null;
  }
  remove(t) {
    nx(this, !0, t);
  }
  replace(t, n) {
    wr();
    let r = Ne();
    r !== null && (r = r.clone()), pb(this, t);
    const i = this.getLatest(), o = this.__key, a = t.__key, s = t.getWritable(), l = this.getParentOrThrow().getWritable(), c = l.__size;
    Ms(s);
    const f = i.getPreviousSibling(), d = i.getNextSibling(), p = i.__prev, m = i.__next, y = i.__parent;
    if (nx(i, !1, !0), f === null ? l.__first = a : f.getWritable().__next = a, s.__prev = p, d === null ? l.__last = a : d.getWritable().__prev = a, s.__next = m, s.__parent = y, l.__size = c, n && (ve(this) && ve(s) || _e(139), this.getChildren().forEach((g) => {
      s.append(g);
    })), we(r)) {
      Vo(r);
      const g = r.anchor, v = r.focus;
      g.key === o && jC(g, s), v.key === o && jC(v, s);
    }
    return Oa() === o && Gn(a), s;
  }
  insertAfter(t, n = !0) {
    wr(), pb(this, t);
    const r = this.getWritable(), i = t.getWritable(), o = i.getParent(), a = Ne();
    let s = !1, l = !1;
    if (o !== null) {
      const m = t.getIndexWithinParent();
      if (Ms(i), we(a)) {
        const y = o.__key, g = a.anchor, v = a.focus;
        s = g.type === "element" && g.key === y && g.offset === m + 1, l = v.type === "element" && v.key === y && v.offset === m + 1;
      }
    }
    const c = this.getNextSibling(), f = this.getParentOrThrow().getWritable(), d = i.__key, p = r.__next;
    if (c === null ? f.__last = d : c.getWritable().__prev = d, f.__size++, r.__next = d, i.__next = p, i.__prev = r.__key, i.__parent = r.__parent, n && we(a)) {
      const m = this.getIndexWithinParent();
      Vp(a, f, m + 1);
      const y = f.__key;
      s && a.anchor.set(y, m + 2, "element"), l && a.focus.set(y, m + 2, "element");
    }
    return t;
  }
  insertBefore(t, n = !0) {
    wr(), pb(this, t);
    const r = this.getWritable(), i = t.getWritable(), o = i.__key;
    Ms(i);
    const a = this.getPreviousSibling(), s = this.getParentOrThrow().getWritable(), l = r.__prev, c = this.getIndexWithinParent();
    a === null ? s.__first = o : a.getWritable().__next = o, s.__size++, r.__prev = o, i.__prev = l, i.__next = r.__key, i.__parent = r.__parent;
    const f = Ne();
    return n && we(f) && Vp(f, this.getParentOrThrow(), c), t;
  }
  isParentRequired() {
    return !1;
  }
  createParentElementNode() {
    return Ro();
  }
  selectStart() {
    return this.selectPrevious();
  }
  selectEnd() {
    return this.selectNext(0, 0);
  }
  selectPrevious(t, n) {
    wr();
    const r = this.getPreviousSibling(), i = this.getParentOrThrow();
    if (r === null) return i.select(0, 0);
    if (ve(r)) return r.select();
    if (!Se(r)) {
      const o = r.getIndexWithinParent() + 1;
      return i.select(o, o);
    }
    return r.select(t, n);
  }
  selectNext(t, n) {
    wr();
    const r = this.getNextSibling(), i = this.getParentOrThrow();
    if (r === null) return i.select();
    if (ve(r)) return r.select(0, 0);
    if (!Se(r)) {
      const o = r.getIndexWithinParent();
      return i.select(o, o);
    }
    return r.select(t, n);
  }
  markDirty() {
    this.getWritable();
  }
}
class yd extends Ig {
  static getType() {
    return "linebreak";
  }
  static clone(t) {
    return new yd(t.__key);
  }
  constructor(t) {
    super(t);
  }
  getTextContent() {
    return `
`;
  }
  createDOM() {
    return document.createElement("br");
  }
  updateDOM() {
    return !1;
  }
  static importDOM() {
    return { br: (t) => function(n) {
      const r = n.parentElement;
      if (r !== null && PC(r)) {
        const i = r.firstChild;
        if (i === n || i.nextSibling === n && Lh(i)) {
          const o = r.lastChild;
          if (o === n || o.previousSibling === n && Lh(o)) return !0;
        }
      }
      return !1;
    }(t) || function(n) {
      const r = n.parentElement;
      if (r !== null && PC(r)) {
        const i = r.firstChild;
        if (i === n || i.nextSibling === n && Lh(i)) return !1;
        const o = r.lastChild;
        if (o === n || o.previousSibling === n && Lh(o)) return !0;
      }
      return !1;
    }(t) ? null : { conversion: dJ, priority: 0 } };
  }
  static importJSON(t) {
    return Af();
  }
  exportJSON() {
    return { type: "linebreak", version: 1 };
  }
}
function dJ(e) {
  return { node: Af() };
}
function Af() {
  return $g(new yd());
}
function Ju(e) {
  return e instanceof yd;
}
function Lh(e) {
  return e.nodeType === Ua && /^( |\t|\r?\n)+$/.test(e.textContent || "");
}
function bb(e, t) {
  return 16 & t ? "code" : t & i_ ? "mark" : 32 & t ? "sub" : 64 & t ? "sup" : null;
}
function xb(e, t) {
  return 1 & t ? "strong" : 2 & t ? "em" : "span";
}
function v2(e, t, n, r, i) {
  const o = r.classList;
  let a = qu(i, "base");
  a !== void 0 && o.add(...a), a = qu(i, "underlineStrikethrough");
  let s = !1;
  const l = t & Dp && t & $p;
  a !== void 0 && (n & Dp && n & $p ? (s = !0, l || o.add(...a)) : l && o.remove(...a));
  for (const c in Io) {
    const f = Io[c];
    if (a = qu(i, c), a !== void 0) if (n & f) {
      if (s && (c === "underline" || c === "strikethrough")) {
        t & f && o.remove(...a);
        continue;
      }
      t & f && (!l || c !== "underline") && c !== "strikethrough" || o.add(...a);
    } else t & f && o.remove(...a);
  }
}
function b2(e, t, n) {
  const r = t.firstChild, i = n.isComposing(), o = e + (i ? Tg : "");
  if (r == null) t.textContent = o;
  else {
    const a = r.nodeValue;
    if (a !== o) if (i || Ma) {
      const [s, l, c] = function(f, d) {
        const p = f.length, m = d.length;
        let y = 0, g = 0;
        for (; y < p && y < m && f[y] === d[y]; ) y++;
        for (; g + y < p && g + y < m && f[p - g - 1] === d[m - g - 1]; ) g++;
        return [y, p - y - g, d.slice(y, m - g)];
      }(a, o);
      l !== 0 && r.deleteData(s, l), r.insertData(s, c);
    } else r.nodeValue = o;
  }
}
function DC(e, t, n, r, i, o) {
  b2(i, e, t);
  const a = o.theme.text;
  a !== void 0 && v2(0, 0, r, e, a);
}
function Bh(e, t) {
  const n = document.createElement(t);
  return n.appendChild(e), n;
}
class jc extends Ig {
  static getType() {
    return "text";
  }
  static clone(t) {
    return new jc(t.__text, t.__key);
  }
  afterCloneFrom(t) {
    super.afterCloneFrom(t), this.__format = t.__format, this.__style = t.__style, this.__mode = t.__mode, this.__detail = t.__detail;
  }
  constructor(t, n) {
    super(n), this.__text = t, this.__format = 0, this.__style = "", this.__mode = 0, this.__detail = 0;
  }
  getFormat() {
    return this.getLatest().__format;
  }
  getDetail() {
    return this.getLatest().__detail;
  }
  getMode() {
    const t = this.getLatest();
    return UZ[t.__mode];
  }
  getStyle() {
    return this.getLatest().__style;
  }
  isToken() {
    return this.getLatest().__mode === 1;
  }
  isComposing() {
    return this.__key === Oa();
  }
  isSegmented() {
    return this.getLatest().__mode === 2;
  }
  isDirectionless() {
    return !!(1 & this.getLatest().__detail);
  }
  isUnmergeable() {
    return !!(2 & this.getLatest().__detail);
  }
  hasFormat(t) {
    const n = Io[t];
    return !!(this.getFormat() & n);
  }
  isSimpleText() {
    return this.__type === "text" && this.__mode === 0;
  }
  getTextContent() {
    return this.getLatest().__text;
  }
  getFormatFlags(t, n) {
    return V0(this.getLatest().__format, t, n);
  }
  canHaveFormat() {
    return !0;
  }
  createDOM(t, n) {
    const r = this.__format, i = bb(0, r), o = xb(0, r), a = i === null ? o : i, s = document.createElement(a);
    let l = s;
    this.hasFormat("code") && s.setAttribute("spellcheck", "false"), i !== null && (l = document.createElement(o), s.appendChild(l)), DC(l, this, 0, r, this.__text, t);
    const c = this.__style;
    return c !== "" && (s.style.cssText = c), s;
  }
  updateDOM(t, n, r) {
    const i = this.__text, o = t.__format, a = this.__format, s = bb(0, o), l = bb(0, a), c = xb(0, o), f = xb(0, a);
    if ((s === null ? c : s) !== (l === null ? f : l)) return !0;
    if (s === l && c !== f) {
      const g = n.firstChild;
      g == null && _e(48);
      const v = document.createElement(f);
      return DC(v, this, 0, a, i, r), n.replaceChild(v, g), !1;
    }
    let d = n;
    l !== null && s !== null && (d = n.firstChild, d == null && _e(49)), b2(i, d, this);
    const p = r.theme.text;
    p !== void 0 && o !== a && v2(0, o, a, d, p);
    const m = t.__style, y = this.__style;
    return m !== y && (n.style.cssText = y), !1;
  }
  static importDOM() {
    return { "#text": () => ({ conversion: gJ, priority: 0 }), b: () => ({ conversion: pJ, priority: 0 }), code: () => ({ conversion: ga, priority: 0 }), em: () => ({ conversion: ga, priority: 0 }), i: () => ({ conversion: ga, priority: 0 }), s: () => ({ conversion: ga, priority: 0 }), span: () => ({ conversion: hJ, priority: 0 }), strong: () => ({ conversion: ga, priority: 0 }), sub: () => ({ conversion: ga, priority: 0 }), sup: () => ({ conversion: ga, priority: 0 }), u: () => ({ conversion: ga, priority: 0 }) };
  }
  static importJSON(t) {
    const n = Vn(t.text);
    return n.setFormat(t.format), n.setDetail(t.detail), n.setMode(t.mode), n.setStyle(t.style), n;
  }
  exportDOM(t) {
    let { element: n } = super.exportDOM(t);
    return n !== null && v_(n) || _e(132), n.style.whiteSpace = "pre-wrap", this.hasFormat("bold") && (n = Bh(n, "b")), this.hasFormat("italic") && (n = Bh(n, "i")), this.hasFormat("strikethrough") && (n = Bh(n, "s")), this.hasFormat("underline") && (n = Bh(n, "u")), { element: n };
  }
  exportJSON() {
    return { detail: this.getDetail(), format: this.getFormat(), mode: this.getMode(), style: this.getStyle(), text: this.getTextContent(), type: "text", version: 1 };
  }
  selectionTransform(t, n) {
  }
  setFormat(t) {
    const n = this.getWritable();
    return n.__format = typeof t == "string" ? Io[t] : t, n;
  }
  setDetail(t) {
    const n = this.getWritable();
    return n.__detail = typeof t == "string" ? WZ[t] : t, n;
  }
  setStyle(t) {
    const n = this.getWritable();
    return n.__style = t, n;
  }
  toggleFormat(t) {
    const n = V0(this.getFormat(), t, null);
    return this.setFormat(n);
  }
  toggleDirectionless() {
    const t = this.getWritable();
    return t.__detail ^= 1, t;
  }
  toggleUnmergeable() {
    const t = this.getWritable();
    return t.__detail ^= 2, t;
  }
  setMode(t) {
    const n = VZ[t];
    if (this.__mode === n) return this;
    const r = this.getWritable();
    return r.__mode = n, r;
  }
  setTextContent(t) {
    if (this.__text === t) return this;
    const n = this.getWritable();
    return n.__text = t, n;
  }
  select(t, n) {
    wr();
    let r = t, i = n;
    const o = Ne(), a = this.getTextContent(), s = this.__key;
    if (typeof a == "string") {
      const l = a.length;
      r === void 0 && (r = l), i === void 0 && (i = l);
    } else r = 0, i = 0;
    if (!we(o)) return O2(s, r, s, i, "text", "text");
    {
      const l = Oa();
      l !== o.anchor.key && l !== o.focus.key || Gn(s), o.setTextNodeRange(this, r, this, i);
    }
    return o;
  }
  selectStart() {
    return this.select(0, 0);
  }
  selectEnd() {
    const t = this.getTextContentSize();
    return this.select(t, t);
  }
  spliceText(t, n, r, i) {
    const o = this.getWritable(), a = o.__text, s = r.length;
    let l = t;
    l < 0 && (l = s + l, l < 0 && (l = 0));
    const c = Ne();
    if (i && we(c)) {
      const d = t + s;
      c.setTextNodeRange(o, d, o, d);
    }
    const f = a.slice(0, l) + r + a.slice(l + n);
    return o.__text = f, o;
  }
  canInsertTextBefore() {
    return !0;
  }
  canInsertTextAfter() {
    return !0;
  }
  splitText(...t) {
    wr();
    const n = this.getLatest(), r = n.getTextContent(), i = n.__key, o = Oa(), a = new Set(t), s = [], l = r.length;
    let c = "";
    for (let _ = 0; _ < l; _++) c !== "" && a.has(_) && (s.push(c), c = ""), c += r[_];
    c !== "" && s.push(c);
    const f = s.length;
    if (f === 0) return [];
    if (s[0] === r) return [n];
    const d = s[0], p = n.getParent();
    let m;
    const y = n.getFormat(), g = n.getStyle(), v = n.__detail;
    let x = !1;
    n.isSegmented() ? (m = Vn(d), m.__format = y, m.__style = g, m.__detail = v, x = !0) : (m = n.getWritable(), m.__text = d);
    const w = Ne(), S = [m];
    let A = d.length;
    for (let _ = 1; _ < f; _++) {
      const O = s[_], P = O.length, C = Vn(O).getWritable();
      C.__format = y, C.__style = g, C.__detail = v;
      const k = C.__key, I = A + P;
      if (we(w)) {
        const $ = w.anchor, N = w.focus;
        $.key === i && $.type === "text" && $.offset > A && $.offset <= I && ($.key = k, $.offset -= A, w.dirty = !0), N.key === i && N.type === "text" && N.offset > A && N.offset <= I && (N.key = k, N.offset -= A, w.dirty = !0);
      }
      o === i && Gn(k), A = I, S.push(C);
    }
    if (p !== null) {
      (function(P) {
        const C = P.getPreviousSibling(), k = P.getNextSibling();
        C !== null && jp(C), k !== null && jp(k);
      })(this);
      const _ = p.getWritable(), O = this.getIndexWithinParent();
      x ? (_.splice(O, 0, S), this.remove()) : _.splice(O, 1, S), we(w) && Vp(w, p, O, f - 1);
    }
    return S;
  }
  mergeWithSibling(t) {
    const n = t === this.getPreviousSibling();
    n || t === this.getNextSibling() || _e(50);
    const r = this.__key, i = t.__key, o = this.__text, a = o.length;
    Oa() === i && Gn(r);
    const s = Ne();
    if (we(s)) {
      const d = s.anchor, p = s.focus;
      d !== null && d.key === i && (UC(d, n, r, t, a), s.dirty = !0), p !== null && p.key === i && (UC(p, n, r, t, a), s.dirty = !0);
    }
    const l = t.__text, c = n ? l + o : o + l;
    this.setTextContent(c);
    const f = this.getWritable();
    return t.remove(), f;
  }
  isTextEntity() {
    return !1;
  }
}
function hJ(e) {
  return { forChild: b_(e.style), node: null };
}
function pJ(e) {
  const t = e, n = t.style.fontWeight === "normal";
  return { forChild: b_(t.style, n ? void 0 : "bold"), node: null };
}
const IC = /* @__PURE__ */ new WeakMap();
function mJ(e) {
  return e.nodeName === "PRE" || e.nodeType === md && e.style !== void 0 && e.style.whiteSpace !== void 0 && e.style.whiteSpace.startsWith("pre");
}
function gJ(e) {
  const t = e;
  e.parentElement === null && _e(129);
  let n = t.textContent || "";
  if (function(r) {
    let i, o = r.parentNode;
    const a = [r];
    for (; o !== null && (i = IC.get(o)) === void 0 && !mJ(o); ) a.push(o), o = o.parentNode;
    const s = i === void 0 ? o : i;
    for (let l = 0; l < a.length; l++) IC.set(a[l], s);
    return s;
  }(t) !== null) {
    const r = n.split(/(\r?\n|\t)/), i = [], o = r.length;
    for (let a = 0; a < o; a++) {
      const s = r[a];
      s === `
` || s === `\r
` ? i.push(Af()) : s === "	" ? i.push(x_()) : s !== "" && i.push(Vn(s));
    }
    return { node: i };
  }
  if (n = n.replace(/\r/g, "").replace(/[ \t\n]+/g, " "), n === "") return { node: null };
  if (n[0] === " ") {
    let r = t, i = !0;
    for (; r !== null && (r = RC(r, !1)) !== null; ) {
      const o = r.textContent || "";
      if (o.length > 0) {
        /[ \t\n]$/.test(o) && (n = n.slice(1)), i = !1;
        break;
      }
    }
    i && (n = n.slice(1));
  }
  if (n[n.length - 1] === " ") {
    let r = t, i = !0;
    for (; r !== null && (r = RC(r, !0)) !== null; )
      if ((r.textContent || "").replace(/^( |\t|\r?\n)+/, "").length > 0) {
        i = !1;
        break;
      }
    i && (n = n.slice(0, n.length - 1));
  }
  return n === "" ? { node: null } : { node: Vn(n) };
}
function RC(e, t) {
  let n = e;
  for (; ; ) {
    let r;
    for (; (r = t ? n.nextSibling : n.previousSibling) === null; ) {
      const o = n.parentElement;
      if (o === null) return null;
      n = o;
    }
    if (n = r, n.nodeType === md) {
      const o = n.style.display;
      if (o === "" && !oJ(n) || o !== "" && !o.startsWith("inline")) return null;
    }
    let i = n;
    for (; (i = t ? n.firstChild : n.lastChild) !== null; ) n = i;
    if (n.nodeType === Ua) return n;
    if (n.nodeName === "BR") return null;
  }
}
const yJ = { code: "code", em: "italic", i: "italic", s: "strikethrough", strong: "bold", sub: "subscript", sup: "superscript", u: "underline" };
function ga(e) {
  const t = yJ[e.nodeName.toLowerCase()];
  return t === void 0 ? { node: null } : { forChild: b_(e.style, t), node: null };
}
function Vn(e = "") {
  return $g(new jc(e));
}
function Se(e) {
  return e instanceof jc;
}
function b_(e, t) {
  const n = e.fontWeight, r = e.textDecoration.split(" "), i = n === "700" || n === "bold", o = r.includes("line-through"), a = e.fontStyle === "italic", s = r.includes("underline"), l = e.verticalAlign;
  return (c) => (Se(c) && (i && !c.hasFormat("bold") && c.toggleFormat("bold"), o && !c.hasFormat("strikethrough") && c.toggleFormat("strikethrough"), a && !c.hasFormat("italic") && c.toggleFormat("italic"), s && !c.hasFormat("underline") && c.toggleFormat("underline"), l !== "sub" || c.hasFormat("subscript") || c.toggleFormat("subscript"), l !== "super" || c.hasFormat("superscript") || c.toggleFormat("superscript"), t && !c.hasFormat(t) && c.toggleFormat(t)), c);
}
class vd extends jc {
  static getType() {
    return "tab";
  }
  static clone(t) {
    return new vd(t.__key);
  }
  afterCloneFrom(t) {
    super.afterCloneFrom(t), this.__text = t.__text;
  }
  constructor(t) {
    super("	", t), this.__detail = 2;
  }
  static importDOM() {
    return null;
  }
  static importJSON(t) {
    const n = x_();
    return n.setFormat(t.format), n.setStyle(t.style), n;
  }
  exportJSON() {
    return { ...super.exportJSON(), type: "tab", version: 1 };
  }
  setTextContent(t) {
    _e(126);
  }
  setDetail(t) {
    _e(127);
  }
  setMode(t) {
    _e(128);
  }
  canInsertTextBefore() {
    return !1;
  }
  canInsertTextAfter() {
    return !1;
  }
}
function x_() {
  return $g(new vd());
}
function vJ(e) {
  return e instanceof vd;
}
class bJ {
  constructor(t, n, r) {
    this._selection = null, this.key = t, this.offset = n, this.type = r;
  }
  is(t) {
    return this.key === t.key && this.offset === t.offset && this.type === t.type;
  }
  isBefore(t) {
    let n = this.getNode(), r = t.getNode();
    const i = this.offset, o = t.offset;
    if (ve(n)) {
      const a = n.getDescendantByIndex(i);
      n = a ?? n;
    }
    if (ve(r)) {
      const a = r.getDescendantByIndex(o);
      r = a ?? r;
    }
    return n === r ? i < o : n.isBefore(r);
  }
  getNode() {
    const t = $n(this.key);
    return t === null && _e(20), t;
  }
  set(t, n, r) {
    const i = this._selection, o = this.key;
    this.key = t, this.offset = n, this.type = r, bd() || (Oa() === o && Gn(t), i !== null && (i.setCachedNodes(null), i.dirty = !0));
  }
}
function Wa(e, t, n) {
  return new bJ(e, t, n);
}
function wb(e, t) {
  let n = t.__key, r = e.offset, i = "element";
  if (Se(t)) {
    i = "text";
    const o = t.getTextContentSize();
    r > o && (r = o);
  } else if (!ve(t)) {
    const o = t.getNextSibling();
    if (Se(o)) n = o.__key, r = 0, i = "text";
    else {
      const a = t.getParent();
      a && (n = a.__key, r = t.getIndexWithinParent() + 1);
    }
  }
  e.set(n, r, i);
}
function jC(e, t) {
  if (ve(t)) {
    const n = t.getLastDescendant();
    ve(n) || Se(n) ? wb(e, n) : wb(e, t);
  } else wb(e, t);
}
function wa(e, t, n, r) {
  e.key = t, e.offset = n, e.type = r;
}
let x2 = class w2 {
  constructor(t) {
    this._cachedNodes = null, this._nodes = t, this.dirty = !1;
  }
  getCachedNodes() {
    return this._cachedNodes;
  }
  setCachedNodes(t) {
    this._cachedNodes = t;
  }
  is(t) {
    if (!Rg(t)) return !1;
    const n = this._nodes, r = t._nodes;
    return n.size === r.size && Array.from(n).every((i) => r.has(i));
  }
  isCollapsed() {
    return !1;
  }
  isBackward() {
    return !1;
  }
  getStartEndPoints() {
    return null;
  }
  add(t) {
    this.dirty = !0, this._nodes.add(t), this._cachedNodes = null;
  }
  delete(t) {
    this.dirty = !0, this._nodes.delete(t), this._cachedNodes = null;
  }
  clear() {
    this.dirty = !0, this._nodes.clear(), this._cachedNodes = null;
  }
  has(t) {
    return this._nodes.has(t);
  }
  clone() {
    return new w2(new Set(this._nodes));
  }
  extract() {
    return this.getNodes();
  }
  insertRawText(t) {
  }
  insertText() {
  }
  insertNodes(t) {
    const n = this.getNodes(), r = n.length, i = n[r - 1];
    let o;
    if (Se(i)) o = i.select();
    else {
      const a = i.getIndexWithinParent() + 1;
      o = i.getParentOrThrow().select(a, a);
    }
    o.insertNodes(t);
    for (let a = 0; a < r; a++) n[a].remove();
  }
  getNodes() {
    const t = this._cachedNodes;
    if (t !== null) return t;
    const n = this._nodes, r = [];
    for (const i of n) {
      const o = $n(i);
      o !== null && r.push(o);
    }
    return bd() || (this._cachedNodes = r), r;
  }
  getTextContent() {
    const t = this.getNodes();
    let n = "";
    for (let r = 0; r < t.length; r++) n += t[r].getTextContent();
    return n;
  }
};
function we(e) {
  return e instanceof qs;
}
class qs {
  constructor(t, n, r, i) {
    this.anchor = t, this.focus = n, t._selection = this, n._selection = this, this._cachedNodes = null, this.format = r, this.style = i, this.dirty = !1;
  }
  getCachedNodes() {
    return this._cachedNodes;
  }
  setCachedNodes(t) {
    this._cachedNodes = t;
  }
  is(t) {
    return !!we(t) && this.anchor.is(t.anchor) && this.focus.is(t.focus) && this.format === t.format && this.style === t.style;
  }
  isCollapsed() {
    return this.anchor.is(this.focus);
  }
  getNodes() {
    const t = this._cachedNodes;
    if (t !== null) return t;
    const n = this.anchor, r = this.focus, i = n.isBefore(r), o = i ? n : r, a = i ? r : n;
    let s = o.getNode(), l = a.getNode();
    const c = o.offset, f = a.offset;
    if (ve(s)) {
      const p = s.getDescendantByIndex(c);
      s = p ?? s;
    }
    if (ve(l)) {
      let p = l.getDescendantByIndex(f);
      p !== null && p !== s && l.getChildAtIndex(f) === p && (p = p.getPreviousSibling()), l = p ?? l;
    }
    let d;
    return d = s.is(l) ? ve(s) && s.getChildrenSize() > 0 ? [] : [s] : s.getNodesBetween(l), bd() || (this._cachedNodes = d), d;
  }
  setTextNodeRange(t, n, r, i) {
    wa(this.anchor, t.__key, n, "text"), wa(this.focus, r.__key, i, "text"), this._cachedNodes = null, this.dirty = !0;
  }
  getTextContent() {
    const t = this.getNodes();
    if (t.length === 0) return "";
    const n = t[0], r = t[t.length - 1], i = this.anchor, o = this.focus, a = i.isBefore(o), [s, l] = rx(this);
    let c = "", f = !0;
    for (let d = 0; d < t.length; d++) {
      const p = t[d];
      if (ve(p) && !p.isInline()) f || (c += `
`), f = !p.isEmpty();
      else if (f = !1, Se(p)) {
        let m = p.getTextContent();
        p === n ? p === r ? i.type === "element" && o.type === "element" && o.offset !== i.offset || (m = s < l ? m.slice(s, l) : m.slice(l, s)) : m = a ? m.slice(s) : m.slice(l) : p === r && (m = a ? m.slice(0, l) : m.slice(0, s)), c += m;
      } else !Ht(p) && !Ju(p) || p === r && this.isCollapsed() || (c += p.getTextContent());
    }
    return c;
  }
  applyDOMRange(t) {
    const n = mn(), r = n.getEditorState()._selection, i = S2(t.startContainer, t.startOffset, t.endContainer, t.endOffset, n, r);
    if (i === null) return;
    const [o, a] = i;
    wa(this.anchor, o.key, o.offset, o.type), wa(this.focus, a.key, a.offset, a.type), this._cachedNodes = null;
  }
  clone() {
    const t = this.anchor, n = this.focus;
    return new qs(Wa(t.key, t.offset, t.type), Wa(n.key, n.offset, n.type), this.format, this.style);
  }
  toggleFormat(t) {
    this.format = V0(this.format, t, null), this.dirty = !0;
  }
  setStyle(t) {
    this.style = t, this.dirty = !0;
  }
  hasFormat(t) {
    const n = Io[t];
    return !!(this.format & n);
  }
  insertRawText(t) {
    const n = t.split(/(\r?\n|\t)/), r = [], i = n.length;
    for (let o = 0; o < i; o++) {
      const a = n[o];
      a === `
` || a === `\r
` ? r.push(Af()) : a === "	" ? r.push(x_()) : r.push(Vn(a));
    }
    this.insertNodes(r);
  }
  insertText(t) {
    const n = this.anchor, r = this.focus, i = this.format, o = this.style;
    let a = n, s = r;
    !this.isCollapsed() && r.isBefore(n) && (a = r, s = n), a.type === "element" && function(v, x, w, S) {
      const A = v.getNode(), _ = A.getChildAtIndex(v.offset), O = Vn(), P = ur(A) ? Ro().append(O) : O;
      O.setFormat(w), O.setStyle(S), _ === null ? A.append(P) : _.insertBefore(P), v.is(x) && x.set(O.__key, 0, "text"), v.set(O.__key, 0, "text");
    }(a, s, i, o);
    const l = a.offset;
    let c = s.offset;
    const f = this.getNodes(), d = f.length;
    let p = f[0];
    Se(p) || _e(26);
    const m = p.getTextContent().length, y = p.getParentOrThrow();
    let g = f[d - 1];
    if (d === 1 && s.type === "element" && (c = m, s.set(a.key, c, "text")), this.isCollapsed() && l === m && (p.isSegmented() || p.isToken() || !p.canInsertTextAfter() || !y.canInsertTextAfter() && p.getNextSibling() === null)) {
      let v = p.getNextSibling();
      if (Se(v) && v.canInsertTextBefore() && !Pl(v) || (v = Vn(), v.setFormat(i), v.setStyle(o), y.canInsertTextAfter() ? p.insertAfter(v) : y.insertAfter(v)), v.select(0, 0), p = v, t !== "") return void this.insertText(t);
    } else if (this.isCollapsed() && l === 0 && (p.isSegmented() || p.isToken() || !p.canInsertTextBefore() || !y.canInsertTextBefore() && p.getPreviousSibling() === null)) {
      let v = p.getPreviousSibling();
      if (Se(v) && !Pl(v) || (v = Vn(), v.setFormat(i), y.canInsertTextBefore() ? p.insertBefore(v) : y.insertBefore(v)), v.select(), p = v, t !== "") return void this.insertText(t);
    } else if (p.isSegmented() && l !== m) {
      const v = Vn(p.getTextContent());
      v.setFormat(i), p.replace(v), p = v;
    } else if (!this.isCollapsed() && t !== "") {
      const v = g.getParent();
      if (!y.canInsertTextBefore() || !y.canInsertTextAfter() || ve(v) && (!v.canInsertTextBefore() || !v.canInsertTextAfter())) return this.insertText(""), _2(this.anchor, this.focus, null), void this.insertText(t);
    }
    if (d === 1) {
      if (p.isToken()) {
        const S = Vn(t);
        return S.select(), void p.replace(S);
      }
      const v = p.getFormat(), x = p.getStyle();
      if (l !== c || v === i && x === o) {
        if (vJ(p)) {
          const S = Vn(t);
          return S.setFormat(i), S.setStyle(o), S.select(), void p.replace(S);
        }
      } else {
        if (p.getTextContent() !== "") {
          const S = Vn(t);
          if (S.setFormat(i), S.setStyle(o), S.select(), l === 0) p.insertBefore(S, !1);
          else {
            const [A] = p.splitText(l);
            A.insertAfter(S, !1);
          }
          return void (S.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= t.length));
        }
        p.setFormat(i), p.setStyle(o);
      }
      const w = c - l;
      p = p.spliceText(l, w, t, !0), p.getTextContent() === "" ? p.remove() : this.anchor.type === "text" && (p.isComposing() ? this.anchor.offset -= t.length : (this.format = v, this.style = x));
    } else {
      const v = /* @__PURE__ */ new Set([...p.getParentKeys(), ...g.getParentKeys()]), x = ve(p) ? p : p.getParentOrThrow();
      let w = ve(g) ? g : g.getParentOrThrow(), S = g;
      if (!x.is(w) && w.isInline()) do
        S = w, w = w.getParentOrThrow();
      while (w.isInline());
      if (s.type === "text" && (c !== 0 || g.getTextContent() === "") || s.type === "element" && g.getIndexWithinParent() < c) if (Se(g) && !g.isToken() && c !== g.getTextContentSize()) {
        if (g.isSegmented()) {
          const C = Vn(g.getTextContent());
          g.replace(C), g = C;
        }
        ur(s.getNode()) || s.type !== "text" || (g = g.spliceText(0, c, "")), v.add(g.__key);
      } else {
        const C = g.getParentOrThrow();
        C.canBeEmpty() || C.getChildrenSize() !== 1 ? g.remove() : C.remove();
      }
      else v.add(g.__key);
      const A = w.getChildren(), _ = new Set(f), O = x.is(w), P = x.isInline() && p.getNextSibling() === null ? x : p;
      for (let C = A.length - 1; C >= 0; C--) {
        const k = A[C];
        if (k.is(p) || ve(k) && k.isParentOf(p)) break;
        k.isAttached() && (!_.has(k) || k.is(S) ? O || P.insertAfter(k, !1) : k.remove());
      }
      if (!O) {
        let C = w, k = null;
        for (; C !== null; ) {
          const I = C.getChildren(), $ = I.length;
          ($ === 0 || I[$ - 1].is(k)) && (v.delete(C.__key), k = C), C = C.getParent();
        }
      }
      if (p.isToken()) if (l === m) p.select();
      else {
        const C = Vn(t);
        C.select(), p.replace(C);
      }
      else p = p.spliceText(l, m - l, t, !0), p.getTextContent() === "" ? p.remove() : p.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= t.length);
      for (let C = 1; C < d; C++) {
        const k = f[C], I = k.__key;
        v.has(I) || k.remove();
      }
    }
  }
  removeText() {
    this.insertText("");
  }
  formatText(t) {
    if (this.isCollapsed()) return this.toggleFormat(t), void Gn(null);
    const n = this.getNodes(), r = [];
    for (const w of n) Se(w) && r.push(w);
    const i = r.length;
    if (i === 0) return this.toggleFormat(t), void Gn(null);
    const o = this.anchor, a = this.focus, s = this.isBackward(), l = s ? a : o, c = s ? o : a;
    let f = 0, d = r[0], p = l.type === "element" ? 0 : l.offset;
    if (l.type === "text" && p === d.getTextContentSize() && (f = 1, d = r[1], p = 0), d == null) return;
    const m = d.getFormatFlags(t, null), y = i - 1;
    let g = r[y];
    const v = c.type === "text" ? c.offset : g.getTextContentSize();
    if (d.is(g)) {
      if (p === v) return;
      if (Pl(d) || p === 0 && v === d.getTextContentSize()) d.setFormat(m);
      else {
        const w = d.splitText(p, v), S = p === 0 ? w[0] : w[1];
        S.setFormat(m), l.type === "text" && l.set(S.__key, 0, "text"), c.type === "text" && c.set(S.__key, v - p, "text");
      }
      return void (this.format = m);
    }
    p === 0 || Pl(d) || ([, d] = d.splitText(p), p = 0), d.setFormat(m);
    const x = g.getFormatFlags(t, m);
    v > 0 && (v === g.getTextContentSize() || Pl(g) || ([g] = g.splitText(v)), g.setFormat(x));
    for (let w = f + 1; w < y; w++) {
      const S = r[w], A = S.getFormatFlags(t, x);
      S.setFormat(A);
    }
    l.type === "text" && l.set(d.__key, p, "text"), c.type === "text" && c.set(g.__key, v, "text"), this.format = m | x;
  }
  insertNodes(t) {
    if (t.length === 0) return;
    if (this.anchor.key === "root") {
      this.insertParagraph();
      const m = Ne();
      return we(m) || _e(134), m.insertNodes(t);
    }
    const n = gb((this.isBackward() ? this.focus : this.anchor).getNode(), Cl), r = t[t.length - 1];
    if ("__language" in n && ve(n)) {
      if ("__language" in t[0]) this.insertText(t[0].getTextContent());
      else {
        const m = _b(this);
        n.splice(m, 0, t), r.selectEnd();
      }
      return;
    }
    if (!t.some((m) => (ve(m) || Ht(m)) && !m.isInline())) {
      ve(n) || _e(135);
      const m = _b(this);
      return n.splice(m, 0, t), void r.selectEnd();
    }
    const i = function(m) {
      const y = Ro();
      let g = null;
      for (let v = 0; v < m.length; v++) {
        const x = m[v], w = Ju(x);
        if (w || Ht(x) && x.isInline() || ve(x) && x.isInline() || Se(x) || x.isParentRequired()) {
          if (g === null && (g = x.createParentElementNode(), y.append(g), w)) continue;
          g !== null && g.append(x);
        } else y.append(x), g = null;
      }
      return y;
    }(t), o = i.getLastDescendant(), a = i.getChildren(), s = !ve(n) || !n.isEmpty() ? this.insertParagraph() : null, l = a[a.length - 1];
    let c = a[0];
    var f;
    ve(f = c) && Cl(f) && !f.isEmpty() && ve(n) && (!n.isEmpty() || n.canMergeWhenEmpty()) && (ve(n) || _e(135), n.append(...c.getChildren()), c = a[1]), c && function(m, y, g) {
      const v = y.getParentOrThrow().getLastChild();
      let x = y;
      const w = [y];
      for (; x !== v; ) x.getNextSibling() || _e(140), x = x.getNextSibling(), w.push(x);
      let S = m;
      for (const A of w) S = S.insertAfter(A);
    }(n, c);
    const d = gb(o, Cl);
    s && ve(d) && (s.canMergeWhenEmpty() || Cl(l)) && (d.append(...s.getChildren()), s.remove()), ve(n) && n.isEmpty() && n.remove(), o.selectEnd();
    const p = ve(n) ? n.getLastChild() : null;
    Ju(p) && d !== n && p.remove();
  }
  insertParagraph() {
    if (this.anchor.key === "root") {
      const a = Ro();
      return ir().splice(this.anchor.offset, 0, [a]), a.select(), a;
    }
    const t = _b(this), n = gb(this.anchor.getNode(), Cl);
    ve(n) || _e(136);
    const r = n.getChildAtIndex(t), i = r ? [r, ...r.getNextSiblings()] : [], o = n.insertNewAfter(this, !1);
    return o ? (o.append(...i), o.selectStart(), o) : null;
  }
  insertLineBreak(t) {
    const n = Af();
    if (this.insertNodes([n]), t) {
      const r = n.getParentOrThrow(), i = n.getIndexWithinParent();
      r.select(i, i);
    }
  }
  extract() {
    const t = this.getNodes(), n = t.length, r = n - 1, i = this.anchor, o = this.focus;
    let a = t[0], s = t[r];
    const [l, c] = rx(this);
    if (n === 0) return [];
    if (n === 1) {
      if (Se(a) && !this.isCollapsed()) {
        const d = l > c ? c : l, p = l > c ? l : c, m = a.splitText(d, p), y = d === 0 ? m[0] : m[1];
        return y != null ? [y] : [];
      }
      return [a];
    }
    const f = i.isBefore(o);
    if (Se(a)) {
      const d = f ? l : c;
      d === a.getTextContentSize() ? t.shift() : d !== 0 && ([, a] = a.splitText(d), t[0] = a);
    }
    if (Se(s)) {
      const d = s.getTextContent().length, p = f ? c : l;
      p === 0 ? t.pop() : p !== d && ([s] = s.splitText(p), t[r] = s);
    }
    return t;
  }
  modify(t, n, r) {
    const i = this.focus, o = this.anchor, a = t === "move", s = U0(i, n);
    if (Ht(s) && !s.isIsolated()) {
      if (a && s.isKeyboardSelectable()) {
        const m = zC();
        return m.add(s.__key), void Vo(m);
      }
      const p = n ? s.getPreviousSibling() : s.getNextSibling();
      if (Se(p)) {
        const m = p.__key, y = n ? p.getTextContent().length : 0;
        return i.set(m, y, "text"), void (a && o.set(m, y, "text"));
      }
      {
        const m = s.getParentOrThrow();
        let y, g;
        return ve(p) ? (g = p.__key, y = n ? p.getChildrenSize() : 0) : (y = s.getIndexWithinParent(), g = m.__key, n || y++), i.set(g, y, "element"), void (a && o.set(g, y, "element"));
      }
    }
    const l = mn(), c = no(l._window);
    if (!c) return;
    const f = l._blockCursorElement, d = l._rootElement;
    if (d === null || f === null || !ve(s) || s.isInline() || s.canBeEmpty() || y_(f, l, d), function(p, m, y, g) {
      p.modify(m, y, g);
    }(c, t, n ? "backward" : "forward", r), c.rangeCount > 0) {
      const p = c.getRangeAt(0), m = this.anchor.getNode(), y = ur(m) ? m : rJ(m);
      if (this.applyDOMRange(p), this.dirty = !0, !a) {
        const g = this.getNodes(), v = [];
        let x = !1;
        for (let w = 0; w < g.length; w++) {
          const S = g[w];
          H0(S, y) ? v.push(S) : x = !0;
        }
        if (x && v.length > 0) if (n) {
          const w = v[0];
          ve(w) ? w.selectStart() : w.getParentOrThrow().selectStart();
        } else {
          const w = v[v.length - 1];
          ve(w) ? w.selectEnd() : w.getParentOrThrow().selectEnd();
        }
        c.anchorNode === p.startContainer && c.anchorOffset === p.startOffset || function(w) {
          const S = w.focus, A = w.anchor, _ = A.key, O = A.offset, P = A.type;
          wa(A, S.key, S.offset, S.type), wa(S, _, O, P), w._cachedNodes = null;
        }(this);
      }
    }
  }
  forwardDeletion(t, n, r) {
    if (!r && (t.type === "element" && ve(n) && t.offset === n.getChildrenSize() || t.type === "text" && t.offset === n.getTextContentSize())) {
      const i = n.getParent(), o = n.getNextSibling() || (i === null ? null : i.getNextSibling());
      if (ve(o) && o.isShadowRoot()) return !0;
    }
    return !1;
  }
  deleteCharacter(t) {
    const n = this.isCollapsed();
    if (this.isCollapsed()) {
      const r = this.anchor;
      let i = r.getNode();
      if (this.forwardDeletion(r, i, t)) return;
      const o = this.focus, a = U0(o, t);
      if (Ht(a) && !a.isIsolated()) {
        if (a.isKeyboardSelectable() && ve(i) && i.getChildrenSize() === 0) {
          i.remove();
          const s = zC();
          s.add(a.__key), Vo(s);
        } else
          a.remove(), mn().dispatchCommand(G1, void 0);
        return;
      }
      if (!t && ve(a) && ve(i) && i.isEmpty()) return i.remove(), void a.selectStart();
      if (this.modify("extend", t, "character"), this.isCollapsed()) {
        if (t && r.offset === 0 && (r.type === "element" ? r.getNode() : r.getNode().getParentOrThrow()).collapseAtStart(this))
          return;
      } else {
        const s = o.type === "text" ? o.getNode() : null;
        if (i = r.type === "text" ? r.getNode() : null, s !== null && s.isSegmented()) {
          const l = o.offset, c = s.getTextContentSize();
          if (s.is(i) || t && l !== c || !t && l !== 0) return void BC(s, t, l);
        } else if (i !== null && i.isSegmented()) {
          const l = r.offset, c = i.getTextContentSize();
          if (i.is(s) || t && l !== 0 || !t && l !== c) return void BC(i, t, l);
        }
        (function(l, c) {
          const f = l.anchor, d = l.focus, p = f.getNode(), m = d.getNode();
          if (p === m && f.type === "text" && d.type === "text") {
            const y = f.offset, g = d.offset, v = y < g, x = v ? y : g, w = v ? g : y, S = w - 1;
            x !== S && (QR(p.getTextContent().slice(x, w)) || (c ? d.offset = S : f.offset = S));
          }
        })(this, t);
      }
    }
    if (this.removeText(), t && !n && this.isCollapsed() && this.anchor.type === "element" && this.anchor.offset === 0) {
      const r = this.anchor.getNode();
      r.isEmpty() && ur(r.getParent()) && r.getIndexWithinParent() === 0 && r.collapseAtStart(this);
    }
  }
  deleteLine(t) {
    if (this.isCollapsed()) {
      const n = this.anchor.type === "element";
      if (n && this.insertText(" "), this.modify("extend", t, "lineboundary"), (t ? this.focus : this.anchor).offset === 0 && this.modify("extend", t, "character"), n) {
        const r = t ? this.anchor : this.focus;
        r.set(r.key, r.offset + 1, r.type);
      }
    }
    this.removeText();
  }
  deleteWord(t) {
    if (this.isCollapsed()) {
      const n = this.anchor, r = n.getNode();
      if (this.forwardDeletion(n, r, t)) return;
      this.modify("extend", t, "word");
    }
    this.removeText();
  }
  isBackward() {
    return this.focus.isBefore(this.anchor);
  }
  getStartEndPoints() {
    return [this.anchor, this.focus];
  }
}
function Rg(e) {
  return e instanceof x2;
}
function LC(e) {
  const t = e.offset;
  if (e.type === "text") return t;
  const n = e.getNode();
  return t === n.getChildrenSize() ? n.getTextContent().length : 0;
}
function rx(e) {
  const t = e.getStartEndPoints();
  if (t === null) return [0, 0];
  const [n, r] = t;
  return n.type === "element" && r.type === "element" && n.key === r.key && n.offset === r.offset ? [0, 0] : [LC(n), LC(r)];
}
function BC(e, t, n) {
  const r = e, i = r.getTextContent().split(/(?=\s)/g), o = i.length;
  let a = 0, s = 0;
  for (let c = 0; c < o; c++) {
    const f = c === o - 1;
    if (s = a, a += i[c].length, t && a === n || a > n || f) {
      i.splice(c, 1), f && (s = void 0);
      break;
    }
  }
  const l = i.join("").trim();
  l === "" ? r.remove() : (r.setTextContent(l), r.select(s, s));
}
function FC(e, t, n, r) {
  let i, o = t;
  if (e.nodeType === md) {
    let a = !1;
    const s = e.childNodes, l = s.length, c = r._blockCursorElement;
    o === l && (a = !0, o = l - 1);
    let f = s[o], d = !1;
    if (f === c) f = s[o + 1], d = !0;
    else if (c !== null) {
      const p = c.parentNode;
      e === p && t > Array.prototype.indexOf.call(p.children, c) && o--;
    }
    if (i = jl(f), Se(i)) o = wC(i, a);
    else {
      let p = jl(e);
      if (p === null) return null;
      if (ve(p)) {
        o = Math.min(p.getChildrenSize(), o);
        let m = p.getChildAtIndex(o);
        if (ve(m) && function(y, g, v) {
          const x = y.getParent();
          return v === null || x === null || !x.canBeEmpty() || x !== v.getNode();
        }(m, 0, n)) {
          const y = a ? m.getLastDescendant() : m.getFirstDescendant();
          y === null ? p = m : (m = y, p = ve(m) ? m : m.getParentOrThrow()), o = 0;
        }
        Se(m) ? (i = m, p = null, o = wC(m, a)) : m !== p && a && !d && o++;
      } else {
        const m = p.getIndexWithinParent();
        o = t === 0 && Ht(p) && jl(e) === p ? m : m + 1, p = p.getParentOrThrow();
      }
      if (ve(p)) return Wa(p.__key, o, "element");
    }
  } else i = jl(e);
  return Se(i) ? Wa(i.__key, o, "text") : null;
}
function WC(e, t, n) {
  const r = e.offset, i = e.getNode();
  if (r === 0) {
    const o = i.getPreviousSibling(), a = i.getParent();
    if (t) {
      if ((n || !t) && o === null && ve(a) && a.isInline()) {
        const s = a.getPreviousSibling();
        Se(s) && (e.key = s.__key, e.offset = s.getTextContent().length);
      }
    } else ve(o) && !n && o.isInline() ? (e.key = o.__key, e.offset = o.getChildrenSize(), e.type = "element") : Se(o) && (e.key = o.__key, e.offset = o.getTextContent().length);
  } else if (r === i.getTextContent().length) {
    const o = i.getNextSibling(), a = i.getParent();
    if (t && ve(o) && o.isInline()) e.key = o.__key, e.offset = 0, e.type = "element";
    else if ((n || t) && o === null && ve(a) && a.isInline() && !a.canInsertTextAfter()) {
      const s = a.getNextSibling();
      Se(s) && (e.key = s.__key, e.offset = 0);
    }
  }
}
function _2(e, t, n) {
  if (e.type === "text" && t.type === "text") {
    const r = e.isBefore(t), i = e.is(t);
    WC(e, r, i), WC(t, !r, i), i && (t.key = e.key, t.offset = e.offset, t.type = e.type);
    const o = mn();
    if (o.isComposing() && o._compositionKey !== e.key && we(n)) {
      const a = n.anchor, s = n.focus;
      wa(e, a.key, a.offset, a.type), wa(t, s.key, s.offset, s.type);
    }
  }
}
function S2(e, t, n, r, i, o) {
  if (e === null || n === null || !Pg(i, e, n)) return null;
  const a = FC(e, t, we(o) ? o.anchor : null, i);
  if (a === null) return null;
  const s = FC(n, r, we(o) ? o.focus : null, i);
  if (s === null) return null;
  if (a.type === "element" && s.type === "element") {
    const l = jl(e), c = jl(n);
    if (Ht(l) && Ht(c)) return null;
  }
  return _2(a, s, o), [a, s];
}
function O2(e, t, n, r, i, o) {
  const a = qo(), s = new qs(Wa(e, t, i), Wa(n, r, o), 0, "");
  return s.dirty = !0, a._selection = s, s;
}
function zC() {
  return new x2(/* @__PURE__ */ new Set());
}
function w_(e, t, n, r) {
  const i = n._window;
  if (i === null) return null;
  const o = r || i.event, a = o ? o.type : void 0, s = a === "selectionchange", l = !z0 && (s || a === "beforeinput" || a === "compositionstart" || a === "compositionend" || a === "click" && o && o.detail === 3 || a === "drop" || a === void 0);
  let c, f, d, p;
  if (we(e) && !l) return e.clone();
  if (t === null) return null;
  if (c = t.anchorNode, f = t.focusNode, d = t.anchorOffset, p = t.focusOffset, s && we(e) && !Pg(n, c, f)) return e.clone();
  const m = S2(c, d, f, p, n, e);
  if (m === null) return null;
  const [y, g] = m;
  return new qs(y, g, we(e) ? e.format : 0, we(e) ? e.style : "");
}
function Ne() {
  return qo()._selection;
}
function jg() {
  return mn()._editorState._selection;
}
function Vp(e, t, n, r = 1) {
  const i = e.anchor, o = e.focus, a = i.getNode(), s = o.getNode();
  if (!t.is(a) && !t.is(s)) return;
  const l = t.__key;
  if (e.isCollapsed()) {
    const c = i.offset;
    if (n <= c && r > 0 || n < c && r < 0) {
      const f = Math.max(0, c + r);
      i.set(l, f, "element"), o.set(l, f, "element"), VC(e);
    }
  } else {
    const c = e.isBackward(), f = c ? o : i, d = f.getNode(), p = c ? i : o, m = p.getNode();
    if (t.is(d)) {
      const y = f.offset;
      (n <= y && r > 0 || n < y && r < 0) && f.set(l, Math.max(0, y + r), "element");
    }
    if (t.is(m)) {
      const y = p.offset;
      (n <= y && r > 0 || n < y && r < 0) && p.set(l, Math.max(0, y + r), "element");
    }
  }
  VC(e);
}
function VC(e) {
  const t = e.anchor, n = t.offset, r = e.focus, i = r.offset, o = t.getNode(), a = r.getNode();
  if (e.isCollapsed()) {
    if (!ve(o)) return;
    const s = o.getChildrenSize(), l = n >= s, c = l ? o.getChildAtIndex(s - 1) : o.getChildAtIndex(n);
    if (Se(c)) {
      let f = 0;
      l && (f = c.getTextContentSize()), t.set(c.__key, f, "text"), r.set(c.__key, f, "text");
    }
  } else {
    if (ve(o)) {
      const s = o.getChildrenSize(), l = n >= s, c = l ? o.getChildAtIndex(s - 1) : o.getChildAtIndex(n);
      if (Se(c)) {
        let f = 0;
        l && (f = c.getTextContentSize()), t.set(c.__key, f, "text");
      }
    }
    if (ve(a)) {
      const s = a.getChildrenSize(), l = i >= s, c = l ? a.getChildAtIndex(s - 1) : a.getChildAtIndex(i);
      if (Se(c)) {
        let f = 0;
        l && (f = c.getTextContentSize()), r.set(c.__key, f, "text");
      }
    }
  }
}
function Up(e, t, n, r, i) {
  let o = null, a = 0, s = null;
  r !== null ? (o = r.__key, Se(r) ? (a = r.getTextContentSize(), s = "text") : ve(r) && (a = r.getChildrenSize(), s = "element")) : i !== null && (o = i.__key, Se(i) ? s = "text" : ve(i) && (s = "element")), o !== null && s !== null ? e.set(o, a, s) : (a = t.getIndexWithinParent(), a === -1 && (a = n.getChildrenSize()), e.set(n.__key, a, "element"));
}
function UC(e, t, n, r, i) {
  e.type === "text" ? (e.key = n, t || (e.offset += i)) : e.offset > r.getIndexWithinParent() && (e.offset -= 1);
}
function xJ(e, t, n, r, i, o, a) {
  const s = r.anchorNode, l = r.focusNode, c = r.anchorOffset, f = r.focusOffset, d = document.activeElement;
  if (i.has("collaboration") && d !== o || d !== null && YR(d)) return;
  if (!we(t)) return void (e !== null && Pg(n, s, l) && r.removeAllRanges());
  const p = t.anchor, m = t.focus, y = p.key, g = m.key, v = Lp(n, y), x = Lp(n, g), w = p.offset, S = m.offset, A = t.format, _ = t.style, O = t.isCollapsed();
  let P = v, C = x, k = !1;
  if (p.type === "text") {
    P = Rp(v);
    const F = p.getNode();
    k = F.getFormat() !== A || F.getStyle() !== _;
  } else we(e) && e.anchor.type === "text" && (k = !0);
  var I, $, N, D, j;
  if (m.type === "text" && (C = Rp(x)), P !== null && C !== null && (O && (e === null || k || we(e) && (e.format !== A || e.style !== _)) && (I = A, $ = _, N = w, D = y, j = performance.now(), h2 = [I, $, N, D, j]), c !== w || f !== S || s !== P || l !== C || r.type === "Range" && O || (d !== null && o.contains(d) || o.focus({ preventScroll: !0 }), p.type === "element"))) {
    try {
      r.setBaseAndExtent(P, w, C, S);
    } catch {
    }
    if (!i.has("skip-scroll-into-view") && t.isCollapsed() && o !== null && o === document.activeElement) {
      const F = t instanceof qs && t.anchor.type === "element" ? P.childNodes[w] || null : r.rangeCount > 0 ? r.getRangeAt(0) : null;
      if (F !== null) {
        let W;
        if (F instanceof Text) {
          const z = document.createRange();
          z.selectNode(F), W = z.getBoundingClientRect();
        } else W = F.getBoundingClientRect();
        (function(z, H, U) {
          const V = U.ownerDocument, Y = V.defaultView;
          if (Y === null) return;
          let { top: Q, bottom: ne } = H, re = 0, ce = 0, oe = U;
          for (; oe !== null; ) {
            const fe = oe === V.body;
            if (fe) re = 0, ce = Ng(z).innerHeight;
            else {
              const ee = oe.getBoundingClientRect();
              re = ee.top, ce = ee.bottom;
            }
            let ae = 0;
            if (Q < re ? ae = -(re - Q) : ne > ce && (ae = ne - ce), ae !== 0) if (fe) Y.scrollBy(0, ae);
            else {
              const ee = oe.scrollTop;
              oe.scrollTop += ae;
              const se = oe.scrollTop - ee;
              Q -= se, ne -= se;
            }
            if (fe) break;
            oe = Mg(oe);
          }
        })(n, W, o);
      }
    }
    ex = !0;
  }
}
function _b(e) {
  let t = e;
  e.isCollapsed() || t.removeText();
  const n = Ne();
  we(n) && (t = n), we(t) || _e(161);
  const r = t.anchor;
  let i = r.getNode(), o = r.offset;
  for (; !Cl(i); ) [i, o] = wJ(i, o);
  return o;
}
function wJ(e, t) {
  const n = e.getParent();
  if (!n) {
    const i = Ro();
    return ir().append(i), i.select(), [ir(), 0];
  }
  if (Se(e)) {
    const i = e.splitText(t);
    if (i.length === 0) return [n, e.getIndexWithinParent()];
    const o = t === 0 ? 0 : 1;
    return [n, i[0].getIndexWithinParent() + o];
  }
  if (!ve(e) || t === 0) return [n, e.getIndexWithinParent()];
  const r = e.getChildAtIndex(t);
  if (r) {
    const i = new qs(Wa(e.__key, t, "element"), Wa(e.__key, t, "element"), 0, ""), o = e.insertNewAfter(i);
    o && o.append(r, ...r.getNextSiblings());
  }
  return [n, e.getIndexWithinParent() + 1];
}
let Dn = null, In = null, Ar = !1, Sb = !1, fp = 0;
const HC = { characterData: !0, childList: !0, subtree: !0 };
function bd() {
  return Ar || Dn !== null && Dn._readOnly;
}
function wr() {
  Ar && _e(13);
}
function A2() {
  fp > 99 && _e(14);
}
function qo() {
  return Dn === null && _e(195, T2()), Dn;
}
function mn() {
  return In === null && _e(196, T2()), In;
}
function T2() {
  let e = 0;
  const t = /* @__PURE__ */ new Set(), n = Fg.version;
  if (typeof window < "u") for (const i of document.querySelectorAll("[contenteditable]")) {
    const o = Cg(i);
    if (d_(o)) e++;
    else if (o) {
      let a = String(o.constructor.version || "<0.17.1");
      a === n && (a += " (separately built, likely a bundler configuration issue)"), t.add(a);
    }
  }
  let r = ` Detected on the page: ${e} compatible editor(s) with version ${n}`;
  return t.size && (r += ` and incompatible editors with versions ${Array.from(t).join(", ")}`), r;
}
function _J() {
  return In;
}
function KC(e, t, n) {
  const r = t.__type, i = function(s, l) {
    const c = s._nodes.get(l);
    return c === void 0 && _e(30, l), c;
  }(e, r);
  let o = n.get(r);
  o === void 0 && (o = Array.from(i.transforms), n.set(r, o));
  const a = o.length;
  for (let s = 0; s < a && (o[s](t), t.isAttached()); s++) ;
}
function GC(e, t) {
  return e !== void 0 && e.__key !== t && e.isAttached();
}
function P2(e, t) {
  const n = e.type, r = t.get(n);
  r === void 0 && _e(17, n);
  const i = r.klass;
  e.type !== i.getType() && _e(18, i.name);
  const o = i.importJSON(e), a = e.children;
  if (ve(o) && Array.isArray(a)) for (let s = 0; s < a.length; s++) {
    const l = P2(a[s], t);
    o.append(l);
  }
  return o;
}
function YC(e, t, n) {
  const r = Dn, i = Ar, o = In;
  Dn = t, Ar = !0, In = e;
  try {
    return n();
  } finally {
    Dn = r, Ar = i, In = o;
  }
}
function Aa(e, t) {
  const n = e._pendingEditorState, r = e._rootElement, i = e._headless || r === null;
  if (n === null) return;
  const o = e._editorState, a = o._selection, s = n._selection, l = e._dirtyType !== Ls, c = Dn, f = Ar, d = In, p = e._updating, m = e._observer;
  let y = null;
  if (e._pendingEditorState = null, e._editorState = n, !i && l && m !== null) {
    In = e, Dn = n, Ar = !1, e._updating = !0;
    try {
      const O = e._dirtyType, P = e._dirtyElements, C = e._dirtyLeaves;
      m.disconnect(), y = uJ(o, n, e, O, P, C);
    } catch (O) {
      if (O instanceof Error && e._onError(O), Sb) throw O;
      return N2(e, null, r, n), GR(e), e._dirtyType = nc, Sb = !0, Aa(e, o), void (Sb = !1);
    } finally {
      m.observe(r, HC), e._updating = p, Dn = c, Ar = f, In = d;
    }
  }
  n._readOnly || (n._readOnly = !0);
  const g = e._dirtyLeaves, v = e._dirtyElements, x = e._normalizedNodes, w = e._updateTags, S = e._deferred;
  l && (e._dirtyType = Ls, e._cloneNotNeeded.clear(), e._dirtyLeaves = /* @__PURE__ */ new Set(), e._dirtyElements = /* @__PURE__ */ new Map(), e._normalizedNodes = /* @__PURE__ */ new Set(), e._updateTags = /* @__PURE__ */ new Set()), function(O, P) {
    const C = O._decorators;
    let k = O._pendingDecorators || C;
    const I = P._nodeMap;
    let $;
    for ($ in k) I.has($) || (k === C && (k = ZR(O)), delete k[$]);
  }(e, n);
  const A = i ? null : no(e._window);
  if (e._editable && A !== null && (l || s === null || s.dirty)) {
    In = e, Dn = n;
    try {
      if (m !== null && m.disconnect(), l || s === null || s.dirty) {
        const O = e._blockCursorElement;
        O !== null && y_(O, e, r), xJ(a, s, e, A, w, r);
      }
      iJ(e, r, s), m !== null && m.observe(r, HC);
    } finally {
      In = d, Dn = c;
    }
  }
  y !== null && function(O, P, C, k, I) {
    const $ = Array.from(O._listeners.mutation), N = $.length;
    for (let D = 0; D < N; D++) {
      const [j, F] = $[D], W = P.get(F);
      W !== void 0 && j(W, { dirtyLeaves: k, prevEditorState: I, updateTags: C });
    }
  }(e, y, w, g, o), we(s) || s === null || a !== null && a.is(s) || e.dispatchCommand(G1, void 0);
  const _ = e._pendingDecorators;
  _ !== null && (e._decorators = _, e._pendingDecorators = null, Qu("decorator", e, !0, _)), function(O, P, C) {
    const k = xC(P), I = xC(C);
    k !== I && Qu("textcontent", O, !0, I);
  }(e, t || o, n), Qu("update", e, !0, { dirtyElements: v, dirtyLeaves: g, editorState: n, normalizedNodes: x, prevEditorState: t || o, tags: w }), function(O, P) {
    if (O._deferred = [], P.length !== 0) {
      const C = O._updating;
      O._updating = !0;
      try {
        for (let k = 0; k < P.length; k++) P[k]();
      } finally {
        O._updating = C;
      }
    }
  }(e, S), function(O) {
    const P = O._updates;
    if (P.length !== 0) {
      const C = P.shift();
      if (C) {
        const [k, I] = C;
        E2(O, k, I);
      }
    }
  }(e);
}
function Qu(e, t, n, ...r) {
  const i = t._updating;
  t._updating = n;
  try {
    const o = Array.from(t._listeners[e]);
    for (let a = 0; a < o.length; a++) o[a].apply(null, r);
  } finally {
    t._updating = i;
  }
}
function C2(e, t, n) {
  if (e._updating === !1 || In !== e) {
    let i = !1;
    return e.update(() => {
      i = C2(e, t, n);
    }), i;
  }
  const r = h_(e);
  for (let i = 4; i >= 0; i--) for (let o = 0; o < r.length; o++) {
    const a = r[o]._commands.get(t);
    if (a !== void 0) {
      const s = a[i];
      if (s !== void 0) {
        const l = Array.from(s), c = l.length;
        for (let f = 0; f < c; f++) if (l[f](n, e) === !0) return !0;
      }
    }
  }
  return !1;
}
function qC(e, t) {
  const n = e._updates;
  let r = t || !1;
  for (; n.length !== 0; ) {
    const i = n.shift();
    if (i) {
      const [o, a] = i;
      let s, l;
      if (a !== void 0) {
        if (s = a.onUpdate, l = a.tag, a.skipTransforms && (r = !0), a.discrete) {
          const c = e._pendingEditorState;
          c === null && _e(191), c._flushSync = !0;
        }
        s && e._deferred.push(s), l && e._updateTags.add(l);
      }
      o();
    }
  }
  return r;
}
function E2(e, t, n) {
  const r = e._updateTags;
  let i, o, a = !1, s = !1;
  n !== void 0 && (i = n.onUpdate, o = n.tag, o != null && r.add(o), a = n.skipTransforms || !1, s = n.discrete || !1), i && e._deferred.push(i);
  const l = e._editorState;
  let c = e._pendingEditorState, f = !1;
  (c === null || c._readOnly) && (c = e._pendingEditorState = new Bg(new Map((c || l)._nodeMap)), f = !0), c._flushSync = s;
  const d = Dn, p = Ar, m = In, y = e._updating;
  Dn = c, Ar = !1, e._updating = !0, In = e;
  try {
    f && (e._headless ? l._selection !== null && (c._selection = l._selection.clone()) : c._selection = function(w) {
      const S = w.getEditorState()._selection, A = no(w._window);
      return we(S) || S == null ? w_(S, A, w, null) : S.clone();
    }(e));
    const v = e._compositionKey;
    t(), a = qC(e, a), function(w, S) {
      const A = S.getEditorState()._selection, _ = w._selection;
      if (we(_)) {
        const O = _.anchor, P = _.focus;
        let C;
        if (O.type === "text" && (C = O.getNode(), C.selectionTransform(A, _)), P.type === "text") {
          const k = P.getNode();
          C !== k && k.selectionTransform(A, _);
        }
      }
    }(c, e), e._dirtyType !== Ls && (a ? function(w, S) {
      const A = S._dirtyLeaves, _ = w._nodeMap;
      for (const O of A) {
        const P = _.get(O);
        Se(P) && P.isAttached() && P.isSimpleText() && !P.isUnmergeable() && vC(P);
      }
    }(c, e) : function(w, S) {
      const A = S._dirtyLeaves, _ = S._dirtyElements, O = w._nodeMap, P = Oa(), C = /* @__PURE__ */ new Map();
      let k = A, I = k.size, $ = _, N = $.size;
      for (; I > 0 || N > 0; ) {
        if (I > 0) {
          S._dirtyLeaves = /* @__PURE__ */ new Set();
          for (const D of k) {
            const j = O.get(D);
            Se(j) && j.isAttached() && j.isSimpleText() && !j.isUnmergeable() && vC(j), j !== void 0 && GC(j, P) && KC(S, j, C), A.add(D);
          }
          if (k = S._dirtyLeaves, I = k.size, I > 0) {
            fp++;
            continue;
          }
        }
        S._dirtyLeaves = /* @__PURE__ */ new Set(), S._dirtyElements = /* @__PURE__ */ new Map();
        for (const D of $) {
          const j = D[0], F = D[1];
          if (j !== "root" && !F) continue;
          const W = O.get(j);
          W !== void 0 && GC(W, P) && KC(S, W, C), _.set(j, F);
        }
        k = S._dirtyLeaves, I = k.size, $ = S._dirtyElements, N = $.size, fp++;
      }
      S._dirtyLeaves = A, S._dirtyElements = _;
    }(c, e), qC(e), function(w, S, A, _) {
      const O = w._nodeMap, P = S._nodeMap, C = [];
      for (const [k] of _) {
        const I = P.get(k);
        I !== void 0 && (I.isAttached() || (ve(I) && i2(I, k, O, P, C, _), O.has(k) || _.delete(k), C.push(k)));
      }
      for (const k of C) P.delete(k);
      for (const k of A) {
        const I = P.get(k);
        I === void 0 || I.isAttached() || (O.has(k) || A.delete(k), P.delete(k));
      }
    }(l, c, e._dirtyLeaves, e._dirtyElements)), v !== e._compositionKey && (c._flushSync = !0);
    const x = c._selection;
    if (we(x)) {
      const w = c._nodeMap, S = x.anchor.key, A = x.focus.key;
      w.get(S) !== void 0 && w.get(A) !== void 0 || _e(19);
    } else Rg(x) && x._nodes.size === 0 && (c._selection = null);
  } catch (v) {
    return v instanceof Error && e._onError(v), e._pendingEditorState = l, e._dirtyType = nc, e._cloneNotNeeded.clear(), e._dirtyLeaves = /* @__PURE__ */ new Set(), e._dirtyElements.clear(), void Aa(e);
  } finally {
    Dn = d, Ar = p, In = m, e._updating = y, fp = 0;
  }
  e._dirtyType !== Ls || function(v, x) {
    const w = x.getEditorState()._selection, S = v._selection;
    if (S !== null) {
      if (S.dirty || !S.is(w)) return !0;
    } else if (w !== null) return !0;
    return !1;
  }(c, e) ? c._flushSync ? (c._flushSync = !1, Aa(e)) : f && JZ(() => {
    Aa(e);
  }) : (c._flushSync = !1, f && (r.clear(), e._deferred = [], e._pendingEditorState = null));
}
function Fr(e, t, n) {
  e._updating ? e._updates.push([t, n]) : E2(e, t, n);
}
class Lg extends Ig {
  constructor(t) {
    super(t), this.__first = null, this.__last = null, this.__size = 0, this.__format = 0, this.__style = "", this.__indent = 0, this.__dir = null;
  }
  afterCloneFrom(t) {
    super.afterCloneFrom(t), this.__first = t.__first, this.__last = t.__last, this.__size = t.__size, this.__indent = t.__indent, this.__format = t.__format, this.__style = t.__style, this.__dir = t.__dir;
  }
  getFormat() {
    return this.getLatest().__format;
  }
  getFormatType() {
    const t = this.getFormat();
    return zZ[t] || "";
  }
  getStyle() {
    return this.getLatest().__style;
  }
  getIndent() {
    return this.getLatest().__indent;
  }
  getChildren() {
    const t = [];
    let n = this.getFirstChild();
    for (; n !== null; ) t.push(n), n = n.getNextSibling();
    return t;
  }
  getChildrenKeys() {
    const t = [];
    let n = this.getFirstChild();
    for (; n !== null; ) t.push(n.__key), n = n.getNextSibling();
    return t;
  }
  getChildrenSize() {
    return this.getLatest().__size;
  }
  isEmpty() {
    return this.getChildrenSize() === 0;
  }
  isDirty() {
    const t = mn()._dirtyElements;
    return t !== null && t.has(this.__key);
  }
  isLastChild() {
    const t = this.getLatest(), n = this.getParentOrThrow().getLastChild();
    return n !== null && n.is(t);
  }
  getAllTextNodes() {
    const t = [];
    let n = this.getFirstChild();
    for (; n !== null; ) {
      if (Se(n) && t.push(n), ve(n)) {
        const r = n.getAllTextNodes();
        t.push(...r);
      }
      n = n.getNextSibling();
    }
    return t;
  }
  getFirstDescendant() {
    let t = this.getFirstChild();
    for (; ve(t); ) {
      const n = t.getFirstChild();
      if (n === null) break;
      t = n;
    }
    return t;
  }
  getLastDescendant() {
    let t = this.getLastChild();
    for (; ve(t); ) {
      const n = t.getLastChild();
      if (n === null) break;
      t = n;
    }
    return t;
  }
  getDescendantByIndex(t) {
    const n = this.getChildren(), r = n.length;
    if (t >= r) {
      const o = n[r - 1];
      return ve(o) && o.getLastDescendant() || o || null;
    }
    const i = n[t];
    return ve(i) && i.getFirstDescendant() || i || null;
  }
  getFirstChild() {
    const t = this.getLatest().__first;
    return t === null ? null : $n(t);
  }
  getFirstChildOrThrow() {
    const t = this.getFirstChild();
    return t === null && _e(45, this.__key), t;
  }
  getLastChild() {
    const t = this.getLatest().__last;
    return t === null ? null : $n(t);
  }
  getLastChildOrThrow() {
    const t = this.getLastChild();
    return t === null && _e(96, this.__key), t;
  }
  getChildAtIndex(t) {
    const n = this.getChildrenSize();
    let r, i;
    if (t < n / 2) {
      for (r = this.getFirstChild(), i = 0; r !== null && i <= t; ) {
        if (i === t) return r;
        r = r.getNextSibling(), i++;
      }
      return null;
    }
    for (r = this.getLastChild(), i = n - 1; r !== null && i >= t; ) {
      if (i === t) return r;
      r = r.getPreviousSibling(), i--;
    }
    return null;
  }
  getTextContent() {
    let t = "";
    const n = this.getChildren(), r = n.length;
    for (let i = 0; i < r; i++) {
      const o = n[i];
      t += o.getTextContent(), ve(o) && i !== r - 1 && !o.isInline() && (t += zo);
    }
    return t;
  }
  getTextContentSize() {
    let t = 0;
    const n = this.getChildren(), r = n.length;
    for (let i = 0; i < r; i++) {
      const o = n[i];
      t += o.getTextContentSize(), ve(o) && i !== r - 1 && !o.isInline() && (t += zo.length);
    }
    return t;
  }
  getDirection() {
    return this.getLatest().__dir;
  }
  hasFormat(t) {
    if (t !== "") {
      const n = mC[t];
      return !!(this.getFormat() & n);
    }
    return !1;
  }
  select(t, n) {
    wr();
    const r = Ne();
    let i = t, o = n;
    const a = this.getChildrenSize();
    if (!this.canBeEmpty()) {
      if (t === 0 && n === 0) {
        const l = this.getFirstChild();
        if (Se(l) || ve(l)) return l.select(0, 0);
      } else if (!(t !== void 0 && t !== a || n !== void 0 && n !== a)) {
        const l = this.getLastChild();
        if (Se(l) || ve(l)) return l.select();
      }
    }
    i === void 0 && (i = a), o === void 0 && (o = a);
    const s = this.__key;
    return we(r) ? (r.anchor.set(s, i, "element"), r.focus.set(s, o, "element"), r.dirty = !0, r) : O2(s, i, s, o, "element", "element");
  }
  selectStart() {
    const t = this.getFirstDescendant();
    return t ? t.selectStart() : this.select();
  }
  selectEnd() {
    const t = this.getLastDescendant();
    return t ? t.selectEnd() : this.select();
  }
  clear() {
    const t = this.getWritable();
    return this.getChildren().forEach((n) => n.remove()), t;
  }
  append(...t) {
    return this.splice(this.getChildrenSize(), 0, t);
  }
  setDirection(t) {
    const n = this.getWritable();
    return n.__dir = t, n;
  }
  setFormat(t) {
    return this.getWritable().__format = t !== "" ? mC[t] : 0, this;
  }
  setStyle(t) {
    return this.getWritable().__style = t || "", this;
  }
  setIndent(t) {
    return this.getWritable().__indent = t, this;
  }
  splice(t, n, r) {
    const i = r.length, o = this.getChildrenSize(), a = this.getWritable(), s = a.__key, l = [], c = [], f = this.getChildAtIndex(t + n);
    let d = null, p = o - n + i;
    if (t !== 0) if (t === o) d = this.getLastChild();
    else {
      const y = this.getChildAtIndex(t);
      y !== null && (d = y.getPreviousSibling());
    }
    if (n > 0) {
      let y = d === null ? this.getFirstChild() : d.getNextSibling();
      for (let g = 0; g < n; g++) {
        y === null && _e(100);
        const v = y.getNextSibling(), x = y.__key;
        Ms(y.getWritable()), c.push(x), y = v;
      }
    }
    let m = d;
    for (let y = 0; y < i; y++) {
      const g = r[y];
      m !== null && g.is(m) && (d = m = m.getPreviousSibling());
      const v = g.getWritable();
      v.__parent === s && p--, Ms(v);
      const x = g.__key;
      if (m === null) a.__first = x, v.__prev = null;
      else {
        const w = m.getWritable();
        w.__next = x, v.__prev = w.__key;
      }
      g.__key === s && _e(76), v.__parent = s, l.push(x), m = g;
    }
    if (t + n === o)
      m !== null && (m.getWritable().__next = null, a.__last = m.__key);
    else if (f !== null) {
      const y = f.getWritable();
      if (m !== null) {
        const g = m.getWritable();
        y.__prev = m.__key, g.__next = f.__key;
      } else y.__prev = null;
    }
    if (a.__size = p, c.length) {
      const y = Ne();
      if (we(y)) {
        const g = new Set(c), v = new Set(l), { anchor: x, focus: w } = y;
        XC(x, g, v) && Up(x, x.getNode(), this, d, f), XC(w, g, v) && Up(w, w.getNode(), this, d, f), p !== 0 || this.canBeEmpty() || gd(this) || this.remove();
      }
    }
    return a;
  }
  exportJSON() {
    return { children: [], direction: this.getDirection(), format: this.getFormatType(), indent: this.getIndent(), type: "element", version: 1 };
  }
  insertNewAfter(t, n) {
    return null;
  }
  canIndent() {
    return !0;
  }
  collapseAtStart(t) {
    return !1;
  }
  excludeFromCopy(t) {
    return !1;
  }
  canReplaceWith(t) {
    return !0;
  }
  canInsertAfter(t) {
    return !0;
  }
  canBeEmpty() {
    return !0;
  }
  canInsertTextBefore() {
    return !0;
  }
  canInsertTextAfter() {
    return !0;
  }
  isInline() {
    return !1;
  }
  isShadowRoot() {
    return !1;
  }
  canMergeWith(t) {
    return !1;
  }
  extractWithChild(t, n, r) {
    return !1;
  }
  canMergeWhenEmpty() {
    return !1;
  }
}
function ve(e) {
  return e instanceof Lg;
}
function XC(e, t, n) {
  let r = e.getNode();
  for (; r; ) {
    const i = r.__key;
    if (t.has(i) && !n.has(i)) return !0;
    r = r.getParent();
  }
  return !1;
}
class k2 extends Ig {
  constructor(t) {
    super(t);
  }
  decorate(t, n) {
    _e(47);
  }
  isIsolated() {
    return !1;
  }
  isInline() {
    return !0;
  }
  isKeyboardSelectable() {
    return !0;
  }
}
function Ht(e) {
  return e instanceof k2;
}
class xd extends Lg {
  static getType() {
    return "root";
  }
  static clone() {
    return new xd();
  }
  constructor() {
    super("root"), this.__cachedText = null;
  }
  getTopLevelElementOrThrow() {
    _e(51);
  }
  getTextContent() {
    const t = this.__cachedText;
    return !bd() && mn()._dirtyType !== Ls || t === null ? super.getTextContent() : t;
  }
  remove() {
    _e(52);
  }
  replace(t) {
    _e(53);
  }
  insertBefore(t) {
    _e(54);
  }
  insertAfter(t) {
    _e(55);
  }
  updateDOM(t, n) {
    return !1;
  }
  append(...t) {
    for (let n = 0; n < t.length; n++) {
      const r = t[n];
      ve(r) || Ht(r) || _e(56);
    }
    return super.append(...t);
  }
  static importJSON(t) {
    const n = ir();
    return n.setFormat(t.format), n.setIndent(t.indent), n.setDirection(t.direction), n;
  }
  exportJSON() {
    return { children: [], direction: this.getDirection(), format: this.getFormatType(), indent: this.getIndent(), type: "root", version: 1 };
  }
  collapseAtStart() {
    return !0;
  }
}
function ur(e) {
  return e instanceof xd;
}
function __() {
  return new Bg(/* @__PURE__ */ new Map([["root", new xd()]]));
}
function M2(e) {
  const t = e.exportJSON(), n = e.constructor;
  if (t.type !== n.getType() && _e(130, n.name), ve(e)) {
    const r = t.children;
    Array.isArray(r) || _e(59, n.name);
    const i = e.getChildren();
    for (let o = 0; o < i.length; o++) {
      const a = M2(i[o]);
      r.push(a);
    }
  }
  return t;
}
class Bg {
  constructor(t, n) {
    this._nodeMap = t, this._selection = n || null, this._flushSync = !1, this._readOnly = !1;
  }
  isEmpty() {
    return this._nodeMap.size === 1 && this._selection === null;
  }
  read(t, n) {
    return YC(n && n.editor || null, this, t);
  }
  clone(t) {
    const n = new Bg(this._nodeMap, t === void 0 ? this._selection : t);
    return n._readOnly = !0, n;
  }
  toJSON() {
    return YC(null, this, () => ({ root: M2(ir()) }));
  }
}
class SJ extends Lg {
  static getType() {
    return "artificial";
  }
  createDOM(t) {
    return document.createElement("div");
  }
}
class Lc extends Lg {
  constructor(t) {
    super(t), this.__textFormat = 0, this.__textStyle = "";
  }
  static getType() {
    return "paragraph";
  }
  getTextFormat() {
    return this.getLatest().__textFormat;
  }
  setTextFormat(t) {
    const n = this.getWritable();
    return n.__textFormat = t, n;
  }
  hasTextFormat(t) {
    const n = Io[t];
    return !!(this.getTextFormat() & n);
  }
  getTextStyle() {
    return this.getLatest().__textStyle;
  }
  setTextStyle(t) {
    const n = this.getWritable();
    return n.__textStyle = t, n;
  }
  static clone(t) {
    return new Lc(t.__key);
  }
  afterCloneFrom(t) {
    super.afterCloneFrom(t), this.__textFormat = t.__textFormat, this.__textStyle = t.__textStyle;
  }
  createDOM(t) {
    const n = document.createElement("p"), r = qu(t.theme, "paragraph");
    return r !== void 0 && n.classList.add(...r), n;
  }
  updateDOM(t, n, r) {
    return !1;
  }
  static importDOM() {
    return { p: (t) => ({ conversion: OJ, priority: 0 }) };
  }
  exportDOM(t) {
    const { element: n } = super.exportDOM(t);
    if (n && v_(n)) {
      this.isEmpty() && n.append(document.createElement("br"));
      const r = this.getFormatType();
      n.style.textAlign = r;
      const i = this.getDirection();
      i && (n.dir = i);
      const o = this.getIndent();
      o > 0 && (n.style.textIndent = 20 * o + "px");
    }
    return { element: n };
  }
  static importJSON(t) {
    const n = Ro();
    return n.setFormat(t.format), n.setIndent(t.indent), n.setDirection(t.direction), n.setTextFormat(t.textFormat), n;
  }
  exportJSON() {
    return { ...super.exportJSON(), textFormat: this.getTextFormat(), textStyle: this.getTextStyle(), type: "paragraph", version: 1 };
  }
  insertNewAfter(t, n) {
    const r = Ro();
    r.setTextFormat(t.format), r.setTextStyle(t.style);
    const i = this.getDirection();
    return r.setDirection(i), r.setFormat(this.getFormatType()), r.setStyle(this.getTextStyle()), this.insertAfter(r, n), r;
  }
  collapseAtStart() {
    const t = this.getChildren();
    if (t.length === 0 || Se(t[0]) && t[0].getTextContent().trim() === "") {
      if (this.getNextSibling() !== null) return this.selectNext(), this.remove(), !0;
      if (this.getPreviousSibling() !== null) return this.selectPrevious(), this.remove(), !0;
    }
    return !1;
  }
}
function OJ(e) {
  const t = Ro();
  if (e.style) {
    t.setFormat(e.style.textAlign);
    const n = parseInt(e.style.textIndent, 10) / 20;
    n > 0 && t.setIndent(n);
  }
  return { node: t };
}
function Ro() {
  return $g(new Lc());
}
function ix(e) {
  return e instanceof Lc;
}
const nn = 0, rc = 1;
function N2(e, t, n, r) {
  const i = e._keyToDOMMap;
  i.clear(), e._editorState = __(), e._pendingEditorState = r, e._compositionKey = null, e._dirtyType = Ls, e._cloneNotNeeded.clear(), e._dirtyLeaves = /* @__PURE__ */ new Set(), e._dirtyElements.clear(), e._normalizedNodes = /* @__PURE__ */ new Set(), e._updateTags = /* @__PURE__ */ new Set(), e._updates = [], e._blockCursorElement = null;
  const o = e._observer;
  o !== null && (o.disconnect(), e._observer = null), t !== null && (t.textContent = ""), n !== null && (n.textContent = "", i.set("root", n));
}
function AJ(e) {
  const t = e || {}, n = _J(), r = t.theme || {}, i = e === void 0 ? n : t.parentEditor || null, o = t.disableEvents || !1, a = __(), s = t.namespace || (i !== null ? i._config.namespace : e2()), l = t.editorState, c = [xd, jc, yd, vd, Lc, SJ, ...t.nodes || []], { onError: f, html: d } = t, p = t.editable === void 0 || t.editable;
  let m;
  if (e === void 0 && n !== null) m = n._nodes;
  else {
    m = /* @__PURE__ */ new Map();
    for (let g = 0; g < c.length; g++) {
      let v = c[g], x = null, w = null;
      if (typeof v != "function") {
        const O = v;
        v = O.replace, x = O.with, w = O.withKlass || null;
      }
      const S = v.getType(), A = v.transform(), _ = /* @__PURE__ */ new Set();
      A !== null && _.add(A), m.set(S, { exportDOM: d && d.export ? d.export.get(v) : void 0, klass: v, replace: x, replaceWithKlass: w, transforms: _ });
    }
  }
  const y = new Fg(a, i, m, { disableEvents: o, namespace: s, theme: r }, f || console.error, function(g, v) {
    const x = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Set(), S = (A) => {
      Object.keys(A).forEach((_) => {
        let O = x.get(_);
        O === void 0 && (O = [], x.set(_, O)), O.push(A[_]);
      });
    };
    return g.forEach((A) => {
      const _ = A.klass.importDOM;
      if (_ == null || w.has(_)) return;
      w.add(_);
      const O = _.call(A.klass);
      O !== null && S(O);
    }), v && S(v), x;
  }(m, d ? d.import : void 0), p);
  return l !== void 0 && (y._pendingEditorState = l, y._dirtyType = nc), y;
}
class Fg {
  constructor(t, n, r, i, o, a, s) {
    this._parentEditor = n, this._rootElement = null, this._editorState = t, this._pendingEditorState = null, this._compositionKey = null, this._deferred = [], this._keyToDOMMap = /* @__PURE__ */ new Map(), this._updates = [], this._updating = !1, this._listeners = { decorator: /* @__PURE__ */ new Set(), editable: /* @__PURE__ */ new Set(), mutation: /* @__PURE__ */ new Map(), root: /* @__PURE__ */ new Set(), textcontent: /* @__PURE__ */ new Set(), update: /* @__PURE__ */ new Set() }, this._commands = /* @__PURE__ */ new Map(), this._config = i, this._nodes = r, this._decorators = {}, this._pendingDecorators = null, this._dirtyType = Ls, this._cloneNotNeeded = /* @__PURE__ */ new Set(), this._dirtyLeaves = /* @__PURE__ */ new Set(), this._dirtyElements = /* @__PURE__ */ new Map(), this._normalizedNodes = /* @__PURE__ */ new Set(), this._updateTags = /* @__PURE__ */ new Set(), this._observer = null, this._key = e2(), this._onError = o, this._htmlConversions = a, this._editable = s, this._headless = n !== null && n._headless, this._window = null, this._blockCursorElement = null;
  }
  isComposing() {
    return this._compositionKey != null;
  }
  registerUpdateListener(t) {
    const n = this._listeners.update;
    return n.add(t), () => {
      n.delete(t);
    };
  }
  registerEditableListener(t) {
    const n = this._listeners.editable;
    return n.add(t), () => {
      n.delete(t);
    };
  }
  registerDecoratorListener(t) {
    const n = this._listeners.decorator;
    return n.add(t), () => {
      n.delete(t);
    };
  }
  registerTextContentListener(t) {
    const n = this._listeners.textcontent;
    return n.add(t), () => {
      n.delete(t);
    };
  }
  registerRootListener(t) {
    const n = this._listeners.root;
    return t(this._rootElement, null), n.add(t), () => {
      t(null, this._rootElement), n.delete(t);
    };
  }
  registerCommand(t, n, r) {
    r === void 0 && _e(35);
    const i = this._commands;
    i.has(t) || i.set(t, [/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()]);
    const o = i.get(t);
    o === void 0 && _e(36, String(t));
    const a = o[r];
    return a.add(n), () => {
      a.delete(n), o.every((s) => s.size === 0) && i.delete(t);
    };
  }
  registerMutationListener(t, n, r) {
    const i = this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(t)).klass, o = this._listeners.mutation;
    o.set(n, i);
    const a = r && r.skipInitialization;
    return a === void 0 || a || this.initializeMutationListener(n, i), () => {
      o.delete(n);
    };
  }
  getRegisteredNode(t) {
    const n = this._nodes.get(t.getType());
    return n === void 0 && _e(37, t.name), n;
  }
  resolveRegisteredNodeAfterReplacements(t) {
    for (; t.replaceWithKlass; ) t = this.getRegisteredNode(t.replaceWithKlass);
    return t;
  }
  initializeMutationListener(t, n) {
    const r = this._editorState, i = sJ(r).get(n.getType());
    if (!i) return;
    const o = /* @__PURE__ */ new Map();
    for (const a of i.keys()) o.set(a, "created");
    o.size > 0 && t(o, { dirtyLeaves: /* @__PURE__ */ new Set(), prevEditorState: r, updateTags: /* @__PURE__ */ new Set(["registerMutationListener"]) });
  }
  registerNodeTransformToKlass(t, n) {
    const r = this.getRegisteredNode(t);
    return r.transforms.add(n), r;
  }
  registerNodeTransform(t, n) {
    const r = this.registerNodeTransformToKlass(t, n), i = [r], o = r.replaceWithKlass;
    if (o != null) {
      const l = this.registerNodeTransformToKlass(o, n);
      i.push(l);
    }
    var a, s;
    return a = this, s = t.getType(), Fr(a, () => {
      const l = qo();
      if (l.isEmpty()) return;
      if (s === "root") return void ir().markDirty();
      const c = l._nodeMap;
      for (const [, f] of c) f.markDirty();
    }, a._pendingEditorState === null ? { tag: "history-merge" } : void 0), () => {
      i.forEach((l) => l.transforms.delete(n));
    };
  }
  hasNode(t) {
    return this._nodes.has(t.getType());
  }
  hasNodes(t) {
    return t.every(this.hasNode.bind(this));
  }
  dispatchCommand(t, n) {
    return Ae(this, t, n);
  }
  getDecorators() {
    return this._decorators;
  }
  getRootElement() {
    return this._rootElement;
  }
  getKey() {
    return this._key;
  }
  setRootElement(t) {
    const n = this._rootElement;
    if (t !== n) {
      const r = qu(this._config.theme, "root"), i = this._pendingEditorState || this._editorState;
      if (this._rootElement = t, N2(this, n, t, i), n !== null && (this._config.disableEvents || fJ(n), r != null && n.classList.remove(...r)), t !== null) {
        const o = function(s) {
          const l = s.ownerDocument;
          return l && l.defaultView || null;
        }(t), a = t.style;
        a.userSelect = "text", a.whiteSpace = "pre-wrap", a.wordBreak = "break-word", t.setAttribute("data-lexical-editor", "true"), this._window = o, this._dirtyType = nc, GR(this), this._updateTags.add("history-merge"), Aa(this), this._config.disableEvents || function(s, l) {
          const c = s.ownerDocument, f = zp.get(c);
          (f === void 0 || f < 1) && c.addEventListener("selectionchange", y2), zp.set(c, (f || 0) + 1), s.__lexicalEditor = l;
          const d = g2(s);
          for (let p = 0; p < Q0.length; p++) {
            const [m, y] = Q0[p], g = typeof y == "function" ? (v) => {
              $C(v) || (NC(v), (l.isEditable() || m === "click") && y(v, l));
            } : (v) => {
              if ($C(v)) return;
              NC(v);
              const x = l.isEditable();
              switch (m) {
                case "cut":
                  return x && Ae(l, t_, v);
                case "copy":
                  return Ae(l, e_, v);
                case "paste":
                  return x && Ae(l, Y1, v);
                case "dragstart":
                  return x && Ae(l, FR, v);
                case "dragover":
                  return x && Ae(l, OZ, v);
                case "dragend":
                  return x && Ae(l, AZ, v);
                case "focus":
                  return x && Ae(l, CZ, v);
                case "blur":
                  return x && Ae(l, EZ, v);
                case "drop":
                  return x && Ae(l, BR, v);
              }
            };
            s.addEventListener(m, g), d.push(() => {
              s.removeEventListener(m, g);
            });
          }
        }(t, this), r != null && t.classList.add(...r);
      } else this._editorState = i, this._pendingEditorState = null, this._window = null;
      Qu("root", this, !1, t, n);
    }
  }
  getElementByKey(t) {
    return this._keyToDOMMap.get(t) || null;
  }
  getEditorState() {
    return this._editorState;
  }
  setEditorState(t, n) {
    t.isEmpty() && _e(38), KR(this);
    const r = this._pendingEditorState, i = this._updateTags, o = n !== void 0 ? n.tag : null;
    r === null || r.isEmpty() || (o != null && i.add(o), Aa(this)), this._pendingEditorState = t, this._dirtyType = nc, this._dirtyElements.set("root", !1), this._compositionKey = null, o != null && i.add(o), Aa(this);
  }
  parseEditorState(t, n) {
    return function(r, i, o) {
      const a = __(), s = Dn, l = Ar, c = In, f = i._dirtyElements, d = i._dirtyLeaves, p = i._cloneNotNeeded, m = i._dirtyType;
      i._dirtyElements = /* @__PURE__ */ new Map(), i._dirtyLeaves = /* @__PURE__ */ new Set(), i._cloneNotNeeded = /* @__PURE__ */ new Set(), i._dirtyType = 0, Dn = a, Ar = !1, In = i;
      try {
        const y = i._nodes;
        P2(r.root, y), o && o(), a._readOnly = !0;
      } catch (y) {
        y instanceof Error && i._onError(y);
      } finally {
        i._dirtyElements = f, i._dirtyLeaves = d, i._cloneNotNeeded = p, i._dirtyType = m, Dn = s, Ar = l, In = c;
      }
      return a;
    }(typeof t == "string" ? JSON.parse(t) : t, this, n);
  }
  read(t) {
    return Aa(this), this.getEditorState().read(t, { editor: this });
  }
  update(t, n) {
    Fr(this, t, n);
  }
  focus(t, n = {}) {
    const r = this._rootElement;
    r !== null && (r.setAttribute("autocapitalize", "off"), Fr(this, () => {
      const i = Ne(), o = ir();
      i !== null ? i.dirty = !0 : o.getChildrenSize() !== 0 && (n.defaultSelection === "rootStart" ? o.selectStart() : o.selectEnd());
    }, { onUpdate: () => {
      r.removeAttribute("autocapitalize"), t && t();
    }, tag: "focus" }), this._pendingEditorState === null && r.removeAttribute("autocapitalize"));
  }
  blur() {
    const t = this._rootElement;
    t !== null && t.blur();
    const n = no(this._window);
    n !== null && n.removeAllRanges();
  }
  isEditable() {
    return this._editable;
  }
  setEditable(t) {
    this._editable !== t && (this._editable = t, Qu("editable", this, !0, t));
  }
  toJSON() {
    return { editorState: this._editorState.toJSON() };
  }
}
Fg.version = "0.17.1+prod.esm";
const $2 = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, TJ = $2 ? react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_1__.useEffect, Fh = { tag: "history-merge" };
function PJ({ initialConfig: e, children: t }) {
  const n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    const { theme: r, namespace: i, nodes: o, onError: a, editorState: s, html: l } = e, c = yZ(null, r), f = AJ({ editable: e.editable, html: l, namespace: i, nodes: o, onError: (d) => a(d, f), theme: r });
    return function(d, p) {
      if (p !== null) {
        if (p === void 0) d.update(() => {
          const m = ir();
          if (m.isEmpty()) {
            const y = Ro();
            m.append(y);
            const g = $2 ? document.activeElement : null;
            (Ne() !== null || g !== null && g === d.getRootElement()) && y.select();
          }
        }, Fh);
        else if (p !== null) switch (typeof p) {
          case "string": {
            const m = d.parseEditorState(p);
            d.setEditorState(m, Fh);
            break;
          }
          case "object":
            d.setEditorState(p, Fh);
            break;
          case "function":
            d.update(() => {
              ir().isEmpty() && p(d);
            }, Fh);
        }
      }
    }(f, s), [f, c];
  }, []);
  return TJ(() => {
    const r = e.editable, [i] = n;
    i.setEditable(r === void 0 || r);
  }, []), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NR.Provider, { value: n, children: t });
}
const CJ = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_1__.useEffect;
function EJ(e) {
  return { initialValueFn: () => e.isEditable(), subscribe: (t) => e.registerEditableListener(t) };
}
function kJ() {
  return function(e) {
    const [t] = Gr(), n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => e(t), [t, e]), r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(n.initialValueFn()), [i, o] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(r.current);
    return CJ(() => {
      const { initialValueFn: a, subscribe: s } = n, l = a();
      return r.current !== l && (r.current = l, o(l)), s((c) => {
        r.current = c, o(c);
      });
    }, [n, e]), i;
  }(EJ);
}
function MJ() {
  return ir().getTextContent();
}
function NJ(e, t = !0) {
  if (e) return !1;
  let n = MJ();
  return t && (n = n.trim()), n === "";
}
function $J(e) {
  if (!NJ(e, !1)) return !1;
  const t = ir().getChildren(), n = t.length;
  if (n > 1) return !1;
  for (let r = 0; r < n; r++) {
    const i = t[r];
    if (Ht(i)) return !1;
    if (ve(i)) {
      if (!ix(i) || i.__indent !== 0) return !1;
      const o = i.getChildren(), a = o.length;
      for (let s = 0; s < a; s++) {
        const l = o[r];
        if (!Se(l)) return !1;
      }
    }
  }
  return !0;
}
function D2(e) {
  return () => $J(e);
}
function DJ(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
DJ(function(e) {
  const t = new URLSearchParams();
  t.append("code", e);
  for (let n = 1; n < arguments.length; n++) t.append("v", arguments[n]);
  throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
});
function IJ(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
IJ(function(e) {
  const t = new URLSearchParams();
  t.append("code", e);
  for (let n = 1; n < arguments.length; n++) t.append("v", arguments[n]);
  throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
});
function RJ(e, t) {
  const n = e.getStartEndPoints();
  if (t.isSelected(e) && !t.isSegmented() && !t.isToken() && n !== null) {
    const [r, i] = n, o = e.isBackward(), a = r.getNode(), s = i.getNode(), l = t.is(a), c = t.is(s);
    if (l || c) {
      const [f, d] = rx(e), p = a.is(s), m = t.is(o ? s : a), y = t.is(o ? a : s);
      let g, v = 0;
      return p ? (v = f > d ? d : f, g = f > d ? f : d) : m ? (v = o ? d : f, g = void 0) : y && (v = 0, g = o ? f : d), t.__text = t.__text.slice(v, g), t;
    }
  }
  return t;
}
function ZC(e, t) {
  const n = U0(e.focus, t);
  return Ht(n) && !n.isIsolated() || ve(n) && !n.isInline() && !n.canBeEmpty();
}
function jJ(e, t, n, r) {
  e.modify(t ? "extend" : "move", n, r);
}
function LJ(e) {
  const t = e.anchor.getNode();
  return (ur(t) ? t : t.getParentOrThrow()).getDirection() === "rtl";
}
function JC(e, t, n) {
  const r = LJ(e);
  jJ(e, t, n ? !r : r, "character");
}
function BJ(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
BJ(function(e) {
  const t = new URLSearchParams();
  t.append("code", e);
  for (let n = 1; n < arguments.length; n++) t.append("v", arguments[n]);
  throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
});
const I2 = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, FJ = I2 && "documentMode" in document ? document.documentMode : null;
!(!I2 || !("InputEvent" in window) || FJ) && "getTargetRanges" in new window.InputEvent("input");
function Uo(...e) {
  return () => {
    for (let t = e.length - 1; t >= 0; t--) e[t]();
    e.length = 0;
  };
}
function WJ(e, t) {
  return e !== null && Object.getPrototypeOf(e).constructor.name === t.name;
}
function zJ(e) {
  const t = window.location.origin, n = (r) => {
    if (r.origin !== t) return;
    const i = e.getRootElement();
    if (document.activeElement !== i) return;
    const o = r.data;
    if (typeof o == "string") {
      let a;
      try {
        a = JSON.parse(o);
      } catch {
        return;
      }
      if (a && a.protocol === "nuanria_messaging" && a.type === "request") {
        const s = a.payload;
        if (s && s.functionId === "makeChanges") {
          const l = s.args;
          if (l) {
            const [c, f, d, p, m, y] = l;
            e.update(() => {
              const g = Ne();
              if (we(g)) {
                const v = g.anchor;
                let x = v.getNode(), w = 0, S = 0;
                if (Se(x) && c >= 0 && f >= 0 && (w = c, S = c + f, g.setTextNodeRange(x, w, x, S)), w === S && d === "" || (g.insertRawText(d), x = v.getNode()), Se(x)) {
                  w = p, S = p + m;
                  const A = x.getTextContentSize();
                  w = w > A ? A : w, S = S > A ? A : S, g.setTextNodeRange(x, w, x, S);
                }
                r.stopImmediatePropagation();
              }
            });
          }
        }
      }
    }
  };
  return window.addEventListener("message", n, !0), () => {
    window.removeEventListener("message", n, !0);
  };
}
function VJ(e, t) {
  if (typeof document > "u" || typeof window > "u" && global.window === void 0) throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");
  const n = document.createElement("div"), r = ir().getChildren();
  for (let i = 0; i < r.length; i++)
    R2(e, r[i], n, t);
  return n.innerHTML;
}
function R2(e, t, n, r = null) {
  let i = r === null || t.isSelected(r);
  const o = ve(t) && t.excludeFromCopy("html");
  let a = t;
  if (r !== null) {
    let m = r2(t);
    m = Se(m) && r !== null ? RJ(r, m) : m, a = m;
  }
  const s = ve(a) ? a.getChildren() : [], l = e._nodes.get(a.getType());
  let c;
  c = l && l.exportDOM !== void 0 ? l.exportDOM(e, a) : a.exportDOM(e);
  const { element: f, after: d } = c;
  if (!f) return !1;
  const p = document.createDocumentFragment();
  for (let m = 0; m < s.length; m++) {
    const y = s[m], g = R2(e, y, p, r);
    !i && ve(t) && g && t.extractWithChild(y, r, "html") && (i = !0);
  }
  if (i && !o) {
    if (v_(f) && f.append(p), n.append(f), d) {
      const m = d.call(a, f);
      m && f.replaceWith(m);
    }
  } else n.append(p);
  return i;
}
function UJ(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var HJ = UJ(function(e) {
  const t = new URLSearchParams();
  t.append("code", e);
  for (let n = 1; n < arguments.length; n++) t.append("v", arguments[n]);
  throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
});
function KJ(e, t = Ne()) {
  return t == null && HJ(166), we(t) && t.isCollapsed() || t.getNodes().length === 0 ? "" : VJ(e, t);
}
function QC(e, t) {
  const n = e.getData("text/plain") || e.getData("text/uri-list");
  n != null && t.insertRawText(n);
}
const Bc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, GJ = Bc && "documentMode" in document ? document.documentMode : null, YJ = !(!Bc || !("InputEvent" in window) || GJ) && "getTargetRanges" in new window.InputEvent("input"), qJ = Bc && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), XJ = Bc && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, ZJ = Bc && /^(?=.*Chrome).*/i.test(navigator.userAgent), JJ = Bc && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !ZJ;
function eE(e, t) {
  t.update(() => {
    if (e !== null) {
      const n = WJ(e, KeyboardEvent) ? null : e.clipboardData, r = Ne();
      if (r !== null && n != null) {
        e.preventDefault();
        const i = KJ(t);
        i !== null && n.setData("text/html", i), n.setData("text/plain", r.getTextContent());
      }
    }
  });
}
function QJ(e) {
  return Uo(e.registerCommand(ks, (t) => {
    const n = Ne();
    return !!we(n) && (n.deleteCharacter(t), !0);
  }, nn), e.registerCommand(bf, (t) => {
    const n = Ne();
    return !!we(n) && (n.deleteWord(t), !0);
  }, nn), e.registerCommand(xf, (t) => {
    const n = Ne();
    return !!we(n) && (n.deleteLine(t), !0);
  }, nn), e.registerCommand(Kl, (t) => {
    const n = Ne();
    if (!we(n)) return !1;
    if (typeof t == "string") n.insertText(t);
    else {
      const r = t.dataTransfer;
      if (r != null) QC(r, n);
      else {
        const i = t.data;
        i && n.insertText(i);
      }
    }
    return !0;
  }, nn), e.registerCommand(F0, () => {
    const t = Ne();
    return !!we(t) && (t.removeText(), !0);
  }, nn), e.registerCommand(Hl, (t) => {
    const n = Ne();
    return !!we(n) && (n.insertLineBreak(t), !0);
  }, nn), e.registerCommand(B0, () => {
    const t = Ne();
    return !!we(t) && (t.insertLineBreak(), !0);
  }, nn), e.registerCommand(J1, (t) => {
    const n = Ne();
    if (!we(n)) return !1;
    const r = t, i = r.shiftKey;
    return !!ZC(n, !0) && (r.preventDefault(), JC(n, i, !0), !0);
  }, nn), e.registerCommand(Z1, (t) => {
    const n = Ne();
    if (!we(n)) return !1;
    const r = t, i = r.shiftKey;
    return !!ZC(n, !1) && (r.preventDefault(), JC(n, i, !1), !0);
  }, nn), e.registerCommand(Q1, (t) => {
    const n = Ne();
    return !!we(n) && (t.preventDefault(), e.dispatchCommand(ks, !0));
  }, nn), e.registerCommand(jR, (t) => {
    const n = Ne();
    return !!we(n) && (t.preventDefault(), e.dispatchCommand(ks, !1));
  }, nn), e.registerCommand(wf, (t) => {
    const n = Ne();
    if (!we(n)) return !1;
    if (t !== null) {
      if ((XJ || qJ || JJ) && YJ) return !1;
      t.preventDefault();
    }
    return e.dispatchCommand(Hl, !1);
  }, nn), e.registerCommand(W0, () => (nJ(), !0), nn), e.registerCommand(e_, (t) => {
    const n = Ne();
    return !!we(n) && (eE(t, e), !0);
  }, nn), e.registerCommand(t_, (t) => {
    const n = Ne();
    return !!we(n) && (function(r, i) {
      eE(r, i), i.update(() => {
        const o = Ne();
        we(o) && o.removeText();
      });
    }(t, e), !0);
  }, nn), e.registerCommand(Y1, (t) => {
    const n = Ne();
    return !!we(n) && (function(r, i) {
      r.preventDefault(), i.update(() => {
        const o = Ne(), { clipboardData: a } = r;
        a != null && we(o) && QC(a, o);
      }, { tag: "paste" });
    }(t, e), !0);
  }, nn), e.registerCommand(BR, (t) => {
    const n = Ne();
    return !!we(n) && (t.preventDefault(), !0);
  }, nn), e.registerCommand(FR, (t) => {
    const n = Ne();
    return !!we(n) && (t.preventDefault(), !0);
  }, nn));
}
const ox = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_1__.useEffect;
function tE(e) {
  return e.getEditorState().read(D2(e.isComposing()));
}
function eQ({ contentEditable: e, placeholder: t = null, ErrorBoundary: n }) {
  const [r] = Gr(), i = function(o, a) {
    const [s, l] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => o.getDecorators());
    return ox(() => o.registerDecoratorListener((c) => {
      (0,react_dom__WEBPACK_IMPORTED_MODULE_2__.flushSync)(() => {
        l(c);
      });
    }), [o]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
      l(o.getDecorators());
    }, [o]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
      const c = [], f = Object.keys(s);
      for (let d = 0; d < f.length; d++) {
        const p = f[d], m = (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(a, { onError: (g) => o._onError(g), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Suspense, { fallback: null, children: s[p] }) }), y = o.getElementByKey(p);
        y !== null && c.push((0,react_dom__WEBPACK_IMPORTED_MODULE_2__.createPortal)(m, y, p));
      }
      return c;
    }, [a, s, o]);
  }(r, n);
  return function(o) {
    ox(() => Uo(QJ(o), zJ(o)), [o]);
  }(r), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [e, (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(tQ, { content: t }), i] });
}
function tQ({ content: e }) {
  const [t] = Gr(), n = function(i) {
    const [o, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => tE(i));
    return ox(() => {
      function s() {
        const l = tE(i);
        a(l);
      }
      return s(), Uo(i.registerUpdateListener(() => {
        s();
      }), i.registerEditableListener(() => {
        s();
      }));
    }, [i]), o;
  }(t), r = kJ();
  return n ? typeof e == "function" ? e(r) : e : null;
}
const j2 = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_1__.useEffect;
function nQ({ editor: e, ariaActiveDescendant: t, ariaAutoComplete: n, ariaControls: r, ariaDescribedBy: i, ariaExpanded: o, ariaLabel: a, ariaLabelledBy: s, ariaMultiline: l, ariaOwns: c, ariaRequired: f, autoCapitalize: d, className: p, id: m, role: y = "textbox", spellCheck: g = !0, style: v, tabIndex: x, "data-testid": w, ...S }, A) {
  const [_, O] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(e.isEditable()), P = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((k) => {
    k && k.ownerDocument && k.ownerDocument.defaultView ? e.setRootElement(k) : e.setRootElement(null);
  }, [e]), C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => /* @__PURE__ */ function(...k) {
    return (I) => {
      k.forEach(($) => {
        typeof $ == "function" ? $(I) : $ != null && ($.current = I);
      });
    };
  }(A, P), [P, A]);
  return j2(() => (O(e.isEditable()), e.registerEditableListener((k) => {
    O(k);
  })), [e]), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { ...S, "aria-activedescendant": _ ? t : void 0, "aria-autocomplete": _ ? n : "none", "aria-controls": _ ? r : void 0, "aria-describedby": i, "aria-expanded": _ && y === "combobox" ? !!o : void 0, "aria-label": a, "aria-labelledby": s, "aria-multiline": l, "aria-owns": _ ? c : void 0, "aria-readonly": !_ || void 0, "aria-required": f, autoCapitalize: d, className: p, contentEditable: _, "data-testid": w, id: m, ref: C, role: _ ? y : void 0, spellCheck: g, style: v, tabIndex: x });
}
const rQ = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(nQ);
function nE(e) {
  return e.getEditorState().read(D2(e.isComposing()));
}
const iQ = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(oQ);
function oQ(e, t) {
  const { placeholder: n, ...r } = e, [i] = Gr();
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(rQ, { editor: i, ...r, ref: t }), n != null && (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(aQ, { editor: i, content: n })] });
}
function aQ({ content: e, editor: t }) {
  const n = function(a) {
    const [s, l] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => nE(a));
    return j2(() => {
      function c() {
        const f = nE(a);
        l(f);
      }
      return c(), Uo(a.registerUpdateListener(() => {
        c();
      }), a.registerEditableListener(() => {
        c();
      }));
    }, [a]), s;
  }(t), [r, i] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(t.isEditable());
  if ((0,react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect)(() => (i(t.isEditable()), t.registerEditableListener((a) => {
    i(a);
  })), [t]), !n) return null;
  let o = null;
  return typeof e == "function" ? o = e(r) : e !== null && (o = e), o === null ? null : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { "aria-hidden": !0, children: o });
}
const Wh = 0, ax = 1, sx = 2, Oi = 0, sQ = 1, rE = 2, lQ = 3, cQ = 4;
function uQ(e, t, n, r, i) {
  if (e === null || n.size === 0 && r.size === 0 && !i) return Oi;
  const o = t._selection, a = e._selection;
  if (i) return sQ;
  if (!(we(o) && we(a) && a.isCollapsed() && o.isCollapsed())) return Oi;
  const s = function(x, w, S) {
    const A = x._nodeMap, _ = [];
    for (const O of w) {
      const P = A.get(O);
      P !== void 0 && _.push(P);
    }
    for (const [O, P] of S) {
      if (!P) continue;
      const C = A.get(O);
      C === void 0 || ur(C) || _.push(C);
    }
    return _;
  }(t, n, r);
  if (s.length === 0) return Oi;
  if (s.length > 1) {
    const x = t._nodeMap, w = x.get(o.anchor.key), S = x.get(a.anchor.key);
    return w && S && !e._nodeMap.has(w.__key) && Se(w) && w.__text.length === 1 && o.anchor.offset === 1 ? rE : Oi;
  }
  const l = s[0], c = e._nodeMap.get(l.__key);
  if (!Se(c) || !Se(l) || c.__mode !== l.__mode) return Oi;
  const f = c.__text, d = l.__text;
  if (f === d) return Oi;
  const p = o.anchor, m = a.anchor;
  if (p.key !== m.key || p.type !== "text") return Oi;
  const y = p.offset, g = m.offset, v = d.length - f.length;
  return v === 1 && g === y - 1 ? rE : v === -1 && g === y + 1 ? lQ : v === -1 && g === y ? cQ : Oi;
}
function fQ(e, t) {
  let n = Date.now(), r = Oi;
  return (i, o, a, s, l, c) => {
    const f = Date.now();
    if (c.has("historic")) return r = Oi, n = f, sx;
    const d = uQ(i, o, s, l, e.isComposing()), p = (() => {
      const m = a === null || a.editor === e, y = c.has("history-push");
      if (!y && m && c.has("history-merge")) return Wh;
      if (i === null) return ax;
      const g = o._selection;
      return s.size > 0 || l.size > 0 ? y === !1 && d !== Oi && d === r && f < n + t && m || s.size === 1 && function(v, x, w) {
        const S = x._nodeMap.get(v), A = w._nodeMap.get(v), _ = x._selection, O = w._selection;
        return !(we(_) && we(O) && _.anchor.type === "element" && _.focus.type === "element" && O.anchor.type === "text" && O.focus.type === "text" || !Se(S) || !Se(A) || S.__parent !== A.__parent) && JSON.stringify(x.read(() => S.exportJSON())) === JSON.stringify(w.read(() => A.exportJSON()));
      }(Array.from(s)[0], i, o) ? Wh : ax : g !== null ? Wh : sx;
    })();
    return n = f, r = d, p;
  };
}
function iE(e) {
  e.undoStack = [], e.redoStack = [], e.current = null;
}
function dQ(e, t, n) {
  const r = fQ(e, n);
  return Uo(e.registerCommand(q1, () => (function(o, a) {
    const s = a.redoStack, l = a.undoStack;
    if (l.length !== 0) {
      const c = a.current, f = l.pop();
      c !== null && (s.push(c), o.dispatchCommand(Rh, !0)), l.length === 0 && o.dispatchCommand(jh, !1), a.current = f || null, f && f.editor.setEditorState(f.editorState, { tag: "historic" });
    }
  }(e, t), !0), nn), e.registerCommand(X1, () => (function(o, a) {
    const s = a.redoStack, l = a.undoStack;
    if (s.length !== 0) {
      const c = a.current;
      c !== null && (l.push(c), o.dispatchCommand(jh, !0));
      const f = s.pop();
      s.length === 0 && o.dispatchCommand(Rh, !1), a.current = f || null, f && f.editor.setEditorState(f.editorState, { tag: "historic" });
    }
  }(e, t), !0), nn), e.registerCommand(TZ, () => (iE(t), !1), nn), e.registerCommand(PZ, () => (iE(t), e.dispatchCommand(Rh, !1), e.dispatchCommand(jh, !1), !0), nn), e.registerUpdateListener(({ editorState: o, prevEditorState: a, dirtyLeaves: s, dirtyElements: l, tags: c }) => {
    const f = t.current, d = t.redoStack, p = t.undoStack, m = f === null ? null : f.editorState;
    if (f !== null && o === m) return;
    const y = r(a, o, f, s, l, c);
    if (y === ax) d.length !== 0 && (t.redoStack = [], e.dispatchCommand(Rh, !1)), f !== null && (p.push({ ...f }), e.dispatchCommand(jh, !0));
    else if (y === sx) return;
    t.current = { editor: e, editorState: o };
  }));
}
function hQ() {
  return { current: null, redoStack: [], undoStack: [] };
}
function pQ({ delay: e, externalHistoryState: t }) {
  const [n] = Gr();
  return function(r, i, o = 1e3) {
    const a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => i || hQ(), [i]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => dQ(r, a, o), [o, r, a]);
  }(n, t, e), null;
}
function lx(e, t) {
  return lx = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
    return n.__proto__ = r, n;
  }, lx(e, t);
}
var oE = { error: null }, mQ = function(e) {
  var t, n;
  function r() {
    for (var o, a = arguments.length, s = new Array(a), l = 0; l < a; l++) s[l] = arguments[l];
    return (o = e.call.apply(e, [this].concat(s)) || this).state = oE, o.resetErrorBoundary = function() {
      for (var c, f = arguments.length, d = new Array(f), p = 0; p < f; p++) d[p] = arguments[p];
      o.props.onReset == null || (c = o.props).onReset.apply(c, d), o.reset();
    }, o;
  }
  n = e, (t = r).prototype = Object.create(n.prototype), t.prototype.constructor = t, lx(t, n), r.getDerivedStateFromError = function(o) {
    return { error: o };
  };
  var i = r.prototype;
  return i.reset = function() {
    this.setState(oE);
  }, i.componentDidCatch = function(o, a) {
    var s, l;
    (s = (l = this.props).onError) == null || s.call(l, o, a);
  }, i.componentDidUpdate = function(o, a) {
    var s, l, c, f, d = this.state.error, p = this.props.resetKeys;
    d !== null && a.error !== null && ((c = o.resetKeys) === void 0 && (c = []), (f = p) === void 0 && (f = []), c.length !== f.length || c.some(function(m, y) {
      return !Object.is(m, f[y]);
    })) && ((s = (l = this.props).onResetKeysChange) == null || s.call(l, o.resetKeys, p), this.reset());
  }, i.render = function() {
    var o = this.state.error, a = this.props, s = a.fallbackRender, l = a.FallbackComponent, c = a.fallback;
    if (o !== null) {
      var f = { error: o, resetErrorBoundary: this.resetErrorBoundary };
      if (react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(c)) return c;
      if (typeof s == "function") return s(f);
      if (l) return react__WEBPACK_IMPORTED_MODULE_1__.createElement(l, f);
      throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
    }
    return this.props.children;
  }, r;
}(react__WEBPACK_IMPORTED_MODULE_1__.Component);
function gQ({ children: e, onError: t }) {
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(mQ, { fallback: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: t, children: e });
}
const yQ = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_1__.useEffect;
function vQ({ ignoreHistoryMergeTagChange: e = !0, ignoreSelectionChange: t = !1, onChange: n }) {
  const [r] = Gr();
  return yQ(() => {
    if (n) return r.registerUpdateListener(({ editorState: i, dirtyElements: o, dirtyLeaves: a, prevEditorState: s, tags: l }) => {
      t && o.size === 0 && a.size === 0 || e && l.has("history-merge") || s.isEmpty() || n(i, r, l);
    });
  }, [r, e, t, n]), null;
}
function bQ({ editorRef: e }) {
  const [t] = Gr();
  return react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    typeof e == "function" ? e(t) : typeof e == "object" && (e.current = t);
  }, [t]), null;
}
const xQ = "w-full [&>p]:w-full [&>p]:m-0", wQ = "focus-within:ring-2 focus-within:ring-offset-2 hover:outline-border-strong hover:focus-within:outline-focus-border focus-within:outline-focus-border focus-within:ring-focus transition-[color,outline,box-shadow] duration-150 ease-in-out outline outline-1 outline-field-border", _Q = "bg-field-secondary-background outline-field-border-disabled hover:outline-field-border-disabled [&_p]:text-badge-color-disabled cursor-not-allowed", SQ = {
  sm: "px-3 py-1.5 rounded [&_.editor-content>p]:text-xs [&_.editor-content>p]:font-normal [&_.pointer-events-none]:text-xs [&_.pointer-events-none]:font-normal [&_.editor-content>p]:content-center [&_.editor-content>p]:min-h-5",
  md: "px-3.5 py-2 rounded-md [&_.editor-content>p]:text-sm [&_.editor-content>p]:font-normal [&_.pointer-events-none]:text-sm [&_.pointer-events-none]:font-normal [&_.editor-content>p]:content-center [&_.editor-content>p]:min-h-6",
  lg: "px-4 py-2.5 rounded-md [&_.editor-content>p]:text-base [&_.editor-content>p]:font-normal [&_.pointer-events-none]:text-base [&_.pointer-events-none]:font-normal [&_.editor-content>p]:content-center [&_.editor-content>p]:min-h-7"
}, OQ = "absolute inset-x-0 top-full mt-2 mx-0 mb-0 w-full h-auto overflow-y-auto overflow-x-hidden z-10 bg-background-primary border border-solid border-border-subtle shadow-lg", AQ = {
  sm: "p-1.5 rounded-md max-h-[10.75rem]",
  md: "p-2 rounded-lg max-h-[13.5rem]",
  lg: "p-2 rounded-lg max-h-[13.5rem]"
}, TQ = "m-0 text-text-primary cursor-pointer", PQ = {
  sm: "p-1.5 rounded text-xs leading-5 font-normal",
  md: "p-2 rounded-md text-sm leading-6 font-normal",
  lg: "p-2 rounded-md text-base leading-6 font-normal"
}, CQ = "bg-button-tertiary-hover", aE = "startTransition", EQ = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? react__WEBPACK_IMPORTED_MODULE_1__.useLayoutEffect : react__WEBPACK_IMPORTED_MODULE_1__.useEffect, sE = (e) => {
  const t = document.getElementById("typeahead-menu");
  if (!t) return;
  const n = t.getBoundingClientRect();
  n.top + n.height > window.innerHeight && t.scrollIntoView({ block: "center" }), n.top < 0 && t.scrollIntoView({ block: "center" }), e.scrollIntoView({ block: "nearest" });
};
function lE(e, t) {
  const n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
  return n.top > r.top && n.top < r.bottom;
}
function kQ(e, t, n, r) {
  const [i] = Gr();
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (t != null && e != null) {
      const o = i.getRootElement(), a = o != null ? function(d, p) {
        let m = getComputedStyle(d);
        const y = m.position === "absolute", g = /(auto|scroll)/;
        if (m.position === "fixed") return document.body;
        for (let v = d; v = v.parentElement; ) if (m = getComputedStyle(v), (!y || m.position !== "static") && g.test(m.overflow + m.overflowY + m.overflowX)) return v;
        return document.body;
      }(o) : document.body;
      let s = !1, l = lE(t, a);
      const c = function() {
        s || (window.requestAnimationFrame(function() {
          n(), s = !1;
        }), s = !0);
        const d = lE(t, a);
        d !== l && (l = d, r != null && r(d));
      }, f = new ResizeObserver(n);
      return window.addEventListener("resize", n), document.addEventListener("scroll", c, { capture: !0, passive: !0 }), f.observe(t), () => {
        f.unobserve(t), window.removeEventListener("resize", n), document.removeEventListener("scroll", c, !0);
      };
    }
  }, [t, i, r, n, e]);
}
const cE = bZ();
function MQ({ close: e, editor: t, anchorElementRef: n, resolution: r, options: i, menuRenderFn: o, onSelectOption: a, shouldSplitNodeWithQuery: s = !1, commandPriority: l = rc }) {
  const [c, f] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), d = r.match && r.match.matchingString;
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    f(0);
  }, [d]);
  const p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((y) => {
    t.update(() => {
      const g = r.match != null && s ? function(v) {
        const x = Ne();
        if (!we(x) || !x.isCollapsed()) return null;
        const w = x.anchor;
        if (w.type !== "text") return null;
        const S = w.getNode();
        if (!S.isSimpleText()) return null;
        const A = w.offset, _ = S.getTextContent().slice(0, A), O = v.replaceableString.length, P = A - function(k, I, $) {
          let N = $;
          for (let D = N; D <= I.length; D++) k.substr(-D) === I.substr(0, D) && (N = D);
          return N;
        }(_, v.matchingString, O);
        if (P < 0) return null;
        let C;
        return P === 0 ? [C] = S.splitText(A) : [, C] = S.splitText(P, A), C;
      }(r.match) : null;
      a(y, g, e, r.match ? r.match.matchingString : "");
    });
  }, [t, s, r.match, a, e]), m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((y) => {
    const g = t.getRootElement();
    g !== null && (g.setAttribute("aria-activedescendant", "typeahead-item-" + y), f(y));
  }, [t]);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => () => {
    const y = t.getRootElement();
    y !== null && y.removeAttribute("aria-activedescendant");
  }, [t]), EQ(() => {
    i === null ? f(null) : c === null && m(0);
  }, [i, c, m]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => Uo(t.registerCommand(cE, ({ option: y }) => !(!y.ref || y.ref.current == null) && (sE(y.ref.current), !0), l)), [t, m, l]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => Uo(t.registerCommand(IR, (y) => {
    const g = y;
    if (i !== null && i.length && c !== null) {
      const v = c !== i.length - 1 ? c + 1 : 0;
      m(v);
      const x = i[v];
      x.ref != null && x.ref.current && t.dispatchCommand(cE, { index: v, option: x }), g.preventDefault(), g.stopImmediatePropagation();
    }
    return !0;
  }, l), t.registerCommand(DR, (y) => {
    const g = y;
    if (i !== null && i.length && c !== null) {
      const v = c !== 0 ? c - 1 : i.length - 1;
      m(v);
      const x = i[v];
      x.ref != null && x.ref.current && sE(x.ref.current), g.preventDefault(), g.stopImmediatePropagation();
    }
    return !0;
  }, l), t.registerCommand(RR, (y) => {
    const g = y;
    return g.preventDefault(), g.stopImmediatePropagation(), e(), !0;
  }, l), t.registerCommand(LR, (y) => {
    const g = y;
    return i !== null && c !== null && i[c] != null && (g.preventDefault(), g.stopImmediatePropagation(), p(i[c]), !0);
  }, l), t.registerCommand(wf, (y) => i !== null && c !== null && i[c] != null && (y !== null && (y.preventDefault(), y.stopImmediatePropagation()), p(i[c]), !0), l)), [p, e, t, i, c, m, l]), o(n, (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({ options: i, selectOptionAndCleanUp: p, selectedIndex: c, setHighlightedIndex: f }), [p, c, i]), r.match ? r.match.matchingString : "");
}
function NQ({ options: e, onQueryChange: t, onSelectOption: n, onOpen: r, onClose: i, menuRenderFn: o, triggerFn: a, anchorClassName: s, commandPriority: l = rc, parent: c }) {
  const [f] = Gr(), [d, p] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), m = function(v, x, w, S = document.body) {
    const [A] = Gr(), _ = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(document.createElement("div")), O = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
      _.current.style.top = _.current.style.bottom;
      const C = A.getRootElement(), k = _.current, I = k.firstChild;
      if (C !== null && v !== null) {
        const { left: $, top: N, width: D, height: j } = v.getRect(), F = _.current.offsetHeight;
        if (k.style.top = `${N + window.pageYOffset + F + 3}px`, k.style.left = `${$ + window.pageXOffset}px`, k.style.height = `${j}px`, k.style.width = `${D}px`, I !== null) {
          I.style.top = `${N}`;
          const W = I.getBoundingClientRect(), z = W.height, H = W.width, U = C.getBoundingClientRect();
          $ + H > U.right && (k.style.left = `${U.right - H + window.pageXOffset}px`), (N + z > window.innerHeight || N + z > U.bottom) && N - U.top > z + j && (k.style.top = N - z + window.pageYOffset - j + "px");
        }
        k.isConnected || (w != null && (k.className = w), k.setAttribute("aria-label", "Typeahead menu"), k.setAttribute("id", "typeahead-menu"), k.setAttribute("role", "listbox"), k.style.display = "block", k.style.position = "absolute", S.append(k)), _.current = k, C.setAttribute("aria-controls", "typeahead-menu");
      }
    }, [A, v, w, S]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
      const C = A.getRootElement();
      if (v !== null) return O(), () => {
        C !== null && C.removeAttribute("aria-controls");
        const k = _.current;
        k !== null && k.isConnected && k.remove();
      };
    }, [A, O, v]);
    const P = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((C) => {
      v !== null && (C || x(null));
    }, [v, x]);
    return kQ(v, _.current, O, P), _;
  }(d, p, s, c), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    p(null), i != null && d !== null && i();
  }, [i, d]), g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((v) => {
    p(v), r != null && d === null && r(v);
  }, [r, d]);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const v = f.registerUpdateListener(() => {
      f.getEditorState().read(() => {
        const x = f._window || window, w = x.document.createRange(), S = Ne(), A = function(P) {
          let C = null;
          return P.getEditorState().read(() => {
            const k = Ne();
            we(k) && (C = function(I) {
              const $ = I.anchor;
              if ($.type !== "text") return null;
              const N = $.getNode();
              if (!N.isSimpleText()) return null;
              const D = $.offset;
              return N.getTextContent().slice(0, D);
            }(k));
          }), C;
        }(f);
        if (!we(S) || !S.isCollapsed() || A === null || w === null) return void y();
        const _ = a(A, f);
        if (t(_ ? _.matchingString : null), _ !== null && !function(P, C) {
          return C === 0 && P.getEditorState().read(() => {
            const k = Ne();
            if (we(k)) {
              const I = k.anchor.getNode().getPreviousSibling();
              return Se(I) && I.isTextEntity();
            }
            return !1;
          });
        }(f, _.leadOffset) && function(C, k, I) {
          const $ = I.getSelection();
          if ($ === null || !$.isCollapsed) return !1;
          const N = $.anchorNode, D = C, j = $.anchorOffset;
          if (N == null || j == null) return !1;
          try {
            k.setStart(N, D), k.setEnd(N, j);
          } catch {
            return !1;
          }
          return !0;
        }(_.leadOffset, w, x) !== null)
          return O = () => g({ getRect: () => w.getBoundingClientRect(), match: _ }), void (aE in react__WEBPACK_IMPORTED_MODULE_1__ ? react__WEBPACK_IMPORTED_MODULE_1__[aE](O) : O());
        var O;
        y();
      });
    });
    return () => {
      v();
    };
  }, [f, a, t, d, y, g]), d === null || f === null ? null : (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MQ, { close: y, resolution: d, editor: f, anchorElementRef: m, options: e, menuRenderFn: o, shouldSplitNodeWithQuery: !0, onSelectOption: n, commandPriority: l });
}
const $Q = (e) => {
  switch (e) {
    case "sm":
      return "xs";
    case "md":
      return "sm";
    case "lg":
      return "md";
    default:
      return "sm";
  }
}, DQ = ({
  data: e,
  by: t,
  size: n,
  nodeKey: r
}) => {
  const [i] = Gr(), o = !i.isEditable(), a = (f) => {
    f.stopPropagation(), f.preventDefault(), !o && i.update(() => {
      const d = $n(r);
      d && d.remove();
    });
  };
  let s = e;
  typeof e == "object" && (s = e[t]);
  const l = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (f) => {
      const d = $n(r);
      if (!d || !d.isSelected())
        return !1;
      let p = !1;
      const m = d.getPreviousSibling();
      return ve(m) && (m.selectEnd(), p = !0), Se(m) && (m.select(), p = !0), Ht(m) && (m.selectNext(), p = !0), m === null && (d.selectPrevious(), p = !0), p && f.preventDefault(), p;
    },
    [r]
  ), c = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (f) => {
      const d = $n(r);
      if (!d || !d.isSelected())
        return !1;
      let p = !1;
      const m = d.getNextSibling();
      return ve(m) && (m.selectStart(), p = !0), Se(m) && (m.select(0, 0), p = !0), Ht(m) && (m.selectPrevious(), p = !0), m === null && (d.selectNext(), p = !0), p && f.preventDefault(), p;
    },
    [r]
  );
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const f = Uo(
      i.registerCommand(
        J1,
        l,
        rc
      ),
      i.registerCommand(
        Z1,
        c,
        rc
      )
    );
    return () => {
      f();
    };
  }, [i, l, c]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    mg,
    {
      className: "inline-flex mr-0.5",
      type: "rounded",
      size: $Q(n),
      label: s,
      icon: null,
      closable: !0,
      onClose: a,
      disabled: o
    }
  );
};
class ic extends k2 {
  constructor(n, r, i, o) {
    super(o);
    ha(this, "__data");
    ha(this, "__by");
    ha(this, "__size");
    this.__data = n, this.__by = r, this.__size = i;
  }
  static getType() {
    return "mention";
  }
  static clone(n) {
    return new ic(n.__data, n.__by, n.__size, n.__key);
  }
  static importJSON(n) {
    return L2(
      n.data,
      n.by,
      n.size
    );
  }
  createDOM() {
    return document.createElement("span");
  }
  updateDOM() {
    return !1;
  }
  exportDOM() {
    return { element: document.createElement("span") };
  }
  exportJSON() {
    return {
      type: ic.getType(),
      data: this.__data,
      by: this.__by,
      size: this.__size,
      version: 1
    };
  }
  decorate() {
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      DQ,
      {
        data: this.__data,
        by: this.__by,
        size: this.__size,
        nodeKey: this.__key
      }
    );
  }
}
const L2 = (e, t, n) => new ic(e, t, n), IQ = (e) => e instanceof ic;
class RQ {
  constructor(t) {
    ha(this, "data");
    ha(this, "key");
    ha(this, "ref");
    ha(this, "setRefElement");
    this.initData = t, this.key = "", this.data = t, this.ref = { current: null }, this.setRefElement = (n) => {
      this.ref.current = n;
    };
  }
}
const Ob = /* @__PURE__ */ new Map();
function jQ(e, t, n = "name") {
  const [r, i] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (t === null) {
      i([]);
      return;
    }
    const o = Ob.get(t);
    if (o !== null) {
      if (o !== void 0) {
        i(o);
        return;
      }
      Ob.set(t, null), LQ.search(
        e,
        t,
        (a) => {
          Ob.set(t, a), i(a);
        },
        n
      );
    }
  }, [t]), r;
}
const LQ = {
  search(e, t, n, r) {
    setTimeout(() => {
      if (!Array.isArray(e))
        return [];
      const i = e.filter(
        (o) => {
          var s;
          if (typeof o == "string")
            return o.toLowerCase().includes(t.toLowerCase());
          const a = (s = o == null ? void 0 : o[r]) == null ? void 0 : s.toString();
          return a ? a.toLowerCase().includes(t.toLowerCase()) : !1;
        }
      );
      n(i);
    }, 500);
  }
}, Hp = ({ size: e, className: t, children: n }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "ul",
  {
    role: "menu",
    className: K(
      OQ,
      AQ[e],
      t
    ),
    children: n
  }
);
Hp.displayName = "EditorCombobox";
const B2 = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
  ({ size: e, children: t, selected: n = !1, className: r, ...i }, o) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "li",
    {
      role: "option",
      ref: o,
      className: K(
        TQ,
        PQ[e],
        n && CQ,
        r
      ),
      ...i,
      children: t
    }
  )
);
B2.displayName = "EditorCombobox.Item";
Hp.Item = B2;
const BQ = ({
  optionsArray: e,
  by: t = "name",
  size: n = "md",
  trigger: r = "@",
  // Default trigger value
  menuComponent: i = Hp,
  menuItemComponent: o = Hp.Item,
  autoSpace: a = !0
}) => {
  const s = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1), l = `\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'"~=<>_:;`, c = [r].join(""), f = "[^" + c + l + "\\s]", d = "(?:\\.[ |$]| |[" + l + "]|)", p = 75, m = new RegExp(
    `(^|\\s|\\()([${c}]((?:${f}${d}){0,${p}}))$`
  ), y = 50, g = new RegExp(
    `(^|\\s|\\()([${c}]((?:${f}){0,${y}}))$`
  ), v = (k) => {
    let I = m.exec(k);
    if (I === null && (I = g.exec(k)), I !== null) {
      const $ = I[1], N = I[3];
      if (N.length >= 0)
        return {
          leadOffset: I.index + $.length,
          matchingString: N,
          replaceableString: I[2]
        };
    }
    return null;
  }, [x] = Gr(), [w, S] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), A = jQ(e, w, t), _ = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (k, I, $) => {
      x.update(() => {
        const N = L2(
          k.data,
          t,
          n
        );
        I && I.replace(N), $();
      });
    },
    [x]
  ), O = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => A.map((k) => new RQ(k)), [x, A]), P = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (k) => {
      if (!a)
        return !1;
      const { key: I, ctrlKey: $, metaKey: N } = k;
      if ($ || N || I === " " || I.length > 1 || s.current)
        return s.current && (s.current = !1), !1;
      const D = Ne(), { focus: j, anchor: F } = D, [W] = D.getNodes();
      if (!F || !j || (F == null ? void 0 : F.key) !== (j == null ? void 0 : j.key) || (F == null ? void 0 : F.offset) !== (j == null ? void 0 : j.offset) || !W)
        return !1;
      if (IQ(W)) {
        const z = Vn(" ");
        return W.insertAfter(z), !0;
      }
      return !1;
    },
    [x, r, a]
  ), C = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(
    (k) => {
      const { key: I } = k;
      return I === "Backspace" ? (s.current = !0, !0) : !1;
    },
    [s]
  );
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (x)
      return Uo(
        x.registerCommand(
          $R,
          P,
          rc
        ),
        x.registerCommand(
          Q1,
          C,
          rc
        )
      );
  }, [x, P]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    NQ,
    {
      onQueryChange: S,
      onSelectOption: _,
      triggerFn: v,
      options: O,
      menuRenderFn: (k, { selectedIndex: I, selectOptionAndCleanUp: $, setHighlightedIndex: N }) => k.current && (O != null && O.length) ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(i, { size: n, children: O.map((D, j) => {
        var F;
        return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          o,
          {
            ref: D.ref,
            size: n,
            selected: j === I,
            onMouseEnter: () => {
              N(j);
            },
            onClick: () => $(D),
            children: typeof D.data == "string" ? D.data : (F = D.data) == null ? void 0 : F[t]
          },
          j
        );
      }) }) : null
    }
  );
}, FQ = {
  ltr: "ltr",
  rtl: "rtl",
  paragraph: "editor-paragraph",
  quote: "editor-quote",
  heading: {
    h1: "editor-heading-h1",
    h2: "editor-heading-h2",
    h3: "editor-heading-h3",
    h4: "editor-heading-h4",
    h5: "editor-heading-h5",
    h6: "editor-heading-h6"
  },
  list: {
    nested: {
      listitem: "editor-nested-listitem"
    },
    ol: "editor-list-ol",
    ul: "editor-list-ul",
    listitem: "editor-listItem",
    listitemChecked: "editor-listItemChecked",
    listitemUnchecked: "editor-listItemUnchecked"
  },
  hashtag: "editor-hashtag",
  image: "editor-image",
  link: "editor-link",
  text: {
    bold: "editor-textBold",
    code: "editor-textCode",
    italic: "editor-textItalic",
    strikethrough: "editor-textStrikethrough",
    subscript: "editor-textSubscript",
    superscript: "editor-textSuperscript",
    underline: "editor-textUnderline",
    underlineStrikethrough: "editor-textUnderlineStrikethrough"
  },
  code: "editor-code",
  codeHighlight: {
    atrule: "editor-tokenAttr",
    attr: "editor-tokenAttr",
    boolean: "editor-tokenProperty",
    builtin: "editor-tokenSelector",
    cdata: "editor-tokenComment",
    char: "editor-tokenSelector",
    class: "editor-tokenFunction",
    "class-name": "editor-tokenFunction",
    comment: "editor-tokenComment",
    constant: "editor-tokenProperty",
    deleted: "editor-tokenProperty",
    doctype: "editor-tokenComment",
    entity: "editor-tokenOperator",
    function: "editor-tokenFunction",
    important: "editor-tokenVariable",
    inserted: "editor-tokenSelector",
    keyword: "editor-tokenAttr",
    namespace: "editor-tokenVariable",
    number: "editor-tokenProperty",
    operator: "editor-tokenOperator",
    prolog: "editor-tokenComment",
    property: "editor-tokenProperty",
    punctuation: "editor-tokenPunctuation",
    regex: "editor-tokenVariable",
    selector: "editor-tokenSelector",
    string: "editor-tokenSelector",
    symbol: "editor-tokenProperty",
    tag: "editor-tokenProperty",
    url: "editor-tokenOperator",
    variable: "editor-tokenVariable"
  }
}, WQ = ({ content: e }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "div",
  {
    "aria-hidden": "true",
    className: "pointer-events-none absolute inset-0 flex items-center justify-start text-field-placeholder w-full",
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "truncate", children: e })
  }
);
function zQ(e) {
  console.error(e);
}
const VQ = `{
    "root": {
        "children": [
            {
                "children": [],
                "direction": null,
                "format": "",
                "indent": 0,
                "type": "paragraph",
                "version": 1,
                "textFormat": 0,
                "textStyle": ""
            }
        ],
        "direction": null,
        "format": "",
        "indent": 0,
        "type": "root",
        "version": 1
    }
}`, UQ = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
  ({
    defaultValue: e = "",
    placeholder: t = "Press @ to view variable suggestions",
    onChange: n,
    size: r = "md",
    autoFocus: i = !1,
    options: o,
    by: a = "name",
    trigger: s = "@",
    menuComponent: l,
    menuItemComponent: c,
    className: f,
    wrapperClassName: d,
    disabled: p = !1,
    autoSpaceAfterMention: m = !1
  }, y) => {
    const g = {
      namespace: "Editor",
      editorTheme: FQ,
      onError: zQ,
      nodes: [ic],
      editorState: e || VQ,
      editable: !p
    }, v = (S, A) => {
      typeof n == "function" && n(S, A);
    };
    let x, w;
    return (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(l) && (x = l), (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(c) && (w = c), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      "div",
      {
        className: K(
          "relative w-full",
          wQ,
          SQ[r],
          p && _Q,
          d
        ),
        children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(PJ, { initialConfig: g, children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "relative w-full [&_p]:m-0", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            eQ,
            {
              contentEditable: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                iQ,
                {
                  className: K(
                    "editor-content focus-visible:outline-none outline-none",
                    xQ,
                    f
                  )
                }
              ),
              placeholder: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(WQ, { content: t }),
              ErrorBoundary: gQ
            }
          ) }),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(pQ, {}),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            BQ,
            {
              menuComponent: x,
              menuItemComponent: w,
              size: r,
              by: a,
              optionsArray: o,
              trigger: s,
              autoSpace: m
            }
          ),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            vQ,
            {
              onChange: v,
              ignoreSelectionChange: !0
            }
          ),
          y && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(bQ, { editorRef: y }),
          i && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(vZ, {})
        ] })
      }
    );
  }
);
UQ.displayName = "EditorInput";
const HQ = (e, t, n, r) => {
  const i = `absolute rounded-full transition-colors duration-500 ${n[r].dot}`;
  return e === "dot" ? K(
    i,
    n[r].dot,
    t ? "bg-brand-primary-600" : "bg-text-tertiary"
  ) : e === "number" ? K(
    i,
    n[r].dot,
    t ? "text-brand-primary-600" : "text-text-tertiary",
    "flex items-center justify-center"
  ) : e === "icon" ? K(
    i,
    t ? "text-brand-primary-600" : "text-text-tertiary",
    "flex items-center justify-center"
  ) : "";
}, KQ = (e, t, n) => K(
  "relative flex items-center rounded-full justify-center transition-colors z-10 duration-500 ring-1",
  e ? "ring-brand-primary-600" : "ring-border-subtle",
  t[n].ring
), GQ = (e, t) => K(
  "rounded-full text-brand-primary-600 transition-colors duration-300",
  e[t].dot,
  e[t].ring
), YQ = {
  sm: {
    dot: "size-2.5",
    ring: "size-5",
    numberIcon: "size-5 text-tiny",
    icon: "size-5",
    label: "text-xs"
  },
  md: {
    dot: "size-3",
    ring: "size-6",
    numberIcon: "size-6 text-sm",
    icon: "size-6",
    label: "text-sm"
  },
  lg: {
    dot: "size-3.5",
    ring: "size-7",
    numberIcon: "size-7 text-md",
    icon: "size-7",
    label: "text-sm"
  }
}, qQ = ({
  variant: e = "dot",
  size: t = "sm",
  type: n = "inline",
  currentStep: r = 1,
  children: i,
  className: o,
  lineClassName: a = "min-w-10",
  ...s
}) => {
  const l = react__WEBPACK_IMPORTED_MODULE_1__.Children.count(i);
  r === -1 && (r = l + 1);
  const c = react__WEBPACK_IMPORTED_MODULE_1__.Children.map(i, (f, d) => {
    const p = d + 1 < r, m = d + 1 === r, y = d + 1 === l, g = {
      isCompleted: p,
      isCurrent: m,
      sizeClasses: YQ,
      size: t,
      variant: e,
      type: n,
      isLast: y,
      index: d,
      lineClassName: a
    };
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { children: react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(f) ? react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(f, g) : f }, d);
  });
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        "flex w-full",
        o,
        n === "inline" ? "items-center justify-between" : ""
      ),
      ...s,
      children: c
    }
  );
}, F2 = ({
  labelText: e = "",
  icon: t = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(nD, {}),
  isCurrent: n,
  isCompleted: r,
  className: i,
  type: o,
  variant: a,
  sizeClasses: s,
  size: l,
  isLast: c,
  index: f,
  lineClassName: d,
  ...p
}) => {
  const m = XQ(
    a,
    r,
    n,
    s,
    l,
    t,
    f
  ), y = {
    lg: "left-[calc(50%+14px)] right-[calc(-50%+14px)]",
    md: "left-[calc(50%+12px)] right-[calc(-50%+12px)]",
    sm: "left-[calc(50%+10px)] right-[calc(-50%+10px)]"
  }, g = {
    lg: "top-3.5",
    md: "top-3",
    sm: "top-2.5"
  }, v = () => {
    if (e) {
      const w = K(
        s[l].label,
        "text-text-tertiary",
        n ? "text-brand-primary-600" : "",
        "break-word",
        // max width for inline and stack
        o === "stack" ? "mt-2 transform max-w-xs" : "mx-2 max-w-32"
      );
      return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: w, children: e });
    }
    return null;
  }, x = () => {
    if (!c) {
      const w = K(
        "block",
        r ? "border-brand-primary-600" : "border-border-subtle",
        d
      );
      return o === "stack" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        "div",
        {
          className: K(
            "relative",
            "flex",
            "border-solid",
            "border-y",
            "absolute",
            r ? "border-brand-primary-600" : "border-border-subtle",
            g[l],
            y[l]
          ),
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "block" })
        }
      ) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        "span",
        {
          className: K(
            "mr-2 border-y border-solid",
            !e && "ml-2",
            w
          )
        }
      ) });
    }
    return null;
  };
  return o === "stack" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative flex-1 justify-center", children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "div",
      {
        className: K("flex items-center flex-col", i),
        ...p,
        children: [
          m,
          v()
        ]
      }
    ),
    x()
  ] }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: K("flex items-center", i), ...p, children: [
      m,
      v()
    ] }),
    x()
  ] });
};
F2.displayName = "ProgressSteps.Step";
const XQ = (e, t, n, r, i, o, a) => {
  if (t)
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(sd, { className: GQ(r, i) });
  const s = KQ(!!n, r, i), l = HQ(
    e,
    n,
    r,
    i
  );
  let c = null;
  return e === "number" ? c = a + 1 : e === "icon" && o && (c = o), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: s, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: l, children: c }) });
};
qQ.Step = F2;
const rke = ({
  variant: e = "rectangular",
  // rectangular, circular
  className: t,
  ...n
}) => {
  const r = {
    circular: "rounded-full bg-gray-200 ",
    rectangular: "rounded-md bg-gray-200"
  }[e], i = {
    circular: "size-10",
    rectangular: "w-96 h-3"
  }[e];
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        r,
        "animate-pulse",
        i,
        t
      ),
      ...n
    }
  );
}, W2 = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({}), z2 = () => (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(W2), Ha = ({ size: e = "md", children: t, className: n }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(W2.Provider, { value: { size: e }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K("flex flex-col bg-background-primary p-2", n), children: t }) });
Ha.displayName = "Menu";
const V2 = ({
  heading: e,
  arrow: t = !1,
  showArrowOnHover: n = !1,
  // Prop to toggle hover-based arrow display
  open: r = !0,
  onClick: i,
  children: o,
  className: a
}) => {
  const [s, l] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(r), [c, f] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), { size: d } = z2(), p = "text-text-primary bg-transparent cursor-pointer flex justify-between items-center gap-1", m = {
    sm: "text-xs",
    md: "text-sm"
  }[d ?? "md"], y = {
    sm: "size-4",
    md: "size-5"
  }[d ?? "md"], g = () => {
    l(!s), i && i(!s);
  }, v = {
    open: { rotate: 180 },
    closed: { rotate: 0 }
  }, x = {
    open: { height: "auto", opacity: 1 },
    closed: { height: 0, opacity: 0 }
  }, w = {
    visible: { opacity: 1 },
    hidden: { opacity: 0 }
  }, S = () => n ? s || c ? "visible" : "hidden" : "visible";
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [
    !!e && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "div",
      {
        role: "button",
        tabIndex: 0,
        onClick: g,
        onKeyDown: (A) => {
          (A.key === "Enter" || A.key === " ") && g();
        },
        onMouseEnter: () => n && f(!0),
        onMouseLeave: () => n && f(!1),
        className: K(
          p,
          m,
          e ? "p-1" : "p-0",
          a
        ),
        "aria-expanded": s,
        children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-text-tertiary", children: e }),
          t && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            An.span,
            {
              className: "flex items-center text-border-strong",
              initial: "hidden",
              animate: S(),
              exit: "hidden",
              variants: w,
              transition: { duration: 0.15 },
              children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                An.span,
                {
                  className: "inline-flex p-1",
                  variants: v,
                  animate: s ? "open" : "closed",
                  transition: { duration: 0.15 },
                  children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                    Xw,
                    {
                      className: K("shrink-0", y)
                    }
                  )
                }
              )
            }
          )
        ]
      }
    ),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ys, { initial: !1, children: s && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      An.ul,
      {
        role: "menu",
        variants: x,
        initial: "closed",
        animate: "open",
        exit: "closed",
        transition: { duration: 0.3, ease: "easeInOut" },
        className: "overflow flex gap-0.5 flex-col m-0 bg-white rounded p-0",
        children: o
      }
    ) })
  ] });
};
V2.displayName = "Menu.List";
const U2 = ({
  disabled: e = !1,
  active: t,
  onClick: n,
  children: r,
  className: i
}) => {
  const { size: o } = z2(), a = "flex p-1 gap-1 items-center bg-transparent border-none rounded text-text-secondary cursor-pointer m-0", s = {
    sm: "[&>svg]:size-4 [&>svg]:m-1 [&>*:not(svg)]:mx-1 [&>*:not(svg)]:my-0.5 text-sm",
    md: "[&>svg]:size-5 [&>svg]:m-1.5 [&>*:not(svg)]:m-1 text-base"
  }[o ?? "md"];
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "li",
    {
      role: "menuitem",
      tabIndex: 0,
      onClick: n,
      onKeyDown: (p) => {
        (p.key === "Enter" || p.key === " ") && (n == null || n());
      },
      className: K(
        a,
        s,
        "hover:bg-background-secondary hover:text-text-primary",
        e ? "text-text-disabled hover:text-text-disabled cursor-not-allowed hover:bg-transparent" : "",
        t ? "text-icon-primary [&>svg]:text-icon-interactive bg-background-secondary" : "",
        "transition-colors duration-300 ease-in-out",
        i
      ),
      children: r
    }
  );
};
U2.displayName = "Menu.Item";
const H2 = ({
  variant: e = "solid",
  className: t
}) => {
  const n = {
    solid: "border-solid",
    dashed: "border-dashed",
    dotted: "border-dotted",
    double: "border-double",
    hidden: "border-hidden",
    none: "border-none"
  }[e];
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { className: "m-0 p-0 list-none", role: "separator", "aria-hidden": "true", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "hr",
    {
      className: K(
        "w-full border-0 border-t border-border-subtle",
        n,
        t
      )
    }
  ) });
};
H2.displayName = "Menu.Separator";
Ha.List = V2;
Ha.Item = U2;
Ha.Separator = H2;
const K2 = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({
  isCollapsed: !1,
  setIsCollapsed: () => {
  },
  collapsible: !0
}), G2 = ({
  children: e,
  className: t,
  onCollapseChange: n,
  collapsible: r = !0,
  borderOn: i = !0,
  ...o
}) => {
  const a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), [s, l] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => {
    const c = ju.get("sidebar-collapsed"), f = window.innerWidth < 1280;
    return c || f;
  });
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    n && n(s);
  }, [s, n]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const c = () => {
      const f = window.innerWidth < 1280;
      if (!r)
        l(!1), ju.remove("sidebar-collapsed");
      else if (f)
        l(!0), ju.set("sidebar-collapsed", !0);
      else {
        const d = ju.get("sidebar-collapsed");
        l(d || !1);
      }
    };
    return window.addEventListener("resize", c), c(), () => {
      window.removeEventListener("resize", c);
    };
  }, [r]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    K2.Provider,
    {
      value: { isCollapsed: s, setIsCollapsed: l, collapsible: r },
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        "div",
        {
          ref: a,
          className: K(
            "h-full overflow-auto w-72 px-4 py-4 gap-4 flex flex-col bg-background-primary",
            i && "border-0 border-r border-solid border-border-subtle",
            "transition-all duration-200",
            s && "w-16 px-2",
            t
          ),
          ...o,
          children: e
        }
      )
    }
  );
};
G2.displayName = "Sidebar";
const Y2 = ({ children: e }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: e });
Y2.displayName = "Sidebar.Header";
const q2 = ({ children: e }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K("space-y-4 grow items-start"), children: e });
q2.displayName = "Sidebar.Body";
const X2 = ({ children: e }) => {
  const { isCollapsed: t, setIsCollapsed: n, collapsible: r } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(K2);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [
    e,
    r && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      "button",
      {
        className: K(
          "bg-transparent w-full border-0 p-0 m-0 flex items-center gap-2 text-base cursor-pointer",
          t && "justify-center"
        ),
        onClick: () => {
          n(!t), ju.set("sidebar-collapsed", !t);
        },
        "aria-label": t ? "Expand sidebar" : "Collapse sidebar",
        children: t ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(f1, { title: "Expand", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(tK, { className: "size-5" }) }) }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(eK, { className: "size-5" }),
          " Collapse"
        ] })
      }
    )
  ] });
};
X2.displayName = "Sidebar.Footer";
const Z2 = ({ children: e, className: t }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K("w-full", t), children: e });
Z2.displayName = "Sidebar.Item";
const ike = Object.assign(G2, {
  Header: Y2,
  Body: q2,
  Footer: X2,
  Item: Z2
}), cx = {
  sm: {
    text: "text-sm",
    separator: "text-sm",
    separatorIconSize: 16
  },
  md: {
    text: "text-base",
    separator: "text-base",
    separatorIconSize: 18
  }
}, wd = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({ sizes: cx.sm }), Xs = ({ children: e, size: t = "sm" }) => {
  const n = cx[t] || cx.sm;
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(wd.Provider, { value: { sizes: n }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("nav", { className: "flex m-0", "aria-label": "Breadcrumb", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "m-0 inline-flex items-center space-x-1 md:space-x-1", children: e }) }) });
};
Xs.displayName = "Breadcrumb";
const J2 = ({ children: e }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: e });
J2.displayName = "Breadcrumb.List";
const Q2 = ({ children: e }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { className: "m-0 inline-flex items-center gap-2", children: e });
Q2.displayName = "Breadcrumb.Item";
const ej = ({
  href: e,
  children: t,
  className: n,
  as: r = "a",
  ...i
}) => {
  const { sizes: o } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(wd);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    r,
    {
      href: e,
      className: K(
        o.text,
        "px-1 font-medium no-underline text-text-tertiary hover:text-text-primary hover:underline",
        "focus:outline-none focus:ring-1 focus:ring-border-interactive focus:border-border-interactive focus:rounded-sm",
        "transition-all duration-200",
        n
      ),
      ...i,
      children: t
    }
  );
};
ej.displayName = "Breadcrumb.Link";
const tj = ({ type: e }) => {
  const { sizes: t } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(wd), n = {
    slash: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: K("mx-1", t.separator), children: "/" }),
    arrow: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Zw, { size: t.separatorIconSize })
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "li",
    {
      role: "separator",
      className: "flex items-center text-text-tertiary mx-2 p-0 list-none",
      "aria-hidden": "true",
      children: n[e] || n.arrow
    }
  );
};
tj.displayName = "Breadcrumb.Separator";
const nj = () => {
  const { sizes: e } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(wd);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    XH,
    {
      className: "mt-[2px] cursor-pointer text-text-tertiary hover:text-text-primary",
      size: e.separatorIconSize + 4
    }
  );
};
nj.displayName = "Breadcrumb.Ellipsis";
const rj = ({ children: e }) => {
  const { sizes: t } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(wd);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: K(t.text, "font-medium text-text-primary"), children: e });
};
rj.displayName = "Breadcrumb.Page";
Xs.List = J2;
Xs.Item = Q2;
Xs.Link = ej;
Xs.Separator = tj;
Xs.Ellipsis = nj;
Xs.Page = rj;
const ij = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({}), Wg = () => (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(ij), oj = {
  open: {
    opacity: 1
  },
  exit: {
    opacity: 0
  }
}, aj = { duration: 0.2 }, Xo = ({
  open: e,
  setOpen: t,
  children: n,
  trigger: r = null,
  className: i,
  exitOnClickOutside: o = !1,
  exitOnEsc: a = !0,
  design: s = "simple",
  scrollLock: l = !0
}) => {
  const c = e !== void 0 && t !== void 0, [f, d] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), p = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), m = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => c ? e : f,
    [e, f]
  ), g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => c ? t : d,
    [d, d]
  ), v = () => {
    y || g(!0);
  }, x = () => {
    y && g(!1);
  }, w = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    var _;
    return (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(r) ? (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(r, {
      onClick: cf(v, (_ = r == null ? void 0 : r.props) == null ? void 0 : _.onClick)
    }) : typeof r == "function" ? r({ onClick: v }) : null;
  }, [r, v, x]), S = (_) => {
    switch (_.key) {
      case "Escape":
        a && x();
        break;
    }
  }, A = (_) => {
    o && p.current && !p.current.contains(_.target) && x();
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => (window.addEventListener("keydown", S), document.addEventListener("mousedown", A), () => {
    window.removeEventListener("keydown", S), document.removeEventListener("mousedown", A);
  }), [y]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (!l)
      return;
    const _ = document.querySelector("html");
    return y && _ && (_.style.overflow = "hidden"), () => {
      _ && (_.style.overflow = "");
    };
  }, [y]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
    w(),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      ij.Provider,
      {
        value: {
          open: y,
          setOpen: g,
          handleClose: x,
          design: s,
          dialogContainerRef: m,
          dialogRef: p
        },
        children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "div",
          {
            ref: m,
            className: K(
              "fixed z-999999 w-0 h-0 overflow-visible",
              i
            ),
            children: n
          }
        )
      }
    )
  ] });
};
Xo.displayName = "Dialog";
const sj = ({
  children: e,
  className: t
}) => {
  const { open: n, handleClose: r, dialogRef: i } = Wg();
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ys, { children: n && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    An.div,
    {
      className: "fixed inset-0 overflow-y-auto",
      initial: "exit",
      animate: "open",
      exit: "exit",
      variants: oj,
      role: "dialog",
      transition: aj,
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center justify-center min-h-full", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        "div",
        {
          ref: i,
          className: K(
            "flex flex-col gap-5 w-120 h-fit bg-background-primary border border-solid border-border-subtle rounded-xl shadow-soft-shadow-2xl my-5 overflow-hidden",
            t
          ),
          children: typeof e == "function" ? e({ close: r }) : e
        }
      ) })
    }
  ) });
};
sj.displayName = "Dialog.Panel";
const lj = ({
  className: e,
  ...t
}) => {
  const { open: n, dialogContainerRef: r } = Wg();
  return r != null && r.current ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: (0,react_dom__WEBPACK_IMPORTED_MODULE_2__.createPortal)(
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ys, { children: n && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      An.div,
      {
        className: K(
          "fixed inset-0 -z-10 bg-background-inverse/90",
          e
        ),
        ...t,
        initial: "exit",
        animate: "open",
        exit: "exit",
        variants: oj,
        transition: aj
      }
    ) }),
    r.current
  ) }) : null;
};
lj.displayName = "Dialog.Backdrop";
const cj = ({
  children: e,
  className: t,
  ...n
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K("space-y-2 px-5 pt-5 pb-1", t), ...n, children: e });
cj.displayName = "Dialog.Header";
const uj = ({
  children: e,
  as: t = "h3",
  className: n,
  ...r
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  t,
  {
    className: K(
      "text-base font-semibold text-text-primary m-0 p-0",
      n
    ),
    ...r,
    children: e
  }
);
uj.displayName = "Dialog.Title";
const fj = ({
  children: e,
  as: t = "p",
  className: n,
  ...r
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  t,
  {
    className: K(
      "text-sm font-normal text-text-secondary my-0 ml-0 mr-1 p-0",
      n
    ),
    ...r,
    children: e
  }
);
fj.displayName = "Dialog.Description";
const ZQ = ({
  className: e,
  ...t
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "button",
  {
    className: K(
      "bg-transparent inline-flex justify-center items-center border-0 p-1 m-0 cursor-pointer focus:outline-none outline-none shadow-none",
      e
    ),
    "aria-label": "Close dialog",
    ...t,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($a, { className: "size-4 text-text-primary shrink-0" })
  }
), dj = ({
  children: e,
  as: t = react__WEBPACK_IMPORTED_MODULE_1__.Fragment,
  ...n
}) => {
  const { handleClose: r } = Wg();
  return e ? t === react__WEBPACK_IMPORTED_MODULE_1__.Fragment ? typeof e == "function" ? e({
    close: r
  }) : (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(e, {
    onClick: r
  }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(t, { ...n, onClick: r, children: e }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ZQ, { onClick: r, ...n });
};
dj.displayName = "Dialog.CloseButton";
const hj = ({
  children: e,
  className: t,
  ...n
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K("px-5", t), ...n, children: e });
hj.displayName = "Dialog.Body";
const pj = ({
  children: e,
  className: t
}) => {
  const { design: n, handleClose: r } = Wg(), i = () => e ? typeof e == "function" ? e({ close: r }) : e : null;
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        "p-4 flex justify-end gap-3",
        {
          "bg-background-secondary": n === "footer-divided"
        },
        t
      ),
      children: i()
    }
  );
};
pj.displayName = "Dialog.Footer";
Xo.Panel = sj;
Xo.Title = uj;
Xo.Description = fj;
Xo.CloseButton = dj;
Xo.Header = cj;
Xo.Body = hj;
Xo.Footer = pj;
Xo.Backdrop = lj;
const _d = ({
  children: e,
  gap: t = "lg",
  className: n,
  ...r
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "div",
  {
    className: K(
      "w-full box-border flex items-center justify-between bg-background-primary p-5 min-h-16",
      Jm(t),
      n
    ),
    ...r,
    children: e
  }
);
_d.displayName = "Topbar";
const mj = ({ gap: e = "sm", children: t, className: n }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K("flex items-center", Jm(e), n), children: t });
mj.displayName = "Topbar.Left";
const gj = ({
  gap: e = "md",
  children: t,
  align: n = "center",
  className: r
}) => {
  const i = {
    left: "justify-start",
    center: "justify-center",
    right: "justify-end"
  }[n];
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        "flex items-center grow",
        Jm(e),
        i,
        r
      ),
      children: t
    }
  );
};
gj.displayName = "Topbar.Middle";
const yj = ({ gap: e = "sm", children: t, className: n }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K("flex items-center", Jm(e), n), children: t });
yj.displayName = "Topbar.Right";
const vj = ({ children: e, className: t }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "div",
  {
    className: K("flex items-center [&>svg]:block h-full", t),
    children: e
  }
);
vj.displayName = "Topbar.Item";
_d.Left = mj;
_d.Middle = gj;
_d.Right = yj;
_d.Item = vj;
const JQ = (e) => {
  if (!e)
    return { error: "Element not found." };
  const t = e.getBoundingClientRect(), n = window.innerWidth, r = n / 2, i = t.right < r, o = t.left > r;
  return {
    isLeft: i,
    isRight: o,
    isCenter: !i && !o,
    elementRect: {
      left: t.left,
      right: t.right,
      width: t.width
    },
    viewport: {
      width: n,
      center: r
    }
  };
}, bj = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({}), QQ = bj.Provider, xj = () => (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(bj), eee = (e) => {
  const t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)({ width: 0, height: 0 });
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    e.current && (t.current.width = e.current.offsetWidth, t.current.height = e.current.offsetHeight);
  }, []), t.current;
}, tee = (e, t, n) => {
  if (!e || !t)
    return {
      open: () => ({}),
      closed: () => ({})
    };
  const r = e == null ? void 0 : e.getBoundingClientRect(), i = t == null ? void 0 : t.getBoundingClientRect(), o = n ? (r == null ? void 0 : r.x) - (i == null ? void 0 : i.x) + (r == null ? void 0 : r.width) / 2 : (i == null ? void 0 : i.width) - ((i == null ? void 0 : i.right) - (r == null ? void 0 : r.x)) + (r == null ? void 0 : r.width) / 2, a = (r == null ? void 0 : r.y) - (i == null ? void 0 : i.y) + (r == null ? void 0 : r.height) / 2, s = (r == null ? void 0 : r.width) / 2;
  return {
    open: (l = 1e3) => ({
      clipPath: `circle(${l * 2 + 200}px at ${o}px ${a}px)`,
      background: "rgb(255, 255, 255, 1)",
      transition: {
        type: "spring",
        stiffness: 20,
        restDelta: 2,
        background: {
          duration: 0
        }
      }
    }),
    closed: {
      clipPath: `circle(${s}px at ${o}px ${a}px)`,
      background: "rgb(255, 255, 255, 0)",
      transition: {
        delay: 0.5,
        type: "spring",
        stiffness: 400,
        damping: 40,
        background: {
          duration: 0,
          delay: 1e3
        }
      }
    }
  };
}, Ab = (e) => (
  // @ts-expect-error Framer Motion types are not compatible with SVGPathElement
  /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    An.path,
    {
      className: "stroke-icon-primary",
      fill: "transparent",
      strokeWidth: "3",
      strokeLinecap: "round",
      ...e
    }
  )
), wj = ({ className: e }) => {
  const { toggleOpen: t, setTriggerRef: n } = xj();
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Hn,
    {
      ref: n,
      className: K(
        "relative z-[1] rounded-full hover:shadow-sm focus:[box-shadow:none] pointer-events-auto bg-background-primary",
        e
      ),
      variant: "ghost",
      size: "xs",
      onClick: t,
      "aria-label": "Toggle menu",
      icon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
        An.svg,
        {
          className: "shrink-0 stroke-icon-primary",
          width: "23",
          height: "23",
          variants: {
            open: {
              viewBox: "0 0 20 20"
            },
            closed: {
              viewBox: "0 0 23 18"
            }
          },
          children: [
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              Ab,
              {
                variants: {
                  closed: { d: "M 2 2.5 L 20 2.5" },
                  open: { d: "M 3 16.5 L 17 2.5" }
                }
              }
            ),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              Ab,
              {
                d: "M 2 9.423 L 20 9.423",
                variants: {
                  closed: { opacity: 1 },
                  open: { opacity: 0 }
                },
                transition: { duration: 0.1 }
              }
            ),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              Ab,
              {
                variants: {
                  closed: { d: "M 2 16.346 L 20 16.346" },
                  open: { d: "M 3 2.5 L 17 16.346" }
                }
              }
            )
          ]
        }
      )
    }
  );
}, nee = {
  open: {
    transition: { staggerChildren: 0.07, delayChildren: 0.2 }
  },
  closed: {
    transition: { staggerChildren: 0.05, staggerDirection: -1 }
  }
}, _j = ({
  tag: e = "a",
  active: t,
  icon: n,
  iconPosition: r = "left",
  className: i,
  children: o,
  ...a
}) => {
  var f;
  let s = null, l = null;
  const c = n && (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(n) ? (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(n, {
    key: "left-icon",
    className: K(
      "size-5",
      t ? "text-brand-800" : "text-icon-secondary",
      ((f = n.props) == null ? void 0 : f.className) ?? ""
    )
  }) : null;
  switch (r) {
    case "left":
      s = c;
      break;
    case "right":
      l = c;
      break;
    default:
      s = null, l = null;
      break;
  }
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(iee, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    e,
    {
      className: K(
        "w-full no-underline hover:no-underline text-text-primary text-lg font-medium flex items-center gap-2 px-2.5 py-1.5 rounded-md hover:bg-background-secondary hover:text-text-primary focus:outline-none focus:shadow-none transition ease-in-out duration-150",
        t ? "text-text-primary bg-background-secondary" : "text-text-secondary",
        i
      ),
      ...a,
      children: [
        !!s && s,
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "contents", children: o }),
        !!l && l
      ]
    }
  ) });
}, ree = {
  open: {
    y: 0,
    opacity: 1,
    transition: {
      y: { stiffness: 1e3, velocity: -100 }
    }
  },
  closed: {
    y: 50,
    opacity: 0,
    transition: {
      y: { stiffness: 1e3 }
    }
  }
}, iee = ({ children: e }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  An.li,
  {
    className: "m-0 p-0 flex items-center justify-start w-full",
    variants: ree,
    whileHover: { scale: 1.05 },
    whileTap: { scale: 0.95 },
    children: e
  }
), Sj = ({ children: e, className: t }) => {
  const { triggerRef: n, triggerOnRight: r, triggerOnLeft: i } = xj(), [o, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  return n ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    An.div,
    {
      ref: a,
      className: K(
        "absolute top-0 bottom-0 w-80 h-screen",
        r ? "right-0" : "left-0",
        t
      ),
      children: [
        o && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          An.div,
          {
            className: K(
              "bg-background-primary shadow-lg absolute top-0 bottom-0 w-80 border-y-0 border-l-0 border-r border-solid border-border-subtle",
              r ? "right-0" : "left-0"
            ),
            variants: tee(
              n,
              o,
              i ?? !1
            )
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          An.ul,
          {
            variants: nee,
            className: K(
              "relative mt-14 mb-0 w-full px-5 pb-5 pt-2 flex flex-col items-start justify-start gap-0.5",
              t
            ),
            children: e
          }
        )
      ]
    }
  ) : null;
}, zg = ({ className: e, children: t }) => {
  const [n, r] = KX(!1, !0), [i, o] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), { height: s } = eee(a), { isRight: l = !1, isLeft: c = !0 } = JQ(i);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(QQ, { value: {
    isOpen: n,
    toggleOpen: r,
    setTriggerRef: (p) => {
      (0,react__WEBPACK_IMPORTED_MODULE_1__.startTransition)(() => {
        o(p);
      });
    },
    triggerRef: i,
    triggerOnRight: l,
    triggerOnLeft: c
  }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K("size-6 z-[1]", e), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    An.nav,
    {
      className: "h-full",
      initial: !1,
      animate: n ? "open" : "closed",
      custom: s,
      variants: {
        open: {
          pointerEvents: "auto"
        },
        closed: {
          pointerEvents: "none"
        }
      },
      ref: a,
      children: t
    }
  ) }) });
};
zg.displayName = "HamburgerMenu";
wj.displayName = "HamburgerMenu.Toggle";
Sj.displayName = "HamburgerMenu.Options";
_j.displayName = "HamburgerMenu.Option";
zg.Options = Sj;
zg.Option = _j;
zg.Toggle = wj;
var Kp = { exports: {} };
/**
 * @license
 * Lodash <https://lodash.com/>
 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */
Kp.exports;
(function(e, t) {
  (function() {
    var n, r = "4.17.21", i = 200, o = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", a = "Expected a function", s = "Invalid `variable` option passed into `_.template`", l = "__lodash_hash_undefined__", c = 500, f = "__lodash_placeholder__", d = 1, p = 2, m = 4, y = 1, g = 2, v = 1, x = 2, w = 4, S = 8, A = 16, _ = 32, O = 64, P = 128, C = 256, k = 512, I = 30, $ = "...", N = 800, D = 16, j = 1, F = 2, W = 3, z = 1 / 0, H = 9007199254740991, U = 17976931348623157e292, V = NaN, Y = 4294967295, Q = Y - 1, ne = Y >>> 1, re = [
      ["ary", P],
      ["bind", v],
      ["bindKey", x],
      ["curry", S],
      ["curryRight", A],
      ["flip", k],
      ["partial", _],
      ["partialRight", O],
      ["rearg", C]
    ], ce = "[object Arguments]", oe = "[object Array]", fe = "[object AsyncFunction]", ae = "[object Boolean]", ee = "[object Date]", se = "[object DOMException]", ge = "[object Error]", X = "[object Function]", $e = "[object GeneratorFunction]", de = "[object Map]", ke = "[object Number]", it = "[object Null]", lt = "[object Object]", Xn = "[object Promise]", Ie = "[object Proxy]", ct = "[object RegExp]", Oe = "[object Set]", Ge = "[object String]", Zt = "[object Symbol]", mt = "[object Undefined]", en = "[object WeakMap]", Yr = "[object WeakSet]", Cn = "[object ArrayBuffer]", yn = "[object DataView]", mr = "[object Float32Array]", tt = "[object Float64Array]", Kt = "[object Int8Array]", St = "[object Int16Array]", jn = "[object Int32Array]", qr = "[object Uint8Array]", lo = "[object Uint8ClampedArray]", un = "[object Uint16Array]", Pr = "[object Uint32Array]", fn = /\b__p \+= '';/g, Xr = /\b(__p \+=) '' \+/g, yt = /(__e\(.*?\)|\b__t\)) \+\n'';/g, Rd = /&(?:amp|lt|gt|quot|#39);/g, jd = /[&<>"']/g, Ey = RegExp(Rd.source), nu = RegExp(jd.source), ru = /<%-([\s\S]+?)%>/g, Ez = /<%([\s\S]+?)%>/g, WS = /<%=([\s\S]+?)%>/g, kz = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Mz = /^\w*$/, Nz = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ky = /[\\^$.*+?()[\]{}|]/g, $z = RegExp(ky.source), My = /^\s+/, Dz = /\s/, Iz = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, Rz = /\{\n\/\* \[wrapped with (.+)\] \*/, jz = /,? & /, Lz = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, Bz = /[()=,{}\[\]\/\s]/, Fz = /\\(\\)?/g, Wz = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, zS = /\w*$/, zz = /^[-+]0x[0-9a-f]+$/i, Vz = /^0b[01]+$/i, Uz = /^\[object .+?Constructor\]$/, Hz = /^0o[0-7]+$/i, Kz = /^(?:0|[1-9]\d*)$/, Gz = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, Ld = /($^)/, Yz = /['\n\r\u2028\u2029\\]/g, Bd = "\\ud800-\\udfff", qz = "\\u0300-\\u036f", Xz = "\\ufe20-\\ufe2f", Zz = "\\u20d0-\\u20ff", VS = qz + Xz + Zz, US = "\\u2700-\\u27bf", HS = "a-z\\xdf-\\xf6\\xf8-\\xff", Jz = "\\xac\\xb1\\xd7\\xf7", Qz = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", e5 = "\\u2000-\\u206f", t5 = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", KS = "A-Z\\xc0-\\xd6\\xd8-\\xde", GS = "\\ufe0e\\ufe0f", YS = Jz + Qz + e5 + t5, Ny = "['’]", n5 = "[" + Bd + "]", qS = "[" + YS + "]", Fd = "[" + VS + "]", XS = "\\d+", r5 = "[" + US + "]", ZS = "[" + HS + "]", JS = "[^" + Bd + YS + XS + US + HS + KS + "]", $y = "\\ud83c[\\udffb-\\udfff]", i5 = "(?:" + Fd + "|" + $y + ")", QS = "[^" + Bd + "]", Dy = "(?:\\ud83c[\\udde6-\\uddff]){2}", Iy = "[\\ud800-\\udbff][\\udc00-\\udfff]", al = "[" + KS + "]", eO = "\\u200d", tO = "(?:" + ZS + "|" + JS + ")", o5 = "(?:" + al + "|" + JS + ")", nO = "(?:" + Ny + "(?:d|ll|m|re|s|t|ve))?", rO = "(?:" + Ny + "(?:D|LL|M|RE|S|T|VE))?", iO = i5 + "?", oO = "[" + GS + "]?", a5 = "(?:" + eO + "(?:" + [QS, Dy, Iy].join("|") + ")" + oO + iO + ")*", s5 = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", l5 = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", aO = oO + iO + a5, c5 = "(?:" + [r5, Dy, Iy].join("|") + ")" + aO, u5 = "(?:" + [QS + Fd + "?", Fd, Dy, Iy, n5].join("|") + ")", f5 = RegExp(Ny, "g"), d5 = RegExp(Fd, "g"), Ry = RegExp($y + "(?=" + $y + ")|" + u5 + aO, "g"), h5 = RegExp([
      al + "?" + ZS + "+" + nO + "(?=" + [qS, al, "$"].join("|") + ")",
      o5 + "+" + rO + "(?=" + [qS, al + tO, "$"].join("|") + ")",
      al + "?" + tO + "+" + nO,
      al + "+" + rO,
      l5,
      s5,
      XS,
      c5
    ].join("|"), "g"), p5 = RegExp("[" + eO + Bd + VS + GS + "]"), m5 = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, g5 = [
      "Array",
      "Buffer",
      "DataView",
      "Date",
      "Error",
      "Float32Array",
      "Float64Array",
      "Function",
      "Int8Array",
      "Int16Array",
      "Int32Array",
      "Map",
      "Math",
      "Object",
      "Promise",
      "RegExp",
      "Set",
      "String",
      "Symbol",
      "TypeError",
      "Uint8Array",
      "Uint8ClampedArray",
      "Uint16Array",
      "Uint32Array",
      "WeakMap",
      "_",
      "clearTimeout",
      "isFinite",
      "parseInt",
      "setTimeout"
    ], y5 = -1, Ft = {};
    Ft[mr] = Ft[tt] = Ft[Kt] = Ft[St] = Ft[jn] = Ft[qr] = Ft[lo] = Ft[un] = Ft[Pr] = !0, Ft[ce] = Ft[oe] = Ft[Cn] = Ft[ae] = Ft[yn] = Ft[ee] = Ft[ge] = Ft[X] = Ft[de] = Ft[ke] = Ft[lt] = Ft[ct] = Ft[Oe] = Ft[Ge] = Ft[en] = !1;
    var It = {};
    It[ce] = It[oe] = It[Cn] = It[yn] = It[ae] = It[ee] = It[mr] = It[tt] = It[Kt] = It[St] = It[jn] = It[de] = It[ke] = It[lt] = It[ct] = It[Oe] = It[Ge] = It[Zt] = It[qr] = It[lo] = It[un] = It[Pr] = !0, It[ge] = It[X] = It[en] = !1;
    var v5 = {
      // Latin-1 Supplement block.
      À: "A",
      Á: "A",
      Â: "A",
      Ã: "A",
      Ä: "A",
      Å: "A",
      à: "a",
      á: "a",
      â: "a",
      ã: "a",
      ä: "a",
      å: "a",
      Ç: "C",
      ç: "c",
      Ð: "D",
      ð: "d",
      È: "E",
      É: "E",
      Ê: "E",
      Ë: "E",
      è: "e",
      é: "e",
      ê: "e",
      ë: "e",
      Ì: "I",
      Í: "I",
      Î: "I",
      Ï: "I",
      ì: "i",
      í: "i",
      î: "i",
      ï: "i",
      Ñ: "N",
      ñ: "n",
      Ò: "O",
      Ó: "O",
      Ô: "O",
      Õ: "O",
      Ö: "O",
      Ø: "O",
      ò: "o",
      ó: "o",
      ô: "o",
      õ: "o",
      ö: "o",
      ø: "o",
      Ù: "U",
      Ú: "U",
      Û: "U",
      Ü: "U",
      ù: "u",
      ú: "u",
      û: "u",
      ü: "u",
      Ý: "Y",
      ý: "y",
      ÿ: "y",
      Æ: "Ae",
      æ: "ae",
      Þ: "Th",
      þ: "th",
      ß: "ss",
      // Latin Extended-A block.
      Ā: "A",
      Ă: "A",
      Ą: "A",
      ā: "a",
      ă: "a",
      ą: "a",
      Ć: "C",
      Ĉ: "C",
      Ċ: "C",
      Č: "C",
      ć: "c",
      ĉ: "c",
      ċ: "c",
      č: "c",
      Ď: "D",
      Đ: "D",
      ď: "d",
      đ: "d",
      Ē: "E",
      Ĕ: "E",
      Ė: "E",
      Ę: "E",
      Ě: "E",
      ē: "e",
      ĕ: "e",
      ė: "e",
      ę: "e",
      ě: "e",
      Ĝ: "G",
      Ğ: "G",
      Ġ: "G",
      Ģ: "G",
      ĝ: "g",
      ğ: "g",
      ġ: "g",
      ģ: "g",
      Ĥ: "H",
      Ħ: "H",
      ĥ: "h",
      ħ: "h",
      Ĩ: "I",
      Ī: "I",
      Ĭ: "I",
      Į: "I",
      İ: "I",
      ĩ: "i",
      ī: "i",
      ĭ: "i",
      į: "i",
      ı: "i",
      Ĵ: "J",
      ĵ: "j",
      Ķ: "K",
      ķ: "k",
      ĸ: "k",
      Ĺ: "L",
      Ļ: "L",
      Ľ: "L",
      Ŀ: "L",
      Ł: "L",
      ĺ: "l",
      ļ: "l",
      ľ: "l",
      ŀ: "l",
      ł: "l",
      Ń: "N",
      Ņ: "N",
      Ň: "N",
      Ŋ: "N",
      ń: "n",
      ņ: "n",
      ň: "n",
      ŋ: "n",
      Ō: "O",
      Ŏ: "O",
      Ő: "O",
      ō: "o",
      ŏ: "o",
      ő: "o",
      Ŕ: "R",
      Ŗ: "R",
      Ř: "R",
      ŕ: "r",
      ŗ: "r",
      ř: "r",
      Ś: "S",
      Ŝ: "S",
      Ş: "S",
      Š: "S",
      ś: "s",
      ŝ: "s",
      ş: "s",
      š: "s",
      Ţ: "T",
      Ť: "T",
      Ŧ: "T",
      ţ: "t",
      ť: "t",
      ŧ: "t",
      Ũ: "U",
      Ū: "U",
      Ŭ: "U",
      Ů: "U",
      Ű: "U",
      Ų: "U",
      ũ: "u",
      ū: "u",
      ŭ: "u",
      ů: "u",
      ű: "u",
      ų: "u",
      Ŵ: "W",
      ŵ: "w",
      Ŷ: "Y",
      ŷ: "y",
      Ÿ: "Y",
      Ź: "Z",
      Ż: "Z",
      Ž: "Z",
      ź: "z",
      ż: "z",
      ž: "z",
      Ĳ: "IJ",
      ĳ: "ij",
      Œ: "Oe",
      œ: "oe",
      ŉ: "'n",
      ſ: "s"
    }, b5 = {
      "&": "&amp;",
      "<": "&lt;",
      ">": "&gt;",
      '"': "&quot;",
      "'": "&#39;"
    }, x5 = {
      "&amp;": "&",
      "&lt;": "<",
      "&gt;": ">",
      "&quot;": '"',
      "&#39;": "'"
    }, w5 = {
      "\\": "\\",
      "'": "'",
      "\n": "n",
      "\r": "r",
      "\u2028": "u2028",
      "\u2029": "u2029"
    }, _5 = parseFloat, S5 = parseInt, sO = typeof _commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.c == "object" && _commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.c && _commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.c.Object === Object && _commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.c, O5 = typeof self == "object" && self && self.Object === Object && self, Ln = sO || O5 || Function("return this")(), jy = t && !t.nodeType && t, Za = jy && !0 && e && !e.nodeType && e, lO = Za && Za.exports === jy, Ly = lO && sO.process, Zr = function() {
      try {
        var Z = Za && Za.require && Za.require("util").types;
        return Z || Ly && Ly.binding && Ly.binding("util");
      } catch {
      }
    }(), cO = Zr && Zr.isArrayBuffer, uO = Zr && Zr.isDate, fO = Zr && Zr.isMap, dO = Zr && Zr.isRegExp, hO = Zr && Zr.isSet, pO = Zr && Zr.isTypedArray;
    function Cr(Z, ue, ie) {
      switch (ie.length) {
        case 0:
          return Z.call(ue);
        case 1:
          return Z.call(ue, ie[0]);
        case 2:
          return Z.call(ue, ie[0], ie[1]);
        case 3:
          return Z.call(ue, ie[0], ie[1], ie[2]);
      }
      return Z.apply(ue, ie);
    }
    function A5(Z, ue, ie, Te) {
      for (var He = -1, gt = Z == null ? 0 : Z.length; ++He < gt; ) {
        var vn = Z[He];
        ue(Te, vn, ie(vn), Z);
      }
      return Te;
    }
    function Jr(Z, ue) {
      for (var ie = -1, Te = Z == null ? 0 : Z.length; ++ie < Te && ue(Z[ie], ie, Z) !== !1; )
        ;
      return Z;
    }
    function T5(Z, ue) {
      for (var ie = Z == null ? 0 : Z.length; ie-- && ue(Z[ie], ie, Z) !== !1; )
        ;
      return Z;
    }
    function mO(Z, ue) {
      for (var ie = -1, Te = Z == null ? 0 : Z.length; ++ie < Te; )
        if (!ue(Z[ie], ie, Z))
          return !1;
      return !0;
    }
    function ia(Z, ue) {
      for (var ie = -1, Te = Z == null ? 0 : Z.length, He = 0, gt = []; ++ie < Te; ) {
        var vn = Z[ie];
        ue(vn, ie, Z) && (gt[He++] = vn);
      }
      return gt;
    }
    function Wd(Z, ue) {
      var ie = Z == null ? 0 : Z.length;
      return !!ie && sl(Z, ue, 0) > -1;
    }
    function By(Z, ue, ie) {
      for (var Te = -1, He = Z == null ? 0 : Z.length; ++Te < He; )
        if (ie(ue, Z[Te]))
          return !0;
      return !1;
    }
    function Gt(Z, ue) {
      for (var ie = -1, Te = Z == null ? 0 : Z.length, He = Array(Te); ++ie < Te; )
        He[ie] = ue(Z[ie], ie, Z);
      return He;
    }
    function oa(Z, ue) {
      for (var ie = -1, Te = ue.length, He = Z.length; ++ie < Te; )
        Z[He + ie] = ue[ie];
      return Z;
    }
    function Fy(Z, ue, ie, Te) {
      var He = -1, gt = Z == null ? 0 : Z.length;
      for (Te && gt && (ie = Z[++He]); ++He < gt; )
        ie = ue(ie, Z[He], He, Z);
      return ie;
    }
    function P5(Z, ue, ie, Te) {
      var He = Z == null ? 0 : Z.length;
      for (Te && He && (ie = Z[--He]); He--; )
        ie = ue(ie, Z[He], He, Z);
      return ie;
    }
    function Wy(Z, ue) {
      for (var ie = -1, Te = Z == null ? 0 : Z.length; ++ie < Te; )
        if (ue(Z[ie], ie, Z))
          return !0;
      return !1;
    }
    var C5 = zy("length");
    function E5(Z) {
      return Z.split("");
    }
    function k5(Z) {
      return Z.match(Lz) || [];
    }
    function gO(Z, ue, ie) {
      var Te;
      return ie(Z, function(He, gt, vn) {
        if (ue(He, gt, vn))
          return Te = gt, !1;
      }), Te;
    }
    function zd(Z, ue, ie, Te) {
      for (var He = Z.length, gt = ie + (Te ? 1 : -1); Te ? gt-- : ++gt < He; )
        if (ue(Z[gt], gt, Z))
          return gt;
      return -1;
    }
    function sl(Z, ue, ie) {
      return ue === ue ? z5(Z, ue, ie) : zd(Z, yO, ie);
    }
    function M5(Z, ue, ie, Te) {
      for (var He = ie - 1, gt = Z.length; ++He < gt; )
        if (Te(Z[He], ue))
          return He;
      return -1;
    }
    function yO(Z) {
      return Z !== Z;
    }
    function vO(Z, ue) {
      var ie = Z == null ? 0 : Z.length;
      return ie ? Uy(Z, ue) / ie : V;
    }
    function zy(Z) {
      return function(ue) {
        return ue == null ? n : ue[Z];
      };
    }
    function Vy(Z) {
      return function(ue) {
        return Z == null ? n : Z[ue];
      };
    }
    function bO(Z, ue, ie, Te, He) {
      return He(Z, function(gt, vn, Mt) {
        ie = Te ? (Te = !1, gt) : ue(ie, gt, vn, Mt);
      }), ie;
    }
    function N5(Z, ue) {
      var ie = Z.length;
      for (Z.sort(ue); ie--; )
        Z[ie] = Z[ie].value;
      return Z;
    }
    function Uy(Z, ue) {
      for (var ie, Te = -1, He = Z.length; ++Te < He; ) {
        var gt = ue(Z[Te]);
        gt !== n && (ie = ie === n ? gt : ie + gt);
      }
      return ie;
    }
    function Hy(Z, ue) {
      for (var ie = -1, Te = Array(Z); ++ie < Z; )
        Te[ie] = ue(ie);
      return Te;
    }
    function $5(Z, ue) {
      return Gt(ue, function(ie) {
        return [ie, Z[ie]];
      });
    }
    function xO(Z) {
      return Z && Z.slice(0, OO(Z) + 1).replace(My, "");
    }
    function Er(Z) {
      return function(ue) {
        return Z(ue);
      };
    }
    function Ky(Z, ue) {
      return Gt(ue, function(ie) {
        return Z[ie];
      });
    }
    function iu(Z, ue) {
      return Z.has(ue);
    }
    function wO(Z, ue) {
      for (var ie = -1, Te = Z.length; ++ie < Te && sl(ue, Z[ie], 0) > -1; )
        ;
      return ie;
    }
    function _O(Z, ue) {
      for (var ie = Z.length; ie-- && sl(ue, Z[ie], 0) > -1; )
        ;
      return ie;
    }
    function D5(Z, ue) {
      for (var ie = Z.length, Te = 0; ie--; )
        Z[ie] === ue && ++Te;
      return Te;
    }
    var I5 = Vy(v5), R5 = Vy(b5);
    function j5(Z) {
      return "\\" + w5[Z];
    }
    function L5(Z, ue) {
      return Z == null ? n : Z[ue];
    }
    function ll(Z) {
      return p5.test(Z);
    }
    function B5(Z) {
      return m5.test(Z);
    }
    function F5(Z) {
      for (var ue, ie = []; !(ue = Z.next()).done; )
        ie.push(ue.value);
      return ie;
    }
    function Gy(Z) {
      var ue = -1, ie = Array(Z.size);
      return Z.forEach(function(Te, He) {
        ie[++ue] = [He, Te];
      }), ie;
    }
    function SO(Z, ue) {
      return function(ie) {
        return Z(ue(ie));
      };
    }
    function aa(Z, ue) {
      for (var ie = -1, Te = Z.length, He = 0, gt = []; ++ie < Te; ) {
        var vn = Z[ie];
        (vn === ue || vn === f) && (Z[ie] = f, gt[He++] = ie);
      }
      return gt;
    }
    function Vd(Z) {
      var ue = -1, ie = Array(Z.size);
      return Z.forEach(function(Te) {
        ie[++ue] = Te;
      }), ie;
    }
    function W5(Z) {
      var ue = -1, ie = Array(Z.size);
      return Z.forEach(function(Te) {
        ie[++ue] = [Te, Te];
      }), ie;
    }
    function z5(Z, ue, ie) {
      for (var Te = ie - 1, He = Z.length; ++Te < He; )
        if (Z[Te] === ue)
          return Te;
      return -1;
    }
    function V5(Z, ue, ie) {
      for (var Te = ie + 1; Te--; )
        if (Z[Te] === ue)
          return Te;
      return Te;
    }
    function cl(Z) {
      return ll(Z) ? H5(Z) : C5(Z);
    }
    function yi(Z) {
      return ll(Z) ? K5(Z) : E5(Z);
    }
    function OO(Z) {
      for (var ue = Z.length; ue-- && Dz.test(Z.charAt(ue)); )
        ;
      return ue;
    }
    var U5 = Vy(x5);
    function H5(Z) {
      for (var ue = Ry.lastIndex = 0; Ry.test(Z); )
        ++ue;
      return ue;
    }
    function K5(Z) {
      return Z.match(Ry) || [];
    }
    function G5(Z) {
      return Z.match(h5) || [];
    }
    var Y5 = function Z(ue) {
      ue = ue == null ? Ln : ul.defaults(Ln.Object(), ue, ul.pick(Ln, g5));
      var ie = ue.Array, Te = ue.Date, He = ue.Error, gt = ue.Function, vn = ue.Math, Mt = ue.Object, Yy = ue.RegExp, q5 = ue.String, Qr = ue.TypeError, Ud = ie.prototype, X5 = gt.prototype, fl = Mt.prototype, Hd = ue["__core-js_shared__"], Kd = X5.toString, Ot = fl.hasOwnProperty, Z5 = 0, AO = function() {
        var u = /[^.]+$/.exec(Hd && Hd.keys && Hd.keys.IE_PROTO || "");
        return u ? "Symbol(src)_1." + u : "";
      }(), Gd = fl.toString, J5 = Kd.call(Mt), Q5 = Ln._, e3 = Yy(
        "^" + Kd.call(Ot).replace(ky, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
      ), Yd = lO ? ue.Buffer : n, sa = ue.Symbol, qd = ue.Uint8Array, TO = Yd ? Yd.allocUnsafe : n, Xd = SO(Mt.getPrototypeOf, Mt), PO = Mt.create, CO = fl.propertyIsEnumerable, Zd = Ud.splice, EO = sa ? sa.isConcatSpreadable : n, ou = sa ? sa.iterator : n, Ja = sa ? sa.toStringTag : n, Jd = function() {
        try {
          var u = rs(Mt, "defineProperty");
          return u({}, "", {}), u;
        } catch {
        }
      }(), t3 = ue.clearTimeout !== Ln.clearTimeout && ue.clearTimeout, n3 = Te && Te.now !== Ln.Date.now && Te.now, r3 = ue.setTimeout !== Ln.setTimeout && ue.setTimeout, Qd = vn.ceil, eh = vn.floor, qy = Mt.getOwnPropertySymbols, i3 = Yd ? Yd.isBuffer : n, kO = ue.isFinite, o3 = Ud.join, a3 = SO(Mt.keys, Mt), bn = vn.max, Zn = vn.min, s3 = Te.now, l3 = ue.parseInt, MO = vn.random, c3 = Ud.reverse, Xy = rs(ue, "DataView"), au = rs(ue, "Map"), Zy = rs(ue, "Promise"), dl = rs(ue, "Set"), su = rs(ue, "WeakMap"), lu = rs(Mt, "create"), th = su && new su(), hl = {}, u3 = is(Xy), f3 = is(au), d3 = is(Zy), h3 = is(dl), p3 = is(su), nh = sa ? sa.prototype : n, cu = nh ? nh.valueOf : n, NO = nh ? nh.toString : n;
      function L(u) {
        if (tn(u) && !Ye(u) && !(u instanceof ut)) {
          if (u instanceof ei)
            return u;
          if (Ot.call(u, "__wrapped__"))
            return $A(u);
        }
        return new ei(u);
      }
      var pl = /* @__PURE__ */ function() {
        function u() {
        }
        return function(h) {
          if (!Jt(h))
            return {};
          if (PO)
            return PO(h);
          u.prototype = h;
          var b = new u();
          return u.prototype = n, b;
        };
      }();
      function rh() {
      }
      function ei(u, h) {
        this.__wrapped__ = u, this.__actions__ = [], this.__chain__ = !!h, this.__index__ = 0, this.__values__ = n;
      }
      L.templateSettings = {
        /**
         * Used to detect `data` property values to be HTML-escaped.
         *
         * @memberOf _.templateSettings
         * @type {RegExp}
         */
        escape: ru,
        /**
         * Used to detect code to be evaluated.
         *
         * @memberOf _.templateSettings
         * @type {RegExp}
         */
        evaluate: Ez,
        /**
         * Used to detect `data` property values to inject.
         *
         * @memberOf _.templateSettings
         * @type {RegExp}
         */
        interpolate: WS,
        /**
         * Used to reference the data object in the template text.
         *
         * @memberOf _.templateSettings
         * @type {string}
         */
        variable: "",
        /**
         * Used to import variables into the compiled template.
         *
         * @memberOf _.templateSettings
         * @type {Object}
         */
        imports: {
          /**
           * A reference to the `lodash` function.
           *
           * @memberOf _.templateSettings.imports
           * @type {Function}
           */
          _: L
        }
      }, L.prototype = rh.prototype, L.prototype.constructor = L, ei.prototype = pl(rh.prototype), ei.prototype.constructor = ei;
      function ut(u) {
        this.__wrapped__ = u, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = Y, this.__views__ = [];
      }
      function m3() {
        var u = new ut(this.__wrapped__);
        return u.__actions__ = gr(this.__actions__), u.__dir__ = this.__dir__, u.__filtered__ = this.__filtered__, u.__iteratees__ = gr(this.__iteratees__), u.__takeCount__ = this.__takeCount__, u.__views__ = gr(this.__views__), u;
      }
      function g3() {
        if (this.__filtered__) {
          var u = new ut(this);
          u.__dir__ = -1, u.__filtered__ = !0;
        } else
          u = this.clone(), u.__dir__ *= -1;
        return u;
      }
      function y3() {
        var u = this.__wrapped__.value(), h = this.__dir__, b = Ye(u), T = h < 0, M = b ? u.length : 0, B = EV(0, M, this.__views__), G = B.start, q = B.end, J = q - G, he = T ? q : G - 1, me = this.__iteratees__, ye = me.length, xe = 0, Ce = Zn(J, this.__takeCount__);
        if (!b || !T && M == J && Ce == J)
          return nA(u, this.__actions__);
        var Re = [];
        e:
          for (; J-- && xe < Ce; ) {
            he += h;
            for (var et = -1, je = u[he]; ++et < ye; ) {
              var ot = me[et], ft = ot.iteratee, Nr = ot.type, sr = ft(je);
              if (Nr == F)
                je = sr;
              else if (!sr) {
                if (Nr == j)
                  continue e;
                break e;
              }
            }
            Re[xe++] = je;
          }
        return Re;
      }
      ut.prototype = pl(rh.prototype), ut.prototype.constructor = ut;
      function Qa(u) {
        var h = -1, b = u == null ? 0 : u.length;
        for (this.clear(); ++h < b; ) {
          var T = u[h];
          this.set(T[0], T[1]);
        }
      }
      function v3() {
        this.__data__ = lu ? lu(null) : {}, this.size = 0;
      }
      function b3(u) {
        var h = this.has(u) && delete this.__data__[u];
        return this.size -= h ? 1 : 0, h;
      }
      function x3(u) {
        var h = this.__data__;
        if (lu) {
          var b = h[u];
          return b === l ? n : b;
        }
        return Ot.call(h, u) ? h[u] : n;
      }
      function w3(u) {
        var h = this.__data__;
        return lu ? h[u] !== n : Ot.call(h, u);
      }
      function _3(u, h) {
        var b = this.__data__;
        return this.size += this.has(u) ? 0 : 1, b[u] = lu && h === n ? l : h, this;
      }
      Qa.prototype.clear = v3, Qa.prototype.delete = b3, Qa.prototype.get = x3, Qa.prototype.has = w3, Qa.prototype.set = _3;
      function co(u) {
        var h = -1, b = u == null ? 0 : u.length;
        for (this.clear(); ++h < b; ) {
          var T = u[h];
          this.set(T[0], T[1]);
        }
      }
      function S3() {
        this.__data__ = [], this.size = 0;
      }
      function O3(u) {
        var h = this.__data__, b = ih(h, u);
        if (b < 0)
          return !1;
        var T = h.length - 1;
        return b == T ? h.pop() : Zd.call(h, b, 1), --this.size, !0;
      }
      function A3(u) {
        var h = this.__data__, b = ih(h, u);
        return b < 0 ? n : h[b][1];
      }
      function T3(u) {
        return ih(this.__data__, u) > -1;
      }
      function P3(u, h) {
        var b = this.__data__, T = ih(b, u);
        return T < 0 ? (++this.size, b.push([u, h])) : b[T][1] = h, this;
      }
      co.prototype.clear = S3, co.prototype.delete = O3, co.prototype.get = A3, co.prototype.has = T3, co.prototype.set = P3;
      function uo(u) {
        var h = -1, b = u == null ? 0 : u.length;
        for (this.clear(); ++h < b; ) {
          var T = u[h];
          this.set(T[0], T[1]);
        }
      }
      function C3() {
        this.size = 0, this.__data__ = {
          hash: new Qa(),
          map: new (au || co)(),
          string: new Qa()
        };
      }
      function E3(u) {
        var h = gh(this, u).delete(u);
        return this.size -= h ? 1 : 0, h;
      }
      function k3(u) {
        return gh(this, u).get(u);
      }
      function M3(u) {
        return gh(this, u).has(u);
      }
      function N3(u, h) {
        var b = gh(this, u), T = b.size;
        return b.set(u, h), this.size += b.size == T ? 0 : 1, this;
      }
      uo.prototype.clear = C3, uo.prototype.delete = E3, uo.prototype.get = k3, uo.prototype.has = M3, uo.prototype.set = N3;
      function es(u) {
        var h = -1, b = u == null ? 0 : u.length;
        for (this.__data__ = new uo(); ++h < b; )
          this.add(u[h]);
      }
      function $3(u) {
        return this.__data__.set(u, l), this;
      }
      function D3(u) {
        return this.__data__.has(u);
      }
      es.prototype.add = es.prototype.push = $3, es.prototype.has = D3;
      function vi(u) {
        var h = this.__data__ = new co(u);
        this.size = h.size;
      }
      function I3() {
        this.__data__ = new co(), this.size = 0;
      }
      function R3(u) {
        var h = this.__data__, b = h.delete(u);
        return this.size = h.size, b;
      }
      function j3(u) {
        return this.__data__.get(u);
      }
      function L3(u) {
        return this.__data__.has(u);
      }
      function B3(u, h) {
        var b = this.__data__;
        if (b instanceof co) {
          var T = b.__data__;
          if (!au || T.length < i - 1)
            return T.push([u, h]), this.size = ++b.size, this;
          b = this.__data__ = new uo(T);
        }
        return b.set(u, h), this.size = b.size, this;
      }
      vi.prototype.clear = I3, vi.prototype.delete = R3, vi.prototype.get = j3, vi.prototype.has = L3, vi.prototype.set = B3;
      function $O(u, h) {
        var b = Ye(u), T = !b && os(u), M = !b && !T && da(u), B = !b && !T && !M && vl(u), G = b || T || M || B, q = G ? Hy(u.length, q5) : [], J = q.length;
        for (var he in u)
          (h || Ot.call(u, he)) && !(G && // Safari 9 has enumerable `arguments.length` in strict mode.
          (he == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
          M && (he == "offset" || he == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
          B && (he == "buffer" || he == "byteLength" || he == "byteOffset") || // Skip index properties.
          mo(he, J))) && q.push(he);
        return q;
      }
      function DO(u) {
        var h = u.length;
        return h ? u[lv(0, h - 1)] : n;
      }
      function F3(u, h) {
        return yh(gr(u), ts(h, 0, u.length));
      }
      function W3(u) {
        return yh(gr(u));
      }
      function Jy(u, h, b) {
        (b !== n && !bi(u[h], b) || b === n && !(h in u)) && fo(u, h, b);
      }
      function uu(u, h, b) {
        var T = u[h];
        (!(Ot.call(u, h) && bi(T, b)) || b === n && !(h in u)) && fo(u, h, b);
      }
      function ih(u, h) {
        for (var b = u.length; b--; )
          if (bi(u[b][0], h))
            return b;
        return -1;
      }
      function z3(u, h, b, T) {
        return la(u, function(M, B, G) {
          h(T, M, b(M), G);
        }), T;
      }
      function IO(u, h) {
        return u && ji(h, En(h), u);
      }
      function V3(u, h) {
        return u && ji(h, vr(h), u);
      }
      function fo(u, h, b) {
        h == "__proto__" && Jd ? Jd(u, h, {
          configurable: !0,
          enumerable: !0,
          value: b,
          writable: !0
        }) : u[h] = b;
      }
      function Qy(u, h) {
        for (var b = -1, T = h.length, M = ie(T), B = u == null; ++b < T; )
          M[b] = B ? n : $v(u, h[b]);
        return M;
      }
      function ts(u, h, b) {
        return u === u && (b !== n && (u = u <= b ? u : b), h !== n && (u = u >= h ? u : h)), u;
      }
      function ti(u, h, b, T, M, B) {
        var G, q = h & d, J = h & p, he = h & m;
        if (b && (G = M ? b(u, T, M, B) : b(u)), G !== n)
          return G;
        if (!Jt(u))
          return u;
        var me = Ye(u);
        if (me) {
          if (G = MV(u), !q)
            return gr(u, G);
        } else {
          var ye = Jn(u), xe = ye == X || ye == $e;
          if (da(u))
            return oA(u, q);
          if (ye == lt || ye == ce || xe && !M) {
            if (G = J || xe ? {} : OA(u), !q)
              return J ? xV(u, V3(G, u)) : bV(u, IO(G, u));
          } else {
            if (!It[ye])
              return M ? u : {};
            G = NV(u, ye, q);
          }
        }
        B || (B = new vi());
        var Ce = B.get(u);
        if (Ce)
          return Ce;
        B.set(u, G), QA(u) ? u.forEach(function(je) {
          G.add(ti(je, h, b, je, u, B));
        }) : ZA(u) && u.forEach(function(je, ot) {
          G.set(ot, ti(je, h, b, ot, u, B));
        });
        var Re = he ? J ? bv : vv : J ? vr : En, et = me ? n : Re(u);
        return Jr(et || u, function(je, ot) {
          et && (ot = je, je = u[ot]), uu(G, ot, ti(je, h, b, ot, u, B));
        }), G;
      }
      function U3(u) {
        var h = En(u);
        return function(b) {
          return RO(b, u, h);
        };
      }
      function RO(u, h, b) {
        var T = b.length;
        if (u == null)
          return !T;
        for (u = Mt(u); T--; ) {
          var M = b[T], B = h[M], G = u[M];
          if (G === n && !(M in u) || !B(G))
            return !1;
        }
        return !0;
      }
      function jO(u, h, b) {
        if (typeof u != "function")
          throw new Qr(a);
        return yu(function() {
          u.apply(n, b);
        }, h);
      }
      function fu(u, h, b, T) {
        var M = -1, B = Wd, G = !0, q = u.length, J = [], he = h.length;
        if (!q)
          return J;
        b && (h = Gt(h, Er(b))), T ? (B = By, G = !1) : h.length >= i && (B = iu, G = !1, h = new es(h));
        e:
          for (; ++M < q; ) {
            var me = u[M], ye = b == null ? me : b(me);
            if (me = T || me !== 0 ? me : 0, G && ye === ye) {
              for (var xe = he; xe--; )
                if (h[xe] === ye)
                  continue e;
              J.push(me);
            } else B(h, ye, T) || J.push(me);
          }
        return J;
      }
      var la = uA(Ri), LO = uA(tv, !0);
      function H3(u, h) {
        var b = !0;
        return la(u, function(T, M, B) {
          return b = !!h(T, M, B), b;
        }), b;
      }
      function oh(u, h, b) {
        for (var T = -1, M = u.length; ++T < M; ) {
          var B = u[T], G = h(B);
          if (G != null && (q === n ? G === G && !Mr(G) : b(G, q)))
            var q = G, J = B;
        }
        return J;
      }
      function K3(u, h, b, T) {
        var M = u.length;
        for (b = Ze(b), b < 0 && (b = -b > M ? 0 : M + b), T = T === n || T > M ? M : Ze(T), T < 0 && (T += M), T = b > T ? 0 : tT(T); b < T; )
          u[b++] = h;
        return u;
      }
      function BO(u, h) {
        var b = [];
        return la(u, function(T, M, B) {
          h(T, M, B) && b.push(T);
        }), b;
      }
      function Bn(u, h, b, T, M) {
        var B = -1, G = u.length;
        for (b || (b = DV), M || (M = []); ++B < G; ) {
          var q = u[B];
          h > 0 && b(q) ? h > 1 ? Bn(q, h - 1, b, T, M) : oa(M, q) : T || (M[M.length] = q);
        }
        return M;
      }
      var ev = fA(), FO = fA(!0);
      function Ri(u, h) {
        return u && ev(u, h, En);
      }
      function tv(u, h) {
        return u && FO(u, h, En);
      }
      function ah(u, h) {
        return ia(h, function(b) {
          return go(u[b]);
        });
      }
      function ns(u, h) {
        h = ua(h, u);
        for (var b = 0, T = h.length; u != null && b < T; )
          u = u[Li(h[b++])];
        return b && b == T ? u : n;
      }
      function WO(u, h, b) {
        var T = h(u);
        return Ye(u) ? T : oa(T, b(u));
      }
      function or(u) {
        return u == null ? u === n ? mt : it : Ja && Ja in Mt(u) ? CV(u) : WV(u);
      }
      function nv(u, h) {
        return u > h;
      }
      function G3(u, h) {
        return u != null && Ot.call(u, h);
      }
      function Y3(u, h) {
        return u != null && h in Mt(u);
      }
      function q3(u, h, b) {
        return u >= Zn(h, b) && u < bn(h, b);
      }
      function rv(u, h, b) {
        for (var T = b ? By : Wd, M = u[0].length, B = u.length, G = B, q = ie(B), J = 1 / 0, he = []; G--; ) {
          var me = u[G];
          G && h && (me = Gt(me, Er(h))), J = Zn(me.length, J), q[G] = !b && (h || M >= 120 && me.length >= 120) ? new es(G && me) : n;
        }
        me = u[0];
        var ye = -1, xe = q[0];
        e:
          for (; ++ye < M && he.length < J; ) {
            var Ce = me[ye], Re = h ? h(Ce) : Ce;
            if (Ce = b || Ce !== 0 ? Ce : 0, !(xe ? iu(xe, Re) : T(he, Re, b))) {
              for (G = B; --G; ) {
                var et = q[G];
                if (!(et ? iu(et, Re) : T(u[G], Re, b)))
                  continue e;
              }
              xe && xe.push(Re), he.push(Ce);
            }
          }
        return he;
      }
      function X3(u, h, b, T) {
        return Ri(u, function(M, B, G) {
          h(T, b(M), B, G);
        }), T;
      }
      function du(u, h, b) {
        h = ua(h, u), u = CA(u, h);
        var T = u == null ? u : u[Li(ri(h))];
        return T == null ? n : Cr(T, u, b);
      }
      function zO(u) {
        return tn(u) && or(u) == ce;
      }
      function Z3(u) {
        return tn(u) && or(u) == Cn;
      }
      function J3(u) {
        return tn(u) && or(u) == ee;
      }
      function hu(u, h, b, T, M) {
        return u === h ? !0 : u == null || h == null || !tn(u) && !tn(h) ? u !== u && h !== h : Q3(u, h, b, T, hu, M);
      }
      function Q3(u, h, b, T, M, B) {
        var G = Ye(u), q = Ye(h), J = G ? oe : Jn(u), he = q ? oe : Jn(h);
        J = J == ce ? lt : J, he = he == ce ? lt : he;
        var me = J == lt, ye = he == lt, xe = J == he;
        if (xe && da(u)) {
          if (!da(h))
            return !1;
          G = !0, me = !1;
        }
        if (xe && !me)
          return B || (B = new vi()), G || vl(u) ? wA(u, h, b, T, M, B) : TV(u, h, J, b, T, M, B);
        if (!(b & y)) {
          var Ce = me && Ot.call(u, "__wrapped__"), Re = ye && Ot.call(h, "__wrapped__");
          if (Ce || Re) {
            var et = Ce ? u.value() : u, je = Re ? h.value() : h;
            return B || (B = new vi()), M(et, je, b, T, B);
          }
        }
        return xe ? (B || (B = new vi()), PV(u, h, b, T, M, B)) : !1;
      }
      function eV(u) {
        return tn(u) && Jn(u) == de;
      }
      function iv(u, h, b, T) {
        var M = b.length, B = M, G = !T;
        if (u == null)
          return !B;
        for (u = Mt(u); M--; ) {
          var q = b[M];
          if (G && q[2] ? q[1] !== u[q[0]] : !(q[0] in u))
            return !1;
        }
        for (; ++M < B; ) {
          q = b[M];
          var J = q[0], he = u[J], me = q[1];
          if (G && q[2]) {
            if (he === n && !(J in u))
              return !1;
          } else {
            var ye = new vi();
            if (T)
              var xe = T(he, me, J, u, h, ye);
            if (!(xe === n ? hu(me, he, y | g, T, ye) : xe))
              return !1;
          }
        }
        return !0;
      }
      function VO(u) {
        if (!Jt(u) || RV(u))
          return !1;
        var h = go(u) ? e3 : Uz;
        return h.test(is(u));
      }
      function tV(u) {
        return tn(u) && or(u) == ct;
      }
      function nV(u) {
        return tn(u) && Jn(u) == Oe;
      }
      function rV(u) {
        return tn(u) && Sh(u.length) && !!Ft[or(u)];
      }
      function UO(u) {
        return typeof u == "function" ? u : u == null ? br : typeof u == "object" ? Ye(u) ? GO(u[0], u[1]) : KO(u) : dT(u);
      }
      function ov(u) {
        if (!gu(u))
          return a3(u);
        var h = [];
        for (var b in Mt(u))
          Ot.call(u, b) && b != "constructor" && h.push(b);
        return h;
      }
      function iV(u) {
        if (!Jt(u))
          return FV(u);
        var h = gu(u), b = [];
        for (var T in u)
          T == "constructor" && (h || !Ot.call(u, T)) || b.push(T);
        return b;
      }
      function av(u, h) {
        return u < h;
      }
      function HO(u, h) {
        var b = -1, T = yr(u) ? ie(u.length) : [];
        return la(u, function(M, B, G) {
          T[++b] = h(M, B, G);
        }), T;
      }
      function KO(u) {
        var h = wv(u);
        return h.length == 1 && h[0][2] ? TA(h[0][0], h[0][1]) : function(b) {
          return b === u || iv(b, u, h);
        };
      }
      function GO(u, h) {
        return Sv(u) && AA(h) ? TA(Li(u), h) : function(b) {
          var T = $v(b, u);
          return T === n && T === h ? Dv(b, u) : hu(h, T, y | g);
        };
      }
      function sh(u, h, b, T, M) {
        u !== h && ev(h, function(B, G) {
          if (M || (M = new vi()), Jt(B))
            oV(u, h, G, b, sh, T, M);
          else {
            var q = T ? T(Av(u, G), B, G + "", u, h, M) : n;
            q === n && (q = B), Jy(u, G, q);
          }
        }, vr);
      }
      function oV(u, h, b, T, M, B, G) {
        var q = Av(u, b), J = Av(h, b), he = G.get(J);
        if (he) {
          Jy(u, b, he);
          return;
        }
        var me = B ? B(q, J, b + "", u, h, G) : n, ye = me === n;
        if (ye) {
          var xe = Ye(J), Ce = !xe && da(J), Re = !xe && !Ce && vl(J);
          me = J, xe || Ce || Re ? Ye(q) ? me = q : an(q) ? me = gr(q) : Ce ? (ye = !1, me = oA(J, !0)) : Re ? (ye = !1, me = aA(J, !0)) : me = [] : vu(J) || os(J) ? (me = q, os(q) ? me = nT(q) : (!Jt(q) || go(q)) && (me = OA(J))) : ye = !1;
        }
        ye && (G.set(J, me), M(me, J, T, B, G), G.delete(J)), Jy(u, b, me);
      }
      function YO(u, h) {
        var b = u.length;
        if (b)
          return h += h < 0 ? b : 0, mo(h, b) ? u[h] : n;
      }
      function qO(u, h, b) {
        h.length ? h = Gt(h, function(B) {
          return Ye(B) ? function(G) {
            return ns(G, B.length === 1 ? B[0] : B);
          } : B;
        }) : h = [br];
        var T = -1;
        h = Gt(h, Er(De()));
        var M = HO(u, function(B, G, q) {
          var J = Gt(h, function(he) {
            return he(B);
          });
          return { criteria: J, index: ++T, value: B };
        });
        return N5(M, function(B, G) {
          return vV(B, G, b);
        });
      }
      function aV(u, h) {
        return XO(u, h, function(b, T) {
          return Dv(u, T);
        });
      }
      function XO(u, h, b) {
        for (var T = -1, M = h.length, B = {}; ++T < M; ) {
          var G = h[T], q = ns(u, G);
          b(q, G) && pu(B, ua(G, u), q);
        }
        return B;
      }
      function sV(u) {
        return function(h) {
          return ns(h, u);
        };
      }
      function sv(u, h, b, T) {
        var M = T ? M5 : sl, B = -1, G = h.length, q = u;
        for (u === h && (h = gr(h)), b && (q = Gt(u, Er(b))); ++B < G; )
          for (var J = 0, he = h[B], me = b ? b(he) : he; (J = M(q, me, J, T)) > -1; )
            q !== u && Zd.call(q, J, 1), Zd.call(u, J, 1);
        return u;
      }
      function ZO(u, h) {
        for (var b = u ? h.length : 0, T = b - 1; b--; ) {
          var M = h[b];
          if (b == T || M !== B) {
            var B = M;
            mo(M) ? Zd.call(u, M, 1) : fv(u, M);
          }
        }
        return u;
      }
      function lv(u, h) {
        return u + eh(MO() * (h - u + 1));
      }
      function lV(u, h, b, T) {
        for (var M = -1, B = bn(Qd((h - u) / (b || 1)), 0), G = ie(B); B--; )
          G[T ? B : ++M] = u, u += b;
        return G;
      }
      function cv(u, h) {
        var b = "";
        if (!u || h < 1 || h > H)
          return b;
        do
          h % 2 && (b += u), h = eh(h / 2), h && (u += u);
        while (h);
        return b;
      }
      function nt(u, h) {
        return Tv(PA(u, h, br), u + "");
      }
      function cV(u) {
        return DO(bl(u));
      }
      function uV(u, h) {
        var b = bl(u);
        return yh(b, ts(h, 0, b.length));
      }
      function pu(u, h, b, T) {
        if (!Jt(u))
          return u;
        h = ua(h, u);
        for (var M = -1, B = h.length, G = B - 1, q = u; q != null && ++M < B; ) {
          var J = Li(h[M]), he = b;
          if (J === "__proto__" || J === "constructor" || J === "prototype")
            return u;
          if (M != G) {
            var me = q[J];
            he = T ? T(me, J, q) : n, he === n && (he = Jt(me) ? me : mo(h[M + 1]) ? [] : {});
          }
          uu(q, J, he), q = q[J];
        }
        return u;
      }
      var JO = th ? function(u, h) {
        return th.set(u, h), u;
      } : br, fV = Jd ? function(u, h) {
        return Jd(u, "toString", {
          configurable: !0,
          enumerable: !1,
          value: Rv(h),
          writable: !0
        });
      } : br;
      function dV(u) {
        return yh(bl(u));
      }
      function ni(u, h, b) {
        var T = -1, M = u.length;
        h < 0 && (h = -h > M ? 0 : M + h), b = b > M ? M : b, b < 0 && (b += M), M = h > b ? 0 : b - h >>> 0, h >>>= 0;
        for (var B = ie(M); ++T < M; )
          B[T] = u[T + h];
        return B;
      }
      function hV(u, h) {
        var b;
        return la(u, function(T, M, B) {
          return b = h(T, M, B), !b;
        }), !!b;
      }
      function lh(u, h, b) {
        var T = 0, M = u == null ? T : u.length;
        if (typeof h == "number" && h === h && M <= ne) {
          for (; T < M; ) {
            var B = T + M >>> 1, G = u[B];
            G !== null && !Mr(G) && (b ? G <= h : G < h) ? T = B + 1 : M = B;
          }
          return M;
        }
        return uv(u, h, br, b);
      }
      function uv(u, h, b, T) {
        var M = 0, B = u == null ? 0 : u.length;
        if (B === 0)
          return 0;
        h = b(h);
        for (var G = h !== h, q = h === null, J = Mr(h), he = h === n; M < B; ) {
          var me = eh((M + B) / 2), ye = b(u[me]), xe = ye !== n, Ce = ye === null, Re = ye === ye, et = Mr(ye);
          if (G)
            var je = T || Re;
          else he ? je = Re && (T || xe) : q ? je = Re && xe && (T || !Ce) : J ? je = Re && xe && !Ce && (T || !et) : Ce || et ? je = !1 : je = T ? ye <= h : ye < h;
          je ? M = me + 1 : B = me;
        }
        return Zn(B, Q);
      }
      function QO(u, h) {
        for (var b = -1, T = u.length, M = 0, B = []; ++b < T; ) {
          var G = u[b], q = h ? h(G) : G;
          if (!b || !bi(q, J)) {
            var J = q;
            B[M++] = G === 0 ? 0 : G;
          }
        }
        return B;
      }
      function eA(u) {
        return typeof u == "number" ? u : Mr(u) ? V : +u;
      }
      function kr(u) {
        if (typeof u == "string")
          return u;
        if (Ye(u))
          return Gt(u, kr) + "";
        if (Mr(u))
          return NO ? NO.call(u) : "";
        var h = u + "";
        return h == "0" && 1 / u == -z ? "-0" : h;
      }
      function ca(u, h, b) {
        var T = -1, M = Wd, B = u.length, G = !0, q = [], J = q;
        if (b)
          G = !1, M = By;
        else if (B >= i) {
          var he = h ? null : OV(u);
          if (he)
            return Vd(he);
          G = !1, M = iu, J = new es();
        } else
          J = h ? [] : q;
        e:
          for (; ++T < B; ) {
            var me = u[T], ye = h ? h(me) : me;
            if (me = b || me !== 0 ? me : 0, G && ye === ye) {
              for (var xe = J.length; xe--; )
                if (J[xe] === ye)
                  continue e;
              h && J.push(ye), q.push(me);
            } else M(J, ye, b) || (J !== q && J.push(ye), q.push(me));
          }
        return q;
      }
      function fv(u, h) {
        return h = ua(h, u), u = CA(u, h), u == null || delete u[Li(ri(h))];
      }
      function tA(u, h, b, T) {
        return pu(u, h, b(ns(u, h)), T);
      }
      function ch(u, h, b, T) {
        for (var M = u.length, B = T ? M : -1; (T ? B-- : ++B < M) && h(u[B], B, u); )
          ;
        return b ? ni(u, T ? 0 : B, T ? B + 1 : M) : ni(u, T ? B + 1 : 0, T ? M : B);
      }
      function nA(u, h) {
        var b = u;
        return b instanceof ut && (b = b.value()), Fy(h, function(T, M) {
          return M.func.apply(M.thisArg, oa([T], M.args));
        }, b);
      }
      function dv(u, h, b) {
        var T = u.length;
        if (T < 2)
          return T ? ca(u[0]) : [];
        for (var M = -1, B = ie(T); ++M < T; )
          for (var G = u[M], q = -1; ++q < T; )
            q != M && (B[M] = fu(B[M] || G, u[q], h, b));
        return ca(Bn(B, 1), h, b);
      }
      function rA(u, h, b) {
        for (var T = -1, M = u.length, B = h.length, G = {}; ++T < M; ) {
          var q = T < B ? h[T] : n;
          b(G, u[T], q);
        }
        return G;
      }
      function hv(u) {
        return an(u) ? u : [];
      }
      function pv(u) {
        return typeof u == "function" ? u : br;
      }
      function ua(u, h) {
        return Ye(u) ? u : Sv(u, h) ? [u] : NA(vt(u));
      }
      var pV = nt;
      function fa(u, h, b) {
        var T = u.length;
        return b = b === n ? T : b, !h && b >= T ? u : ni(u, h, b);
      }
      var iA = t3 || function(u) {
        return Ln.clearTimeout(u);
      };
      function oA(u, h) {
        if (h)
          return u.slice();
        var b = u.length, T = TO ? TO(b) : new u.constructor(b);
        return u.copy(T), T;
      }
      function mv(u) {
        var h = new u.constructor(u.byteLength);
        return new qd(h).set(new qd(u)), h;
      }
      function mV(u, h) {
        var b = h ? mv(u.buffer) : u.buffer;
        return new u.constructor(b, u.byteOffset, u.byteLength);
      }
      function gV(u) {
        var h = new u.constructor(u.source, zS.exec(u));
        return h.lastIndex = u.lastIndex, h;
      }
      function yV(u) {
        return cu ? Mt(cu.call(u)) : {};
      }
      function aA(u, h) {
        var b = h ? mv(u.buffer) : u.buffer;
        return new u.constructor(b, u.byteOffset, u.length);
      }
      function sA(u, h) {
        if (u !== h) {
          var b = u !== n, T = u === null, M = u === u, B = Mr(u), G = h !== n, q = h === null, J = h === h, he = Mr(h);
          if (!q && !he && !B && u > h || B && G && J && !q && !he || T && G && J || !b && J || !M)
            return 1;
          if (!T && !B && !he && u < h || he && b && M && !T && !B || q && b && M || !G && M || !J)
            return -1;
        }
        return 0;
      }
      function vV(u, h, b) {
        for (var T = -1, M = u.criteria, B = h.criteria, G = M.length, q = b.length; ++T < G; ) {
          var J = sA(M[T], B[T]);
          if (J) {
            if (T >= q)
              return J;
            var he = b[T];
            return J * (he == "desc" ? -1 : 1);
          }
        }
        return u.index - h.index;
      }
      function lA(u, h, b, T) {
        for (var M = -1, B = u.length, G = b.length, q = -1, J = h.length, he = bn(B - G, 0), me = ie(J + he), ye = !T; ++q < J; )
          me[q] = h[q];
        for (; ++M < G; )
          (ye || M < B) && (me[b[M]] = u[M]);
        for (; he--; )
          me[q++] = u[M++];
        return me;
      }
      function cA(u, h, b, T) {
        for (var M = -1, B = u.length, G = -1, q = b.length, J = -1, he = h.length, me = bn(B - q, 0), ye = ie(me + he), xe = !T; ++M < me; )
          ye[M] = u[M];
        for (var Ce = M; ++J < he; )
          ye[Ce + J] = h[J];
        for (; ++G < q; )
          (xe || M < B) && (ye[Ce + b[G]] = u[M++]);
        return ye;
      }
      function gr(u, h) {
        var b = -1, T = u.length;
        for (h || (h = ie(T)); ++b < T; )
          h[b] = u[b];
        return h;
      }
      function ji(u, h, b, T) {
        var M = !b;
        b || (b = {});
        for (var B = -1, G = h.length; ++B < G; ) {
          var q = h[B], J = T ? T(b[q], u[q], q, b, u) : n;
          J === n && (J = u[q]), M ? fo(b, q, J) : uu(b, q, J);
        }
        return b;
      }
      function bV(u, h) {
        return ji(u, _v(u), h);
      }
      function xV(u, h) {
        return ji(u, _A(u), h);
      }
      function uh(u, h) {
        return function(b, T) {
          var M = Ye(b) ? A5 : z3, B = h ? h() : {};
          return M(b, u, De(T, 2), B);
        };
      }
      function ml(u) {
        return nt(function(h, b) {
          var T = -1, M = b.length, B = M > 1 ? b[M - 1] : n, G = M > 2 ? b[2] : n;
          for (B = u.length > 3 && typeof B == "function" ? (M--, B) : n, G && ar(b[0], b[1], G) && (B = M < 3 ? n : B, M = 1), h = Mt(h); ++T < M; ) {
            var q = b[T];
            q && u(h, q, T, B);
          }
          return h;
        });
      }
      function uA(u, h) {
        return function(b, T) {
          if (b == null)
            return b;
          if (!yr(b))
            return u(b, T);
          for (var M = b.length, B = h ? M : -1, G = Mt(b); (h ? B-- : ++B < M) && T(G[B], B, G) !== !1; )
            ;
          return b;
        };
      }
      function fA(u) {
        return function(h, b, T) {
          for (var M = -1, B = Mt(h), G = T(h), q = G.length; q--; ) {
            var J = G[u ? q : ++M];
            if (b(B[J], J, B) === !1)
              break;
          }
          return h;
        };
      }
      function wV(u, h, b) {
        var T = h & v, M = mu(u);
        function B() {
          var G = this && this !== Ln && this instanceof B ? M : u;
          return G.apply(T ? b : this, arguments);
        }
        return B;
      }
      function dA(u) {
        return function(h) {
          h = vt(h);
          var b = ll(h) ? yi(h) : n, T = b ? b[0] : h.charAt(0), M = b ? fa(b, 1).join("") : h.slice(1);
          return T[u]() + M;
        };
      }
      function gl(u) {
        return function(h) {
          return Fy(uT(cT(h).replace(f5, "")), u, "");
        };
      }
      function mu(u) {
        return function() {
          var h = arguments;
          switch (h.length) {
            case 0:
              return new u();
            case 1:
              return new u(h[0]);
            case 2:
              return new u(h[0], h[1]);
            case 3:
              return new u(h[0], h[1], h[2]);
            case 4:
              return new u(h[0], h[1], h[2], h[3]);
            case 5:
              return new u(h[0], h[1], h[2], h[3], h[4]);
            case 6:
              return new u(h[0], h[1], h[2], h[3], h[4], h[5]);
            case 7:
              return new u(h[0], h[1], h[2], h[3], h[4], h[5], h[6]);
          }
          var b = pl(u.prototype), T = u.apply(b, h);
          return Jt(T) ? T : b;
        };
      }
      function _V(u, h, b) {
        var T = mu(u);
        function M() {
          for (var B = arguments.length, G = ie(B), q = B, J = yl(M); q--; )
            G[q] = arguments[q];
          var he = B < 3 && G[0] !== J && G[B - 1] !== J ? [] : aa(G, J);
          if (B -= he.length, B < b)
            return yA(
              u,
              h,
              fh,
              M.placeholder,
              n,
              G,
              he,
              n,
              n,
              b - B
            );
          var me = this && this !== Ln && this instanceof M ? T : u;
          return Cr(me, this, G);
        }
        return M;
      }
      function hA(u) {
        return function(h, b, T) {
          var M = Mt(h);
          if (!yr(h)) {
            var B = De(b, 3);
            h = En(h), b = function(q) {
              return B(M[q], q, M);
            };
          }
          var G = u(h, b, T);
          return G > -1 ? M[B ? h[G] : G] : n;
        };
      }
      function pA(u) {
        return po(function(h) {
          var b = h.length, T = b, M = ei.prototype.thru;
          for (u && h.reverse(); T--; ) {
            var B = h[T];
            if (typeof B != "function")
              throw new Qr(a);
            if (M && !G && mh(B) == "wrapper")
              var G = new ei([], !0);
          }
          for (T = G ? T : b; ++T < b; ) {
            B = h[T];
            var q = mh(B), J = q == "wrapper" ? xv(B) : n;
            J && Ov(J[0]) && J[1] == (P | S | _ | C) && !J[4].length && J[9] == 1 ? G = G[mh(J[0])].apply(G, J[3]) : G = B.length == 1 && Ov(B) ? G[q]() : G.thru(B);
          }
          return function() {
            var he = arguments, me = he[0];
            if (G && he.length == 1 && Ye(me))
              return G.plant(me).value();
            for (var ye = 0, xe = b ? h[ye].apply(this, he) : me; ++ye < b; )
              xe = h[ye].call(this, xe);
            return xe;
          };
        });
      }
      function fh(u, h, b, T, M, B, G, q, J, he) {
        var me = h & P, ye = h & v, xe = h & x, Ce = h & (S | A), Re = h & k, et = xe ? n : mu(u);
        function je() {
          for (var ot = arguments.length, ft = ie(ot), Nr = ot; Nr--; )
            ft[Nr] = arguments[Nr];
          if (Ce)
            var sr = yl(je), $r = D5(ft, sr);
          if (T && (ft = lA(ft, T, M, Ce)), B && (ft = cA(ft, B, G, Ce)), ot -= $r, Ce && ot < he) {
            var sn = aa(ft, sr);
            return yA(
              u,
              h,
              fh,
              je.placeholder,
              b,
              ft,
              sn,
              q,
              J,
              he - ot
            );
          }
          var xi = ye ? b : this, vo = xe ? xi[u] : u;
          return ot = ft.length, q ? ft = zV(ft, q) : Re && ot > 1 && ft.reverse(), me && J < ot && (ft.length = J), this && this !== Ln && this instanceof je && (vo = et || mu(vo)), vo.apply(xi, ft);
        }
        return je;
      }
      function mA(u, h) {
        return function(b, T) {
          return X3(b, u, h(T), {});
        };
      }
      function dh(u, h) {
        return function(b, T) {
          var M;
          if (b === n && T === n)
            return h;
          if (b !== n && (M = b), T !== n) {
            if (M === n)
              return T;
            typeof b == "string" || typeof T == "string" ? (b = kr(b), T = kr(T)) : (b = eA(b), T = eA(T)), M = u(b, T);
          }
          return M;
        };
      }
      function gv(u) {
        return po(function(h) {
          return h = Gt(h, Er(De())), nt(function(b) {
            var T = this;
            return u(h, function(M) {
              return Cr(M, T, b);
            });
          });
        });
      }
      function hh(u, h) {
        h = h === n ? " " : kr(h);
        var b = h.length;
        if (b < 2)
          return b ? cv(h, u) : h;
        var T = cv(h, Qd(u / cl(h)));
        return ll(h) ? fa(yi(T), 0, u).join("") : T.slice(0, u);
      }
      function SV(u, h, b, T) {
        var M = h & v, B = mu(u);
        function G() {
          for (var q = -1, J = arguments.length, he = -1, me = T.length, ye = ie(me + J), xe = this && this !== Ln && this instanceof G ? B : u; ++he < me; )
            ye[he] = T[he];
          for (; J--; )
            ye[he++] = arguments[++q];
          return Cr(xe, M ? b : this, ye);
        }
        return G;
      }
      function gA(u) {
        return function(h, b, T) {
          return T && typeof T != "number" && ar(h, b, T) && (b = T = n), h = yo(h), b === n ? (b = h, h = 0) : b = yo(b), T = T === n ? h < b ? 1 : -1 : yo(T), lV(h, b, T, u);
        };
      }
      function ph(u) {
        return function(h, b) {
          return typeof h == "string" && typeof b == "string" || (h = ii(h), b = ii(b)), u(h, b);
        };
      }
      function yA(u, h, b, T, M, B, G, q, J, he) {
        var me = h & S, ye = me ? G : n, xe = me ? n : G, Ce = me ? B : n, Re = me ? n : B;
        h |= me ? _ : O, h &= ~(me ? O : _), h & w || (h &= ~(v | x));
        var et = [
          u,
          h,
          M,
          Ce,
          ye,
          Re,
          xe,
          q,
          J,
          he
        ], je = b.apply(n, et);
        return Ov(u) && EA(je, et), je.placeholder = T, kA(je, u, h);
      }
      function yv(u) {
        var h = vn[u];
        return function(b, T) {
          if (b = ii(b), T = T == null ? 0 : Zn(Ze(T), 292), T && kO(b)) {
            var M = (vt(b) + "e").split("e"), B = h(M[0] + "e" + (+M[1] + T));
            return M = (vt(B) + "e").split("e"), +(M[0] + "e" + (+M[1] - T));
          }
          return h(b);
        };
      }
      var OV = dl && 1 / Vd(new dl([, -0]))[1] == z ? function(u) {
        return new dl(u);
      } : Bv;
      function vA(u) {
        return function(h) {
          var b = Jn(h);
          return b == de ? Gy(h) : b == Oe ? W5(h) : $5(h, u(h));
        };
      }
      function ho(u, h, b, T, M, B, G, q) {
        var J = h & x;
        if (!J && typeof u != "function")
          throw new Qr(a);
        var he = T ? T.length : 0;
        if (he || (h &= ~(_ | O), T = M = n), G = G === n ? G : bn(Ze(G), 0), q = q === n ? q : Ze(q), he -= M ? M.length : 0, h & O) {
          var me = T, ye = M;
          T = M = n;
        }
        var xe = J ? n : xv(u), Ce = [
          u,
          h,
          b,
          T,
          M,
          me,
          ye,
          B,
          G,
          q
        ];
        if (xe && BV(Ce, xe), u = Ce[0], h = Ce[1], b = Ce[2], T = Ce[3], M = Ce[4], q = Ce[9] = Ce[9] === n ? J ? 0 : u.length : bn(Ce[9] - he, 0), !q && h & (S | A) && (h &= ~(S | A)), !h || h == v)
          var Re = wV(u, h, b);
        else h == S || h == A ? Re = _V(u, h, q) : (h == _ || h == (v | _)) && !M.length ? Re = SV(u, h, b, T) : Re = fh.apply(n, Ce);
        var et = xe ? JO : EA;
        return kA(et(Re, Ce), u, h);
      }
      function bA(u, h, b, T) {
        return u === n || bi(u, fl[b]) && !Ot.call(T, b) ? h : u;
      }
      function xA(u, h, b, T, M, B) {
        return Jt(u) && Jt(h) && (B.set(h, u), sh(u, h, n, xA, B), B.delete(h)), u;
      }
      function AV(u) {
        return vu(u) ? n : u;
      }
      function wA(u, h, b, T, M, B) {
        var G = b & y, q = u.length, J = h.length;
        if (q != J && !(G && J > q))
          return !1;
        var he = B.get(u), me = B.get(h);
        if (he && me)
          return he == h && me == u;
        var ye = -1, xe = !0, Ce = b & g ? new es() : n;
        for (B.set(u, h), B.set(h, u); ++ye < q; ) {
          var Re = u[ye], et = h[ye];
          if (T)
            var je = G ? T(et, Re, ye, h, u, B) : T(Re, et, ye, u, h, B);
          if (je !== n) {
            if (je)
              continue;
            xe = !1;
            break;
          }
          if (Ce) {
            if (!Wy(h, function(ot, ft) {
              if (!iu(Ce, ft) && (Re === ot || M(Re, ot, b, T, B)))
                return Ce.push(ft);
            })) {
              xe = !1;
              break;
            }
          } else if (!(Re === et || M(Re, et, b, T, B))) {
            xe = !1;
            break;
          }
        }
        return B.delete(u), B.delete(h), xe;
      }
      function TV(u, h, b, T, M, B, G) {
        switch (b) {
          case yn:
            if (u.byteLength != h.byteLength || u.byteOffset != h.byteOffset)
              return !1;
            u = u.buffer, h = h.buffer;
          case Cn:
            return !(u.byteLength != h.byteLength || !B(new qd(u), new qd(h)));
          case ae:
          case ee:
          case ke:
            return bi(+u, +h);
          case ge:
            return u.name == h.name && u.message == h.message;
          case ct:
          case Ge:
            return u == h + "";
          case de:
            var q = Gy;
          case Oe:
            var J = T & y;
            if (q || (q = Vd), u.size != h.size && !J)
              return !1;
            var he = G.get(u);
            if (he)
              return he == h;
            T |= g, G.set(u, h);
            var me = wA(q(u), q(h), T, M, B, G);
            return G.delete(u), me;
          case Zt:
            if (cu)
              return cu.call(u) == cu.call(h);
        }
        return !1;
      }
      function PV(u, h, b, T, M, B) {
        var G = b & y, q = vv(u), J = q.length, he = vv(h), me = he.length;
        if (J != me && !G)
          return !1;
        for (var ye = J; ye--; ) {
          var xe = q[ye];
          if (!(G ? xe in h : Ot.call(h, xe)))
            return !1;
        }
        var Ce = B.get(u), Re = B.get(h);
        if (Ce && Re)
          return Ce == h && Re == u;
        var et = !0;
        B.set(u, h), B.set(h, u);
        for (var je = G; ++ye < J; ) {
          xe = q[ye];
          var ot = u[xe], ft = h[xe];
          if (T)
            var Nr = G ? T(ft, ot, xe, h, u, B) : T(ot, ft, xe, u, h, B);
          if (!(Nr === n ? ot === ft || M(ot, ft, b, T, B) : Nr)) {
            et = !1;
            break;
          }
          je || (je = xe == "constructor");
        }
        if (et && !je) {
          var sr = u.constructor, $r = h.constructor;
          sr != $r && "constructor" in u && "constructor" in h && !(typeof sr == "function" && sr instanceof sr && typeof $r == "function" && $r instanceof $r) && (et = !1);
        }
        return B.delete(u), B.delete(h), et;
      }
      function po(u) {
        return Tv(PA(u, n, RA), u + "");
      }
      function vv(u) {
        return WO(u, En, _v);
      }
      function bv(u) {
        return WO(u, vr, _A);
      }
      var xv = th ? function(u) {
        return th.get(u);
      } : Bv;
      function mh(u) {
        for (var h = u.name + "", b = hl[h], T = Ot.call(hl, h) ? b.length : 0; T--; ) {
          var M = b[T], B = M.func;
          if (B == null || B == u)
            return M.name;
        }
        return h;
      }
      function yl(u) {
        var h = Ot.call(L, "placeholder") ? L : u;
        return h.placeholder;
      }
      function De() {
        var u = L.iteratee || jv;
        return u = u === jv ? UO : u, arguments.length ? u(arguments[0], arguments[1]) : u;
      }
      function gh(u, h) {
        var b = u.__data__;
        return IV(h) ? b[typeof h == "string" ? "string" : "hash"] : b.map;
      }
      function wv(u) {
        for (var h = En(u), b = h.length; b--; ) {
          var T = h[b], M = u[T];
          h[b] = [T, M, AA(M)];
        }
        return h;
      }
      function rs(u, h) {
        var b = L5(u, h);
        return VO(b) ? b : n;
      }
      function CV(u) {
        var h = Ot.call(u, Ja), b = u[Ja];
        try {
          u[Ja] = n;
          var T = !0;
        } catch {
        }
        var M = Gd.call(u);
        return T && (h ? u[Ja] = b : delete u[Ja]), M;
      }
      var _v = qy ? function(u) {
        return u == null ? [] : (u = Mt(u), ia(qy(u), function(h) {
          return CO.call(u, h);
        }));
      } : Fv, _A = qy ? function(u) {
        for (var h = []; u; )
          oa(h, _v(u)), u = Xd(u);
        return h;
      } : Fv, Jn = or;
      (Xy && Jn(new Xy(new ArrayBuffer(1))) != yn || au && Jn(new au()) != de || Zy && Jn(Zy.resolve()) != Xn || dl && Jn(new dl()) != Oe || su && Jn(new su()) != en) && (Jn = function(u) {
        var h = or(u), b = h == lt ? u.constructor : n, T = b ? is(b) : "";
        if (T)
          switch (T) {
            case u3:
              return yn;
            case f3:
              return de;
            case d3:
              return Xn;
            case h3:
              return Oe;
            case p3:
              return en;
          }
        return h;
      });
      function EV(u, h, b) {
        for (var T = -1, M = b.length; ++T < M; ) {
          var B = b[T], G = B.size;
          switch (B.type) {
            case "drop":
              u += G;
              break;
            case "dropRight":
              h -= G;
              break;
            case "take":
              h = Zn(h, u + G);
              break;
            case "takeRight":
              u = bn(u, h - G);
              break;
          }
        }
        return { start: u, end: h };
      }
      function kV(u) {
        var h = u.match(Rz);
        return h ? h[1].split(jz) : [];
      }
      function SA(u, h, b) {
        h = ua(h, u);
        for (var T = -1, M = h.length, B = !1; ++T < M; ) {
          var G = Li(h[T]);
          if (!(B = u != null && b(u, G)))
            break;
          u = u[G];
        }
        return B || ++T != M ? B : (M = u == null ? 0 : u.length, !!M && Sh(M) && mo(G, M) && (Ye(u) || os(u)));
      }
      function MV(u) {
        var h = u.length, b = new u.constructor(h);
        return h && typeof u[0] == "string" && Ot.call(u, "index") && (b.index = u.index, b.input = u.input), b;
      }
      function OA(u) {
        return typeof u.constructor == "function" && !gu(u) ? pl(Xd(u)) : {};
      }
      function NV(u, h, b) {
        var T = u.constructor;
        switch (h) {
          case Cn:
            return mv(u);
          case ae:
          case ee:
            return new T(+u);
          case yn:
            return mV(u, b);
          case mr:
          case tt:
          case Kt:
          case St:
          case jn:
          case qr:
          case lo:
          case un:
          case Pr:
            return aA(u, b);
          case de:
            return new T();
          case ke:
          case Ge:
            return new T(u);
          case ct:
            return gV(u);
          case Oe:
            return new T();
          case Zt:
            return yV(u);
        }
      }
      function $V(u, h) {
        var b = h.length;
        if (!b)
          return u;
        var T = b - 1;
        return h[T] = (b > 1 ? "& " : "") + h[T], h = h.join(b > 2 ? ", " : " "), u.replace(Iz, `{
/* [wrapped with ` + h + `] */
`);
      }
      function DV(u) {
        return Ye(u) || os(u) || !!(EO && u && u[EO]);
      }
      function mo(u, h) {
        var b = typeof u;
        return h = h ?? H, !!h && (b == "number" || b != "symbol" && Kz.test(u)) && u > -1 && u % 1 == 0 && u < h;
      }
      function ar(u, h, b) {
        if (!Jt(b))
          return !1;
        var T = typeof h;
        return (T == "number" ? yr(b) && mo(h, b.length) : T == "string" && h in b) ? bi(b[h], u) : !1;
      }
      function Sv(u, h) {
        if (Ye(u))
          return !1;
        var b = typeof u;
        return b == "number" || b == "symbol" || b == "boolean" || u == null || Mr(u) ? !0 : Mz.test(u) || !kz.test(u) || h != null && u in Mt(h);
      }
      function IV(u) {
        var h = typeof u;
        return h == "string" || h == "number" || h == "symbol" || h == "boolean" ? u !== "__proto__" : u === null;
      }
      function Ov(u) {
        var h = mh(u), b = L[h];
        if (typeof b != "function" || !(h in ut.prototype))
          return !1;
        if (u === b)
          return !0;
        var T = xv(b);
        return !!T && u === T[0];
      }
      function RV(u) {
        return !!AO && AO in u;
      }
      var jV = Hd ? go : Wv;
      function gu(u) {
        var h = u && u.constructor, b = typeof h == "function" && h.prototype || fl;
        return u === b;
      }
      function AA(u) {
        return u === u && !Jt(u);
      }
      function TA(u, h) {
        return function(b) {
          return b == null ? !1 : b[u] === h && (h !== n || u in Mt(b));
        };
      }
      function LV(u) {
        var h = wh(u, function(T) {
          return b.size === c && b.clear(), T;
        }), b = h.cache;
        return h;
      }
      function BV(u, h) {
        var b = u[1], T = h[1], M = b | T, B = M < (v | x | P), G = T == P && b == S || T == P && b == C && u[7].length <= h[8] || T == (P | C) && h[7].length <= h[8] && b == S;
        if (!(B || G))
          return u;
        T & v && (u[2] = h[2], M |= b & v ? 0 : w);
        var q = h[3];
        if (q) {
          var J = u[3];
          u[3] = J ? lA(J, q, h[4]) : q, u[4] = J ? aa(u[3], f) : h[4];
        }
        return q = h[5], q && (J = u[5], u[5] = J ? cA(J, q, h[6]) : q, u[6] = J ? aa(u[5], f) : h[6]), q = h[7], q && (u[7] = q), T & P && (u[8] = u[8] == null ? h[8] : Zn(u[8], h[8])), u[9] == null && (u[9] = h[9]), u[0] = h[0], u[1] = M, u;
      }
      function FV(u) {
        var h = [];
        if (u != null)
          for (var b in Mt(u))
            h.push(b);
        return h;
      }
      function WV(u) {
        return Gd.call(u);
      }
      function PA(u, h, b) {
        return h = bn(h === n ? u.length - 1 : h, 0), function() {
          for (var T = arguments, M = -1, B = bn(T.length - h, 0), G = ie(B); ++M < B; )
            G[M] = T[h + M];
          M = -1;
          for (var q = ie(h + 1); ++M < h; )
            q[M] = T[M];
          return q[h] = b(G), Cr(u, this, q);
        };
      }
      function CA(u, h) {
        return h.length < 2 ? u : ns(u, ni(h, 0, -1));
      }
      function zV(u, h) {
        for (var b = u.length, T = Zn(h.length, b), M = gr(u); T--; ) {
          var B = h[T];
          u[T] = mo(B, b) ? M[B] : n;
        }
        return u;
      }
      function Av(u, h) {
        if (!(h === "constructor" && typeof u[h] == "function") && h != "__proto__")
          return u[h];
      }
      var EA = MA(JO), yu = r3 || function(u, h) {
        return Ln.setTimeout(u, h);
      }, Tv = MA(fV);
      function kA(u, h, b) {
        var T = h + "";
        return Tv(u, $V(T, VV(kV(T), b)));
      }
      function MA(u) {
        var h = 0, b = 0;
        return function() {
          var T = s3(), M = D - (T - b);
          if (b = T, M > 0) {
            if (++h >= N)
              return arguments[0];
          } else
            h = 0;
          return u.apply(n, arguments);
        };
      }
      function yh(u, h) {
        var b = -1, T = u.length, M = T - 1;
        for (h = h === n ? T : h; ++b < h; ) {
          var B = lv(b, M), G = u[B];
          u[B] = u[b], u[b] = G;
        }
        return u.length = h, u;
      }
      var NA = LV(function(u) {
        var h = [];
        return u.charCodeAt(0) === 46 && h.push(""), u.replace(Nz, function(b, T, M, B) {
          h.push(M ? B.replace(Fz, "$1") : T || b);
        }), h;
      });
      function Li(u) {
        if (typeof u == "string" || Mr(u))
          return u;
        var h = u + "";
        return h == "0" && 1 / u == -z ? "-0" : h;
      }
      function is(u) {
        if (u != null) {
          try {
            return Kd.call(u);
          } catch {
          }
          try {
            return u + "";
          } catch {
          }
        }
        return "";
      }
      function VV(u, h) {
        return Jr(re, function(b) {
          var T = "_." + b[0];
          h & b[1] && !Wd(u, T) && u.push(T);
        }), u.sort();
      }
      function $A(u) {
        if (u instanceof ut)
          return u.clone();
        var h = new ei(u.__wrapped__, u.__chain__);
        return h.__actions__ = gr(u.__actions__), h.__index__ = u.__index__, h.__values__ = u.__values__, h;
      }
      function UV(u, h, b) {
        (b ? ar(u, h, b) : h === n) ? h = 1 : h = bn(Ze(h), 0);
        var T = u == null ? 0 : u.length;
        if (!T || h < 1)
          return [];
        for (var M = 0, B = 0, G = ie(Qd(T / h)); M < T; )
          G[B++] = ni(u, M, M += h);
        return G;
      }
      function HV(u) {
        for (var h = -1, b = u == null ? 0 : u.length, T = 0, M = []; ++h < b; ) {
          var B = u[h];
          B && (M[T++] = B);
        }
        return M;
      }
      function KV() {
        var u = arguments.length;
        if (!u)
          return [];
        for (var h = ie(u - 1), b = arguments[0], T = u; T--; )
          h[T - 1] = arguments[T];
        return oa(Ye(b) ? gr(b) : [b], Bn(h, 1));
      }
      var GV = nt(function(u, h) {
        return an(u) ? fu(u, Bn(h, 1, an, !0)) : [];
      }), YV = nt(function(u, h) {
        var b = ri(h);
        return an(b) && (b = n), an(u) ? fu(u, Bn(h, 1, an, !0), De(b, 2)) : [];
      }), qV = nt(function(u, h) {
        var b = ri(h);
        return an(b) && (b = n), an(u) ? fu(u, Bn(h, 1, an, !0), n, b) : [];
      });
      function XV(u, h, b) {
        var T = u == null ? 0 : u.length;
        return T ? (h = b || h === n ? 1 : Ze(h), ni(u, h < 0 ? 0 : h, T)) : [];
      }
      function ZV(u, h, b) {
        var T = u == null ? 0 : u.length;
        return T ? (h = b || h === n ? 1 : Ze(h), h = T - h, ni(u, 0, h < 0 ? 0 : h)) : [];
      }
      function JV(u, h) {
        return u && u.length ? ch(u, De(h, 3), !0, !0) : [];
      }
      function QV(u, h) {
        return u && u.length ? ch(u, De(h, 3), !0) : [];
      }
      function e4(u, h, b, T) {
        var M = u == null ? 0 : u.length;
        return M ? (b && typeof b != "number" && ar(u, h, b) && (b = 0, T = M), K3(u, h, b, T)) : [];
      }
      function DA(u, h, b) {
        var T = u == null ? 0 : u.length;
        if (!T)
          return -1;
        var M = b == null ? 0 : Ze(b);
        return M < 0 && (M = bn(T + M, 0)), zd(u, De(h, 3), M);
      }
      function IA(u, h, b) {
        var T = u == null ? 0 : u.length;
        if (!T)
          return -1;
        var M = T - 1;
        return b !== n && (M = Ze(b), M = b < 0 ? bn(T + M, 0) : Zn(M, T - 1)), zd(u, De(h, 3), M, !0);
      }
      function RA(u) {
        var h = u == null ? 0 : u.length;
        return h ? Bn(u, 1) : [];
      }
      function t4(u) {
        var h = u == null ? 0 : u.length;
        return h ? Bn(u, z) : [];
      }
      function n4(u, h) {
        var b = u == null ? 0 : u.length;
        return b ? (h = h === n ? 1 : Ze(h), Bn(u, h)) : [];
      }
      function r4(u) {
        for (var h = -1, b = u == null ? 0 : u.length, T = {}; ++h < b; ) {
          var M = u[h];
          T[M[0]] = M[1];
        }
        return T;
      }
      function jA(u) {
        return u && u.length ? u[0] : n;
      }
      function i4(u, h, b) {
        var T = u == null ? 0 : u.length;
        if (!T)
          return -1;
        var M = b == null ? 0 : Ze(b);
        return M < 0 && (M = bn(T + M, 0)), sl(u, h, M);
      }
      function o4(u) {
        var h = u == null ? 0 : u.length;
        return h ? ni(u, 0, -1) : [];
      }
      var a4 = nt(function(u) {
        var h = Gt(u, hv);
        return h.length && h[0] === u[0] ? rv(h) : [];
      }), s4 = nt(function(u) {
        var h = ri(u), b = Gt(u, hv);
        return h === ri(b) ? h = n : b.pop(), b.length && b[0] === u[0] ? rv(b, De(h, 2)) : [];
      }), l4 = nt(function(u) {
        var h = ri(u), b = Gt(u, hv);
        return h = typeof h == "function" ? h : n, h && b.pop(), b.length && b[0] === u[0] ? rv(b, n, h) : [];
      });
      function c4(u, h) {
        return u == null ? "" : o3.call(u, h);
      }
      function ri(u) {
        var h = u == null ? 0 : u.length;
        return h ? u[h - 1] : n;
      }
      function u4(u, h, b) {
        var T = u == null ? 0 : u.length;
        if (!T)
          return -1;
        var M = T;
        return b !== n && (M = Ze(b), M = M < 0 ? bn(T + M, 0) : Zn(M, T - 1)), h === h ? V5(u, h, M) : zd(u, yO, M, !0);
      }
      function f4(u, h) {
        return u && u.length ? YO(u, Ze(h)) : n;
      }
      var d4 = nt(LA);
      function LA(u, h) {
        return u && u.length && h && h.length ? sv(u, h) : u;
      }
      function h4(u, h, b) {
        return u && u.length && h && h.length ? sv(u, h, De(b, 2)) : u;
      }
      function p4(u, h, b) {
        return u && u.length && h && h.length ? sv(u, h, n, b) : u;
      }
      var m4 = po(function(u, h) {
        var b = u == null ? 0 : u.length, T = Qy(u, h);
        return ZO(u, Gt(h, function(M) {
          return mo(M, b) ? +M : M;
        }).sort(sA)), T;
      });
      function g4(u, h) {
        var b = [];
        if (!(u && u.length))
          return b;
        var T = -1, M = [], B = u.length;
        for (h = De(h, 3); ++T < B; ) {
          var G = u[T];
          h(G, T, u) && (b.push(G), M.push(T));
        }
        return ZO(u, M), b;
      }
      function Pv(u) {
        return u == null ? u : c3.call(u);
      }
      function y4(u, h, b) {
        var T = u == null ? 0 : u.length;
        return T ? (b && typeof b != "number" && ar(u, h, b) ? (h = 0, b = T) : (h = h == null ? 0 : Ze(h), b = b === n ? T : Ze(b)), ni(u, h, b)) : [];
      }
      function v4(u, h) {
        return lh(u, h);
      }
      function b4(u, h, b) {
        return uv(u, h, De(b, 2));
      }
      function x4(u, h) {
        var b = u == null ? 0 : u.length;
        if (b) {
          var T = lh(u, h);
          if (T < b && bi(u[T], h))
            return T;
        }
        return -1;
      }
      function w4(u, h) {
        return lh(u, h, !0);
      }
      function _4(u, h, b) {
        return uv(u, h, De(b, 2), !0);
      }
      function S4(u, h) {
        var b = u == null ? 0 : u.length;
        if (b) {
          var T = lh(u, h, !0) - 1;
          if (bi(u[T], h))
            return T;
        }
        return -1;
      }
      function O4(u) {
        return u && u.length ? QO(u) : [];
      }
      function A4(u, h) {
        return u && u.length ? QO(u, De(h, 2)) : [];
      }
      function T4(u) {
        var h = u == null ? 0 : u.length;
        return h ? ni(u, 1, h) : [];
      }
      function P4(u, h, b) {
        return u && u.length ? (h = b || h === n ? 1 : Ze(h), ni(u, 0, h < 0 ? 0 : h)) : [];
      }
      function C4(u, h, b) {
        var T = u == null ? 0 : u.length;
        return T ? (h = b || h === n ? 1 : Ze(h), h = T - h, ni(u, h < 0 ? 0 : h, T)) : [];
      }
      function E4(u, h) {
        return u && u.length ? ch(u, De(h, 3), !1, !0) : [];
      }
      function k4(u, h) {
        return u && u.length ? ch(u, De(h, 3)) : [];
      }
      var M4 = nt(function(u) {
        return ca(Bn(u, 1, an, !0));
      }), N4 = nt(function(u) {
        var h = ri(u);
        return an(h) && (h = n), ca(Bn(u, 1, an, !0), De(h, 2));
      }), $4 = nt(function(u) {
        var h = ri(u);
        return h = typeof h == "function" ? h : n, ca(Bn(u, 1, an, !0), n, h);
      });
      function D4(u) {
        return u && u.length ? ca(u) : [];
      }
      function I4(u, h) {
        return u && u.length ? ca(u, De(h, 2)) : [];
      }
      function R4(u, h) {
        return h = typeof h == "function" ? h : n, u && u.length ? ca(u, n, h) : [];
      }
      function Cv(u) {
        if (!(u && u.length))
          return [];
        var h = 0;
        return u = ia(u, function(b) {
          if (an(b))
            return h = bn(b.length, h), !0;
        }), Hy(h, function(b) {
          return Gt(u, zy(b));
        });
      }
      function BA(u, h) {
        if (!(u && u.length))
          return [];
        var b = Cv(u);
        return h == null ? b : Gt(b, function(T) {
          return Cr(h, n, T);
        });
      }
      var j4 = nt(function(u, h) {
        return an(u) ? fu(u, h) : [];
      }), L4 = nt(function(u) {
        return dv(ia(u, an));
      }), B4 = nt(function(u) {
        var h = ri(u);
        return an(h) && (h = n), dv(ia(u, an), De(h, 2));
      }), F4 = nt(function(u) {
        var h = ri(u);
        return h = typeof h == "function" ? h : n, dv(ia(u, an), n, h);
      }), W4 = nt(Cv);
      function z4(u, h) {
        return rA(u || [], h || [], uu);
      }
      function V4(u, h) {
        return rA(u || [], h || [], pu);
      }
      var U4 = nt(function(u) {
        var h = u.length, b = h > 1 ? u[h - 1] : n;
        return b = typeof b == "function" ? (u.pop(), b) : n, BA(u, b);
      });
      function FA(u) {
        var h = L(u);
        return h.__chain__ = !0, h;
      }
      function H4(u, h) {
        return h(u), u;
      }
      function vh(u, h) {
        return h(u);
      }
      var K4 = po(function(u) {
        var h = u.length, b = h ? u[0] : 0, T = this.__wrapped__, M = function(B) {
          return Qy(B, u);
        };
        return h > 1 || this.__actions__.length || !(T instanceof ut) || !mo(b) ? this.thru(M) : (T = T.slice(b, +b + (h ? 1 : 0)), T.__actions__.push({
          func: vh,
          args: [M],
          thisArg: n
        }), new ei(T, this.__chain__).thru(function(B) {
          return h && !B.length && B.push(n), B;
        }));
      });
      function G4() {
        return FA(this);
      }
      function Y4() {
        return new ei(this.value(), this.__chain__);
      }
      function q4() {
        this.__values__ === n && (this.__values__ = eT(this.value()));
        var u = this.__index__ >= this.__values__.length, h = u ? n : this.__values__[this.__index__++];
        return { done: u, value: h };
      }
      function X4() {
        return this;
      }
      function Z4(u) {
        for (var h, b = this; b instanceof rh; ) {
          var T = $A(b);
          T.__index__ = 0, T.__values__ = n, h ? M.__wrapped__ = T : h = T;
          var M = T;
          b = b.__wrapped__;
        }
        return M.__wrapped__ = u, h;
      }
      function J4() {
        var u = this.__wrapped__;
        if (u instanceof ut) {
          var h = u;
          return this.__actions__.length && (h = new ut(this)), h = h.reverse(), h.__actions__.push({
            func: vh,
            args: [Pv],
            thisArg: n
          }), new ei(h, this.__chain__);
        }
        return this.thru(Pv);
      }
      function Q4() {
        return nA(this.__wrapped__, this.__actions__);
      }
      var eU = uh(function(u, h, b) {
        Ot.call(u, b) ? ++u[b] : fo(u, b, 1);
      });
      function tU(u, h, b) {
        var T = Ye(u) ? mO : H3;
        return b && ar(u, h, b) && (h = n), T(u, De(h, 3));
      }
      function nU(u, h) {
        var b = Ye(u) ? ia : BO;
        return b(u, De(h, 3));
      }
      var rU = hA(DA), iU = hA(IA);
      function oU(u, h) {
        return Bn(bh(u, h), 1);
      }
      function aU(u, h) {
        return Bn(bh(u, h), z);
      }
      function sU(u, h, b) {
        return b = b === n ? 1 : Ze(b), Bn(bh(u, h), b);
      }
      function WA(u, h) {
        var b = Ye(u) ? Jr : la;
        return b(u, De(h, 3));
      }
      function zA(u, h) {
        var b = Ye(u) ? T5 : LO;
        return b(u, De(h, 3));
      }
      var lU = uh(function(u, h, b) {
        Ot.call(u, b) ? u[b].push(h) : fo(u, b, [h]);
      });
      function cU(u, h, b, T) {
        u = yr(u) ? u : bl(u), b = b && !T ? Ze(b) : 0;
        var M = u.length;
        return b < 0 && (b = bn(M + b, 0)), Oh(u) ? b <= M && u.indexOf(h, b) > -1 : !!M && sl(u, h, b) > -1;
      }
      var uU = nt(function(u, h, b) {
        var T = -1, M = typeof h == "function", B = yr(u) ? ie(u.length) : [];
        return la(u, function(G) {
          B[++T] = M ? Cr(h, G, b) : du(G, h, b);
        }), B;
      }), fU = uh(function(u, h, b) {
        fo(u, b, h);
      });
      function bh(u, h) {
        var b = Ye(u) ? Gt : HO;
        return b(u, De(h, 3));
      }
      function dU(u, h, b, T) {
        return u == null ? [] : (Ye(h) || (h = h == null ? [] : [h]), b = T ? n : b, Ye(b) || (b = b == null ? [] : [b]), qO(u, h, b));
      }
      var hU = uh(function(u, h, b) {
        u[b ? 0 : 1].push(h);
      }, function() {
        return [[], []];
      });
      function pU(u, h, b) {
        var T = Ye(u) ? Fy : bO, M = arguments.length < 3;
        return T(u, De(h, 4), b, M, la);
      }
      function mU(u, h, b) {
        var T = Ye(u) ? P5 : bO, M = arguments.length < 3;
        return T(u, De(h, 4), b, M, LO);
      }
      function gU(u, h) {
        var b = Ye(u) ? ia : BO;
        return b(u, _h(De(h, 3)));
      }
      function yU(u) {
        var h = Ye(u) ? DO : cV;
        return h(u);
      }
      function vU(u, h, b) {
        (b ? ar(u, h, b) : h === n) ? h = 1 : h = Ze(h);
        var T = Ye(u) ? F3 : uV;
        return T(u, h);
      }
      function bU(u) {
        var h = Ye(u) ? W3 : dV;
        return h(u);
      }
      function xU(u) {
        if (u == null)
          return 0;
        if (yr(u))
          return Oh(u) ? cl(u) : u.length;
        var h = Jn(u);
        return h == de || h == Oe ? u.size : ov(u).length;
      }
      function wU(u, h, b) {
        var T = Ye(u) ? Wy : hV;
        return b && ar(u, h, b) && (h = n), T(u, De(h, 3));
      }
      var _U = nt(function(u, h) {
        if (u == null)
          return [];
        var b = h.length;
        return b > 1 && ar(u, h[0], h[1]) ? h = [] : b > 2 && ar(h[0], h[1], h[2]) && (h = [h[0]]), qO(u, Bn(h, 1), []);
      }), xh = n3 || function() {
        return Ln.Date.now();
      };
      function SU(u, h) {
        if (typeof h != "function")
          throw new Qr(a);
        return u = Ze(u), function() {
          if (--u < 1)
            return h.apply(this, arguments);
        };
      }
      function VA(u, h, b) {
        return h = b ? n : h, h = u && h == null ? u.length : h, ho(u, P, n, n, n, n, h);
      }
      function UA(u, h) {
        var b;
        if (typeof h != "function")
          throw new Qr(a);
        return u = Ze(u), function() {
          return --u > 0 && (b = h.apply(this, arguments)), u <= 1 && (h = n), b;
        };
      }
      var Ev = nt(function(u, h, b) {
        var T = v;
        if (b.length) {
          var M = aa(b, yl(Ev));
          T |= _;
        }
        return ho(u, T, h, b, M);
      }), HA = nt(function(u, h, b) {
        var T = v | x;
        if (b.length) {
          var M = aa(b, yl(HA));
          T |= _;
        }
        return ho(h, T, u, b, M);
      });
      function KA(u, h, b) {
        h = b ? n : h;
        var T = ho(u, S, n, n, n, n, n, h);
        return T.placeholder = KA.placeholder, T;
      }
      function GA(u, h, b) {
        h = b ? n : h;
        var T = ho(u, A, n, n, n, n, n, h);
        return T.placeholder = GA.placeholder, T;
      }
      function YA(u, h, b) {
        var T, M, B, G, q, J, he = 0, me = !1, ye = !1, xe = !0;
        if (typeof u != "function")
          throw new Qr(a);
        h = ii(h) || 0, Jt(b) && (me = !!b.leading, ye = "maxWait" in b, B = ye ? bn(ii(b.maxWait) || 0, h) : B, xe = "trailing" in b ? !!b.trailing : xe);
        function Ce(sn) {
          var xi = T, vo = M;
          return T = M = n, he = sn, G = u.apply(vo, xi), G;
        }
        function Re(sn) {
          return he = sn, q = yu(ot, h), me ? Ce(sn) : G;
        }
        function et(sn) {
          var xi = sn - J, vo = sn - he, hT = h - xi;
          return ye ? Zn(hT, B - vo) : hT;
        }
        function je(sn) {
          var xi = sn - J, vo = sn - he;
          return J === n || xi >= h || xi < 0 || ye && vo >= B;
        }
        function ot() {
          var sn = xh();
          if (je(sn))
            return ft(sn);
          q = yu(ot, et(sn));
        }
        function ft(sn) {
          return q = n, xe && T ? Ce(sn) : (T = M = n, G);
        }
        function Nr() {
          q !== n && iA(q), he = 0, T = J = M = q = n;
        }
        function sr() {
          return q === n ? G : ft(xh());
        }
        function $r() {
          var sn = xh(), xi = je(sn);
          if (T = arguments, M = this, J = sn, xi) {
            if (q === n)
              return Re(J);
            if (ye)
              return iA(q), q = yu(ot, h), Ce(J);
          }
          return q === n && (q = yu(ot, h)), G;
        }
        return $r.cancel = Nr, $r.flush = sr, $r;
      }
      var OU = nt(function(u, h) {
        return jO(u, 1, h);
      }), AU = nt(function(u, h, b) {
        return jO(u, ii(h) || 0, b);
      });
      function TU(u) {
        return ho(u, k);
      }
      function wh(u, h) {
        if (typeof u != "function" || h != null && typeof h != "function")
          throw new Qr(a);
        var b = function() {
          var T = arguments, M = h ? h.apply(this, T) : T[0], B = b.cache;
          if (B.has(M))
            return B.get(M);
          var G = u.apply(this, T);
          return b.cache = B.set(M, G) || B, G;
        };
        return b.cache = new (wh.Cache || uo)(), b;
      }
      wh.Cache = uo;
      function _h(u) {
        if (typeof u != "function")
          throw new Qr(a);
        return function() {
          var h = arguments;
          switch (h.length) {
            case 0:
              return !u.call(this);
            case 1:
              return !u.call(this, h[0]);
            case 2:
              return !u.call(this, h[0], h[1]);
            case 3:
              return !u.call(this, h[0], h[1], h[2]);
          }
          return !u.apply(this, h);
        };
      }
      function PU(u) {
        return UA(2, u);
      }
      var CU = pV(function(u, h) {
        h = h.length == 1 && Ye(h[0]) ? Gt(h[0], Er(De())) : Gt(Bn(h, 1), Er(De()));
        var b = h.length;
        return nt(function(T) {
          for (var M = -1, B = Zn(T.length, b); ++M < B; )
            T[M] = h[M].call(this, T[M]);
          return Cr(u, this, T);
        });
      }), kv = nt(function(u, h) {
        var b = aa(h, yl(kv));
        return ho(u, _, n, h, b);
      }), qA = nt(function(u, h) {
        var b = aa(h, yl(qA));
        return ho(u, O, n, h, b);
      }), EU = po(function(u, h) {
        return ho(u, C, n, n, n, h);
      });
      function kU(u, h) {
        if (typeof u != "function")
          throw new Qr(a);
        return h = h === n ? h : Ze(h), nt(u, h);
      }
      function MU(u, h) {
        if (typeof u != "function")
          throw new Qr(a);
        return h = h == null ? 0 : bn(Ze(h), 0), nt(function(b) {
          var T = b[h], M = fa(b, 0, h);
          return T && oa(M, T), Cr(u, this, M);
        });
      }
      function NU(u, h, b) {
        var T = !0, M = !0;
        if (typeof u != "function")
          throw new Qr(a);
        return Jt(b) && (T = "leading" in b ? !!b.leading : T, M = "trailing" in b ? !!b.trailing : M), YA(u, h, {
          leading: T,
          maxWait: h,
          trailing: M
        });
      }
      function $U(u) {
        return VA(u, 1);
      }
      function DU(u, h) {
        return kv(pv(h), u);
      }
      function IU() {
        if (!arguments.length)
          return [];
        var u = arguments[0];
        return Ye(u) ? u : [u];
      }
      function RU(u) {
        return ti(u, m);
      }
      function jU(u, h) {
        return h = typeof h == "function" ? h : n, ti(u, m, h);
      }
      function LU(u) {
        return ti(u, d | m);
      }
      function BU(u, h) {
        return h = typeof h == "function" ? h : n, ti(u, d | m, h);
      }
      function FU(u, h) {
        return h == null || RO(u, h, En(h));
      }
      function bi(u, h) {
        return u === h || u !== u && h !== h;
      }
      var WU = ph(nv), zU = ph(function(u, h) {
        return u >= h;
      }), os = zO(/* @__PURE__ */ function() {
        return arguments;
      }()) ? zO : function(u) {
        return tn(u) && Ot.call(u, "callee") && !CO.call(u, "callee");
      }, Ye = ie.isArray, VU = cO ? Er(cO) : Z3;
      function yr(u) {
        return u != null && Sh(u.length) && !go(u);
      }
      function an(u) {
        return tn(u) && yr(u);
      }
      function UU(u) {
        return u === !0 || u === !1 || tn(u) && or(u) == ae;
      }
      var da = i3 || Wv, HU = uO ? Er(uO) : J3;
      function KU(u) {
        return tn(u) && u.nodeType === 1 && !vu(u);
      }
      function GU(u) {
        if (u == null)
          return !0;
        if (yr(u) && (Ye(u) || typeof u == "string" || typeof u.splice == "function" || da(u) || vl(u) || os(u)))
          return !u.length;
        var h = Jn(u);
        if (h == de || h == Oe)
          return !u.size;
        if (gu(u))
          return !ov(u).length;
        for (var b in u)
          if (Ot.call(u, b))
            return !1;
        return !0;
      }
      function YU(u, h) {
        return hu(u, h);
      }
      function qU(u, h, b) {
        b = typeof b == "function" ? b : n;
        var T = b ? b(u, h) : n;
        return T === n ? hu(u, h, n, b) : !!T;
      }
      function Mv(u) {
        if (!tn(u))
          return !1;
        var h = or(u);
        return h == ge || h == se || typeof u.message == "string" && typeof u.name == "string" && !vu(u);
      }
      function XU(u) {
        return typeof u == "number" && kO(u);
      }
      function go(u) {
        if (!Jt(u))
          return !1;
        var h = or(u);
        return h == X || h == $e || h == fe || h == Ie;
      }
      function XA(u) {
        return typeof u == "number" && u == Ze(u);
      }
      function Sh(u) {
        return typeof u == "number" && u > -1 && u % 1 == 0 && u <= H;
      }
      function Jt(u) {
        var h = typeof u;
        return u != null && (h == "object" || h == "function");
      }
      function tn(u) {
        return u != null && typeof u == "object";
      }
      var ZA = fO ? Er(fO) : eV;
      function ZU(u, h) {
        return u === h || iv(u, h, wv(h));
      }
      function JU(u, h, b) {
        return b = typeof b == "function" ? b : n, iv(u, h, wv(h), b);
      }
      function QU(u) {
        return JA(u) && u != +u;
      }
      function e6(u) {
        if (jV(u))
          throw new He(o);
        return VO(u);
      }
      function t6(u) {
        return u === null;
      }
      function n6(u) {
        return u == null;
      }
      function JA(u) {
        return typeof u == "number" || tn(u) && or(u) == ke;
      }
      function vu(u) {
        if (!tn(u) || or(u) != lt)
          return !1;
        var h = Xd(u);
        if (h === null)
          return !0;
        var b = Ot.call(h, "constructor") && h.constructor;
        return typeof b == "function" && b instanceof b && Kd.call(b) == J5;
      }
      var Nv = dO ? Er(dO) : tV;
      function r6(u) {
        return XA(u) && u >= -H && u <= H;
      }
      var QA = hO ? Er(hO) : nV;
      function Oh(u) {
        return typeof u == "string" || !Ye(u) && tn(u) && or(u) == Ge;
      }
      function Mr(u) {
        return typeof u == "symbol" || tn(u) && or(u) == Zt;
      }
      var vl = pO ? Er(pO) : rV;
      function i6(u) {
        return u === n;
      }
      function o6(u) {
        return tn(u) && Jn(u) == en;
      }
      function a6(u) {
        return tn(u) && or(u) == Yr;
      }
      var s6 = ph(av), l6 = ph(function(u, h) {
        return u <= h;
      });
      function eT(u) {
        if (!u)
          return [];
        if (yr(u))
          return Oh(u) ? yi(u) : gr(u);
        if (ou && u[ou])
          return F5(u[ou]());
        var h = Jn(u), b = h == de ? Gy : h == Oe ? Vd : bl;
        return b(u);
      }
      function yo(u) {
        if (!u)
          return u === 0 ? u : 0;
        if (u = ii(u), u === z || u === -z) {
          var h = u < 0 ? -1 : 1;
          return h * U;
        }
        return u === u ? u : 0;
      }
      function Ze(u) {
        var h = yo(u), b = h % 1;
        return h === h ? b ? h - b : h : 0;
      }
      function tT(u) {
        return u ? ts(Ze(u), 0, Y) : 0;
      }
      function ii(u) {
        if (typeof u == "number")
          return u;
        if (Mr(u))
          return V;
        if (Jt(u)) {
          var h = typeof u.valueOf == "function" ? u.valueOf() : u;
          u = Jt(h) ? h + "" : h;
        }
        if (typeof u != "string")
          return u === 0 ? u : +u;
        u = xO(u);
        var b = Vz.test(u);
        return b || Hz.test(u) ? S5(u.slice(2), b ? 2 : 8) : zz.test(u) ? V : +u;
      }
      function nT(u) {
        return ji(u, vr(u));
      }
      function c6(u) {
        return u ? ts(Ze(u), -H, H) : u === 0 ? u : 0;
      }
      function vt(u) {
        return u == null ? "" : kr(u);
      }
      var u6 = ml(function(u, h) {
        if (gu(h) || yr(h)) {
          ji(h, En(h), u);
          return;
        }
        for (var b in h)
          Ot.call(h, b) && uu(u, b, h[b]);
      }), rT = ml(function(u, h) {
        ji(h, vr(h), u);
      }), Ah = ml(function(u, h, b, T) {
        ji(h, vr(h), u, T);
      }), f6 = ml(function(u, h, b, T) {
        ji(h, En(h), u, T);
      }), d6 = po(Qy);
      function h6(u, h) {
        var b = pl(u);
        return h == null ? b : IO(b, h);
      }
      var p6 = nt(function(u, h) {
        u = Mt(u);
        var b = -1, T = h.length, M = T > 2 ? h[2] : n;
        for (M && ar(h[0], h[1], M) && (T = 1); ++b < T; )
          for (var B = h[b], G = vr(B), q = -1, J = G.length; ++q < J; ) {
            var he = G[q], me = u[he];
            (me === n || bi(me, fl[he]) && !Ot.call(u, he)) && (u[he] = B[he]);
          }
        return u;
      }), m6 = nt(function(u) {
        return u.push(n, xA), Cr(iT, n, u);
      });
      function g6(u, h) {
        return gO(u, De(h, 3), Ri);
      }
      function y6(u, h) {
        return gO(u, De(h, 3), tv);
      }
      function v6(u, h) {
        return u == null ? u : ev(u, De(h, 3), vr);
      }
      function b6(u, h) {
        return u == null ? u : FO(u, De(h, 3), vr);
      }
      function x6(u, h) {
        return u && Ri(u, De(h, 3));
      }
      function w6(u, h) {
        return u && tv(u, De(h, 3));
      }
      function _6(u) {
        return u == null ? [] : ah(u, En(u));
      }
      function S6(u) {
        return u == null ? [] : ah(u, vr(u));
      }
      function $v(u, h, b) {
        var T = u == null ? n : ns(u, h);
        return T === n ? b : T;
      }
      function O6(u, h) {
        return u != null && SA(u, h, G3);
      }
      function Dv(u, h) {
        return u != null && SA(u, h, Y3);
      }
      var A6 = mA(function(u, h, b) {
        h != null && typeof h.toString != "function" && (h = Gd.call(h)), u[h] = b;
      }, Rv(br)), T6 = mA(function(u, h, b) {
        h != null && typeof h.toString != "function" && (h = Gd.call(h)), Ot.call(u, h) ? u[h].push(b) : u[h] = [b];
      }, De), P6 = nt(du);
      function En(u) {
        return yr(u) ? $O(u) : ov(u);
      }
      function vr(u) {
        return yr(u) ? $O(u, !0) : iV(u);
      }
      function C6(u, h) {
        var b = {};
        return h = De(h, 3), Ri(u, function(T, M, B) {
          fo(b, h(T, M, B), T);
        }), b;
      }
      function E6(u, h) {
        var b = {};
        return h = De(h, 3), Ri(u, function(T, M, B) {
          fo(b, M, h(T, M, B));
        }), b;
      }
      var k6 = ml(function(u, h, b) {
        sh(u, h, b);
      }), iT = ml(function(u, h, b, T) {
        sh(u, h, b, T);
      }), M6 = po(function(u, h) {
        var b = {};
        if (u == null)
          return b;
        var T = !1;
        h = Gt(h, function(B) {
          return B = ua(B, u), T || (T = B.length > 1), B;
        }), ji(u, bv(u), b), T && (b = ti(b, d | p | m, AV));
        for (var M = h.length; M--; )
          fv(b, h[M]);
        return b;
      });
      function N6(u, h) {
        return oT(u, _h(De(h)));
      }
      var $6 = po(function(u, h) {
        return u == null ? {} : aV(u, h);
      });
      function oT(u, h) {
        if (u == null)
          return {};
        var b = Gt(bv(u), function(T) {
          return [T];
        });
        return h = De(h), XO(u, b, function(T, M) {
          return h(T, M[0]);
        });
      }
      function D6(u, h, b) {
        h = ua(h, u);
        var T = -1, M = h.length;
        for (M || (M = 1, u = n); ++T < M; ) {
          var B = u == null ? n : u[Li(h[T])];
          B === n && (T = M, B = b), u = go(B) ? B.call(u) : B;
        }
        return u;
      }
      function I6(u, h, b) {
        return u == null ? u : pu(u, h, b);
      }
      function R6(u, h, b, T) {
        return T = typeof T == "function" ? T : n, u == null ? u : pu(u, h, b, T);
      }
      var aT = vA(En), sT = vA(vr);
      function j6(u, h, b) {
        var T = Ye(u), M = T || da(u) || vl(u);
        if (h = De(h, 4), b == null) {
          var B = u && u.constructor;
          M ? b = T ? new B() : [] : Jt(u) ? b = go(B) ? pl(Xd(u)) : {} : b = {};
        }
        return (M ? Jr : Ri)(u, function(G, q, J) {
          return h(b, G, q, J);
        }), b;
      }
      function L6(u, h) {
        return u == null ? !0 : fv(u, h);
      }
      function B6(u, h, b) {
        return u == null ? u : tA(u, h, pv(b));
      }
      function F6(u, h, b, T) {
        return T = typeof T == "function" ? T : n, u == null ? u : tA(u, h, pv(b), T);
      }
      function bl(u) {
        return u == null ? [] : Ky(u, En(u));
      }
      function W6(u) {
        return u == null ? [] : Ky(u, vr(u));
      }
      function z6(u, h, b) {
        return b === n && (b = h, h = n), b !== n && (b = ii(b), b = b === b ? b : 0), h !== n && (h = ii(h), h = h === h ? h : 0), ts(ii(u), h, b);
      }
      function V6(u, h, b) {
        return h = yo(h), b === n ? (b = h, h = 0) : b = yo(b), u = ii(u), q3(u, h, b);
      }
      function U6(u, h, b) {
        if (b && typeof b != "boolean" && ar(u, h, b) && (h = b = n), b === n && (typeof h == "boolean" ? (b = h, h = n) : typeof u == "boolean" && (b = u, u = n)), u === n && h === n ? (u = 0, h = 1) : (u = yo(u), h === n ? (h = u, u = 0) : h = yo(h)), u > h) {
          var T = u;
          u = h, h = T;
        }
        if (b || u % 1 || h % 1) {
          var M = MO();
          return Zn(u + M * (h - u + _5("1e-" + ((M + "").length - 1))), h);
        }
        return lv(u, h);
      }
      var H6 = gl(function(u, h, b) {
        return h = h.toLowerCase(), u + (b ? lT(h) : h);
      });
      function lT(u) {
        return Iv(vt(u).toLowerCase());
      }
      function cT(u) {
        return u = vt(u), u && u.replace(Gz, I5).replace(d5, "");
      }
      function K6(u, h, b) {
        u = vt(u), h = kr(h);
        var T = u.length;
        b = b === n ? T : ts(Ze(b), 0, T);
        var M = b;
        return b -= h.length, b >= 0 && u.slice(b, M) == h;
      }
      function G6(u) {
        return u = vt(u), u && nu.test(u) ? u.replace(jd, R5) : u;
      }
      function Y6(u) {
        return u = vt(u), u && $z.test(u) ? u.replace(ky, "\\$&") : u;
      }
      var q6 = gl(function(u, h, b) {
        return u + (b ? "-" : "") + h.toLowerCase();
      }), X6 = gl(function(u, h, b) {
        return u + (b ? " " : "") + h.toLowerCase();
      }), Z6 = dA("toLowerCase");
      function J6(u, h, b) {
        u = vt(u), h = Ze(h);
        var T = h ? cl(u) : 0;
        if (!h || T >= h)
          return u;
        var M = (h - T) / 2;
        return hh(eh(M), b) + u + hh(Qd(M), b);
      }
      function Q6(u, h, b) {
        u = vt(u), h = Ze(h);
        var T = h ? cl(u) : 0;
        return h && T < h ? u + hh(h - T, b) : u;
      }
      function e8(u, h, b) {
        u = vt(u), h = Ze(h);
        var T = h ? cl(u) : 0;
        return h && T < h ? hh(h - T, b) + u : u;
      }
      function t8(u, h, b) {
        return b || h == null ? h = 0 : h && (h = +h), l3(vt(u).replace(My, ""), h || 0);
      }
      function n8(u, h, b) {
        return (b ? ar(u, h, b) : h === n) ? h = 1 : h = Ze(h), cv(vt(u), h);
      }
      function r8() {
        var u = arguments, h = vt(u[0]);
        return u.length < 3 ? h : h.replace(u[1], u[2]);
      }
      var i8 = gl(function(u, h, b) {
        return u + (b ? "_" : "") + h.toLowerCase();
      });
      function o8(u, h, b) {
        return b && typeof b != "number" && ar(u, h, b) && (h = b = n), b = b === n ? Y : b >>> 0, b ? (u = vt(u), u && (typeof h == "string" || h != null && !Nv(h)) && (h = kr(h), !h && ll(u)) ? fa(yi(u), 0, b) : u.split(h, b)) : [];
      }
      var a8 = gl(function(u, h, b) {
        return u + (b ? " " : "") + Iv(h);
      });
      function s8(u, h, b) {
        return u = vt(u), b = b == null ? 0 : ts(Ze(b), 0, u.length), h = kr(h), u.slice(b, b + h.length) == h;
      }
      function l8(u, h, b) {
        var T = L.templateSettings;
        b && ar(u, h, b) && (h = n), u = vt(u), h = Ah({}, h, T, bA);
        var M = Ah({}, h.imports, T.imports, bA), B = En(M), G = Ky(M, B), q, J, he = 0, me = h.interpolate || Ld, ye = "__p += '", xe = Yy(
          (h.escape || Ld).source + "|" + me.source + "|" + (me === WS ? Wz : Ld).source + "|" + (h.evaluate || Ld).source + "|$",
          "g"
        ), Ce = "//# sourceURL=" + (Ot.call(h, "sourceURL") ? (h.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++y5 + "]") + `
`;
        u.replace(xe, function(je, ot, ft, Nr, sr, $r) {
          return ft || (ft = Nr), ye += u.slice(he, $r).replace(Yz, j5), ot && (q = !0, ye += `' +
__e(` + ot + `) +
'`), sr && (J = !0, ye += `';
` + sr + `;
__p += '`), ft && (ye += `' +
((__t = (` + ft + `)) == null ? '' : __t) +
'`), he = $r + je.length, je;
        }), ye += `';
`;
        var Re = Ot.call(h, "variable") && h.variable;
        if (!Re)
          ye = `with (obj) {
` + ye + `
}
`;
        else if (Bz.test(Re))
          throw new He(s);
        ye = (J ? ye.replace(fn, "") : ye).replace(Xr, "$1").replace(yt, "$1;"), ye = "function(" + (Re || "obj") + `) {
` + (Re ? "" : `obj || (obj = {});
`) + "var __t, __p = ''" + (q ? ", __e = _.escape" : "") + (J ? `, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
` : `;
`) + ye + `return __p
}`;
        var et = fT(function() {
          return gt(B, Ce + "return " + ye).apply(n, G);
        });
        if (et.source = ye, Mv(et))
          throw et;
        return et;
      }
      function c8(u) {
        return vt(u).toLowerCase();
      }
      function u8(u) {
        return vt(u).toUpperCase();
      }
      function f8(u, h, b) {
        if (u = vt(u), u && (b || h === n))
          return xO(u);
        if (!u || !(h = kr(h)))
          return u;
        var T = yi(u), M = yi(h), B = wO(T, M), G = _O(T, M) + 1;
        return fa(T, B, G).join("");
      }
      function d8(u, h, b) {
        if (u = vt(u), u && (b || h === n))
          return u.slice(0, OO(u) + 1);
        if (!u || !(h = kr(h)))
          return u;
        var T = yi(u), M = _O(T, yi(h)) + 1;
        return fa(T, 0, M).join("");
      }
      function h8(u, h, b) {
        if (u = vt(u), u && (b || h === n))
          return u.replace(My, "");
        if (!u || !(h = kr(h)))
          return u;
        var T = yi(u), M = wO(T, yi(h));
        return fa(T, M).join("");
      }
      function p8(u, h) {
        var b = I, T = $;
        if (Jt(h)) {
          var M = "separator" in h ? h.separator : M;
          b = "length" in h ? Ze(h.length) : b, T = "omission" in h ? kr(h.omission) : T;
        }
        u = vt(u);
        var B = u.length;
        if (ll(u)) {
          var G = yi(u);
          B = G.length;
        }
        if (b >= B)
          return u;
        var q = b - cl(T);
        if (q < 1)
          return T;
        var J = G ? fa(G, 0, q).join("") : u.slice(0, q);
        if (M === n)
          return J + T;
        if (G && (q += J.length - q), Nv(M)) {
          if (u.slice(q).search(M)) {
            var he, me = J;
            for (M.global || (M = Yy(M.source, vt(zS.exec(M)) + "g")), M.lastIndex = 0; he = M.exec(me); )
              var ye = he.index;
            J = J.slice(0, ye === n ? q : ye);
          }
        } else if (u.indexOf(kr(M), q) != q) {
          var xe = J.lastIndexOf(M);
          xe > -1 && (J = J.slice(0, xe));
        }
        return J + T;
      }
      function m8(u) {
        return u = vt(u), u && Ey.test(u) ? u.replace(Rd, U5) : u;
      }
      var g8 = gl(function(u, h, b) {
        return u + (b ? " " : "") + h.toUpperCase();
      }), Iv = dA("toUpperCase");
      function uT(u, h, b) {
        return u = vt(u), h = b ? n : h, h === n ? B5(u) ? G5(u) : k5(u) : u.match(h) || [];
      }
      var fT = nt(function(u, h) {
        try {
          return Cr(u, n, h);
        } catch (b) {
          return Mv(b) ? b : new He(b);
        }
      }), y8 = po(function(u, h) {
        return Jr(h, function(b) {
          b = Li(b), fo(u, b, Ev(u[b], u));
        }), u;
      });
      function v8(u) {
        var h = u == null ? 0 : u.length, b = De();
        return u = h ? Gt(u, function(T) {
          if (typeof T[1] != "function")
            throw new Qr(a);
          return [b(T[0]), T[1]];
        }) : [], nt(function(T) {
          for (var M = -1; ++M < h; ) {
            var B = u[M];
            if (Cr(B[0], this, T))
              return Cr(B[1], this, T);
          }
        });
      }
      function b8(u) {
        return U3(ti(u, d));
      }
      function Rv(u) {
        return function() {
          return u;
        };
      }
      function x8(u, h) {
        return u == null || u !== u ? h : u;
      }
      var w8 = pA(), _8 = pA(!0);
      function br(u) {
        return u;
      }
      function jv(u) {
        return UO(typeof u == "function" ? u : ti(u, d));
      }
      function S8(u) {
        return KO(ti(u, d));
      }
      function O8(u, h) {
        return GO(u, ti(h, d));
      }
      var A8 = nt(function(u, h) {
        return function(b) {
          return du(b, u, h);
        };
      }), T8 = nt(function(u, h) {
        return function(b) {
          return du(u, b, h);
        };
      });
      function Lv(u, h, b) {
        var T = En(h), M = ah(h, T);
        b == null && !(Jt(h) && (M.length || !T.length)) && (b = h, h = u, u = this, M = ah(h, En(h)));
        var B = !(Jt(b) && "chain" in b) || !!b.chain, G = go(u);
        return Jr(M, function(q) {
          var J = h[q];
          u[q] = J, G && (u.prototype[q] = function() {
            var he = this.__chain__;
            if (B || he) {
              var me = u(this.__wrapped__), ye = me.__actions__ = gr(this.__actions__);
              return ye.push({ func: J, args: arguments, thisArg: u }), me.__chain__ = he, me;
            }
            return J.apply(u, oa([this.value()], arguments));
          });
        }), u;
      }
      function P8() {
        return Ln._ === this && (Ln._ = Q5), this;
      }
      function Bv() {
      }
      function C8(u) {
        return u = Ze(u), nt(function(h) {
          return YO(h, u);
        });
      }
      var E8 = gv(Gt), k8 = gv(mO), M8 = gv(Wy);
      function dT(u) {
        return Sv(u) ? zy(Li(u)) : sV(u);
      }
      function N8(u) {
        return function(h) {
          return u == null ? n : ns(u, h);
        };
      }
      var $8 = gA(), D8 = gA(!0);
      function Fv() {
        return [];
      }
      function Wv() {
        return !1;
      }
      function I8() {
        return {};
      }
      function R8() {
        return "";
      }
      function j8() {
        return !0;
      }
      function L8(u, h) {
        if (u = Ze(u), u < 1 || u > H)
          return [];
        var b = Y, T = Zn(u, Y);
        h = De(h), u -= Y;
        for (var M = Hy(T, h); ++b < u; )
          h(b);
        return M;
      }
      function B8(u) {
        return Ye(u) ? Gt(u, Li) : Mr(u) ? [u] : gr(NA(vt(u)));
      }
      function F8(u) {
        var h = ++Z5;
        return vt(u) + h;
      }
      var W8 = dh(function(u, h) {
        return u + h;
      }, 0), z8 = yv("ceil"), V8 = dh(function(u, h) {
        return u / h;
      }, 1), U8 = yv("floor");
      function H8(u) {
        return u && u.length ? oh(u, br, nv) : n;
      }
      function K8(u, h) {
        return u && u.length ? oh(u, De(h, 2), nv) : n;
      }
      function G8(u) {
        return vO(u, br);
      }
      function Y8(u, h) {
        return vO(u, De(h, 2));
      }
      function q8(u) {
        return u && u.length ? oh(u, br, av) : n;
      }
      function X8(u, h) {
        return u && u.length ? oh(u, De(h, 2), av) : n;
      }
      var Z8 = dh(function(u, h) {
        return u * h;
      }, 1), J8 = yv("round"), Q8 = dh(function(u, h) {
        return u - h;
      }, 0);
      function eH(u) {
        return u && u.length ? Uy(u, br) : 0;
      }
      function tH(u, h) {
        return u && u.length ? Uy(u, De(h, 2)) : 0;
      }
      return L.after = SU, L.ary = VA, L.assign = u6, L.assignIn = rT, L.assignInWith = Ah, L.assignWith = f6, L.at = d6, L.before = UA, L.bind = Ev, L.bindAll = y8, L.bindKey = HA, L.castArray = IU, L.chain = FA, L.chunk = UV, L.compact = HV, L.concat = KV, L.cond = v8, L.conforms = b8, L.constant = Rv, L.countBy = eU, L.create = h6, L.curry = KA, L.curryRight = GA, L.debounce = YA, L.defaults = p6, L.defaultsDeep = m6, L.defer = OU, L.delay = AU, L.difference = GV, L.differenceBy = YV, L.differenceWith = qV, L.drop = XV, L.dropRight = ZV, L.dropRightWhile = JV, L.dropWhile = QV, L.fill = e4, L.filter = nU, L.flatMap = oU, L.flatMapDeep = aU, L.flatMapDepth = sU, L.flatten = RA, L.flattenDeep = t4, L.flattenDepth = n4, L.flip = TU, L.flow = w8, L.flowRight = _8, L.fromPairs = r4, L.functions = _6, L.functionsIn = S6, L.groupBy = lU, L.initial = o4, L.intersection = a4, L.intersectionBy = s4, L.intersectionWith = l4, L.invert = A6, L.invertBy = T6, L.invokeMap = uU, L.iteratee = jv, L.keyBy = fU, L.keys = En, L.keysIn = vr, L.map = bh, L.mapKeys = C6, L.mapValues = E6, L.matches = S8, L.matchesProperty = O8, L.memoize = wh, L.merge = k6, L.mergeWith = iT, L.method = A8, L.methodOf = T8, L.mixin = Lv, L.negate = _h, L.nthArg = C8, L.omit = M6, L.omitBy = N6, L.once = PU, L.orderBy = dU, L.over = E8, L.overArgs = CU, L.overEvery = k8, L.overSome = M8, L.partial = kv, L.partialRight = qA, L.partition = hU, L.pick = $6, L.pickBy = oT, L.property = dT, L.propertyOf = N8, L.pull = d4, L.pullAll = LA, L.pullAllBy = h4, L.pullAllWith = p4, L.pullAt = m4, L.range = $8, L.rangeRight = D8, L.rearg = EU, L.reject = gU, L.remove = g4, L.rest = kU, L.reverse = Pv, L.sampleSize = vU, L.set = I6, L.setWith = R6, L.shuffle = bU, L.slice = y4, L.sortBy = _U, L.sortedUniq = O4, L.sortedUniqBy = A4, L.split = o8, L.spread = MU, L.tail = T4, L.take = P4, L.takeRight = C4, L.takeRightWhile = E4, L.takeWhile = k4, L.tap = H4, L.throttle = NU, L.thru = vh, L.toArray = eT, L.toPairs = aT, L.toPairsIn = sT, L.toPath = B8, L.toPlainObject = nT, L.transform = j6, L.unary = $U, L.union = M4, L.unionBy = N4, L.unionWith = $4, L.uniq = D4, L.uniqBy = I4, L.uniqWith = R4, L.unset = L6, L.unzip = Cv, L.unzipWith = BA, L.update = B6, L.updateWith = F6, L.values = bl, L.valuesIn = W6, L.without = j4, L.words = uT, L.wrap = DU, L.xor = L4, L.xorBy = B4, L.xorWith = F4, L.zip = W4, L.zipObject = z4, L.zipObjectDeep = V4, L.zipWith = U4, L.entries = aT, L.entriesIn = sT, L.extend = rT, L.extendWith = Ah, Lv(L, L), L.add = W8, L.attempt = fT, L.camelCase = H6, L.capitalize = lT, L.ceil = z8, L.clamp = z6, L.clone = RU, L.cloneDeep = LU, L.cloneDeepWith = BU, L.cloneWith = jU, L.conformsTo = FU, L.deburr = cT, L.defaultTo = x8, L.divide = V8, L.endsWith = K6, L.eq = bi, L.escape = G6, L.escapeRegExp = Y6, L.every = tU, L.find = rU, L.findIndex = DA, L.findKey = g6, L.findLast = iU, L.findLastIndex = IA, L.findLastKey = y6, L.floor = U8, L.forEach = WA, L.forEachRight = zA, L.forIn = v6, L.forInRight = b6, L.forOwn = x6, L.forOwnRight = w6, L.get = $v, L.gt = WU, L.gte = zU, L.has = O6, L.hasIn = Dv, L.head = jA, L.identity = br, L.includes = cU, L.indexOf = i4, L.inRange = V6, L.invoke = P6, L.isArguments = os, L.isArray = Ye, L.isArrayBuffer = VU, L.isArrayLike = yr, L.isArrayLikeObject = an, L.isBoolean = UU, L.isBuffer = da, L.isDate = HU, L.isElement = KU, L.isEmpty = GU, L.isEqual = YU, L.isEqualWith = qU, L.isError = Mv, L.isFinite = XU, L.isFunction = go, L.isInteger = XA, L.isLength = Sh, L.isMap = ZA, L.isMatch = ZU, L.isMatchWith = JU, L.isNaN = QU, L.isNative = e6, L.isNil = n6, L.isNull = t6, L.isNumber = JA, L.isObject = Jt, L.isObjectLike = tn, L.isPlainObject = vu, L.isRegExp = Nv, L.isSafeInteger = r6, L.isSet = QA, L.isString = Oh, L.isSymbol = Mr, L.isTypedArray = vl, L.isUndefined = i6, L.isWeakMap = o6, L.isWeakSet = a6, L.join = c4, L.kebabCase = q6, L.last = ri, L.lastIndexOf = u4, L.lowerCase = X6, L.lowerFirst = Z6, L.lt = s6, L.lte = l6, L.max = H8, L.maxBy = K8, L.mean = G8, L.meanBy = Y8, L.min = q8, L.minBy = X8, L.stubArray = Fv, L.stubFalse = Wv, L.stubObject = I8, L.stubString = R8, L.stubTrue = j8, L.multiply = Z8, L.nth = f4, L.noConflict = P8, L.noop = Bv, L.now = xh, L.pad = J6, L.padEnd = Q6, L.padStart = e8, L.parseInt = t8, L.random = U6, L.reduce = pU, L.reduceRight = mU, L.repeat = n8, L.replace = r8, L.result = D6, L.round = J8, L.runInContext = Z, L.sample = yU, L.size = xU, L.snakeCase = i8, L.some = wU, L.sortedIndex = v4, L.sortedIndexBy = b4, L.sortedIndexOf = x4, L.sortedLastIndex = w4, L.sortedLastIndexBy = _4, L.sortedLastIndexOf = S4, L.startCase = a8, L.startsWith = s8, L.subtract = Q8, L.sum = eH, L.sumBy = tH, L.template = l8, L.times = L8, L.toFinite = yo, L.toInteger = Ze, L.toLength = tT, L.toLower = c8, L.toNumber = ii, L.toSafeInteger = c6, L.toString = vt, L.toUpper = u8, L.trim = f8, L.trimEnd = d8, L.trimStart = h8, L.truncate = p8, L.unescape = m8, L.uniqueId = F8, L.upperCase = g8, L.upperFirst = Iv, L.each = WA, L.eachRight = zA, L.first = jA, Lv(L, function() {
        var u = {};
        return Ri(L, function(h, b) {
          Ot.call(L.prototype, b) || (u[b] = h);
        }), u;
      }(), { chain: !1 }), L.VERSION = r, Jr(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(u) {
        L[u].placeholder = L;
      }), Jr(["drop", "take"], function(u, h) {
        ut.prototype[u] = function(b) {
          b = b === n ? 1 : bn(Ze(b), 0);
          var T = this.__filtered__ && !h ? new ut(this) : this.clone();
          return T.__filtered__ ? T.__takeCount__ = Zn(b, T.__takeCount__) : T.__views__.push({
            size: Zn(b, Y),
            type: u + (T.__dir__ < 0 ? "Right" : "")
          }), T;
        }, ut.prototype[u + "Right"] = function(b) {
          return this.reverse()[u](b).reverse();
        };
      }), Jr(["filter", "map", "takeWhile"], function(u, h) {
        var b = h + 1, T = b == j || b == W;
        ut.prototype[u] = function(M) {
          var B = this.clone();
          return B.__iteratees__.push({
            iteratee: De(M, 3),
            type: b
          }), B.__filtered__ = B.__filtered__ || T, B;
        };
      }), Jr(["head", "last"], function(u, h) {
        var b = "take" + (h ? "Right" : "");
        ut.prototype[u] = function() {
          return this[b](1).value()[0];
        };
      }), Jr(["initial", "tail"], function(u, h) {
        var b = "drop" + (h ? "" : "Right");
        ut.prototype[u] = function() {
          return this.__filtered__ ? new ut(this) : this[b](1);
        };
      }), ut.prototype.compact = function() {
        return this.filter(br);
      }, ut.prototype.find = function(u) {
        return this.filter(u).head();
      }, ut.prototype.findLast = function(u) {
        return this.reverse().find(u);
      }, ut.prototype.invokeMap = nt(function(u, h) {
        return typeof u == "function" ? new ut(this) : this.map(function(b) {
          return du(b, u, h);
        });
      }), ut.prototype.reject = function(u) {
        return this.filter(_h(De(u)));
      }, ut.prototype.slice = function(u, h) {
        u = Ze(u);
        var b = this;
        return b.__filtered__ && (u > 0 || h < 0) ? new ut(b) : (u < 0 ? b = b.takeRight(-u) : u && (b = b.drop(u)), h !== n && (h = Ze(h), b = h < 0 ? b.dropRight(-h) : b.take(h - u)), b);
      }, ut.prototype.takeRightWhile = function(u) {
        return this.reverse().takeWhile(u).reverse();
      }, ut.prototype.toArray = function() {
        return this.take(Y);
      }, Ri(ut.prototype, function(u, h) {
        var b = /^(?:filter|find|map|reject)|While$/.test(h), T = /^(?:head|last)$/.test(h), M = L[T ? "take" + (h == "last" ? "Right" : "") : h], B = T || /^find/.test(h);
        M && (L.prototype[h] = function() {
          var G = this.__wrapped__, q = T ? [1] : arguments, J = G instanceof ut, he = q[0], me = J || Ye(G), ye = function(ot) {
            var ft = M.apply(L, oa([ot], q));
            return T && xe ? ft[0] : ft;
          };
          me && b && typeof he == "function" && he.length != 1 && (J = me = !1);
          var xe = this.__chain__, Ce = !!this.__actions__.length, Re = B && !xe, et = J && !Ce;
          if (!B && me) {
            G = et ? G : new ut(this);
            var je = u.apply(G, q);
            return je.__actions__.push({ func: vh, args: [ye], thisArg: n }), new ei(je, xe);
          }
          return Re && et ? u.apply(this, q) : (je = this.thru(ye), Re ? T ? je.value()[0] : je.value() : je);
        });
      }), Jr(["pop", "push", "shift", "sort", "splice", "unshift"], function(u) {
        var h = Ud[u], b = /^(?:push|sort|unshift)$/.test(u) ? "tap" : "thru", T = /^(?:pop|shift)$/.test(u);
        L.prototype[u] = function() {
          var M = arguments;
          if (T && !this.__chain__) {
            var B = this.value();
            return h.apply(Ye(B) ? B : [], M);
          }
          return this[b](function(G) {
            return h.apply(Ye(G) ? G : [], M);
          });
        };
      }), Ri(ut.prototype, function(u, h) {
        var b = L[h];
        if (b) {
          var T = b.name + "";
          Ot.call(hl, T) || (hl[T] = []), hl[T].push({ name: h, func: b });
        }
      }), hl[fh(n, x).name] = [{
        name: "wrapper",
        func: n
      }], ut.prototype.clone = m3, ut.prototype.reverse = g3, ut.prototype.value = y3, L.prototype.at = K4, L.prototype.chain = G4, L.prototype.commit = Y4, L.prototype.next = q4, L.prototype.plant = Z4, L.prototype.reverse = J4, L.prototype.toJSON = L.prototype.valueOf = L.prototype.value = Q4, L.prototype.first = L.prototype.head, ou && (L.prototype[ou] = X4), L;
    }, ul = Y5();
    Za ? ((Za.exports = ul)._ = ul, jy._ = ul) : Ln._ = ul;
  }).call(_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.c);
})(Kp, Kp.exports);
var oee = Kp.exports;
const ux = {
  sm: "text-xs [&>svg]:size-4 rounded",
  md: "text-sm [&>svg]:size-5 rounded-md",
  lg: "text-base [&>svg]:size-6 rounded-md"
}, Xi = {
  input: {
    sm: "py-1.5 px-2 rounded",
    md: "p-2.5 rounded-md",
    lg: "p-3 rounded-md"
  },
  content: {
    sm: "p-1.5",
    md: "p-1.5",
    lg: "p-2"
  },
  title: {
    sm: "p-2 text-xs",
    md: "p-2 text-sm",
    lg: "p-2 text-sm"
  },
  item: {
    sm: "text-sm text-text-secondary rounded",
    md: "text-base text-text-secondary rounded-md",
    lg: "text-base text-text-secondary rounded-md"
  },
  icon: {
    sm: "p-1 text-sm [&>svg]:size-4 text-icon-secondary",
    md: "p-2 text-base [&>svg]:size-5 text-icon-secondary",
    lg: "p-2 text-base [&>svg]:size-5 text-icon-secondary"
  },
  dialog: {
    sm: "mt-1 rounded-md",
    md: "mt-1.5 rounded-lg",
    lg: "mt-1.5 rounded-lg"
  },
  slashIcon: {
    sm: "px-2 py-0.5",
    md: "px-3 py-1",
    lg: "px-3.5 py-1"
  }
}, aee = {
  primary: "bg-field-primary-background outline outline-1 outline-field-border hover:outline-border-strong",
  secondary: "bg-field-secondary-background outline outline-1 outline-field-border hover:outline-border-strong",
  ghost: "bg-field-secondary-background outline outline-1 outline-transparent"
}, see = "text-icon-secondary group-hover:text-icon-primary group-focus-within:text-icon-primary", uE = {
  ghost: "cursor-not-allowed text-text-disabled placeholder:text-text-disabled",
  primary: "border-border-disabled hover:border-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled placeholder:text-text-disabled",
  secondary: "border-border-disabled hover:border-border-disabled cursor-not-allowed text-text-disabled placeholder:text-text-disabled"
}, Oj = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({}), Zs = () => (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Oj), Zo = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
  ({
    className: e,
    size: t = "sm",
    open: n = !1,
    onOpenChange: r = () => {
    },
    loading: i = !1,
    ...o
  }, a) => {
    const [s, l] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(""), [c, f] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(i ?? !1), { refs: d, floatingStyles: p, context: m } = dg({
      open: n,
      onOpenChange: r,
      placement: "bottom-start",
      whileElementsMounted: ig,
      middleware: [
        og(t === "sm" ? 4 : 6),
        ag({ padding: 10 }),
        SD({
          apply({ rects: x, elements: w, availableHeight: S }) {
            w.floating.style.maxHeight = `${S}px`, w.floating.style.width = `${x.reference.width}px`, w.floating.style.fontFamily = window.getComputedStyle(
              w.reference
            ).fontFamily;
          }
        })
      ]
    }), y = fg(m), { getReferenceProps: g, getFloatingProps: v } = hg([
      y
    ]);
    return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
      const x = FH(), w = (S) => {
        const _ = x === "Mac OS" ? S.metaKey : S.ctrlKey;
        if (S.key === "/" && _ && (S.preventDefault(), d.reference && d.reference.current)) {
          const O = d.reference.current instanceof HTMLElement ? d.reference.current.querySelector("input") : null;
          O && O.focus();
        }
      };
      return window.addEventListener("keydown", w), () => {
        window.removeEventListener("keydown", w);
      };
    }, [d.reference]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Oj.Provider,
      {
        value: {
          size: t,
          open: n,
          onOpenChange: r,
          refs: d,
          floatingStyles: p,
          context: m,
          getReferenceProps: g,
          getFloatingProps: v,
          searchTerm: s,
          setSearchTerm: l,
          isLoading: c,
          setIsLoading: f
        },
        children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "div",
          {
            className: K(
              "searchbox-wrapper box-border relative w-full",
              e
            ),
            ...o,
            ref: a
          }
        )
      }
    );
  }
);
Zo.displayName = "SearchBox";
const Aj = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
  ({
    className: e,
    type: t = "text",
    placeholder: n = "Search...",
    variant: r = "primary",
    disabled: i = !1,
    onChange: o = () => {
    },
    ...a
  }, s) => {
    const {
      size: l,
      onOpenChange: c,
      refs: f,
      getReferenceProps: d,
      searchTerm: p,
      setSearchTerm: m
    } = Zs(), y = l === "lg" ? "sm" : "xs", g = (v) => {
      const x = v.target.value;
      m(x), o(x), typeof c == "function" && (x.trim() ? c(!0) : c(!1));
    };
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "div",
      {
        ref: f.setReference,
        className: K(
          "w-full group relative flex justify-center items-center gap-1.5 focus-within:z-10 transition-colors ease-in-out duration-150",
          aee[r],
          Xi.input[l],
          i ? uE[r] : "focus-within:ring-2 focus-within:ring-focus focus-within:ring-offset-2 focus-within:border-focus-border focus-within:hover:border-focus-border"
        ),
        ...d,
        children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            "span",
            {
              className: K(
                ux[l],
                i ? "text-icon-disabled" : see,
                "flex justify-center items-center"
              ),
              children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(rD, {})
            }
          ),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            "input",
            {
              type: t,
              ref: s,
              className: K(
                ux[l],
                "flex-grow font-medium bg-transparent border-none outline-none border-transparent focus:ring-0 py-0",
                i ? uE[r] : [
                  "text-field-placeholder focus-within:text-field-input group-hover:text-field-input",
                  "placeholder:text-field-placeholder"
                ],
                e
              ),
              disabled: i,
              value: p,
              onChange: g,
              placeholder: n,
              ...oee.omit(a, [
                "size",
                "open",
                "onOpenChange",
                "loading"
              ])
            }
          ),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            mg,
            {
              label: "⌘/",
              size: y,
              type: "rounded",
              variant: "neutral"
            }
          )
        ]
      }
    );
  }
);
Aj.displayName = "SearchBox.Input";
const Tj = ({
  className: e,
  dropdownPortalRoot: t = null,
  // Root element where the dropdown will be rendered.
  dropdownPortalId: n = "",
  // Id of the dropdown portal where the dropdown will be rendered.
  children: r,
  ...i
}) => {
  const { size: o, open: a, refs: s, floatingStyles: l, getFloatingProps: c } = Zs();
  return a ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ug, { id: n, root: t, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      ref: s.setFloating,
      style: {
        ...l
      },
      className: K(
        "bg-background-primary rounded-md border border-solid border-border-subtle shadow-soft-shadow-lg overflow-y-auto text-wrap",
        Xi.dialog[o],
        e
      ),
      ...c(),
      ...i,
      children: r
    }
  ) }) : null;
};
Tj.displayName = "SearchBox.Content";
const Pj = ({
  filter: e = !0,
  children: t
}) => {
  const { searchTerm: n, isLoading: r } = Zs();
  if (!e)
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: t });
  const i = react__WEBPACK_IMPORTED_MODULE_1__.Children.toArray(t).map((o) => {
    if (react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(o) && o.type === O_) {
      const a = react__WEBPACK_IMPORTED_MODULE_1__.Children.toArray(
        o.props.children
      ).filter(
        (s) => react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(s) && typeof s.props.children == "string" && s.props.children.toLowerCase().includes(n.toLowerCase())
      );
      return a.length > 0 ? (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(o, {
        children: a
      }) : null;
    }
    return o;
  }).filter(Boolean);
  return r ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(A_, {}) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: i.some(
    (o) => react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(o) && o.type !== T_
  ) ? i : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(S_, {}) });
};
Pj.displayName = "SearchBox.List";
const S_ = ({
  children: e = "No results found."
}) => {
  const { size: t } = Zs();
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        "flex justify-center items-center",
        Xi.item[t],
        "text-text-tertiary p-4"
      ),
      children: e
    }
  );
};
S_.displayName = "SearchBox.Empty";
const O_ = ({ heading: e, children: t }) => {
  const { size: n } = Zs();
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    "div",
    {
      className: K(
        Xi.content[n],
        Xi.item[n]
      ),
      children: [
        e && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "div",
          {
            className: K(
              Xi.title[n],
              "text-text-secondary"
            ),
            children: e
          }
        ),
        t
      ]
    }
  );
};
O_.displayName = "SearchBox.Group";
const Cj = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
  ({ className: e, icon: t, children: n, ...r }, i) => {
    const { size: o } = Zs();
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "div",
      {
        ref: i,
        className: K(
          "flex items-center justify-start gap-1 p-1 hover:bg-background-secondary focus:bg-background-secondary cursor-pointer",
          Xi.item[o]
        ),
        ...r,
        children: [
          t && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            "span",
            {
              className: K(
                Xi.icon[o],
                "flex items-center justify-center"
              ),
              children: t
            }
          ),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            "span",
            {
              className: K(
                "flex-grow p-1 font-normal cursor-pointer",
                Xi.item[o],
                e
              ),
              children: n
            }
          )
        ]
      }
    );
  }
);
Cj.displayName = "SearchBox.Item";
const A_ = ({
  loadingIcon: e = /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(d1, {})
}) => {
  const { size: t } = Zs(), n = react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(e) ? (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(e, { size: t }) : e;
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        "flex justify-center p-4",
        ux[t],
        Xi.item[t]
      ),
      children: n
    }
  );
};
A_.displayName = "SearchBox.Loading";
const T_ = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(({ className: e, ...t }, n) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "hr",
  {
    ref: n,
    className: K(
      "border-0 border-t border-border-subtle border-solid m-0",
      e
    ),
    ...t
  }
));
T_.displayName = "SearchBox.Separator";
Zo.Input = Aj;
Zo.Loading = A_;
Zo.Separator = T_;
Zo.Content = Tj;
Zo.List = Pj;
Zo.Empty = S_;
Zo.Group = O_;
Zo.Item = Cj;
const Ej = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({}), kj = () => (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Ej), Js = ({
  placement: e = "bottom",
  offset: t = 10,
  boundary: n = "clippingAncestors",
  children: r,
  className: i
}) => {
  const [o, a] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), { refs: s, floatingStyles: l, context: c } = dg({
    open: o,
    onOpenChange: a,
    placement: e,
    strategy: "absolute",
    middleware: [
      og(t),
      ag({ boundary: n }),
      _D({ boundary: n })
    ],
    whileElementsMounted: ig
  }), f = c1(c), d = fg(c), p = u1(c, { role: "menu" }), { getReferenceProps: m, getFloatingProps: y } = hg([
    f,
    d,
    p
  ]), { isMounted: g, styles: v } = ND(c, {
    duration: 150,
    initial: { opacity: 0, scale: 0.95 },
    open: { opacity: 1, scale: 1 },
    close: { opacity: 0, scale: 0.95 }
  }), x = () => a((S) => !S), w = () => a(!1);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Ej.Provider,
    {
      value: {
        refs: s,
        handleClose: w,
        isMounted: g,
        styles: v,
        floatingStyles: l,
        getFloatingProps: y
      },
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: K("relative inline-block", i), children: [
        react__WEBPACK_IMPORTED_MODULE_1__.Children.map(r, (S) => {
          var A;
          return react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(S) && ((A = S == null ? void 0 : S.type) == null ? void 0 : A.displayName) === "DropdownMenu.Trigger" ? (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(S, {
            ref: s.setReference,
            onClick: x,
            ...m()
          }) : null;
        }),
        react__WEBPACK_IMPORTED_MODULE_1__.Children.map(r, (S) => {
          var A;
          return react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(S) && ((A = S == null ? void 0 : S.type) == null ? void 0 : A.displayName) === "DropdownMenu.Portal" ? S : null;
        })
      ] })
    }
  );
};
Js.displayName = "DropdownMenu";
const Mj = ({
  children: e,
  className: t,
  root: n,
  id: r
}) => {
  const { refs: i, floatingStyles: o, getFloatingProps: a, isMounted: s, styles: l } = kj();
  return s && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ug, { id: r, root: n, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      ref: i.setFloating,
      className: t,
      style: {
        ...o,
        ...l
      },
      ...a(),
      children: react__WEBPACK_IMPORTED_MODULE_1__.Children.map(e, (c) => {
        var f;
        return ((f = c == null ? void 0 : c.type) == null ? void 0 : f.displayName) === "DropdownMenu.Content" ? c : null;
      })
    }
  ) });
};
Mj.displayName = "DropdownMenu.Portal";
const Nj = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(({ children: e, className: t, ...n }, r) => (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(e) ? react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(e, {
  className: K(t, e.props.className),
  ref: r,
  ...n
}) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "div",
  {
    ref: r,
    className: K("cursor-pointer", t),
    role: "button",
    tabIndex: 0,
    ...n,
    children: e
  }
));
Nj.displayName = "DropdownMenu.Trigger";
const $j = ({
  children: e,
  className: t,
  ...n
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "div",
  {
    className: K(
      "border border-solid border-border-subtle rounded-md shadow-lg overflow-hidden",
      t
    ),
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ha, { ...n, children: e })
  }
);
$j.displayName = "DropdownMenu.Content";
const Dj = (e) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ha.List, { ...e });
Dj.displayName = "DropdownMenu.List";
const Ij = ({
  children: e,
  as: t = Ha.Item,
  ...n
}) => {
  var i;
  const { handleClose: r } = kj();
  return e ? t === react__WEBPACK_IMPORTED_MODULE_1__.Fragment && (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(e) ? (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(e, {
    onClick: cf(
      (i = e.props) == null ? void 0 : i.onClick,
      r
    )
  }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    t,
    {
      ...n,
      className: K("px-2", n.className),
      onClick: cf(n.onClick, r),
      children: e
    }
  ) : null;
};
Ij.displayName = "DropdownMenu.Item";
const Rj = (e) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ha.Separator, { ...e });
Rj.displayName = "DropdownMenu.Separator";
Js.Trigger = Nj;
Js.Content = $j;
Js.List = Dj;
Js.Item = Ij;
Js.Separator = Rj;
Js.Portal = Mj;
const lee = {
  left: {
    open: {
      x: 0
    },
    exit: {
      x: "-100%"
    }
  },
  right: {
    open: {
      x: 0
    },
    exit: {
      x: "100%"
    }
  }
}, jj = ({ children: e, className: t }) => {
  const { open: n, position: r, handleClose: i, drawerRef: o, transitionDuration: a } = Vg();
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ys, { children: n && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        "flex items-center justify-center h-full",
        {
          "justify-start": r === "left",
          "justify-end": r === "right"
        }
      ),
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        An.div,
        {
          ref: o,
          className: K(
            "flex flex-col w-120 h-full bg-background-primary shadow-2xl my-5 overflow-hidden",
            t
          ),
          initial: "exit",
          animate: "open",
          exit: "exit",
          variants: lee[r],
          transition: a,
          children: typeof e == "function" ? e({ close: i }) : e
        }
      )
    }
  ) }) });
};
jj.displayName = "Drawer.Panel";
const Lj = ({ children: e, className: t, ...n }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K("space-y-2 px-5 pt-5 pb-4", t), ...n, children: e });
Lj.displayName = "Drawer.Header";
const Bj = ({
  children: e,
  as: t = "h3",
  className: n,
  ...r
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  t,
  {
    className: K(
      "text-base font-semibold text-text-primary m-0 p-0",
      n
    ),
    ...r,
    children: e
  }
);
Bj.displayName = "Drawer.Title";
const Fj = ({
  children: e,
  as: t = "p",
  className: n,
  ...r
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  t,
  {
    className: K(
      "text-sm font-normal text-text-secondary my-0 ml-0 mr-1 p-0",
      n
    ),
    ...r,
    children: e
  }
);
Fj.displayName = "Drawer.Description";
const Wj = ({ children: e, className: t, ...n }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "div",
  {
    className: K(
      "px-5 pb-4 pt-2 flex flex-col flex-1 overflow-y-auto overflow-x-hidden",
      t
    ),
    ...n,
    children: e
  }
);
Wj.displayName = "Drawer.Body";
const zj = ({ children: e, className: t }) => {
  const { design: n, handleClose: r } = Vg(), i = () => e ? typeof e == "function" ? e({ close: r }) : e : null;
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        "px-5 py-4 flex justify-end gap-3 mt-auto",
        {
          "bg-background-secondary": n === "footer-divided",
          "border-t border-b-0 border-x-0 border-solid border-border-subtle": n === "footer-bordered"
        },
        t
      ),
      children: i()
    }
  );
};
zj.displayName = "Drawer.Footer";
const fE = ({
  className: e,
  ...t
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "button",
  {
    className: K(
      "bg-transparent inline-flex justify-center items-center border-0 p-1 m-0 cursor-pointer focus:outline-none outline-none shadow-none",
      e
    ),
    "aria-label": "Close drawer",
    ...t,
    children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)($a, { className: "size-4 text-text-primary shrink-0" })
  }
), Vj = ({
  children: e,
  as: t = react__WEBPACK_IMPORTED_MODULE_1__.Fragment,
  ...n
}) => {
  const { handleClose: r } = Vg();
  return e ? t === react__WEBPACK_IMPORTED_MODULE_1__.Fragment ? typeof e == "function" ? e({ close: r }) : (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(e) ? (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(e, {
    onClick: r
  }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(fE, { onClick: r, ...n }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(t, { ...n, onClick: r, children: e }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(fE, { onClick: r, ...n });
};
Vj.displayName = "Drawer.CloseButton";
const cee = {
  open: {
    opacity: 1
  },
  exit: {
    opacity: 0
  }
}, Uj = ({ className: e, ...t }) => {
  const { open: n, drawerContainerRef: r, transitionDuration: i } = Vg();
  return r != null && r.current ? !!r.current && (0,react_dom__WEBPACK_IMPORTED_MODULE_2__.createPortal)(
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ys, { children: n && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      An.div,
      {
        className: K(
          "fixed inset-0 -z-10 bg-background-inverse/90",
          e
        ),
        ...t,
        initial: "exit",
        animate: "open",
        exit: "exit",
        variants: cee,
        transition: i
      }
    ) }),
    r.current
  ) : null;
};
Uj.displayName = "Drawer.Backdrop";
const uee = 0.2, Hj = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({}), Vg = () => (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Hj), Jo = ({
  open: e,
  setOpen: t,
  children: n,
  trigger: r,
  className: i,
  exitOnClickOutside: o = !1,
  exitOnEsc: a = !0,
  design: s = "simple",
  position: l = "right",
  transitionDuration: c = uee,
  scrollLock: f = !0
}) => {
  const d = e !== void 0 && t !== void 0, [p, m] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), g = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), v = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => d ? e : p,
    [e, p]
  ), x = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(
    () => d ? t : m,
    [m, m]
  ), w = () => {
    v || x(!0);
  }, S = () => {
    v && x(!1);
  }, A = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(r) ? (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(r, {
    onClick: cf(w, r.props.onClick)
  }) : typeof r == "function" ? r({ onClick: w }) : null, [r, w, S]), _ = (P) => {
    switch (P.key) {
      case "Escape":
        a && S();
        break;
    }
  }, O = (P) => {
    o && y.current && !y.current.contains(P.target) && S();
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => (window.addEventListener("keydown", _), document.addEventListener("mousedown", O), () => {
    window.removeEventListener("keydown", _), document.removeEventListener("mousedown", O);
  }), [v]), (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (!f)
      return;
    const P = document.querySelector("html");
    return v && P && (P.style.overflow = "hidden"), () => {
      P && (P.style.overflow = "");
    };
  }, [v]), /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
    A(),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Hj.Provider,
      {
        value: {
          open: v,
          setOpen: x,
          handleClose: S,
          design: s,
          position: l,
          drawerContainerRef: g,
          drawerRef: y,
          transitionDuration: { duration: c }
        },
        children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "div",
          {
            className: K(
              "fixed z-auto w-0 h-0 overflow-visible",
              i
            ),
            ref: g,
            role: "dialog",
            "aria-modal": "true",
            "aria-label": "drawer",
            children: n
          }
        )
      }
    )
  ] });
};
Jo.displayName = "Drawer";
Jo.Panel = jj;
Jo.Header = Lj;
Jo.Title = Bj;
Jo.Description = Fj;
Jo.Body = Wj;
Jo.CloseButton = Vj;
Jo.Footer = zj;
Jo.Backdrop = Uj;
const Ug = {
  xs: {
    general: "text-xs min-w-6 h-6",
    ellipse: "text-xs min-w-6",
    icon: "size-4"
  },
  sm: {
    general: "text-xs min-w-8 h-8",
    ellipse: "text-xs min-w-8",
    icon: "size-4"
  },
  md: {
    general: "text-sm min-w-10 h-10",
    ellipse: "text-sm min-w-10",
    icon: "size-5"
  },
  lg: {
    general: "text-base min-w-12 h-12",
    ellipse: "text-base min-w-12",
    icon: "size-6"
  }
}, Fs = {
  general: "group disabled:border-field-border-disabled opacity-50",
  text: "group-disabled:text-field-color-disabled"
}, Kj = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({
  size: "sm",
  disabled: !1
}), Sd = () => (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Kj), Fc = ({
  size: e = "sm",
  disabled: t = !1,
  children: n,
  className: r,
  ...i
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Kj.Provider, { value: { size: e, disabled: t }, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "nav",
  {
    role: "navigation",
    "aria-label": "pagination",
    className: K(
      "flex w-full justify-center box-border m-0",
      r
    ),
    ...i,
    children: n
  }
) });
Fc.displayName = "Pagination";
const Gj = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(({ className: e, ...t }, n) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "ul",
  {
    ref: n,
    className: K(
      "m-0 p-0 w-full flex justify-center flex-row items-center gap-1",
      "list-none",
      e
    ),
    ...t
  }
));
Gj.displayName = "Pagination.Content";
const Yj = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
  ({ isActive: e = !1, className: t, children: n, ...r }, i) => {
    const { disabled: o } = Sd();
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      "li",
      {
        ref: i,
        className: K("flex", o && Fs.general),
        children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          P_,
          {
            isActive: e,
            disabled: o,
            className: t,
            ...r,
            children: n
          }
        )
      }
    );
  }
);
Yj.displayName = "Pagination.Item";
const P_ = ({
  isActive: e = !1,
  tag: t = "a",
  children: n,
  className: r,
  ...i
}) => {
  const { size: o, disabled: a } = Sd(), s = (l) => l.preventDefault();
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Hn,
    {
      tag: t,
      size: o,
      variant: "ghost",
      className: K(
        "no-underline bg-transparent p-0 m-0 border-none",
        "flex justify-center items-center rounded text-button-secondary",
        "focus:outline focus:outline-1 focus:outline-border-subtle focus:bg-button-tertiary-hover",
        Ug[o].general,
        !a && e && "text-button-primary active:text-button-primary bg-brand-background-50",
        a && [
          Fs.general,
          Fs.text,
          "focus:ring-transparent cursor-not-allowed"
        ],
        r
      ),
      disabled: a,
      ...i,
      onClick: (l) => cf(
        i.onClick || (() => {
        }),
        a ? s : () => {
        }
      )(l),
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-1 flex", children: n })
    }
  );
}, qj = (e) => {
  const { size: t, disabled: n } = Sd();
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "li",
    {
      className: K("flex", n && Fs.general),
      "aria-label": "Go to previous page",
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        P_,
        {
          className: K("[&>span]:flex [&>span]:items-center"),
          ...e,
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(eD, { className: K(Ug[t].icon) })
        }
      )
    }
  );
};
qj.displayName = "Pagination.Previous";
const Xj = (e) => {
  const { size: t, disabled: n } = Sd();
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "li",
    {
      className: K("flex", n && Fs.general),
      "aria-label": "Go to next page",
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        P_,
        {
          className: K("[&>span]:flex [&>span]:items-center"),
          ...e,
          children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Zw, { className: K(Ug[t].icon) })
        }
      )
    }
  );
};
Xj.displayName = "Pagination.Next";
const Zj = (e) => {
  const { size: t, disabled: n } = Sd();
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { className: K("flex", n && Fs.general), children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "span",
    {
      className: K(
        "flex justify-center",
        Ug[t].ellipse,
        n && Fs.general
      ),
      ...e,
      children: "•••"
    }
  ) });
};
Zj.displayName = "Pagination.Ellipsis";
Fc.Content = Gj;
Fc.Item = Yj;
Fc.Previous = qj;
Fc.Next = Xj;
Fc.Ellipsis = Zj;
var Le;
(function(e) {
  e.Root = "root", e.Chevron = "chevron", e.Day = "day", e.DayButton = "day_button", e.CaptionLabel = "caption_label", e.Dropdowns = "dropdowns", e.Dropdown = "dropdown", e.DropdownRoot = "dropdown_root", e.Footer = "footer", e.MonthGrid = "month_grid", e.MonthCaption = "month_caption", e.MonthsDropdown = "months_dropdown", e.Month = "month", e.Months = "months", e.Nav = "nav", e.NextMonthButton = "button_next", e.PreviousMonthButton = "button_previous", e.Week = "week", e.Weeks = "weeks", e.Weekday = "weekday", e.Weekdays = "weekdays", e.WeekNumber = "week_number", e.WeekNumberHeader = "week_number_header", e.YearsDropdown = "years_dropdown";
})(Le || (Le = {}));
var Lt;
(function(e) {
  e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
})(Lt || (Lt = {}));
var Ei;
(function(e) {
  e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
})(Ei || (Ei = {}));
const Jj = 6048e5, fee = 864e5, dE = Symbol.for("constructDateFrom");
function Tn(e, t) {
  return typeof e == "function" ? e(t) : e && typeof e == "object" && dE in e ? e[dE](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
}
function Et(e, t) {
  return Tn(t || e, e);
}
function C_(e, t, n) {
  const r = Et(e, n == null ? void 0 : n.in);
  return isNaN(t) ? Tn(e, NaN) : (t && r.setDate(r.getDate() + t), r);
}
function E_(e, t, n) {
  const r = Et(e, n == null ? void 0 : n.in);
  if (isNaN(t)) return Tn(e, NaN);
  if (!t)
    return r;
  const i = r.getDate(), o = Tn(e, r.getTime());
  o.setMonth(r.getMonth() + t + 1, 0);
  const a = o.getDate();
  return i >= a ? o : (r.setFullYear(
    o.getFullYear(),
    o.getMonth(),
    i
  ), r);
}
let dee = {};
function Od() {
  return dee;
}
function Ws(e, t) {
  var s, l, c, f;
  const n = Od(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((l = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : l.weekStartsOn) ?? n.weekStartsOn ?? ((f = (c = n.locale) == null ? void 0 : c.options) == null ? void 0 : f.weekStartsOn) ?? 0, i = Et(e, t == null ? void 0 : t.in), o = i.getDay(), a = (o < r ? 7 : 0) + o - r;
  return i.setDate(i.getDate() - a), i.setHours(0, 0, 0, 0), i;
}
function Tf(e, t) {
  return Ws(e, { ...t, weekStartsOn: 1 });
}
function Qj(e, t) {
  const n = Et(e, t == null ? void 0 : t.in), r = n.getFullYear(), i = Tn(n, 0);
  i.setFullYear(r + 1, 0, 4), i.setHours(0, 0, 0, 0);
  const o = Tf(i), a = Tn(n, 0);
  a.setFullYear(r, 0, 4), a.setHours(0, 0, 0, 0);
  const s = Tf(a);
  return n.getTime() >= o.getTime() ? r + 1 : n.getTime() >= s.getTime() ? r : r - 1;
}
function hE(e) {
  const t = Et(e), n = new Date(
    Date.UTC(
      t.getFullYear(),
      t.getMonth(),
      t.getDate(),
      t.getHours(),
      t.getMinutes(),
      t.getSeconds(),
      t.getMilliseconds()
    )
  );
  return n.setUTCFullYear(t.getFullYear()), +e - +n;
}
function Ad(e, ...t) {
  const n = Tn.bind(
    null,
    t.find((r) => typeof r == "object")
  );
  return t.map(n);
}
function Wi(e, t) {
  const n = Et(e, t == null ? void 0 : t.in);
  return n.setHours(0, 0, 0, 0), n;
}
function eL(e, t, n) {
  const [r, i] = Ad(
    n == null ? void 0 : n.in,
    e,
    t
  ), o = Wi(r), a = Wi(i), s = +o - hE(o), l = +a - hE(a);
  return Math.round((s - l) / fee);
}
function hee(e, t) {
  const n = Qj(e, t), r = Tn(e, 0);
  return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), Tf(r);
}
function pee(e, t, n) {
  return C_(e, t * 7, n);
}
function mee(e, t, n) {
  return E_(e, t * 12, n);
}
function gee(e, t) {
  let n, r = t == null ? void 0 : t.in;
  return e.forEach((i) => {
    !r && typeof i == "object" && (r = Tn.bind(null, i));
    const o = Et(i, r);
    (!n || n < o || isNaN(+o)) && (n = o);
  }), Tn(r, n || NaN);
}
function yee(e, t) {
  let n, r = t == null ? void 0 : t.in;
  return e.forEach((i) => {
    !r && typeof i == "object" && (r = Tn.bind(null, i));
    const o = Et(i, r);
    (!n || n > o || isNaN(+o)) && (n = o);
  }), Tn(r, n || NaN);
}
function pE(e) {
  return Tn(e, Date.now());
}
function vee(e, t, n) {
  const [r, i] = Ad(
    n == null ? void 0 : n.in,
    e,
    t
  );
  return +Wi(r) == +Wi(i);
}
function tL(e) {
  return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
}
function bee(e) {
  return !(!tL(e) && typeof e != "number" || isNaN(+Et(e)));
}
function xee(e, t, n) {
  const [r, i] = Ad(
    n == null ? void 0 : n.in,
    e,
    t
  ), o = r.getFullYear() - i.getFullYear(), a = r.getMonth() - i.getMonth();
  return o * 12 + a;
}
function nL(e, t) {
  const n = Et(e, t == null ? void 0 : t.in), r = n.getMonth();
  return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n;
}
function rL(e, t) {
  const n = Et(e, t == null ? void 0 : t.in);
  return n.setDate(1), n.setHours(0, 0, 0, 0), n;
}
function wee(e, t) {
  const n = Et(e, t == null ? void 0 : t.in), r = n.getFullYear();
  return n.setFullYear(r + 1, 0, 0), n.setHours(23, 59, 59, 999), n;
}
function iL(e, t) {
  const n = Et(e, t == null ? void 0 : t.in);
  return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
}
function k_(e, t) {
  var s, l, c, f;
  const n = Od(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((l = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : l.weekStartsOn) ?? n.weekStartsOn ?? ((f = (c = n.locale) == null ? void 0 : c.options) == null ? void 0 : f.weekStartsOn) ?? 0, i = Et(e, t == null ? void 0 : t.in), o = i.getDay(), a = (o < r ? -7 : 0) + 6 - (o - r);
  return i.setDate(i.getDate() + a), i.setHours(23, 59, 59, 999), i;
}
function _ee(e, t) {
  return k_(e, { ...t, weekStartsOn: 1 });
}
const See = {
  lessThanXSeconds: {
    one: "less than a second",
    other: "less than {{count}} seconds"
  },
  xSeconds: {
    one: "1 second",
    other: "{{count}} seconds"
  },
  halfAMinute: "half a minute",
  lessThanXMinutes: {
    one: "less than a minute",
    other: "less than {{count}} minutes"
  },
  xMinutes: {
    one: "1 minute",
    other: "{{count}} minutes"
  },
  aboutXHours: {
    one: "about 1 hour",
    other: "about {{count}} hours"
  },
  xHours: {
    one: "1 hour",
    other: "{{count}} hours"
  },
  xDays: {
    one: "1 day",
    other: "{{count}} days"
  },
  aboutXWeeks: {
    one: "about 1 week",
    other: "about {{count}} weeks"
  },
  xWeeks: {
    one: "1 week",
    other: "{{count}} weeks"
  },
  aboutXMonths: {
    one: "about 1 month",
    other: "about {{count}} months"
  },
  xMonths: {
    one: "1 month",
    other: "{{count}} months"
  },
  aboutXYears: {
    one: "about 1 year",
    other: "about {{count}} years"
  },
  xYears: {
    one: "1 year",
    other: "{{count}} years"
  },
  overXYears: {
    one: "over 1 year",
    other: "over {{count}} years"
  },
  almostXYears: {
    one: "almost 1 year",
    other: "almost {{count}} years"
  }
}, Oee = (e, t, n) => {
  let r;
  const i = See[e];
  return typeof i == "string" ? r = i : t === 1 ? r = i.one : r = i.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
};
function Tb(e) {
  return (t = {}) => {
    const n = t.width ? String(t.width) : e.defaultWidth;
    return e.formats[n] || e.formats[e.defaultWidth];
  };
}
const Aee = {
  full: "EEEE, MMMM do, y",
  long: "MMMM do, y",
  medium: "MMM d, y",
  short: "MM/dd/yyyy"
}, Tee = {
  full: "h:mm:ss a zzzz",
  long: "h:mm:ss a z",
  medium: "h:mm:ss a",
  short: "h:mm a"
}, Pee = {
  full: "{{date}} 'at' {{time}}",
  long: "{{date}} 'at' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
}, Cee = {
  date: Tb({
    formats: Aee,
    defaultWidth: "full"
  }),
  time: Tb({
    formats: Tee,
    defaultWidth: "full"
  }),
  dateTime: Tb({
    formats: Pee,
    defaultWidth: "full"
  })
}, Eee = {
  lastWeek: "'last' eeee 'at' p",
  yesterday: "'yesterday at' p",
  today: "'today at' p",
  tomorrow: "'tomorrow at' p",
  nextWeek: "eeee 'at' p",
  other: "P"
}, kee = (e, t, n, r) => Eee[e];
function Au(e) {
  return (t, n) => {
    const r = n != null && n.context ? String(n.context) : "standalone";
    let i;
    if (r === "formatting" && e.formattingValues) {
      const a = e.defaultFormattingWidth || e.defaultWidth, s = n != null && n.width ? String(n.width) : a;
      i = e.formattingValues[s] || e.formattingValues[a];
    } else {
      const a = e.defaultWidth, s = n != null && n.width ? String(n.width) : e.defaultWidth;
      i = e.values[s] || e.values[a];
    }
    const o = e.argumentCallback ? e.argumentCallback(t) : t;
    return i[o];
  };
}
const Mee = {
  narrow: ["B", "A"],
  abbreviated: ["BC", "AD"],
  wide: ["Before Christ", "Anno Domini"]
}, Nee = {
  narrow: ["1", "2", "3", "4"],
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
}, $ee = {
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
  abbreviated: [
    "Jan",
    "Feb",
    "Mar",
    "Apr",
    "May",
    "Jun",
    "Jul",
    "Aug",
    "Sep",
    "Oct",
    "Nov",
    "Dec"
  ],
  wide: [
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December"
  ]
}, Dee = {
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  wide: [
    "Sunday",
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday",
    "Saturday"
  ]
}, Iee = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  }
}, Ree = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  }
}, jee = (e, t) => {
  const n = Number(e), r = n % 100;
  if (r > 20 || r < 10)
    switch (r % 10) {
      case 1:
        return n + "st";
      case 2:
        return n + "nd";
      case 3:
        return n + "rd";
    }
  return n + "th";
}, Lee = {
  ordinalNumber: jee,
  era: Au({
    values: Mee,
    defaultWidth: "wide"
  }),
  quarter: Au({
    values: Nee,
    defaultWidth: "wide",
    argumentCallback: (e) => e - 1
  }),
  month: Au({
    values: $ee,
    defaultWidth: "wide"
  }),
  day: Au({
    values: Dee,
    defaultWidth: "wide"
  }),
  dayPeriod: Au({
    values: Iee,
    defaultWidth: "wide",
    formattingValues: Ree,
    defaultFormattingWidth: "wide"
  })
};
function Tu(e) {
  return (t, n = {}) => {
    const r = n.width, i = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], o = t.match(i);
    if (!o)
      return null;
    const a = o[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], l = Array.isArray(s) ? Fee(s, (d) => d.test(a)) : (
      // [TODO] -- I challenge you to fix the type
      Bee(s, (d) => d.test(a))
    );
    let c;
    c = e.valueCallback ? e.valueCallback(l) : l, c = n.valueCallback ? (
      // [TODO] -- I challenge you to fix the type
      n.valueCallback(c)
    ) : c;
    const f = t.slice(a.length);
    return { value: c, rest: f };
  };
}
function Bee(e, t) {
  for (const n in e)
    if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
      return n;
}
function Fee(e, t) {
  for (let n = 0; n < e.length; n++)
    if (t(e[n]))
      return n;
}
function Wee(e) {
  return (t, n = {}) => {
    const r = t.match(e.matchPattern);
    if (!r) return null;
    const i = r[0], o = t.match(e.parsePattern);
    if (!o) return null;
    let a = e.valueCallback ? e.valueCallback(o[0]) : o[0];
    a = n.valueCallback ? n.valueCallback(a) : a;
    const s = t.slice(i.length);
    return { value: a, rest: s };
  };
}
const zee = /^(\d+)(th|st|nd|rd)?/i, Vee = /\d+/i, Uee = {
  narrow: /^(b|a)/i,
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
  wide: /^(before christ|before common era|anno domini|common era)/i
}, Hee = {
  any: [/^b/i, /^(a|c)/i]
}, Kee = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
}, Gee = {
  any: [/1/i, /2/i, /3/i, /4/i]
}, Yee = {
  narrow: /^[jfmasond]/i,
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
}, qee = {
  narrow: [
    /^j/i,
    /^f/i,
    /^m/i,
    /^a/i,
    /^m/i,
    /^j/i,
    /^j/i,
    /^a/i,
    /^s/i,
    /^o/i,
    /^n/i,
    /^d/i
  ],
  any: [
    /^ja/i,
    /^f/i,
    /^mar/i,
    /^ap/i,
    /^may/i,
    /^jun/i,
    /^jul/i,
    /^au/i,
    /^s/i,
    /^o/i,
    /^n/i,
    /^d/i
  ]
}, Xee = {
  narrow: /^[smtwf]/i,
  short: /^(su|mo|tu|we|th|fr|sa)/i,
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
}, Zee = {
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
}, Jee = {
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
}, Qee = {
  any: {
    am: /^a/i,
    pm: /^p/i,
    midnight: /^mi/i,
    noon: /^no/i,
    morning: /morning/i,
    afternoon: /afternoon/i,
    evening: /evening/i,
    night: /night/i
  }
}, ete = {
  ordinalNumber: Wee({
    matchPattern: zee,
    parsePattern: Vee,
    valueCallback: (e) => parseInt(e, 10)
  }),
  era: Tu({
    matchPatterns: Uee,
    defaultMatchWidth: "wide",
    parsePatterns: Hee,
    defaultParseWidth: "any"
  }),
  quarter: Tu({
    matchPatterns: Kee,
    defaultMatchWidth: "wide",
    parsePatterns: Gee,
    defaultParseWidth: "any",
    valueCallback: (e) => e + 1
  }),
  month: Tu({
    matchPatterns: Yee,
    defaultMatchWidth: "wide",
    parsePatterns: qee,
    defaultParseWidth: "any"
  }),
  day: Tu({
    matchPatterns: Xee,
    defaultMatchWidth: "wide",
    parsePatterns: Zee,
    defaultParseWidth: "any"
  }),
  dayPeriod: Tu({
    matchPatterns: Jee,
    defaultMatchWidth: "any",
    parsePatterns: Qee,
    defaultParseWidth: "any"
  })
}, Hg = {
  code: "en-US",
  formatDistance: Oee,
  formatLong: Cee,
  formatRelative: kee,
  localize: Lee,
  match: ete,
  options: {
    weekStartsOn: 0,
    firstWeekContainsDate: 1
  }
};
function tte(e, t) {
  const n = Et(e, t == null ? void 0 : t.in);
  return eL(n, iL(n)) + 1;
}
function oL(e, t) {
  const n = Et(e, t == null ? void 0 : t.in), r = +Tf(n) - +hee(n);
  return Math.round(r / Jj) + 1;
}
function aL(e, t) {
  var f, d, p, m;
  const n = Et(e, t == null ? void 0 : t.in), r = n.getFullYear(), i = Od(), o = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((d = (f = t == null ? void 0 : t.locale) == null ? void 0 : f.options) == null ? void 0 : d.firstWeekContainsDate) ?? i.firstWeekContainsDate ?? ((m = (p = i.locale) == null ? void 0 : p.options) == null ? void 0 : m.firstWeekContainsDate) ?? 1, a = Tn((t == null ? void 0 : t.in) || e, 0);
  a.setFullYear(r + 1, 0, o), a.setHours(0, 0, 0, 0);
  const s = Ws(a, t), l = Tn((t == null ? void 0 : t.in) || e, 0);
  l.setFullYear(r, 0, o), l.setHours(0, 0, 0, 0);
  const c = Ws(l, t);
  return +n >= +s ? r + 1 : +n >= +c ? r : r - 1;
}
function nte(e, t) {
  var s, l, c, f;
  const n = Od(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((l = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : l.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((f = (c = n.locale) == null ? void 0 : c.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1, i = aL(e, t), o = Tn((t == null ? void 0 : t.in) || e, 0);
  return o.setFullYear(i, 0, r), o.setHours(0, 0, 0, 0), Ws(o, t);
}
function sL(e, t) {
  const n = Et(e, t == null ? void 0 : t.in), r = +Ws(n, t) - +nte(n, t);
  return Math.round(r / Jj) + 1;
}
function At(e, t) {
  const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
  return n + r;
}
const ya = {
  // Year
  y(e, t) {
    const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
    return At(t === "yy" ? r % 100 : r, t.length);
  },
  // Month
  M(e, t) {
    const n = e.getMonth();
    return t === "M" ? String(n + 1) : At(n + 1, 2);
  },
  // Day of the month
  d(e, t) {
    return At(e.getDate(), t.length);
  },
  // AM or PM
  a(e, t) {
    const n = e.getHours() / 12 >= 1 ? "pm" : "am";
    switch (t) {
      case "a":
      case "aa":
        return n.toUpperCase();
      case "aaa":
        return n;
      case "aaaaa":
        return n[0];
      case "aaaa":
      default:
        return n === "am" ? "a.m." : "p.m.";
    }
  },
  // Hour [1-12]
  h(e, t) {
    return At(e.getHours() % 12 || 12, t.length);
  },
  // Hour [0-23]
  H(e, t) {
    return At(e.getHours(), t.length);
  },
  // Minute
  m(e, t) {
    return At(e.getMinutes(), t.length);
  },
  // Second
  s(e, t) {
    return At(e.getSeconds(), t.length);
  },
  // Fraction of second
  S(e, t) {
    const n = t.length, r = e.getMilliseconds(), i = Math.trunc(
      r * Math.pow(10, n - 3)
    );
    return At(i, t.length);
  }
}, _l = {
  am: "am",
  pm: "pm",
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
}, mE = {
  // Era
  G: function(e, t, n) {
    const r = e.getFullYear() > 0 ? 1 : 0;
    switch (t) {
      case "G":
      case "GG":
      case "GGG":
        return n.era(r, { width: "abbreviated" });
      case "GGGGG":
        return n.era(r, { width: "narrow" });
      case "GGGG":
      default:
        return n.era(r, { width: "wide" });
    }
  },
  // Year
  y: function(e, t, n) {
    if (t === "yo") {
      const r = e.getFullYear(), i = r > 0 ? r : 1 - r;
      return n.ordinalNumber(i, { unit: "year" });
    }
    return ya.y(e, t);
  },
  // Local week-numbering year
  Y: function(e, t, n, r) {
    const i = aL(e, r), o = i > 0 ? i : 1 - i;
    if (t === "YY") {
      const a = o % 100;
      return At(a, 2);
    }
    return t === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : At(o, t.length);
  },
  // ISO week-numbering year
  R: function(e, t) {
    const n = Qj(e);
    return At(n, t.length);
  },
  // Extended year. This is a single number designating the year of this calendar system.
  // The main difference between `y` and `u` localizers are B.C. years:
  // | Year | `y` | `u` |
  // |------|-----|-----|
  // | AC 1 |   1 |   1 |
  // | BC 1 |   1 |   0 |
  // | BC 2 |   2 |  -1 |
  // Also `yy` always returns the last two digits of a year,
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
  u: function(e, t) {
    const n = e.getFullYear();
    return At(n, t.length);
  },
  // Quarter
  Q: function(e, t, n) {
    const r = Math.ceil((e.getMonth() + 1) / 3);
    switch (t) {
      case "Q":
        return String(r);
      case "QQ":
        return At(r, 2);
      case "Qo":
        return n.ordinalNumber(r, { unit: "quarter" });
      case "QQQ":
        return n.quarter(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "QQQQQ":
        return n.quarter(r, {
          width: "narrow",
          context: "formatting"
        });
      case "QQQQ":
      default:
        return n.quarter(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone quarter
  q: function(e, t, n) {
    const r = Math.ceil((e.getMonth() + 1) / 3);
    switch (t) {
      case "q":
        return String(r);
      case "qq":
        return At(r, 2);
      case "qo":
        return n.ordinalNumber(r, { unit: "quarter" });
      case "qqq":
        return n.quarter(r, {
          width: "abbreviated",
          context: "standalone"
        });
      case "qqqqq":
        return n.quarter(r, {
          width: "narrow",
          context: "standalone"
        });
      case "qqqq":
      default:
        return n.quarter(r, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Month
  M: function(e, t, n) {
    const r = e.getMonth();
    switch (t) {
      case "M":
      case "MM":
        return ya.M(e, t);
      case "Mo":
        return n.ordinalNumber(r + 1, { unit: "month" });
      case "MMM":
        return n.month(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "MMMMM":
        return n.month(r, {
          width: "narrow",
          context: "formatting"
        });
      case "MMMM":
      default:
        return n.month(r, { width: "wide", context: "formatting" });
    }
  },
  // Stand-alone month
  L: function(e, t, n) {
    const r = e.getMonth();
    switch (t) {
      case "L":
        return String(r + 1);
      case "LL":
        return At(r + 1, 2);
      case "Lo":
        return n.ordinalNumber(r + 1, { unit: "month" });
      case "LLL":
        return n.month(r, {
          width: "abbreviated",
          context: "standalone"
        });
      case "LLLLL":
        return n.month(r, {
          width: "narrow",
          context: "standalone"
        });
      case "LLLL":
      default:
        return n.month(r, { width: "wide", context: "standalone" });
    }
  },
  // Local week of year
  w: function(e, t, n, r) {
    const i = sL(e, r);
    return t === "wo" ? n.ordinalNumber(i, { unit: "week" }) : At(i, t.length);
  },
  // ISO week of year
  I: function(e, t, n) {
    const r = oL(e);
    return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : At(r, t.length);
  },
  // Day of the month
  d: function(e, t, n) {
    return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : ya.d(e, t);
  },
  // Day of year
  D: function(e, t, n) {
    const r = tte(e);
    return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : At(r, t.length);
  },
  // Day of week
  E: function(e, t, n) {
    const r = e.getDay();
    switch (t) {
      case "E":
      case "EE":
      case "EEE":
        return n.day(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "EEEEE":
        return n.day(r, {
          width: "narrow",
          context: "formatting"
        });
      case "EEEEEE":
        return n.day(r, {
          width: "short",
          context: "formatting"
        });
      case "EEEE":
      default:
        return n.day(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Local day of week
  e: function(e, t, n, r) {
    const i = e.getDay(), o = (i - r.weekStartsOn + 8) % 7 || 7;
    switch (t) {
      case "e":
        return String(o);
      case "ee":
        return At(o, 2);
      case "eo":
        return n.ordinalNumber(o, { unit: "day" });
      case "eee":
        return n.day(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "eeeee":
        return n.day(i, {
          width: "narrow",
          context: "formatting"
        });
      case "eeeeee":
        return n.day(i, {
          width: "short",
          context: "formatting"
        });
      case "eeee":
      default:
        return n.day(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone local day of week
  c: function(e, t, n, r) {
    const i = e.getDay(), o = (i - r.weekStartsOn + 8) % 7 || 7;
    switch (t) {
      case "c":
        return String(o);
      case "cc":
        return At(o, t.length);
      case "co":
        return n.ordinalNumber(o, { unit: "day" });
      case "ccc":
        return n.day(i, {
          width: "abbreviated",
          context: "standalone"
        });
      case "ccccc":
        return n.day(i, {
          width: "narrow",
          context: "standalone"
        });
      case "cccccc":
        return n.day(i, {
          width: "short",
          context: "standalone"
        });
      case "cccc":
      default:
        return n.day(i, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // ISO day of week
  i: function(e, t, n) {
    const r = e.getDay(), i = r === 0 ? 7 : r;
    switch (t) {
      case "i":
        return String(i);
      case "ii":
        return At(i, t.length);
      case "io":
        return n.ordinalNumber(i, { unit: "day" });
      case "iii":
        return n.day(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "iiiii":
        return n.day(r, {
          width: "narrow",
          context: "formatting"
        });
      case "iiiiii":
        return n.day(r, {
          width: "short",
          context: "formatting"
        });
      case "iiii":
      default:
        return n.day(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM or PM
  a: function(e, t, n) {
    const i = e.getHours() / 12 >= 1 ? "pm" : "am";
    switch (t) {
      case "a":
      case "aa":
        return n.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "aaa":
        return n.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "aaaaa":
        return n.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "aaaa":
      default:
        return n.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM, PM, midnight, noon
  b: function(e, t, n) {
    const r = e.getHours();
    let i;
    switch (r === 12 ? i = _l.noon : r === 0 ? i = _l.midnight : i = r / 12 >= 1 ? "pm" : "am", t) {
      case "b":
      case "bb":
        return n.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "bbb":
        return n.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "bbbbb":
        return n.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "bbbb":
      default:
        return n.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // in the morning, in the afternoon, in the evening, at night
  B: function(e, t, n) {
    const r = e.getHours();
    let i;
    switch (r >= 17 ? i = _l.evening : r >= 12 ? i = _l.afternoon : r >= 4 ? i = _l.morning : i = _l.night, t) {
      case "B":
      case "BB":
      case "BBB":
        return n.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "BBBBB":
        return n.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "BBBB":
      default:
        return n.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Hour [1-12]
  h: function(e, t, n) {
    if (t === "ho") {
      let r = e.getHours() % 12;
      return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
    }
    return ya.h(e, t);
  },
  // Hour [0-23]
  H: function(e, t, n) {
    return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : ya.H(e, t);
  },
  // Hour [0-11]
  K: function(e, t, n) {
    const r = e.getHours() % 12;
    return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : At(r, t.length);
  },
  // Hour [1-24]
  k: function(e, t, n) {
    let r = e.getHours();
    return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : At(r, t.length);
  },
  // Minute
  m: function(e, t, n) {
    return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : ya.m(e, t);
  },
  // Second
  s: function(e, t, n) {
    return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : ya.s(e, t);
  },
  // Fraction of second
  S: function(e, t) {
    return ya.S(e, t);
  },
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
  X: function(e, t, n) {
    const r = e.getTimezoneOffset();
    if (r === 0)
      return "Z";
    switch (t) {
      case "X":
        return yE(r);
      case "XXXX":
      case "XX":
        return gs(r);
      case "XXXXX":
      case "XXX":
      default:
        return gs(r, ":");
    }
  },
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
  x: function(e, t, n) {
    const r = e.getTimezoneOffset();
    switch (t) {
      case "x":
        return yE(r);
      case "xxxx":
      case "xx":
        return gs(r);
      case "xxxxx":
      case "xxx":
      default:
        return gs(r, ":");
    }
  },
  // Timezone (GMT)
  O: function(e, t, n) {
    const r = e.getTimezoneOffset();
    switch (t) {
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + gE(r, ":");
      case "OOOO":
      default:
        return "GMT" + gs(r, ":");
    }
  },
  // Timezone (specific non-location)
  z: function(e, t, n) {
    const r = e.getTimezoneOffset();
    switch (t) {
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + gE(r, ":");
      case "zzzz":
      default:
        return "GMT" + gs(r, ":");
    }
  },
  // Seconds timestamp
  t: function(e, t, n) {
    const r = Math.trunc(+e / 1e3);
    return At(r, t.length);
  },
  // Milliseconds timestamp
  T: function(e, t, n) {
    return At(+e, t.length);
  }
};
function gE(e, t = "") {
  const n = e > 0 ? "-" : "+", r = Math.abs(e), i = Math.trunc(r / 60), o = r % 60;
  return o === 0 ? n + String(i) : n + String(i) + t + At(o, 2);
}
function yE(e, t) {
  return e % 60 === 0 ? (e > 0 ? "-" : "+") + At(Math.abs(e) / 60, 2) : gs(e, t);
}
function gs(e, t = "") {
  const n = e > 0 ? "-" : "+", r = Math.abs(e), i = At(Math.trunc(r / 60), 2), o = At(r % 60, 2);
  return n + i + t + o;
}
const vE = (e, t) => {
  switch (e) {
    case "P":
      return t.date({ width: "short" });
    case "PP":
      return t.date({ width: "medium" });
    case "PPP":
      return t.date({ width: "long" });
    case "PPPP":
    default:
      return t.date({ width: "full" });
  }
}, lL = (e, t) => {
  switch (e) {
    case "p":
      return t.time({ width: "short" });
    case "pp":
      return t.time({ width: "medium" });
    case "ppp":
      return t.time({ width: "long" });
    case "pppp":
    default:
      return t.time({ width: "full" });
  }
}, rte = (e, t) => {
  const n = e.match(/(P+)(p+)?/) || [], r = n[1], i = n[2];
  if (!i)
    return vE(e, t);
  let o;
  switch (r) {
    case "P":
      o = t.dateTime({ width: "short" });
      break;
    case "PP":
      o = t.dateTime({ width: "medium" });
      break;
    case "PPP":
      o = t.dateTime({ width: "long" });
      break;
    case "PPPP":
    default:
      o = t.dateTime({ width: "full" });
      break;
  }
  return o.replace("{{date}}", vE(r, t)).replace("{{time}}", lL(i, t));
}, ite = {
  p: lL,
  P: rte
}, ote = /^D+$/, ate = /^Y+$/, ste = ["D", "DD", "YY", "YYYY"];
function lte(e) {
  return ote.test(e);
}
function cte(e) {
  return ate.test(e);
}
function ute(e, t, n) {
  const r = fte(e, t, n);
  if (console.warn(r), ste.includes(e)) throw new RangeError(r);
}
function fte(e, t, n) {
  const r = e[0] === "Y" ? "years" : "days of the month";
  return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
}
const dte = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, hte = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, pte = /^'([^]*?)'?$/, mte = /''/g, gte = /[a-zA-Z]/;
function Fn(e, t, n) {
  var f, d, p, m, y, g, v, x;
  const r = Od(), i = (n == null ? void 0 : n.locale) ?? r.locale ?? Hg, o = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((d = (f = n == null ? void 0 : n.locale) == null ? void 0 : f.options) == null ? void 0 : d.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((m = (p = r.locale) == null ? void 0 : p.options) == null ? void 0 : m.firstWeekContainsDate) ?? 1, a = (n == null ? void 0 : n.weekStartsOn) ?? ((g = (y = n == null ? void 0 : n.locale) == null ? void 0 : y.options) == null ? void 0 : g.weekStartsOn) ?? r.weekStartsOn ?? ((x = (v = r.locale) == null ? void 0 : v.options) == null ? void 0 : x.weekStartsOn) ?? 0, s = Et(e, n == null ? void 0 : n.in);
  if (!bee(s))
    throw new RangeError("Invalid time value");
  let l = t.match(hte).map((w) => {
    const S = w[0];
    if (S === "p" || S === "P") {
      const A = ite[S];
      return A(w, i.formatLong);
    }
    return w;
  }).join("").match(dte).map((w) => {
    if (w === "''")
      return { isToken: !1, value: "'" };
    const S = w[0];
    if (S === "'")
      return { isToken: !1, value: yte(w) };
    if (mE[S])
      return { isToken: !0, value: w };
    if (S.match(gte))
      throw new RangeError(
        "Format string contains an unescaped latin alphabet character `" + S + "`"
      );
    return { isToken: !1, value: w };
  });
  i.localize.preprocessor && (l = i.localize.preprocessor(s, l));
  const c = {
    firstWeekContainsDate: o,
    weekStartsOn: a,
    locale: i
  };
  return l.map((w) => {
    if (!w.isToken) return w.value;
    const S = w.value;
    (!(n != null && n.useAdditionalWeekYearTokens) && cte(S) || !(n != null && n.useAdditionalDayOfYearTokens) && lte(S)) && ute(S, t, String(e));
    const A = mE[S[0]];
    return A(s, S, i.localize, c);
  }).join("");
}
function yte(e) {
  const t = e.match(pte);
  return t ? t[1].replace(mte, "'") : e;
}
function vte(e, t) {
  const n = Et(e, t == null ? void 0 : t.in), r = n.getFullYear(), i = n.getMonth(), o = Tn(n, 0);
  return o.setFullYear(r, i + 1, 0), o.setHours(0, 0, 0, 0), o.getDate();
}
function fx(e, t) {
  return +Et(e) > +Et(t);
}
function dx(e, t) {
  return +Et(e) < +Et(t);
}
function bE(e, t) {
  return +Et(e) == +Et(t);
}
function bte(e, t, n) {
  const [r, i] = Ad(
    n == null ? void 0 : n.in,
    e,
    t
  );
  return r.getFullYear() === i.getFullYear() && r.getMonth() === i.getMonth();
}
function xte(e, t, n) {
  const [r, i] = Ad(
    n == null ? void 0 : n.in,
    e,
    t
  );
  return r.getFullYear() === i.getFullYear();
}
function xE(e, t, n) {
  return C_(e, -t, n);
}
function wte(e, t, n) {
  const r = Et(e, n == null ? void 0 : n.in), i = r.getFullYear(), o = r.getDate(), a = Tn(e, 0);
  a.setFullYear(i, t, 15), a.setHours(0, 0, 0, 0);
  const s = vte(a);
  return r.setMonth(t, Math.min(o, s)), r;
}
function _te(e, t, n) {
  const r = Et(e, n == null ? void 0 : n.in);
  return isNaN(+r) ? Tn(e, NaN) : (r.setFullYear(t), r);
}
function wE(e) {
  return Wi(Date.now(), e);
}
function _E(e) {
  const t = pE(e == null ? void 0 : e.in), n = t.getFullYear(), r = t.getMonth(), i = t.getDate(), o = pE(e == null ? void 0 : e.in);
  return o.setFullYear(n, r, i - 1), o.setHours(0, 0, 0, 0), o;
}
function Ste(e, t, n) {
  return E_(e, -t, n);
}
class Qo {
  /**
   * Creates an instance of DateLib.
   *
   * @param options The options for the date library.
   * @param overrides Overrides for the date library functions.
   */
  constructor(t, n) {
    this.Date = Date, this.addDays = (r, i) => {
      var o;
      return (o = this.overrides) != null && o.addDays ? this.overrides.addDays(r, i) : C_(r, i);
    }, this.addMonths = (r, i) => {
      var o;
      return (o = this.overrides) != null && o.addMonths ? this.overrides.addMonths(r, i) : E_(r, i);
    }, this.addWeeks = (r, i) => {
      var o;
      return (o = this.overrides) != null && o.addWeeks ? this.overrides.addWeeks(r, i) : pee(r, i);
    }, this.addYears = (r, i) => {
      var o;
      return (o = this.overrides) != null && o.addYears ? this.overrides.addYears(r, i) : mee(r, i);
    }, this.differenceInCalendarDays = (r, i) => {
      var o;
      return (o = this.overrides) != null && o.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, i) : eL(r, i);
    }, this.differenceInCalendarMonths = (r, i) => {
      var o;
      return (o = this.overrides) != null && o.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, i) : xee(r, i);
    }, this.endOfISOWeek = (r) => {
      var i;
      return (i = this.overrides) != null && i.endOfISOWeek ? this.overrides.endOfISOWeek(r) : _ee(r);
    }, this.endOfMonth = (r) => {
      var i;
      return (i = this.overrides) != null && i.endOfMonth ? this.overrides.endOfMonth(r) : nL(r);
    }, this.endOfWeek = (r) => {
      var i;
      return (i = this.overrides) != null && i.endOfWeek ? this.overrides.endOfWeek(r, this.options) : k_(r, this.options);
    }, this.endOfYear = (r) => {
      var i;
      return (i = this.overrides) != null && i.endOfYear ? this.overrides.endOfYear(r) : wee(r);
    }, this.format = (r, i) => {
      var o;
      return (o = this.overrides) != null && o.format ? this.overrides.format(r, i, this.options) : Fn(r, i, this.options);
    }, this.getISOWeek = (r) => {
      var i;
      return (i = this.overrides) != null && i.getISOWeek ? this.overrides.getISOWeek(r) : oL(r);
    }, this.getWeek = (r) => {
      var i;
      return (i = this.overrides) != null && i.getWeek ? this.overrides.getWeek(r, this.options) : sL(r, this.options);
    }, this.isAfter = (r, i) => {
      var o;
      return (o = this.overrides) != null && o.isAfter ? this.overrides.isAfter(r, i) : fx(r, i);
    }, this.isBefore = (r, i) => {
      var o;
      return (o = this.overrides) != null && o.isBefore ? this.overrides.isBefore(r, i) : dx(r, i);
    }, this.isDate = (r) => {
      var i;
      return (i = this.overrides) != null && i.isDate ? this.overrides.isDate(r) : tL(r);
    }, this.isSameDay = (r, i) => {
      var o;
      return (o = this.overrides) != null && o.isSameDay ? this.overrides.isSameDay(r, i) : vee(r, i);
    }, this.isSameMonth = (r, i) => {
      var o;
      return (o = this.overrides) != null && o.isSameMonth ? this.overrides.isSameMonth(r, i) : bte(r, i);
    }, this.isSameYear = (r, i) => {
      var o;
      return (o = this.overrides) != null && o.isSameYear ? this.overrides.isSameYear(r, i) : xte(r, i);
    }, this.max = (r) => {
      var i;
      return (i = this.overrides) != null && i.max ? this.overrides.max(r) : gee(r);
    }, this.min = (r) => {
      var i;
      return (i = this.overrides) != null && i.min ? this.overrides.min(r) : yee(r);
    }, this.setMonth = (r, i) => {
      var o;
      return (o = this.overrides) != null && o.setMonth ? this.overrides.setMonth(r, i) : wte(r, i);
    }, this.setYear = (r, i) => {
      var o;
      return (o = this.overrides) != null && o.setYear ? this.overrides.setYear(r, i) : _te(r, i);
    }, this.startOfDay = (r) => {
      var i;
      return (i = this.overrides) != null && i.startOfDay ? this.overrides.startOfDay(r) : Wi(r);
    }, this.startOfISOWeek = (r) => {
      var i;
      return (i = this.overrides) != null && i.startOfISOWeek ? this.overrides.startOfISOWeek(r) : Tf(r);
    }, this.startOfMonth = (r) => {
      var i;
      return (i = this.overrides) != null && i.startOfMonth ? this.overrides.startOfMonth(r) : rL(r);
    }, this.startOfWeek = (r) => {
      var i;
      return (i = this.overrides) != null && i.startOfWeek ? this.overrides.startOfWeek(r, this.options) : Ws(r, this.options);
    }, this.startOfYear = (r) => {
      var i;
      return (i = this.overrides) != null && i.startOfYear ? this.overrides.startOfYear(r) : iL(r);
    }, this.options = { locale: Hg, ...t }, this.overrides = n;
  }
}
const Qs = new Qo();
function Ote(e, t, n = {}) {
  return Object.entries(e).filter(([, i]) => i === !0).reduce((i, [o]) => (n[o] ? i.push(n[o]) : t[Lt[o]] ? i.push(t[Lt[o]]) : t[Ei[o]] && i.push(t[Ei[o]]), i), [t[Le.Day]]);
}
function Ate(e) {
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("button", { ...e });
}
function Tte(e) {
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", { ...e });
}
function Pte(e) {
  const { size: t = 24, orientation: n = "left", className: r } = e;
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement(
    "svg",
    { className: r, width: t, height: t, viewBox: "0 0 24 24" },
    n === "up" && react__WEBPACK_IMPORTED_MODULE_1__.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
    n === "down" && react__WEBPACK_IMPORTED_MODULE_1__.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
    n === "left" && react__WEBPACK_IMPORTED_MODULE_1__.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
    n === "right" && react__WEBPACK_IMPORTED_MODULE_1__.createElement("polygon", { points: "8 18.612 14.1888889 12.5 8 6.37733333 9.91111111 4.5 18 12.5 9.91111111 20.5" })
  );
}
function Cte(e) {
  const { day: t, modifiers: n, ...r } = e;
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("td", { ...r });
}
function Ete(e) {
  const { day: t, modifiers: n, ...r } = e, i = react__WEBPACK_IMPORTED_MODULE_1__.useRef(null);
  return react__WEBPACK_IMPORTED_MODULE_1__.useEffect(() => {
    var o;
    n.focused && ((o = i.current) == null || o.focus());
  }, [n.focused]), react__WEBPACK_IMPORTED_MODULE_1__.createElement("button", { ref: i, ...r });
}
function kte(e) {
  const { options: t, className: n, components: r, classNames: i, ...o } = e, a = [i[Le.Dropdown], n].join(" "), s = t == null ? void 0 : t.find(({ value: l }) => l === o.value);
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement(
    "span",
    { "data-disabled": o.disabled, className: i[Le.DropdownRoot] },
    react__WEBPACK_IMPORTED_MODULE_1__.createElement(r.Select, { className: a, ...o }, t == null ? void 0 : t.map(({ value: l, label: c, disabled: f }) => react__WEBPACK_IMPORTED_MODULE_1__.createElement(r.Option, { key: l, value: l, disabled: f }, c))),
    react__WEBPACK_IMPORTED_MODULE_1__.createElement(
      "span",
      { className: i[Le.CaptionLabel], "aria-hidden": !0 },
      s == null ? void 0 : s.label,
      react__WEBPACK_IMPORTED_MODULE_1__.createElement(r.Chevron, { orientation: "down", size: 18, className: i[Le.Chevron] })
    )
  );
}
function Mte(e) {
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", { ...e });
}
function Nte(e) {
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", { ...e });
}
function $te(e) {
  const { calendarMonth: t, displayIndex: n, ...r } = e;
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", { ...r }, e.children);
}
function Dte(e) {
  const { calendarMonth: t, displayIndex: n, ...r } = e;
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", { ...r });
}
function Ite(e) {
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("table", { ...e });
}
function Rte(e) {
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", { ...e });
}
const cL = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(void 0);
function Wc() {
  const e = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(cL);
  if (e === void 0)
    throw new Error("useDayPicker() must be used within a custom component.");
  return e;
}
function jte(e) {
  const { components: t } = Wc();
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.Dropdown, { ...e });
}
function Lte(e) {
  const { onPreviousClick: t, onNextClick: n, previousMonth: r, nextMonth: i, ...o } = e, { components: a, classNames: s, labels: { labelPrevious: l, labelNext: c } } = Wc();
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement(
    "nav",
    { ...o },
    react__WEBPACK_IMPORTED_MODULE_1__.createElement(
      a.PreviousMonthButton,
      { type: "button", className: s[Le.PreviousMonthButton], tabIndex: r ? void 0 : -1, disabled: r ? void 0 : !0, "aria-label": l(r), onClick: e.onPreviousClick },
      react__WEBPACK_IMPORTED_MODULE_1__.createElement(a.Chevron, { disabled: r ? void 0 : !0, className: s[Le.Chevron], orientation: "left" })
    ),
    react__WEBPACK_IMPORTED_MODULE_1__.createElement(
      a.NextMonthButton,
      { type: "button", className: s[Le.NextMonthButton], tabIndex: i ? void 0 : -1, disabled: i ? void 0 : !0, "aria-label": c(i), onClick: e.onNextClick },
      react__WEBPACK_IMPORTED_MODULE_1__.createElement(a.Chevron, { disabled: i ? void 0 : !0, orientation: "right", className: s[Le.Chevron] })
    )
  );
}
function Bte(e) {
  const { components: t } = Wc();
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.Button, { ...e });
}
function Fte(e) {
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("option", { ...e });
}
function Wte(e) {
  const { components: t } = Wc();
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.Button, { ...e });
}
function zte(e) {
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", { ...e });
}
function Vte(e) {
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("select", { ...e });
}
function Ute(e) {
  const { week: t, ...n } = e;
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", { ...n });
}
function Hte(e) {
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("th", { ...e });
}
function Kte(e) {
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement(
    "thead",
    null,
    react__WEBPACK_IMPORTED_MODULE_1__.createElement("tr", { ...e })
  );
}
function Gte(e) {
  const { week: t, ...n } = e;
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("th", { ...n });
}
function Yte(e) {
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("th", { ...e });
}
function qte(e) {
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement("tbody", { ...e });
}
function Xte(e) {
  const { components: t } = Wc();
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.Dropdown, { ...e });
}
const Zte = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Button: Ate,
  CaptionLabel: Tte,
  Chevron: Pte,
  Day: Cte,
  DayButton: Ete,
  Dropdown: kte,
  DropdownNav: Mte,
  Footer: Nte,
  Month: $te,
  MonthCaption: Dte,
  MonthGrid: Ite,
  Months: Rte,
  MonthsDropdown: jte,
  Nav: Lte,
  NextMonthButton: Bte,
  Option: Fte,
  PreviousMonthButton: Wte,
  Root: zte,
  Select: Vte,
  Week: Ute,
  WeekNumber: Gte,
  WeekNumberHeader: Yte,
  Weekday: Hte,
  Weekdays: Kte,
  Weeks: qte,
  YearsDropdown: Xte
}, Symbol.toStringTag, { value: "Module" }));
function Jte(e) {
  return {
    ...Zte,
    ...e
  };
}
function Qte(e) {
  const t = {
    "data-mode": e.mode ?? void 0,
    "data-required": "required" in e ? e.required : void 0,
    "data-multiple-months": e.numberOfMonths && e.numberOfMonths > 1 || void 0,
    "data-week-numbers": e.showWeekNumber || void 0
  };
  return Object.entries(e).forEach(([n, r]) => {
    n.startsWith("data-") && (t[n] = r);
  }), t;
}
function ene() {
  const e = {};
  for (const t in Le)
    e[Le[t]] = `rdp-${Le[t]}`;
  for (const t in Lt)
    e[Lt[t]] = `rdp-${Lt[t]}`;
  for (const t in Ei)
    e[Ei[t]] = `rdp-${Ei[t]}`;
  return e;
}
function uL(e, t, n) {
  return (n ?? new Qo(t)).format(e, "LLLL y");
}
const tne = uL;
function nne(e, t, n) {
  return (n ?? new Qo(t)).format(e, "d");
}
function rne(e, t) {
  var n;
  return (n = t.localize) == null ? void 0 : n.month(e);
}
function ine(e) {
  return e < 10 ? `0${e.toLocaleString()}` : `${e.toLocaleString()}`;
}
function one() {
  return "";
}
function ane(e, t, n) {
  return (n ?? new Qo(t)).format(e, "cccccc");
}
function fL(e) {
  return e.toString();
}
const sne = fL, lne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  formatCaption: uL,
  formatDay: nne,
  formatMonthCaption: tne,
  formatMonthDropdown: rne,
  formatWeekNumber: ine,
  formatWeekNumberHeader: one,
  formatWeekdayName: ane,
  formatYearCaption: sne,
  formatYearDropdown: fL
}, Symbol.toStringTag, { value: "Module" }));
function cne(e) {
  return e != null && e.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e != null && e.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
    ...lne,
    ...e
  };
}
function une(e, t, n, r, i) {
  if (!t || !n)
    return;
  const { addMonths: o, startOfMonth: a, isBefore: s } = i, l = e.getFullYear(), c = [];
  let f = t;
  for (; c.length < 12 && s(f, o(n, 1)); )
    c.push(f.getMonth()), f = o(f, 1);
  return c.sort((m, y) => m - y).map((m) => {
    const y = r.formatMonthDropdown(m, i.options.locale ?? Hg), g = i.Date ? new i.Date(l, m) : new Date(l, m), v = t && g < a(t) || n && g > a(n) || !1;
    return { value: m, label: y, disabled: v };
  });
}
function fne(e, t = {}, n = {}) {
  let r = { ...t == null ? void 0 : t[Le.Day] };
  return Object.entries(e).filter(([, i]) => i === !0).forEach(([i]) => {
    r = {
      ...r,
      ...n == null ? void 0 : n[i]
    };
  }), r;
}
const Pb = {}, zu = {};
function ef(e, t) {
  try {
    const r = (Pb[e] || (Pb[e] = new Intl.DateTimeFormat("en-GB", {
      timeZone: e,
      hour: "numeric",
      timeZoneName: "longOffset"
    }).format))(t).split("GMT")[1] || "";
    return r in zu ? zu[r] : SE(r, r.split(":"));
  } catch {
    if (e in zu) return zu[e];
    const n = e == null ? void 0 : e.match(dne);
    return n ? SE(e, n.slice(1)) : NaN;
  }
}
const dne = /([+-]\d\d):?(\d\d)?/;
function SE(e, t) {
  const n = +t[0], r = +(t[1] || 0);
  return zu[e] = n > 0 ? n * 60 + r : n * 60 - r;
}
class zi extends Date {
  //#region static
  constructor(...t) {
    super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(ef(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)), dL(this), hx(this)) : this.setTime(Date.now());
  }
  static tz(t, ...n) {
    return n.length ? new zi(...n, t) : new zi(Date.now(), t);
  }
  //#endregion
  //#region time zone
  withTimeZone(t) {
    return new zi(+this, t);
  }
  getTimezoneOffset() {
    return -ef(this.timeZone, this);
  }
  //#endregion
  //#region time
  setTime(t) {
    return Date.prototype.setTime.apply(this, arguments), hx(this), +this;
  }
  //#endregion
  //#region date-fns integration
  [Symbol.for("constructDateFrom")](t) {
    return new zi(+new Date(t), this.timeZone);
  }
  //#endregion
}
const OE = /^(get|set)(?!UTC)/;
Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
  if (!OE.test(e)) return;
  const t = e.replace(OE, "$1UTC");
  zi.prototype[t] && (e.startsWith("get") ? zi.prototype[e] = function() {
    return this.internal[t]();
  } : (zi.prototype[e] = function() {
    return Date.prototype[t].apply(this.internal, arguments), hne(this), +this;
  }, zi.prototype[t] = function() {
    return Date.prototype[t].apply(this, arguments), hx(this), +this;
  }));
});
function hx(e) {
  e.internal.setTime(+e), e.internal.setUTCMinutes(e.internal.getUTCMinutes() - e.getTimezoneOffset());
}
function hne(e) {
  Date.prototype.setFullYear.call(e, e.internal.getUTCFullYear(), e.internal.getUTCMonth(), e.internal.getUTCDate()), Date.prototype.setHours.call(e, e.internal.getUTCHours(), e.internal.getUTCMinutes(), e.internal.getUTCSeconds(), e.internal.getUTCMilliseconds()), dL(e);
}
function dL(e) {
  const t = ef(e.timeZone, e), n = /* @__PURE__ */ new Date(+e);
  n.setUTCHours(n.getUTCHours() - 1);
  const r = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), i = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset(), o = r - i, a = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
  o && a && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + o);
  const s = r - t;
  s && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + s);
  const l = ef(e.timeZone, e), f = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - l, d = l !== t, p = f - s;
  if (d && p) {
    Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + p);
    const m = ef(e.timeZone, e), y = l - m;
    y && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + y), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + y));
  }
}
class Vi extends zi {
  //#region static
  static tz(t, ...n) {
    return n.length ? new Vi(...n, t) : new Vi(Date.now(), t);
  }
  //#endregion
  //#region representation
  toISOString() {
    const [t, n, r] = this.tzComponents(), i = `${t}${n}:${r}`;
    return this.internal.toISOString().slice(0, -1) + i;
  }
  toString() {
    return `${this.toDateString()} ${this.toTimeString()}`;
  }
  toDateString() {
    const [t, n, r, i] = this.internal.toUTCString().split(" ");
    return `${t == null ? void 0 : t.slice(0, -1)} ${r} ${n} ${i}`;
  }
  toTimeString() {
    const t = this.internal.toUTCString().split(" ")[4], [n, r, i] = this.tzComponents();
    return `${t} GMT${n}${r}${i} (${pne(this.timeZone, this)})`;
  }
  toLocaleString(t, n) {
    return Date.prototype.toLocaleString.call(this, t, {
      ...n,
      timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
    });
  }
  toLocaleDateString(t, n) {
    return Date.prototype.toLocaleDateString.call(this, t, {
      ...n,
      timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
    });
  }
  toLocaleTimeString(t, n) {
    return Date.prototype.toLocaleTimeString.call(this, t, {
      ...n,
      timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
    });
  }
  //#endregion
  //#region private
  tzComponents() {
    const t = this.getTimezoneOffset(), n = t > 0 ? "-" : "+", r = String(Math.floor(Math.abs(t) / 60)).padStart(2, "0"), i = String(Math.abs(t) % 60).padStart(2, "0");
    return [n, r, i];
  }
  //#endregion
  withTimeZone(t) {
    return new Vi(+this, t);
  }
  //#region date-fns integration
  [Symbol.for("constructDateFrom")](t) {
    return new Vi(+new Date(t), this.timeZone);
  }
  //#endregion
}
function pne(e, t) {
  return new Intl.DateTimeFormat("en-GB", {
    timeZone: e,
    timeZoneName: "long"
  }).format(t).slice(12);
}
function mne(e, t, n) {
  const r = n ? Vi.tz(n) : e.Date ? new e.Date() : /* @__PURE__ */ new Date(), i = t ? e.startOfISOWeek(r) : e.startOfWeek(r), o = [];
  for (let a = 0; a < 7; a++) {
    const s = e.addDays(i, a);
    o.push(s);
  }
  return o;
}
function gne(e, t, n, r, i) {
  if (!t || !n)
    return;
  const { startOfMonth: o, startOfYear: a, endOfYear: s, addYears: l, isBefore: c, isSameYear: f } = i, d = e.getMonth(), p = a(t), m = s(n), y = [];
  let g = p;
  for (; c(g, m) || f(g, m); )
    y.push(g.getFullYear()), g = l(g, 1);
  return y.map((v) => {
    const x = i.Date ? new i.Date(v, d) : new Date(v, d), w = t && x < o(t) || d && n && x > o(n) || !1, S = r.formatYearDropdown(v);
    return {
      value: v,
      label: S,
      disabled: w
    };
  });
}
function hL(e, t, n) {
  return (n ?? new Qo(t)).format(e, "LLLL y");
}
const yne = hL;
function vne(e, t, n, r) {
  let i = (r ?? new Qo(n)).format(e, "PPPP");
  return t != null && t.today && (i = `Today, ${i}`), i;
}
function pL(e, t, n, r) {
  let i = (r ?? new Qo(n)).format(e, "PPPP");
  return t.today && (i = `Today, ${i}`), t.selected && (i = `${i}, selected`), i;
}
const bne = pL;
function xne() {
  return "";
}
function wne(e) {
  return "Choose the Month";
}
function _ne(e) {
  return "Go to the Next Month";
}
function Sne(e) {
  return "Go to the Previous Month";
}
function One(e, t, n) {
  return (n ?? new Qo(t)).format(e, "cccc");
}
function Ane(e, t) {
  return `Week ${e}`;
}
function Tne(e) {
  return "Week Number";
}
function Pne(e) {
  return "Choose the Year";
}
const Cne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  labelCaption: yne,
  labelDay: bne,
  labelDayButton: pL,
  labelGrid: hL,
  labelGridcell: vne,
  labelMonthDropdown: wne,
  labelNav: xne,
  labelNext: _ne,
  labelPrevious: Sne,
  labelWeekNumber: Ane,
  labelWeekNumberHeader: Tne,
  labelWeekday: One,
  labelYearDropdown: Pne
}, Symbol.toStringTag, { value: "Module" })), px = 42;
function Ene(e, t, n, r) {
  const i = e[0], o = e[e.length - 1], { ISOWeek: a, fixedWeeks: s } = n ?? {}, { startOfWeek: l, endOfWeek: c, startOfISOWeek: f, endOfISOWeek: d, addDays: p, differenceInCalendarDays: m, differenceInCalendarMonths: y, isAfter: g, endOfMonth: v } = r, x = a ? f(i) : l(i), w = a ? d(v(o)) : c(v(o)), S = m(w, x), A = y(o, i) + 1, _ = [];
  for (let P = 0; P <= S; P++) {
    const C = p(x, P);
    if (t && g(C, t))
      break;
    _.push(C);
  }
  const O = px * A;
  if (s && _.length < O) {
    const P = O - _.length;
    for (let C = 0; C < P; C++) {
      const k = p(_[_.length - 1], 1);
      _.push(k);
    }
  }
  return _;
}
function kne(e) {
  const t = [];
  return e.reduce((n, r) => {
    const i = [], o = r.weeks.reduce((a, s) => [...a, ...s.days], i);
    return [...n, ...o];
  }, t);
}
function Mne(e, t, n, r) {
  const { numberOfMonths: i = 1 } = n, o = [];
  for (let a = 0; a < i; a++) {
    const s = r.addMonths(e, a);
    if (t && s > t)
      break;
    o.push(s);
  }
  return o;
}
function AE(e, t) {
  const { month: n, defaultMonth: r, today: i = e.timeZone ? Vi.tz(e.timeZone) : t.Date ? new t.Date() : /* @__PURE__ */ new Date(), numberOfMonths: o = 1, endMonth: a, startMonth: s } = e;
  let l = n || r || i;
  const { differenceInCalendarMonths: c, addMonths: f, startOfMonth: d } = t;
  if (a && c(a, l) < 0) {
    const p = -1 * (o - 1);
    l = f(a, p);
  }
  return s && c(l, s) < 0 && (l = s), d(l);
}
class mL {
  constructor(t, n, r = Qs) {
    this.date = t, this.displayMonth = n, this.outside = !!(n && !r.isSameMonth(t, n)), this.dateLib = r;
  }
  /**
   * Check if the day is the same as the given day: considering if it is in the
   * same display month.
   */
  isEqualTo(t) {
    return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
  }
}
class Nne {
  constructor(t, n) {
    this.date = t, this.weeks = n;
  }
}
class $ne {
  constructor(t, n) {
    this.days = n, this.weekNumber = t;
  }
}
function Dne(e, t, n, r) {
  const { startOfWeek: i, endOfWeek: o, startOfISOWeek: a, endOfISOWeek: s, endOfMonth: l, addDays: c, getWeek: f, getISOWeek: d } = r, p = e.reduce((m, y) => {
    const g = n.ISOWeek ? a(y) : i(y), v = n.ISOWeek ? s(l(y)) : o(l(y)), x = t.filter((A) => A >= g && A <= v);
    if (n.fixedWeeks && x.length < px) {
      const A = t.filter((_) => {
        const O = px - x.length;
        return _ > v && _ <= c(v, O);
      });
      x.push(...A);
    }
    const w = x.reduce((A, _) => {
      const O = n.ISOWeek ? d(_) : f(_), P = A.find((k) => k.weekNumber === O), C = new mL(_, y, r);
      return P ? P.days.push(C) : A.push(new $ne(O, [C])), A;
    }, []), S = new Nne(y, w);
    return m.push(S), m;
  }, []);
  return n.reverseMonths ? p.reverse() : p;
}
function Ine(e, t) {
  var g;
  let { startMonth: n, endMonth: r } = e;
  const { startOfYear: i, startOfDay: o, startOfMonth: a, endOfMonth: s, addYears: l, endOfYear: c } = t, { fromYear: f, toYear: d, fromMonth: p, toMonth: m } = e;
  !n && p && (n = p), !n && f && (n = new Date(f, 0, 1)), !r && m && (r = m), !r && d && (r = new Date(d, 11, 31));
  const y = (g = e.captionLayout) == null ? void 0 : g.startsWith("dropdown");
  if (n)
    n = a(n);
  else if (f)
    n = new Date(f, 0, 1);
  else if (!n && y) {
    const v = e.today ?? (e.timeZone ? Vi.tz(e.timeZone) : t.Date ? new t.Date() : /* @__PURE__ */ new Date());
    n = i(l(v, -100));
  }
  if (r)
    r = s(r);
  else if (d)
    r = new Date(d, 11, 31);
  else if (!r && y) {
    const v = e.today ?? (e.timeZone ? Vi.tz(e.timeZone) : t.Date ? new t.Date() : /* @__PURE__ */ new Date());
    r = c(v);
  }
  return [
    n && o(n),
    r && o(r)
  ];
}
function Rne(e, t, n, r) {
  if (n.disableNavigation)
    return;
  const { pagedNavigation: i, numberOfMonths: o = 1 } = n, { startOfMonth: a, addMonths: s, differenceInCalendarMonths: l } = r, c = i ? o : 1, f = a(e);
  if (!t)
    return s(f, c);
  if (!(l(t, e) < o))
    return s(f, c);
}
function jne(e, t, n, r) {
  if (n.disableNavigation)
    return;
  const { pagedNavigation: i, numberOfMonths: o } = n, { startOfMonth: a, addMonths: s, differenceInCalendarMonths: l } = r, c = i ? o ?? 1 : 1, f = a(e);
  if (!t)
    return s(f, -c);
  if (!(l(f, t) <= 0))
    return s(f, -c);
}
function Lne(e) {
  const t = [];
  return e.reduce((n, r) => [...n, ...r.weeks], t);
}
function Kg(e, t) {
  const [n, r] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(e);
  return [t === void 0 ? n : t, r];
}
function Bne(e, t) {
  const [n, r] = Ine(e, t), { startOfMonth: i, endOfMonth: o } = t, a = AE(e, t), [s, l] = Kg(a, e.month ? i(e.month) : void 0);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const O = AE(e, t);
    l(O);
  }, [e.timeZone]);
  const c = Mne(s, r, e, t), f = Ene(c, e.endMonth ? o(e.endMonth) : void 0, e, t), d = Dne(c, f, e, t), p = Lne(d), m = kne(d), y = jne(s, n, e, t), g = Rne(s, r, e, t), { disableNavigation: v, onMonthChange: x } = e, w = (O) => p.some((P) => P.days.some((C) => C.isEqualTo(O))), S = (O) => {
    if (v)
      return;
    let P = i(O);
    n && P < i(n) && (P = i(n)), r && P > i(r) && (P = i(r)), l(P), x == null || x(P);
  };
  return {
    months: d,
    weeks: p,
    days: m,
    navStart: n,
    navEnd: r,
    previousMonth: y,
    nextMonth: g,
    goToMonth: S,
    goToDay: (O) => {
      w(O) || S(O.date);
    }
  };
}
function Fne(e, t, n, r) {
  let i, o = 0, a = !1;
  for (; o < e.length && !a; ) {
    const s = e[o], l = t(s);
    !l[Lt.disabled] && !l[Lt.hidden] && !l[Lt.outside] && (l[Lt.focused] || r != null && r.isEqualTo(s) || n(s.date) || l[Lt.today]) && (i = s, a = !0), o++;
  }
  return i || (i = e.find((s) => {
    const l = t(s);
    return !l[Lt.disabled] && !l[Lt.hidden] && !l[Lt.outside];
  })), i;
}
function Po(e, t, n = !1, r = Qs) {
  let { from: i, to: o } = e;
  const { differenceInCalendarDays: a, isSameDay: s } = r;
  return i && o ? (a(o, i) < 0 && ([i, o] = [o, i]), a(t, i) >= (n ? 1 : 0) && a(o, t) >= (n ? 1 : 0)) : !n && o ? s(o, t) : !n && i ? s(i, t) : !1;
}
function gL(e) {
  return !!(e && typeof e == "object" && "before" in e && "after" in e);
}
function M_(e) {
  return !!(e && typeof e == "object" && "from" in e);
}
function yL(e) {
  return !!(e && typeof e == "object" && "after" in e);
}
function vL(e) {
  return !!(e && typeof e == "object" && "before" in e);
}
function bL(e) {
  return !!(e && typeof e == "object" && "dayOfWeek" in e);
}
function xL(e, t) {
  return Array.isArray(e) && e.every(t.isDate);
}
function Co(e, t, n = Qs) {
  const r = Array.isArray(t) ? t : [t], { isSameDay: i, differenceInCalendarDays: o, isAfter: a } = n;
  return r.some((s) => {
    if (typeof s == "boolean")
      return s;
    if (n.isDate(s))
      return i(e, s);
    if (xL(s, n))
      return s.includes(e);
    if (M_(s))
      return Po(s, e, !1, n);
    if (bL(s))
      return Array.isArray(s.dayOfWeek) ? s.dayOfWeek.includes(e.getDay()) : s.dayOfWeek === e.getDay();
    if (gL(s)) {
      const l = o(s.before, e), c = o(s.after, e), f = l > 0, d = c < 0;
      return a(s.before, s.after) ? d && f : f || d;
    }
    return yL(s) ? o(e, s.after) > 0 : vL(s) ? o(s.before, e) > 0 : typeof s == "function" ? s(e) : !1;
  });
}
function Wne(e, t, n, r, i, o, a) {
  const { ISOWeek: s } = o, { addDays: l, addMonths: c, addYears: f, addWeeks: d, startOfISOWeek: p, endOfISOWeek: m, startOfWeek: y, endOfWeek: g, max: v, min: x } = a;
  let S = {
    day: l,
    week: d,
    month: c,
    year: f,
    startOfWeek: (A) => s ? p(A) : y(A),
    endOfWeek: (A) => s ? m(A) : g(A)
  }[e](n, t === "after" ? 1 : -1);
  return t === "before" && r ? S = v([r, S]) : t === "after" && i && (S = x([i, S])), S;
}
function wL(e, t, n, r, i, o, a, s = 0) {
  if (s > 365)
    return;
  const l = Wne(
    e,
    t,
    n.date,
    // should be refDay? or refDay.date?
    r,
    i,
    o,
    a
  ), c = !!(o.disabled && Co(l, o.disabled, a)), f = !!(o.hidden && Co(l, o.hidden, a)), d = l, p = new mL(l, d, a);
  return !c && !f ? p : wL(e, t, p, r, i, o, a, s + 1);
}
function zne(e, t, n, r, i) {
  const { autoFocus: o } = e, [a, s] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(), l = Fne(t.days, n, r || (() => !1), a), [c, f] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(o ? l : void 0);
  return {
    isFocusTarget: (g) => !!(l != null && l.isEqualTo(g)),
    setFocused: f,
    focused: c,
    blur: () => {
      s(c), f(void 0);
    },
    moveFocus: (g, v) => {
      if (!c)
        return;
      const x = wL(g, v, c, t.navStart, t.navEnd, e, i);
      x && (t.goToDay(x), f(x));
    }
  };
}
function Vne(e, t, n) {
  const { disabled: r, hidden: i, modifiers: o, showOutsideDays: a, today: s } = t, { isSameDay: l, isSameMonth: c, startOfMonth: f, isBefore: d, endOfMonth: p, isAfter: m } = n, y = t.startMonth && f(t.startMonth), g = t.endMonth && p(t.endMonth), v = {
    [Lt.focused]: [],
    [Lt.outside]: [],
    [Lt.disabled]: [],
    [Lt.hidden]: [],
    [Lt.today]: []
  }, x = {};
  for (const w of e) {
    const { date: S, displayMonth: A } = w, _ = !!(A && !c(S, A)), O = !!(y && d(S, y)), P = !!(g && m(S, g)), C = !!(r && Co(S, r, n)), k = !!(i && Co(S, i, n)) || O || P || !a && _, I = l(S, s ?? (t.timeZone ? Vi.tz(t.timeZone) : n.Date ? new n.Date() : /* @__PURE__ */ new Date()));
    _ && v.outside.push(w), C && v.disabled.push(w), k && v.hidden.push(w), I && v.today.push(w), o && Object.keys(o).forEach(($) => {
      const N = o == null ? void 0 : o[$];
      N && Co(S, N, n) && (x[$] ? x[$].push(w) : x[$] = [w]);
    });
  }
  return (w) => {
    const S = {
      [Lt.focused]: !1,
      [Lt.disabled]: !1,
      [Lt.hidden]: !1,
      [Lt.outside]: !1,
      [Lt.today]: !1
    }, A = {};
    for (const _ in v) {
      const O = v[_];
      S[_] = O.some((P) => P === w);
    }
    for (const _ in x)
      A[_] = x[_].some((O) => O === w);
    return {
      ...S,
      // custom modifiers should override all the previous ones
      ...A
    };
  };
}
function Une(e, t) {
  const { selected: n, required: r, onSelect: i } = e, [o, a] = Kg(n, i ? n : void 0), s = i ? n : o, { isSameDay: l } = t, c = (m) => (s == null ? void 0 : s.some((y) => l(y, m))) ?? !1, { min: f, max: d } = e;
  return {
    selected: s,
    select: (m, y, g) => {
      let v = [...s ?? []];
      if (c(m)) {
        if ((s == null ? void 0 : s.length) === f || r && (s == null ? void 0 : s.length) === 1)
          return;
        v = s == null ? void 0 : s.filter((x) => !l(x, m));
      } else
        (s == null ? void 0 : s.length) === d ? v = [m] : v = [...v, m];
      return i || a(v), i == null || i(v, m, y, g), v;
    },
    isSelected: c
  };
}
function Hne(e, t, n = 0, r = 0, i = !1, o = Qs) {
  const { from: a, to: s } = t || {}, { isSameDay: l, isAfter: c, isBefore: f } = o;
  let d;
  if (!a && !s)
    d = { from: e, to: n > 0 ? void 0 : e };
  else if (a && !s)
    l(a, e) ? i ? d = { from: a, to: void 0 } : d = void 0 : f(e, a) ? d = { from: e, to: a } : d = { from: a, to: e };
  else if (a && s)
    if (l(a, e) && l(s, e))
      i ? d = { from: a, to: s } : d = void 0;
    else if (l(a, e))
      d = { from: a, to: n > 0 ? void 0 : e };
    else if (l(s, e))
      d = { from: e, to: n > 0 ? void 0 : e };
    else if (f(e, a))
      d = { from: e, to: s };
    else if (c(e, a))
      d = { from: a, to: e };
    else if (c(e, s))
      d = { from: a, to: e };
    else
      throw new Error("Invalid range");
  if (d != null && d.from && (d != null && d.to)) {
    const p = o.differenceInCalendarDays(d.to, d.from);
    r > 0 && p > r ? d = { from: e, to: void 0 } : n > 1 && p < n && (d = { from: e, to: void 0 });
  }
  return d;
}
function Kne(e, t, n = Qs) {
  const r = Array.isArray(t) ? t : [t];
  let i = e.from;
  const o = n.differenceInCalendarDays(e.to, e.from), a = Math.min(o, 6);
  for (let s = 0; s <= a; s++) {
    if (r.includes(i.getDay()))
      return !0;
    i = n.addDays(i, 1);
  }
  return !1;
}
function TE(e, t, n = Qs) {
  return Po(e, t.from, !1, n) || Po(e, t.to, !1, n) || Po(t, e.from, !1, n) || Po(t, e.to, !1, n);
}
function Gne(e, t, n = Qs) {
  const r = Array.isArray(t) ? t : [t];
  if (r.filter((s) => typeof s != "function").some((s) => typeof s == "boolean" ? s : n.isDate(s) ? Po(e, s, !1, n) : xL(s, n) ? s.some((l) => Po(e, l, !1, n)) : M_(s) ? s.from && s.to ? TE(e, { from: s.from, to: s.to }, n) : !1 : bL(s) ? Kne(e, s.dayOfWeek, n) : gL(s) ? n.isAfter(s.before, s.after) ? TE(e, {
    from: n.addDays(s.after, 1),
    to: n.addDays(s.before, -1)
  }, n) : Co(e.from, s, n) || Co(e.to, s, n) : yL(s) || vL(s) ? Co(e.from, s, n) || Co(e.to, s, n) : !1))
    return !0;
  const a = r.filter((s) => typeof s == "function");
  if (a.length) {
    let s = e.from;
    const l = n.differenceInCalendarDays(e.to, e.from);
    for (let c = 0; c <= l; c++) {
      if (a.some((f) => f(s)))
        return !0;
      s = n.addDays(s, 1);
    }
  }
  return !1;
}
function Yne(e, t) {
  const { disabled: n, excludeDisabled: r, selected: i, required: o, onSelect: a } = e, [s, l] = Kg(i, a ? i : void 0), c = a ? i : s;
  return {
    selected: c,
    select: (p, m, y) => {
      const { min: g, max: v } = e, x = p ? Hne(p, c, g, v, o, t) : void 0;
      return r && n && (x != null && x.from) && x.to && Gne({ from: x.from, to: x.to }, n, t) && (x.from = p, x.to = void 0), a || l(x), a == null || a(x, p, m, y), x;
    },
    isSelected: (p) => c && Po(c, p, !1, t)
  };
}
function qne(e, t) {
  const { selected: n, required: r, onSelect: i } = e, [o, a] = Kg(n, i ? n : void 0), s = i ? n : o, { isSameDay: l } = t;
  return {
    selected: s,
    select: (d, p, m) => {
      let y = d;
      return !r && s && s && l(d, s) && (y = void 0), i || a(y), i == null || i(y, d, p, m), y;
    },
    isSelected: (d) => s ? l(s, d) : !1
  };
}
function Xne(e, t) {
  const n = qne(e, t), r = Une(e, t), i = Yne(e, t);
  switch (e.mode) {
    case "single":
      return n;
    case "multiple":
      return r;
    case "range":
      return i;
    default:
      return;
  }
}
function Zne(e) {
  const { components: t, formatters: n, labels: r, dateLib: i, locale: o, classNames: a } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    const tt = { ...Hg, ...e.locale };
    return {
      dateLib: new Qo({
        locale: tt,
        weekStartsOn: e.weekStartsOn,
        firstWeekContainsDate: e.firstWeekContainsDate,
        useAdditionalWeekYearTokens: e.useAdditionalWeekYearTokens,
        useAdditionalDayOfYearTokens: e.useAdditionalDayOfYearTokens
      }, e.dateLib),
      components: Jte(e.components),
      formatters: cne(e.formatters),
      labels: { ...Cne, ...e.labels },
      locale: tt,
      classNames: { ...ene(), ...e.classNames }
    };
  }, [
    e.classNames,
    e.components,
    e.dateLib,
    e.firstWeekContainsDate,
    e.formatters,
    e.labels,
    e.locale,
    e.useAdditionalDayOfYearTokens,
    e.useAdditionalWeekYearTokens,
    e.weekStartsOn
  ]), { captionLayout: s, mode: l, onDayBlur: c, onDayClick: f, onDayFocus: d, onDayKeyDown: p, onDayMouseEnter: m, onDayMouseLeave: y, onNextClick: g, onPrevClick: v, showWeekNumber: x, styles: w } = e, { formatCaption: S, formatDay: A, formatMonthDropdown: _, formatWeekNumber: O, formatWeekNumberHeader: P, formatWeekdayName: C, formatYearDropdown: k } = n, I = Bne(e, i), { days: $, months: N, navStart: D, navEnd: j, previousMonth: F, nextMonth: W, goToMonth: z } = I, H = Vne($, e, i), { isSelected: U, select: V, selected: Y } = Xne(e, i) ?? {}, { blur: Q, focused: ne, isFocusTarget: re, moveFocus: ce, setFocused: oe } = zne(e, I, H, U ?? (() => !1), i), { labelDayButton: fe, labelGridcell: ae, labelGrid: ee, labelMonthDropdown: se, labelNav: ge, labelWeekday: X, labelWeekNumber: $e, labelWeekNumberHeader: de, labelYearDropdown: ke } = r, it = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => mne(i, e.ISOWeek, e.timeZone), [i, e.ISOWeek, e.timeZone]), lt = l !== void 0 || f !== void 0, Xn = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    F && (z(F), v == null || v(F));
  }, [F, z, v]), Ie = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    W && (z(W), g == null || g(W));
  }, [z, W, g]), ct = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((tt, Kt) => (St) => {
    St.preventDefault(), St.stopPropagation(), oe(tt), V == null || V(tt.date, Kt, St), f == null || f(tt.date, Kt, St);
  }, [V, f, oe]), Oe = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((tt, Kt) => (St) => {
    oe(tt), d == null || d(tt.date, Kt, St);
  }, [d, oe]), Ge = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((tt, Kt) => (St) => {
    Q(), c == null || c(tt.date, Kt, St);
  }, [Q, c]), Zt = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((tt, Kt) => (St) => {
    const jn = {
      ArrowLeft: ["day", e.dir === "rtl" ? "after" : "before"],
      ArrowRight: ["day", e.dir === "rtl" ? "before" : "after"],
      ArrowDown: ["week", "after"],
      ArrowUp: ["week", "before"],
      PageUp: [St.shiftKey ? "year" : "month", "before"],
      PageDown: [St.shiftKey ? "year" : "month", "after"],
      Home: ["startOfWeek", "before"],
      End: ["endOfWeek", "after"]
    };
    if (jn[St.key]) {
      St.preventDefault(), St.stopPropagation();
      const [qr, lo] = jn[St.key];
      ce(qr, lo);
    }
    p == null || p(tt.date, Kt, St);
  }, [ce, p, e.dir]), mt = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((tt, Kt) => (St) => {
    m == null || m(tt.date, Kt, St);
  }, [m]), en = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((tt, Kt) => (St) => {
    y == null || y(tt.date, Kt, St);
  }, [y]), { className: Yr, style: Cn } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    className: [a[Le.Root], e.className].filter(Boolean).join(" "),
    style: { ...w == null ? void 0 : w[Le.Root], ...e.style }
  }), [a, e.className, e.style, w]), yn = Qte(e), mr = {
    dayPickerProps: e,
    selected: Y,
    select: V,
    isSelected: U,
    months: N,
    nextMonth: W,
    previousMonth: F,
    goToMonth: z,
    getModifiers: H,
    components: t,
    classNames: a,
    styles: w,
    labels: r,
    formatters: n
  };
  return react__WEBPACK_IMPORTED_MODULE_1__.createElement(
    cL.Provider,
    { value: mr },
    react__WEBPACK_IMPORTED_MODULE_1__.createElement(
      t.Root,
      { className: Yr, style: Cn, dir: e.dir, id: e.id, lang: e.lang, nonce: e.nonce, title: e.title, ...yn },
      react__WEBPACK_IMPORTED_MODULE_1__.createElement(
        t.Months,
        { className: a[Le.Months], style: w == null ? void 0 : w[Le.Months] },
        !e.hideNavigation && react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.Nav, { className: a[Le.Nav], style: w == null ? void 0 : w[Le.Nav], "aria-label": ge(), onPreviousClick: Xn, onNextClick: Ie, previousMonth: F, nextMonth: W }),
        N.map((tt, Kt) => {
          const St = (un) => {
            const Pr = Number(un.target.value), fn = i.setMonth(i.startOfMonth(tt.date), Pr);
            z(fn);
          }, jn = (un) => {
            const Pr = i.setYear(i.startOfMonth(tt.date), Number(un.target.value));
            z(Pr);
          }, qr = une(tt.date, D, j, n, i), lo = gne(N[0].date, D, j, n, i);
          return react__WEBPACK_IMPORTED_MODULE_1__.createElement(
            t.Month,
            { className: a[Le.Month], style: w == null ? void 0 : w[Le.Month], key: Kt, displayIndex: Kt, calendarMonth: tt },
            react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.MonthCaption, { className: a[Le.MonthCaption], style: w == null ? void 0 : w[Le.MonthCaption], calendarMonth: tt, displayIndex: Kt }, s != null && s.startsWith("dropdown") ? react__WEBPACK_IMPORTED_MODULE_1__.createElement(
              t.DropdownNav,
              { className: a[Le.Dropdowns], style: w == null ? void 0 : w[Le.Dropdowns] },
              s === "dropdown" || s === "dropdown-months" ? react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.MonthsDropdown, { className: a[Le.MonthsDropdown], "aria-label": se(), classNames: a, components: t, disabled: !!e.disableNavigation, onChange: St, options: qr, style: w == null ? void 0 : w[Le.Dropdown], value: tt.date.getMonth() }) : react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", { role: "status", "aria-live": "polite" }, _(tt.date.getMonth(), o)),
              s === "dropdown" || s === "dropdown-years" ? react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.YearsDropdown, { className: a[Le.YearsDropdown], "aria-label": ke(i.options), classNames: a, components: t, disabled: !!e.disableNavigation, onChange: jn, options: lo, style: w == null ? void 0 : w[Le.Dropdown], value: tt.date.getFullYear() }) : react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", { role: "status", "aria-live": "polite" }, k(tt.date.getFullYear()))
            ) : react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.CaptionLabel, { className: a[Le.CaptionLabel], role: "status", "aria-live": "polite" }, S(tt.date, i.options, i))),
            react__WEBPACK_IMPORTED_MODULE_1__.createElement(
              t.MonthGrid,
              { role: "grid", "aria-multiselectable": l === "multiple" || l === "range", "aria-label": ee(tt.date, i.options, i) || void 0, className: a[Le.MonthGrid], style: w == null ? void 0 : w[Le.MonthGrid] },
              !e.hideWeekdays && react__WEBPACK_IMPORTED_MODULE_1__.createElement(
                t.Weekdays,
                { className: a[Le.Weekdays], style: w == null ? void 0 : w[Le.Weekdays] },
                x && react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.WeekNumberHeader, { "aria-label": de(i.options), className: a[Le.WeekNumberHeader], style: w == null ? void 0 : w[Le.WeekNumberHeader], scope: "col" }, P()),
                it.map((un, Pr) => react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.Weekday, { "aria-label": X(un, i.options, i), className: a[Le.Weekday], key: Pr, style: w == null ? void 0 : w[Le.Weekday], scope: "col" }, C(un, i.options, i)))
              ),
              react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.Weeks, { className: a[Le.Weeks], style: w == null ? void 0 : w[Le.Weeks] }, tt.weeks.map((un, Pr) => react__WEBPACK_IMPORTED_MODULE_1__.createElement(
                t.Week,
                { className: a[Le.Week], key: un.weekNumber, style: w == null ? void 0 : w[Le.Week], week: un },
                x && react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.WeekNumber, { week: un, style: w == null ? void 0 : w[Le.WeekNumber], "aria-label": $e(un.weekNumber, {
                  locale: o
                }), className: a[Le.WeekNumber], scope: "row" }, O(un.weekNumber)),
                un.days.map((fn) => {
                  const { date: Xr } = fn, yt = H(fn);
                  if (yt[Lt.focused] = !yt.hidden && !!(ne != null && ne.isEqualTo(fn)), yt[Ei.selected] = !yt.disabled && ((U == null ? void 0 : U(Xr)) || yt.selected), M_(Y)) {
                    const { from: nu, to: ru } = Y;
                    yt[Ei.range_start] = !!(nu && ru && i.isSameDay(Xr, nu)), yt[Ei.range_end] = !!(nu && ru && i.isSameDay(Xr, ru)), yt[Ei.range_middle] = Po(Y, Xr, !0, i);
                  }
                  const Rd = fne(yt, w, e.modifiersStyles), jd = Ote(yt, a, e.modifiersClassNames), Ey = lt ? void 0 : ae(Xr, yt, i.options, i);
                  return react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.Day, { key: `${i.format(Xr, "yyyy-MM-dd")}_${i.format(fn.displayMonth, "yyyy-MM")}`, day: fn, modifiers: yt, className: jd.join(" "), style: Rd, "aria-hidden": yt.hidden || void 0, "aria-selected": yt.selected || void 0, "aria-label": Ey, "data-day": i.format(Xr, "yyyy-MM-dd"), "data-month": fn.outside ? i.format(Xr, "yyyy-MM") : void 0, "data-selected": yt.selected || void 0, "data-disabled": yt.disabled || void 0, "data-hidden": yt.hidden || void 0, "data-outside": fn.outside || void 0, "data-focused": yt.focused || void 0, "data-today": yt.today || void 0 }, lt ? react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.DayButton, { className: a[Le.DayButton], style: w == null ? void 0 : w[Le.DayButton], type: "button", day: fn, modifiers: yt, disabled: yt.disabled || void 0, tabIndex: re(fn) ? 0 : -1, "aria-label": fe(Xr, yt, i.options, i), onClick: ct(fn, yt), onBlur: Ge(fn, yt), onFocus: Oe(fn, yt), onKeyDown: Zt(fn, yt), onMouseEnter: mt(fn, yt), onMouseLeave: en(fn, yt) }, A(Xr, i.options, i)) : A(fn.date, i.options, i));
                })
              )))
            )
          );
        })
      ),
      e.footer && react__WEBPACK_IMPORTED_MODULE_1__.createElement(t.Footer, { className: a[Le.Footer], style: w == null ? void 0 : w[Le.Footer], role: "status", "aria-live": "polite" }, e.footer)
    )
  );
}
const PE = () => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "bg-icon-interactive h-1 w-1 absolute rounded-full inline-block bottom-0 left-1/2 right-1/2" }), CE = (e) => Fn(e, "E").slice(0, 1), Jne = (e, t = 24) => Array.from({ length: t }, (n, r) => e + r), EE = (e) => {
  if (e === "multiple")
    return [];
  if (e === "range")
    return { from: void 0, to: void 0 };
}, Cb = ({
  width: e,
  className: t,
  // Renamed to avoid shadowing
  classNames: n,
  selectedDates: r,
  setSelectedDates: i,
  showOutsideDays: o = !0,
  mode: a = "single",
  variant: s = "normal",
  alignment: l = "horizontal",
  numberOfMonths: c,
  disabled: f,
  ...d
}) => {
  const p = react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(d.footer) || typeof d.footer == "function", [m, y] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [g, v] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [x, w] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((/* @__PURE__ */ new Date()).getFullYear()), [S, A] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(
    x - x % 24
  );
  r === void 0 && (a === "multiple" ? r = [] : a === "range" ? r = { from: void 0, to: void 0 } : r = void 0);
  function _($) {
    const { goToMonth: N, nextMonth: D, previousMonth: j } = Wc(), F = Fn(
      $.calendarMonth.date,
      "yyyy"
    ), W = Fn($.calendarMonth.date, "MMMM"), z = new Date($.calendarMonth.date);
    z.setDate(z.getDate() - z.getDay());
    const H = Array.from({ length: 7 }, (ne, re) => {
      const ce = new Date(z);
      return ce.setDate(z.getDate() + re), CE(ce);
    }), U = () => {
      if (g)
        A(S - 24);
      else if (m) {
        const ne = new Date(
          x - 1,
          $.calendarMonth.date.getMonth()
        );
        w(ne.getFullYear()), N(ne);
      } else
        N(j);
    }, V = () => {
      if (g)
        A(S + 24);
      else if (m) {
        const ne = new Date(
          x + 1,
          $.calendarMonth.date.getMonth()
        );
        w(ne.getFullYear()), N(ne);
      } else
        N(D);
    }, Y = (ne) => {
      w(ne), v(!1), y(!0), N(
        new Date(
          ne,
          $.calendarMonth.date.getMonth()
        )
      );
    };
    let Q;
    return g ? Q = `${S} - ${S + 23}` : m ? Q = F : Q = `${W} ${F}`, /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Hn,
          {
            variant: "ghost",
            onClick: U,
            className: "bg-background-primary border-none cursor-pointer",
            "aria-label": "Previous Button",
            icon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(eD, { className: "h-4 w-4 text-button-tertiary-color" })
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Hn,
          {
            variant: "ghost",
            onClick: () => {
              c > 1 || (m ? (v(!0), y(!1)) : g ? v(!1) : y(!m));
            },
            children: Q
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Hn,
          {
            variant: "ghost",
            onClick: V,
            className: "bg-background-primary border-none cursor-pointer",
            "aria-label": "Next Button",
            icon: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Zw, { className: "h-4 w-4 text-button-tertiary-color" })
          }
        )
      ] }),
      g && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-4 w-full", children: Jne(S).map((ne) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
        Hn,
        {
          variant: "ghost",
          onClick: () => Y(ne),
          className: K(
            "h-10 w-full text-center font-normal relative",
            ne === x && ne !== (/* @__PURE__ */ new Date()).getFullYear() && "bg-background-brand text-text-on-color hover:bg-background-brand hover:text-black",
            ne === (/* @__PURE__ */ new Date()).getFullYear() && "font-semibold"
          ),
          children: [
            ne,
            ne === (/* @__PURE__ */ new Date()).getFullYear() && PE()
          ]
        },
        ne
      )) }),
      m && !g && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-4 gap-2 my-12", children: Array.from({ length: 12 }, (ne, re) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
        Hn,
        {
          variant: "ghost",
          onClick: () => {
            y(!1), N(
              new Date(x, re)
            );
          },
          className: K(
            "px-1.5 py-2 h-10 w-[4.375rem] text-center font-normal relative",
            re === $.calendarMonth.date.getMonth() && re !== (/* @__PURE__ */ new Date()).getMonth() && x === $.calendarMonth.date.getFullYear() && $.calendarMonth.date.getFullYear() !== (/* @__PURE__ */ new Date()).getFullYear() && "bg-background-brand text-text-on-color hover:bg-background-brand hover:text-black",
            re === (/* @__PURE__ */ new Date()).getMonth() && (/* @__PURE__ */ new Date()).getFullYear() === x && "font-semibold"
          ),
          children: [
            Fn(new Date(0, re), "MMM"),
            (/* @__PURE__ */ new Date()).getMonth() === re && (/* @__PURE__ */ new Date()).getFullYear() === x && PE()
          ]
        },
        re
      )) }),
      !m && !g && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(O, { weekdays: H })
    ] });
  }
  const O = ({ weekdays: $ }) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-between", children: $.map((N, D) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "button",
    {
      className: "h-10 w-10 px-1.5 py-2 text-center text-text-secondary text-sm font-normal content-center bg-transparent border-none shrink-0",
      children: N
    },
    D
  )) }), P = ({
    day: $,
    modifiers: N,
    ...D
  }) => {
    const {
      selected: j,
      today: F,
      disabled: W,
      outside: z,
      range_middle: H,
      range_start: U,
      range_end: V
    } = N, Y = U || V || H, Q = /* @__PURE__ */ new Date(), ne = r == null ? void 0 : r.to, re = Fn($.displayMonth, "yyyy-MM") === Fn(Q, "yyyy-MM"), ce = ne && Fn(ne, "yyyy-MM") === Fn($.date, "yyyy-MM"), oe = Ste(Q, 1), fe = Fn($.date, "yyyy-MM") === Fn(oe, "yyyy-MM"), ae = re || ce || Y, ee = !o && z, ge = K(
      "h-10 w-10 flex items-center justify-center transition text-text-secondary relative text-sm",
      "border-none rounded",
      (j || Y) && !z ? "bg-background-brand text-text-on-color" : "bg-transparent hover:bg-button-tertiary-hover",
      H && ae && !z ? "bg-brand-background-50 text-text-secondary rounded-none" : "",
      W ? "opacity-50 cursor-not-allowed text-text-disabled" : "cursor-pointer",
      z && !Y || !ae && z || z && !fe || z ? "bg-transparent opacity-50 text-text-disabled cursor-auto" : ""
    ), X = (ke) => {
      typeof D.onMouseEnter == "function" && D.onMouseEnter(ke), ke.currentTarget.setAttribute("data-hover", "true");
    }, $e = (ke) => {
      typeof D.onMouseLeave == "function" && D.onMouseLeave(ke), ke.currentTarget.setAttribute("data-hover", "false");
    }, de = (ke) => {
      typeof D.onClick == "function" && D.onClick(ke);
    };
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "button",
      {
        className: K(
          ge,
          F && "font-semibold",
          ee && "opacity-0",
          U && "fui-range-start",
          V && "fui-range-end",
          H && "fui-range-middle",
          {
            "[&:is([data-hover=true])]:bg-brand-background-50 [&:is([data-hover=true])]:rounded-none": !Y && !j
          }
        ),
        disabled: W || z,
        onClick: de,
        onMouseEnter: X,
        onMouseLeave: $e,
        "aria-label": Fn($.date, "EEEE, MMMM do, yyyy"),
        "data-selected": j,
        "data-day": Fn($.date, "yyyy-MM-dd"),
        children: [
          (!ee || Y && ae) && D.children,
          F && ae && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute h-1 w-1 bg-background-brand rounded-full bottom-1" })
        ]
      }
    );
  }, C = ($) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-col bsf-force-ui-month-weeks", children: $.children[1].props.children.map(
    (N, D) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      "div",
      {
        className: "flex flex-row justify-between",
        children: N
      },
      D
    )
  ) }), k = ($, N) => {
    if (a === "range") {
      const D = r;
      if (!(D != null && D.from) && !(D != null && D.to) || D != null && D.from && (D != null && D.to)) {
        if (D.from && bE(N, D == null ? void 0 : D.from) || D.to && bE(N, D == null ? void 0 : D.to)) {
          i({ from: void 0, to: void 0 });
          return;
        }
        i({ from: N, to: void 0 });
        return;
      }
      if (D != null && D.from && !(D != null && D.to)) {
        if (N < D.from) {
          i({
            from: N,
            to: D.from
          });
          return;
        }
        i({
          from: D.from,
          to: N
        });
        return;
      }
      i($);
    } else a === "multiple" ? r.some(
      (D) => Fn(D, "yyyy-MM-dd") === Fn(N, "yyyy-MM-dd")
    ) ? i(
      r.filter(
        (D) => Fn(D, "yyyy-MM-dd") !== Fn(N, "yyyy-MM-dd")
      )
    ) : i([...r, N]) : a === "single" && i($);
  }, I = K(
    "relative bg-background-primary shadow-datepicker-wrapper",
    e,
    l === "vertical" ? "flex flex-col" : "flex flex-row  gap-3",
    s === "normal" ? "rounded-tr-md rounded-tl-md border border-solid border-border-subtle" : "",
    s === "presets" ? "rounded-tr-md border border-solid border-border-subtle" : "",
    s === "dualdate" ? "rounded-tr-md rounded-tl-md border border-solid border-border-subtle" : "",
    p ? "rounded-b-none" : "rounded-bl-md rounded-br-md"
  );
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Zne,
    {
      mode: a,
      selected: r,
      onSelect: k,
      hideNavigation: !0,
      captionLayout: "label",
      className: K(t),
      formatters: {
        formatWeekdayName: CE
      },
      classNames: {
        months: I,
        month: "flex flex-col p-2 gap-1 text-center w-full",
        caption: "relative flex justify-center items-center",
        table: "w-full border-separate border-spacing-0",
        head_row: "flex mb-1",
        head_cell: "text-muted-foreground rounded-md w-10 font-normal text-sm",
        row: "flex w-full mt-2",
        cell: "h-10 w-10 text-center text-sm p-0 relative",
        ...n
      },
      numberOfMonths: c,
      components: {
        MonthCaption: _,
        DayButton: P,
        Day: ($) => {
          const N = Object.entries(
            $
          ).reduce(
            (D, [j, F]) => (j.startsWith("data-") && (D[j] = F), D),
            {}
          );
          return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            "div",
            {
              ...N,
              className: K(
                $.className,
                "inline-flex"
              ),
              children: $.children
            }
          );
        },
        Weekdays: () => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {}),
        Week: ($) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "div",
          {
            className: K(
              "bsf-force-ui-month-week flex flex-row",
              $.className
            ),
            children: $.children
          }
        ),
        Months: ($) => {
          var N;
          return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            "div",
            {
              className: K(
                "bsf-force-ui-date-picker-month",
                I
              ),
              children: (N = $ == null ? void 0 : $.children) == null ? void 0 : N.map((D, j) => D ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, { children: D.map((F, W) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
                react__WEBPACK_IMPORTED_MODULE_1__.Fragment,
                {
                  children: [
                    W > 0 && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "border border-solid border-border-subtle border-l-0" }),
                    F
                  ]
                },
                W
              )) }, j) : null)
            }
          ) });
        },
        MonthGrid: ($) => !m && !g ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(C, { ...$ }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {})
      },
      ...a === "range" ? { required: !1 } : {},
      ...d,
      onDayMouseEnter: ($, N, D) => {
        var oe;
        if (a !== "range")
          return;
        const j = r;
        if (j != null && j.from && (j != null && j.to) || !(j != null && j.from) && !(j != null && j.to)) {
          Array.from(
            document.querySelectorAll("[data-hover]")
          ).forEach((ae) => {
            ae.setAttribute("data-hover", "false");
          });
          return;
        }
        const F = D.target, W = new Date(
          F.dataset.day
        ), z = dx(
          W,
          j.from
        ), H = fx(
          W,
          j.to
        );
        let U;
        switch (s) {
          case "dualdate":
          case "presets":
            U = F.closest(
              ".bsf-force-ui-date-picker-month"
            );
            break;
          case "normal":
          default:
            U = F.closest(
              ".bsf-force-ui-month-weeks"
            );
            break;
        }
        const V = Array.from(
          U.querySelectorAll("button")
        );
        H && V.sort(
          (fe, ae) => fx(
            new Date(fe.dataset.day),
            new Date(ae.dataset.day)
          ) ? -1 : 1
        ), z && V.sort(
          (fe, ae) => dx(
            new Date(fe.dataset.day),
            new Date(ae.dataset.day)
          ) ? 1 : -1
        );
        const Y = V.indexOf(F), Q = V.findIndex(
          (fe) => fe.getAttribute("data-selected") === "true"
        ), ne = [], re = Math.min(Y, Q), ce = Math.max(Y, Q);
        for (let fe = re; fe <= ce; fe++)
          (oe = V[fe]) != null && oe.disabled || ne.push(V[fe]);
        V.forEach((fe) => {
          fe.setAttribute(
            "data-hover",
            ne.includes(fe) ? "true" : "false"
          );
        });
      },
      disabled: f
    }
  ) });
}, oke = ({
  selectionType: e = "single",
  variant: t = "normal",
  presets: n = [],
  onCancel: r,
  onApply: i,
  onDateSelect: o,
  applyButtonText: a = "Apply",
  cancelButtonText: s = "Cancel",
  showOutsideDays: l = !0,
  isFooter: c = !0,
  selected: f,
  disabled: d,
  ...p
}) => {
  const [m, y] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => {
    if (!f)
      return EE(e);
    const _ = e === "multiple" && Array.isArray(f), O = e === "range" && "from" in f && "to" in f, P = e === "single" && f instanceof Date;
    return _ || O || P ? f : EE(e);
  }), g = (_) => {
    y(_), o && o(_);
  }, v = [
    {
      label: "Today",
      range: { from: wE(), to: wE() }
    },
    {
      label: "Yesterday",
      range: { from: _E(), to: _E() }
    },
    {
      label: "This Week",
      range: {
        from: Ws(/* @__PURE__ */ new Date(), { weekStartsOn: 1 }),
        to: k_(/* @__PURE__ */ new Date(), { weekStartsOn: 1 })
      }
    },
    {
      label: "Last 7 Days",
      range: {
        from: Wi(xE(/* @__PURE__ */ new Date(), 6)),
        to: Wi(/* @__PURE__ */ new Date())
      }
    },
    {
      label: "This Month",
      range: {
        from: rL(/* @__PURE__ */ new Date()),
        to: nL(/* @__PURE__ */ new Date())
      }
    },
    {
      label: "Last 30 Days",
      range: {
        from: Wi(xE(/* @__PURE__ */ new Date(), 29)),
        to: Wi(/* @__PURE__ */ new Date())
      }
    }
  ], x = n.length > 0 ? n : v, w = (_) => {
    y(_);
  }, S = () => {
    y(
      e === "multiple" ? [] : { from: void 0, to: void 0 }
    ), r && r();
  }, A = () => {
    i && i(m);
  };
  if (t === "normal")
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Cb,
      {
        ...p,
        mode: e,
        variant: t,
        width: "w-[18.5rem]",
        selectedDates: m,
        showOutsideDays: l,
        setSelectedDates: g,
        footer: c && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex bg-background-primary justify-end p-2 gap-3 border border-solid border-border-subtle border-t-0 rounded-md rounded-tl-none rounded-tr-none", children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            Hn,
            {
              variant: "outline",
              onClick: S,
              children: s
            }
          ),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hn, { onClick: A, children: a })
        ] }),
        disabled: d
      }
    );
  if (t === "dualdate")
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Cb,
      {
        mode: e,
        numberOfMonths: 2,
        alignment: "horizontal",
        selectedDates: m,
        setSelectedDates: g,
        showOutsideDays: l,
        variant: t,
        width: "w-auto",
        footer: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex bg-background-primary justify-end p-2 gap-3 border border-solid border-border-subtle border-t-0 rounded-md rounded-tl-none rounded-tr-none", children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hn, { variant: "outline", onClick: S, children: s }),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hn, { onClick: A, children: a })
        ] }),
        disabled: d,
        ...p
      }
    );
  if (t === "presets")
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-row shadow-datepicker-wrapper", children: [
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-col gap-1 p-3 items-start border border-solid border-border-subtle border-r-0 rounded-tl-md rounded-bl-md bg-background-primary", children: x.map((_, O) => {
        var C, k;
        const P = m && "from" in m && "to" in m && ((C = m.from) == null ? void 0 : C.getTime()) === _.range.from.getTime() && ((k = m.to) == null ? void 0 : k.getTime()) === _.range.to.getTime();
        return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Hn,
          {
            onClick: () => w(_.range),
            variant: "ghost",
            className: K(
              "text-left font-medium text-sm text-nowrap w-full",
              P && "bg-brand-background-50"
            ),
            children: _.label
          },
          O
        );
      }) }),
      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
        Cb,
        {
          ...p,
          mode: e,
          selectedDates: m,
          setSelectedDates: g,
          variant: t,
          showOutsideDays: l,
          width: "w-auto",
          numberOfMonths: 2,
          footer: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-end p-2 gap-3 border-l border-r border-t-0 border-b border-solid border-border-subtle bg-background-primary rounded-br-md", children: [
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              Hn,
              {
                variant: "outline",
                onClick: S,
                children: s
              }
            ),
            /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Hn, { onClick: A, children: a })
          ] }),
          disabled: d
        }
      )
    ] });
}, _L = ({
  type: e = "simple",
  defaultValue: t = [],
  autoClose: n = !1,
  disabled: r = !1,
  children: i,
  className: o
}) => {
  const [a, s] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(
    Array.isArray(t) ? t : [t]
  ), l = (f) => {
    s((d) => n ? d.includes(f) ? [] : [f] : d.includes(f) ? d.filter((p) => p !== f) : [...d, f]);
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K(e === "boxed" ? "space-y-3" : "", o), children: react__WEBPACK_IMPORTED_MODULE_1__.Children.map(i, (f) => react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(f) && "value" in f.props ? react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(
    f,
    {
      isOpen: a.includes(f.props.value),
      onToggle: () => l(f.props.value),
      type: e,
      disabled: r || f.props.disabled
    }
  ) : f) });
};
_L.displayName = "Accordion";
const SL = ({
  isOpen: e,
  onToggle: t,
  type: n = "simple",
  disabled: r = !1,
  children: i,
  className: o
}) => {
  const a = {
    simple: "border-0",
    separator: "border-0 border-b border-solid border-border-subtle",
    boxed: "border border-solid border-border-subtle rounded-md"
  }[n];
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K(a, o), children: react__WEBPACK_IMPORTED_MODULE_1__.Children.map(
    i,
    (s) => react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(s) ? react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(s, {
      isOpen: e,
      onToggle: t,
      type: n,
      disabled: r
    }) : s
  ) });
};
SL.displayName = "Accordion.Item";
const OL = ({
  onToggle: e,
  isOpen: t,
  iconType: n = "arrow",
  // arrow, plus-minus
  disabled: r = !1,
  tag: i = "h3",
  type: o = "simple",
  children: a,
  className: s,
  ...l
}) => {
  const c = {
    simple: "px-2 py-3",
    separator: "px-2 py-4",
    boxed: "px-3 py-4"
  }[o], f = () => n === "arrow" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Xw,
    {
      className: K(
        "flex-shrink-0 text-icon-secondary size-5 transition-transform duration-300 ease-in-out",
        t ? "rotate-180" : "rotate-0"
      )
    }
  ) : n === "plus-minus" ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    An.span,
    {
      initial: { opacity: 0, rotate: t ? -180 : 0 },
      animate: { opacity: 1, rotate: t ? 0 : 180 },
      exit: { opacity: 0 },
      transition: { duration: 0.3, ease: "easeInOut" },
      className: "flex items-center flex-shrink-0 text-icon-secondary",
      children: t ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(tD, {}) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(nD, {})
    },
    t ? "minus" : "plus"
  ) : null;
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(i, { className: "flex m-0 hover:bg-background-secondary transition duration-150 ease-in-out", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    "button",
    {
      className: K(
        "flex w-full items-center justify-between text-sm font-medium transition-all appearance-none bg-transparent border-0 cursor-pointer gap-3",
        c,
        r && "cursor-not-allowed opacity-40",
        s
      ),
      onClick: r ? () => {
      } : e,
      "aria-expanded": t,
      disabled: r,
      ...l,
      children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-2 text-text-primary font-semibold text-left", children: a }),
        f()
      ]
    }
  ) });
};
OL.displayName = "Accordion.Trigger";
const AL = ({
  isOpen: e,
  disabled: t = !1,
  type: n = "simple",
  children: r,
  className: i
}) => {
  const o = {
    open: { height: "auto", opacity: 1 },
    closed: { height: 0, opacity: 0 }
  }, a = {
    simple: "px-2 pb-3",
    separator: "px-2 pb-4",
    boxed: "px-3 pb-4"
  }[n];
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ys, { initial: !1, children: e && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    An.div,
    {
      variants: o,
      initial: "closed",
      animate: "open",
      exit: "closed",
      transition: { duration: 0.3, ease: "easeInOut" },
      className: K(
        "overflow-hidden text-text-secondary w-full text-sm transition-[height, opacity, transform] ease-in box-border",
        t && "opacity-40",
        i
      ),
      "aria-hidden": !e,
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K(a), children: r })
    },
    "content"
  ) });
};
AL.displayName = "Accordion.Content";
const ake = Object.assign(_L, {
  Item: SL,
  Trigger: OL,
  Content: AL
});
var Qne = Array.isArray, Tr = Qne, ere = typeof _commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.c == "object" && _commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.c && _commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.c.Object === Object && _commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.c, TL = ere, tre = TL, nre = typeof self == "object" && self && self.Object === Object && self, rre = tre || nre || Function("return this")(), ao = rre, ire = ao, ore = ire.Symbol, Td = ore, kE = Td, PL = Object.prototype, are = PL.hasOwnProperty, sre = PL.toString, Pu = kE ? kE.toStringTag : void 0;
function lre(e) {
  var t = are.call(e, Pu), n = e[Pu];
  try {
    e[Pu] = void 0;
    var r = !0;
  } catch {
  }
  var i = sre.call(e);
  return r && (t ? e[Pu] = n : delete e[Pu]), i;
}
var cre = lre, ure = Object.prototype, fre = ure.toString;
function dre(e) {
  return fre.call(e);
}
var hre = dre, ME = Td, pre = cre, mre = hre, gre = "[object Null]", yre = "[object Undefined]", NE = ME ? ME.toStringTag : void 0;
function vre(e) {
  return e == null ? e === void 0 ? yre : gre : NE && NE in Object(e) ? pre(e) : mre(e);
}
var ea = vre;
function bre(e) {
  return e != null && typeof e == "object";
}
var ta = bre, xre = ea, wre = ta, _re = "[object Symbol]";
function Sre(e) {
  return typeof e == "symbol" || wre(e) && xre(e) == _re;
}
var zc = Sre, Ore = Tr, Are = zc, Tre = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Pre = /^\w*$/;
function Cre(e, t) {
  if (Ore(e))
    return !1;
  var n = typeof e;
  return n == "number" || n == "symbol" || n == "boolean" || e == null || Are(e) ? !0 : Pre.test(e) || !Tre.test(e) || t != null && e in Object(t);
}
var N_ = Cre;
function Ere(e) {
  var t = typeof e;
  return e != null && (t == "object" || t == "function");
}
var Ka = Ere;
const Vc = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(Ka);
var kre = ea, Mre = Ka, Nre = "[object AsyncFunction]", $re = "[object Function]", Dre = "[object GeneratorFunction]", Ire = "[object Proxy]";
function Rre(e) {
  if (!Mre(e))
    return !1;
  var t = kre(e);
  return t == $re || t == Dre || t == Nre || t == Ire;
}
var $_ = Rre;
const ze = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)($_);
var jre = ao, Lre = jre["__core-js_shared__"], Bre = Lre, Eb = Bre, $E = function() {
  var e = /[^.]+$/.exec(Eb && Eb.keys && Eb.keys.IE_PROTO || "");
  return e ? "Symbol(src)_1." + e : "";
}();
function Fre(e) {
  return !!$E && $E in e;
}
var Wre = Fre, zre = Function.prototype, Vre = zre.toString;
function Ure(e) {
  if (e != null) {
    try {
      return Vre.call(e);
    } catch {
    }
    try {
      return e + "";
    } catch {
    }
  }
  return "";
}
var CL = Ure, Hre = $_, Kre = Wre, Gre = Ka, Yre = CL, qre = /[\\^$.*+?()[\]{}|]/g, Xre = /^\[object .+?Constructor\]$/, Zre = Function.prototype, Jre = Object.prototype, Qre = Zre.toString, eie = Jre.hasOwnProperty, tie = RegExp(
  "^" + Qre.call(eie).replace(qre, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function nie(e) {
  if (!Gre(e) || Kre(e))
    return !1;
  var t = Hre(e) ? tie : Xre;
  return t.test(Yre(e));
}
var rie = nie;
function iie(e, t) {
  return e == null ? void 0 : e[t];
}
var oie = iie, aie = rie, sie = oie;
function lie(e, t) {
  var n = sie(e, t);
  return aie(n) ? n : void 0;
}
var el = lie, cie = el, uie = cie(Object, "create"), Gg = uie, DE = Gg;
function fie() {
  this.__data__ = DE ? DE(null) : {}, this.size = 0;
}
var die = fie;
function hie(e) {
  var t = this.has(e) && delete this.__data__[e];
  return this.size -= t ? 1 : 0, t;
}
var pie = hie, mie = Gg, gie = "__lodash_hash_undefined__", yie = Object.prototype, vie = yie.hasOwnProperty;
function bie(e) {
  var t = this.__data__;
  if (mie) {
    var n = t[e];
    return n === gie ? void 0 : n;
  }
  return vie.call(t, e) ? t[e] : void 0;
}
var xie = bie, wie = Gg, _ie = Object.prototype, Sie = _ie.hasOwnProperty;
function Oie(e) {
  var t = this.__data__;
  return wie ? t[e] !== void 0 : Sie.call(t, e);
}
var Aie = Oie, Tie = Gg, Pie = "__lodash_hash_undefined__";
function Cie(e, t) {
  var n = this.__data__;
  return this.size += this.has(e) ? 0 : 1, n[e] = Tie && t === void 0 ? Pie : t, this;
}
var Eie = Cie, kie = die, Mie = pie, Nie = xie, $ie = Aie, Die = Eie;
function Uc(e) {
  var t = -1, n = e == null ? 0 : e.length;
  for (this.clear(); ++t < n; ) {
    var r = e[t];
    this.set(r[0], r[1]);
  }
}
Uc.prototype.clear = kie;
Uc.prototype.delete = Mie;
Uc.prototype.get = Nie;
Uc.prototype.has = $ie;
Uc.prototype.set = Die;
var Iie = Uc;
function Rie() {
  this.__data__ = [], this.size = 0;
}
var jie = Rie;
function Lie(e, t) {
  return e === t || e !== e && t !== t;
}
var D_ = Lie, Bie = D_;
function Fie(e, t) {
  for (var n = e.length; n--; )
    if (Bie(e[n][0], t))
      return n;
  return -1;
}
var Yg = Fie, Wie = Yg, zie = Array.prototype, Vie = zie.splice;
function Uie(e) {
  var t = this.__data__, n = Wie(t, e);
  if (n < 0)
    return !1;
  var r = t.length - 1;
  return n == r ? t.pop() : Vie.call(t, n, 1), --this.size, !0;
}
var Hie = Uie, Kie = Yg;
function Gie(e) {
  var t = this.__data__, n = Kie(t, e);
  return n < 0 ? void 0 : t[n][1];
}
var Yie = Gie, qie = Yg;
function Xie(e) {
  return qie(this.__data__, e) > -1;
}
var Zie = Xie, Jie = Yg;
function Qie(e, t) {
  var n = this.__data__, r = Jie(n, e);
  return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this;
}
var eoe = Qie, toe = jie, noe = Hie, roe = Yie, ioe = Zie, ooe = eoe;
function Hc(e) {
  var t = -1, n = e == null ? 0 : e.length;
  for (this.clear(); ++t < n; ) {
    var r = e[t];
    this.set(r[0], r[1]);
  }
}
Hc.prototype.clear = toe;
Hc.prototype.delete = noe;
Hc.prototype.get = roe;
Hc.prototype.has = ioe;
Hc.prototype.set = ooe;
var qg = Hc, aoe = el, soe = ao, loe = aoe(soe, "Map"), I_ = loe, IE = Iie, coe = qg, uoe = I_;
function foe() {
  this.size = 0, this.__data__ = {
    hash: new IE(),
    map: new (uoe || coe)(),
    string: new IE()
  };
}
var doe = foe;
function hoe(e) {
  var t = typeof e;
  return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
}
var poe = hoe, moe = poe;
function goe(e, t) {
  var n = e.__data__;
  return moe(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
}
var Xg = goe, yoe = Xg;
function voe(e) {
  var t = yoe(this, e).delete(e);
  return this.size -= t ? 1 : 0, t;
}
var boe = voe, xoe = Xg;
function woe(e) {
  return xoe(this, e).get(e);
}
var _oe = woe, Soe = Xg;
function Ooe(e) {
  return Soe(this, e).has(e);
}
var Aoe = Ooe, Toe = Xg;
function Poe(e, t) {
  var n = Toe(this, e), r = n.size;
  return n.set(e, t), this.size += n.size == r ? 0 : 1, this;
}
var Coe = Poe, Eoe = doe, koe = boe, Moe = _oe, Noe = Aoe, $oe = Coe;
function Kc(e) {
  var t = -1, n = e == null ? 0 : e.length;
  for (this.clear(); ++t < n; ) {
    var r = e[t];
    this.set(r[0], r[1]);
  }
}
Kc.prototype.clear = Eoe;
Kc.prototype.delete = koe;
Kc.prototype.get = Moe;
Kc.prototype.has = Noe;
Kc.prototype.set = $oe;
var R_ = Kc, EL = R_, Doe = "Expected a function";
function j_(e, t) {
  if (typeof e != "function" || t != null && typeof t != "function")
    throw new TypeError(Doe);
  var n = function() {
    var r = arguments, i = t ? t.apply(this, r) : r[0], o = n.cache;
    if (o.has(i))
      return o.get(i);
    var a = e.apply(this, r);
    return n.cache = o.set(i, a) || o, a;
  };
  return n.cache = new (j_.Cache || EL)(), n;
}
j_.Cache = EL;
var kL = j_;
const Ioe = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(kL);
var Roe = kL, joe = 500;
function Loe(e) {
  var t = Roe(e, function(r) {
    return n.size === joe && n.clear(), r;
  }), n = t.cache;
  return t;
}
var Boe = Loe, Foe = Boe, Woe = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, zoe = /\\(\\)?/g, Voe = Foe(function(e) {
  var t = [];
  return e.charCodeAt(0) === 46 && t.push(""), e.replace(Woe, function(n, r, i, o) {
    t.push(i ? o.replace(zoe, "$1") : r || n);
  }), t;
}), Uoe = Voe;
function Hoe(e, t) {
  for (var n = -1, r = e == null ? 0 : e.length, i = Array(r); ++n < r; )
    i[n] = t(e[n], n, e);
  return i;
}
var L_ = Hoe, RE = Td, Koe = L_, Goe = Tr, Yoe = zc, qoe = 1 / 0, jE = RE ? RE.prototype : void 0, LE = jE ? jE.toString : void 0;
function ML(e) {
  if (typeof e == "string")
    return e;
  if (Goe(e))
    return Koe(e, ML) + "";
  if (Yoe(e))
    return LE ? LE.call(e) : "";
  var t = e + "";
  return t == "0" && 1 / e == -qoe ? "-0" : t;
}
var Xoe = ML, Zoe = Xoe;
function Joe(e) {
  return e == null ? "" : Zoe(e);
}
var NL = Joe, Qoe = Tr, eae = N_, tae = Uoe, nae = NL;
function rae(e, t) {
  return Qoe(e) ? e : eae(e, t) ? [e] : tae(nae(e));
}
var $L = rae, iae = zc, oae = 1 / 0;
function aae(e) {
  if (typeof e == "string" || iae(e))
    return e;
  var t = e + "";
  return t == "0" && 1 / e == -oae ? "-0" : t;
}
var Zg = aae, sae = $L, lae = Zg;
function cae(e, t) {
  t = sae(t, e);
  for (var n = 0, r = t.length; e != null && n < r; )
    e = e[lae(t[n++])];
  return n && n == r ? e : void 0;
}
var B_ = cae, uae = B_;
function fae(e, t, n) {
  var r = e == null ? void 0 : uae(e, t);
  return r === void 0 ? n : r;
}
var DL = fae;
const zr = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(DL);
function dae(e) {
  return e == null;
}
var hae = dae;
const Ue = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(hae);
var pae = ea, mae = Tr, gae = ta, yae = "[object String]";
function vae(e) {
  return typeof e == "string" || !mae(e) && gae(e) && pae(e) == yae;
}
var bae = vae;
const Pd = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(bae);
var mx = { exports: {} }, bt = {};
/**
 * @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 BE;
function xae() {
  if (BE) return bt;
  BE = 1;
  var e = Symbol.for("react.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), a = Symbol.for("react.context"), s = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), y;
  y = Symbol.for("react.module.reference");
  function g(v) {
    if (typeof v == "object" && v !== null) {
      var x = v.$$typeof;
      switch (x) {
        case e:
          switch (v = v.type, v) {
            case n:
            case i:
            case r:
            case c:
            case f:
              return v;
            default:
              switch (v = v && v.$$typeof, v) {
                case s:
                case a:
                case l:
                case p:
                case d:
                case o:
                  return v;
                default:
                  return x;
              }
          }
        case t:
          return x;
      }
    }
  }
  return bt.ContextConsumer = a, bt.ContextProvider = o, bt.Element = e, bt.ForwardRef = l, bt.Fragment = n, bt.Lazy = p, bt.Memo = d, bt.Portal = t, bt.Profiler = i, bt.StrictMode = r, bt.Suspense = c, bt.SuspenseList = f, bt.isAsyncMode = function() {
    return !1;
  }, bt.isConcurrentMode = function() {
    return !1;
  }, bt.isContextConsumer = function(v) {
    return g(v) === a;
  }, bt.isContextProvider = function(v) {
    return g(v) === o;
  }, bt.isElement = function(v) {
    return typeof v == "object" && v !== null && v.$$typeof === e;
  }, bt.isForwardRef = function(v) {
    return g(v) === l;
  }, bt.isFragment = function(v) {
    return g(v) === n;
  }, bt.isLazy = function(v) {
    return g(v) === p;
  }, bt.isMemo = function(v) {
    return g(v) === d;
  }, bt.isPortal = function(v) {
    return g(v) === t;
  }, bt.isProfiler = function(v) {
    return g(v) === i;
  }, bt.isStrictMode = function(v) {
    return g(v) === r;
  }, bt.isSuspense = function(v) {
    return g(v) === c;
  }, bt.isSuspenseList = function(v) {
    return g(v) === f;
  }, bt.isValidElementType = function(v) {
    return typeof v == "string" || typeof v == "function" || v === n || v === i || v === r || v === c || v === f || v === m || typeof v == "object" && v !== null && (v.$$typeof === p || v.$$typeof === d || v.$$typeof === o || v.$$typeof === a || v.$$typeof === l || v.$$typeof === y || v.getModuleId !== void 0);
  }, bt.typeOf = g, bt;
}
var xt = {};
/**
 * @license React
 * react-is.development.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 FE;
function wae() {
  return FE || (FE = 1,  true && function() {
    var e = Symbol.for("react.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), a = Symbol.for("react.context"), s = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), y = !1, g = !1, v = !1, x = !1, w = !1, S;
    S = Symbol.for("react.module.reference");
    function A(de) {
      return !!(typeof de == "string" || typeof de == "function" || de === n || de === i || w || de === r || de === c || de === f || x || de === m || y || g || v || typeof de == "object" && de !== null && (de.$$typeof === p || de.$$typeof === d || de.$$typeof === o || de.$$typeof === a || de.$$typeof === l || // This needs to include all possible module reference object
      // types supported by any Flight configuration anywhere since
      // we don't know which Flight build this will end up being used
      // with.
      de.$$typeof === S || de.getModuleId !== void 0));
    }
    function _(de) {
      if (typeof de == "object" && de !== null) {
        var ke = de.$$typeof;
        switch (ke) {
          case e:
            var it = de.type;
            switch (it) {
              case n:
              case i:
              case r:
              case c:
              case f:
                return it;
              default:
                var lt = it && it.$$typeof;
                switch (lt) {
                  case s:
                  case a:
                  case l:
                  case p:
                  case d:
                  case o:
                    return lt;
                  default:
                    return ke;
                }
            }
          case t:
            return ke;
        }
      }
    }
    var O = a, P = o, C = e, k = l, I = n, $ = p, N = d, D = t, j = i, F = r, W = c, z = f, H = !1, U = !1;
    function V(de) {
      return H || (H = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")), !1;
    }
    function Y(de) {
      return U || (U = !0, console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")), !1;
    }
    function Q(de) {
      return _(de) === a;
    }
    function ne(de) {
      return _(de) === o;
    }
    function re(de) {
      return typeof de == "object" && de !== null && de.$$typeof === e;
    }
    function ce(de) {
      return _(de) === l;
    }
    function oe(de) {
      return _(de) === n;
    }
    function fe(de) {
      return _(de) === p;
    }
    function ae(de) {
      return _(de) === d;
    }
    function ee(de) {
      return _(de) === t;
    }
    function se(de) {
      return _(de) === i;
    }
    function ge(de) {
      return _(de) === r;
    }
    function X(de) {
      return _(de) === c;
    }
    function $e(de) {
      return _(de) === f;
    }
    xt.ContextConsumer = O, xt.ContextProvider = P, xt.Element = C, xt.ForwardRef = k, xt.Fragment = I, xt.Lazy = $, xt.Memo = N, xt.Portal = D, xt.Profiler = j, xt.StrictMode = F, xt.Suspense = W, xt.SuspenseList = z, xt.isAsyncMode = V, xt.isConcurrentMode = Y, xt.isContextConsumer = Q, xt.isContextProvider = ne, xt.isElement = re, xt.isForwardRef = ce, xt.isFragment = oe, xt.isLazy = fe, xt.isMemo = ae, xt.isPortal = ee, xt.isProfiler = se, xt.isStrictMode = ge, xt.isSuspense = X, xt.isSuspenseList = $e, xt.isValidElementType = A, xt.typeOf = _;
  }()), xt;
}
 false ? 0 : mx.exports = wae();
var _ae = mx.exports, Sae = ea, Oae = ta, Aae = "[object Number]";
function Tae(e) {
  return typeof e == "number" || Oae(e) && Sae(e) == Aae;
}
var IL = Tae;
const Pae = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(IL);
var Cae = IL;
function Eae(e) {
  return Cae(e) && e != +e;
}
var kae = Eae;
const Gc = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(kae);
var fr = function(t) {
  return t === 0 ? 0 : t > 0 ? 1 : -1;
}, Ss = function(t) {
  return Pd(t) && t.indexOf("%") === t.length - 1;
}, be = function(t) {
  return Pae(t) && !Gc(t);
}, On = function(t) {
  return be(t) || Pd(t);
}, Mae = 0, tl = function(t) {
  var n = ++Mae;
  return "".concat(t || "").concat(n);
}, dr = function(t, n) {
  var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
  if (!be(t) && !Pd(t))
    return r;
  var o;
  if (Ss(t)) {
    var a = t.indexOf("%");
    o = n * parseFloat(t.slice(0, a)) / 100;
  } else
    o = +t;
  return Gc(o) && (o = r), i && o > n && (o = n), o;
}, Sa = function(t) {
  if (!t)
    return null;
  var n = Object.keys(t);
  return n && n.length ? t[n[0]] : null;
}, Nae = function(t) {
  if (!Array.isArray(t))
    return !1;
  for (var n = t.length, r = {}, i = 0; i < n; i++)
    if (!r[t[i]])
      r[t[i]] = !0;
    else
      return !0;
  return !1;
}, _n = function(t, n) {
  return be(t) && be(n) ? function(r) {
    return t + r * (n - t);
  } : function() {
    return n;
  };
};
function Gp(e, t, n) {
  return !e || !e.length ? null : e.find(function(r) {
    return r && (typeof t == "function" ? t(r) : zr(r, t)) === n;
  });
}
function Yl(e, t) {
  for (var n in e)
    if ({}.hasOwnProperty.call(e, n) && (!{}.hasOwnProperty.call(t, n) || e[n] !== t[n]))
      return !1;
  for (var r in t)
    if ({}.hasOwnProperty.call(t, r) && !{}.hasOwnProperty.call(e, r))
      return !1;
  return !0;
}
function gx(e) {
  "@babel/helpers - typeof";
  return gx = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, gx(e);
}
var $ae = ["viewBox", "children"], Dae = [
  "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"
], WE = ["points", "pathLength"], kb = {
  svg: $ae,
  polygon: WE,
  polyline: WE
}, F_ = ["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"], Yp = function(t, n) {
  if (!t || typeof t == "function" || typeof t == "boolean")
    return null;
  var r = t;
  if (/* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(t) && (r = t.props), !Vc(r))
    return null;
  var i = {};
  return Object.keys(r).forEach(function(o) {
    F_.includes(o) && (i[o] = n || function(a) {
      return r[o](r, a);
    });
  }), i;
}, Iae = function(t, n, r) {
  return function(i) {
    return t(n, r, i), null;
  };
}, zs = function(t, n, r) {
  if (!Vc(t) || gx(t) !== "object")
    return null;
  var i = null;
  return Object.keys(t).forEach(function(o) {
    var a = t[o];
    F_.includes(o) && typeof a == "function" && (i || (i = {}), i[o] = Iae(a, n, r));
  }), i;
}, Rae = ["children"], jae = ["children"];
function zE(e, t) {
  if (e == null) return {};
  var n = Lae(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function Lae(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function yx(e) {
  "@babel/helpers - typeof";
  return yx = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, yx(e);
}
var VE = {
  click: "onClick",
  mousedown: "onMouseDown",
  mouseup: "onMouseUp",
  mouseover: "onMouseOver",
  mousemove: "onMouseMove",
  mouseout: "onMouseOut",
  mouseenter: "onMouseEnter",
  mouseleave: "onMouseLeave",
  touchcancel: "onTouchCancel",
  touchend: "onTouchEnd",
  touchmove: "onTouchMove",
  touchstart: "onTouchStart"
}, jo = function(t) {
  return typeof t == "string" ? t : t ? t.displayName || t.name || "Component" : "";
}, UE = null, Mb = null, W_ = function e(t) {
  if (t === UE && Array.isArray(Mb))
    return Mb;
  var n = [];
  return react__WEBPACK_IMPORTED_MODULE_1__.Children.forEach(t, function(r) {
    Ue(r) || (_ae.isFragment(r) ? n = n.concat(e(r.props.children)) : n.push(r));
  }), Mb = n, UE = t, n;
};
function Vr(e, t) {
  var n = [], r = [];
  return Array.isArray(t) ? r = t.map(function(i) {
    return jo(i);
  }) : r = [jo(t)], W_(e).forEach(function(i) {
    var o = zr(i, "type.displayName") || zr(i, "type.name");
    r.indexOf(o) !== -1 && n.push(i);
  }), n;
}
function jr(e, t) {
  var n = Vr(e, t);
  return n && n[0];
}
var HE = function(t) {
  if (!t || !t.props)
    return !1;
  var n = t.props, r = n.width, i = n.height;
  return !(!be(r) || r <= 0 || !be(i) || i <= 0);
}, Bae = ["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"], Fae = function(t) {
  return t && t.type && Pd(t.type) && Bae.indexOf(t.type) >= 0;
}, RL = function(t) {
  return t && yx(t) === "object" && "clipDot" in t;
}, Wae = function(t, n, r, i) {
  var o, a = (o = kb == null ? void 0 : kb[i]) !== null && o !== void 0 ? o : [];
  return !ze(t) && (i && a.includes(n) || Dae.includes(n)) || r && F_.includes(n);
}, Ee = function(t, n, r) {
  if (!t || typeof t == "function" || typeof t == "boolean")
    return null;
  var i = t;
  if (/* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(t) && (i = t.props), !Vc(i))
    return null;
  var o = {};
  return Object.keys(i).forEach(function(a) {
    var s;
    Wae((s = i) === null || s === void 0 ? void 0 : s[a], a, n, r) && (o[a] = i[a]);
  }), o;
}, vx = function e(t, n) {
  if (t === n)
    return !0;
  var r = react__WEBPACK_IMPORTED_MODULE_1__.Children.count(t);
  if (r !== react__WEBPACK_IMPORTED_MODULE_1__.Children.count(n))
    return !1;
  if (r === 0)
    return !0;
  if (r === 1)
    return KE(Array.isArray(t) ? t[0] : t, Array.isArray(n) ? n[0] : n);
  for (var i = 0; i < r; i++) {
    var o = t[i], a = n[i];
    if (Array.isArray(o) || Array.isArray(a)) {
      if (!e(o, a))
        return !1;
    } else if (!KE(o, a))
      return !1;
  }
  return !0;
}, KE = function(t, n) {
  if (Ue(t) && Ue(n))
    return !0;
  if (!Ue(t) && !Ue(n)) {
    var r = t.props || {}, i = r.children, o = zE(r, Rae), a = n.props || {}, s = a.children, l = zE(a, jae);
    return i && s ? Yl(o, l) && vx(i, s) : !i && !s ? Yl(o, l) : !1;
  }
  return !1;
}, GE = function(t, n) {
  var r = [], i = {};
  return W_(t).forEach(function(o, a) {
    if (Fae(o))
      r.push(o);
    else if (o) {
      var s = jo(o.type), l = n[s] || {}, c = l.handler, f = l.once;
      if (c && (!f || !i[s])) {
        var d = c(o, s, a);
        r.push(d), i[s] = !0;
      }
    }
  }), r;
}, zae = function(t) {
  var n = t && t.type;
  return n && VE[n] ? VE[n] : null;
}, Vae = function(t, n) {
  return W_(n).indexOf(t);
}, Uae = ["children", "width", "height", "viewBox", "className", "style", "title", "desc"];
function bx() {
  return bx = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, bx.apply(this, arguments);
}
function Hae(e, t) {
  if (e == null) return {};
  var n = Kae(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function Kae(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function xx(e) {
  var t = e.children, n = e.width, r = e.height, i = e.viewBox, o = e.className, a = e.style, s = e.title, l = e.desc, c = Hae(e, Uae), f = i || {
    width: n,
    height: r,
    x: 0,
    y: 0
  }, d = Xe("recharts-surface", o);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("svg", bx({}, Ee(c, !0, "svg"), {
    className: d,
    width: n,
    height: r,
    style: a,
    viewBox: "".concat(f.x, " ").concat(f.y, " ").concat(f.width, " ").concat(f.height)
  }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("title", null, s), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("desc", null, l), t);
}
var Gae = ["children", "className"];
function wx() {
  return wx = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, wx.apply(this, arguments);
}
function Yae(e, t) {
  if (e == null) return {};
  var n = qae(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function qae(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
var at = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(function(e, t) {
  var n = e.children, r = e.className, i = Yae(e, Gae), o = Xe("recharts-layer", r);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("g", wx({
    className: o
  }, Ee(i, !0), {
    ref: t
  }), n);
}), Xae = "development" !== "production", Mi = function(t, n) {
  for (var r = arguments.length, i = new Array(r > 2 ? r - 2 : 0), o = 2; o < r; o++)
    i[o - 2] = arguments[o];
  if (Xae && typeof console < "u" && console.warn && (n === void 0 && console.warn("LogUtils requires an error message argument"), !t))
    if (n === void 0)
      console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
    else {
      var a = 0;
      console.warn(n.replace(/%s/g, function() {
        return i[a++];
      }));
    }
};
function Zae(e, t, n) {
  var r = -1, i = e.length;
  t < 0 && (t = -t > i ? 0 : i + t), n = n > i ? i : n, n < 0 && (n += i), i = t > n ? 0 : n - t >>> 0, t >>>= 0;
  for (var o = Array(i); ++r < i; )
    o[r] = e[r + t];
  return o;
}
var Jae = Zae, Qae = Jae;
function ese(e, t, n) {
  var r = e.length;
  return n = n === void 0 ? r : n, !t && n >= r ? e : Qae(e, t, n);
}
var tse = ese, nse = "\\ud800-\\udfff", rse = "\\u0300-\\u036f", ise = "\\ufe20-\\ufe2f", ose = "\\u20d0-\\u20ff", ase = rse + ise + ose, sse = "\\ufe0e\\ufe0f", lse = "\\u200d", cse = RegExp("[" + lse + nse + ase + sse + "]");
function use(e) {
  return cse.test(e);
}
var jL = use;
function fse(e) {
  return e.split("");
}
var dse = fse, LL = "\\ud800-\\udfff", hse = "\\u0300-\\u036f", pse = "\\ufe20-\\ufe2f", mse = "\\u20d0-\\u20ff", gse = hse + pse + mse, yse = "\\ufe0e\\ufe0f", vse = "[" + LL + "]", _x = "[" + gse + "]", Sx = "\\ud83c[\\udffb-\\udfff]", bse = "(?:" + _x + "|" + Sx + ")", BL = "[^" + LL + "]", FL = "(?:\\ud83c[\\udde6-\\uddff]){2}", WL = "[\\ud800-\\udbff][\\udc00-\\udfff]", xse = "\\u200d", zL = bse + "?", VL = "[" + yse + "]?", wse = "(?:" + xse + "(?:" + [BL, FL, WL].join("|") + ")" + VL + zL + ")*", _se = VL + zL + wse, Sse = "(?:" + [BL + _x + "?", _x, FL, WL, vse].join("|") + ")", Ose = RegExp(Sx + "(?=" + Sx + ")|" + Sse + _se, "g");
function Ase(e) {
  return e.match(Ose) || [];
}
var Tse = Ase, Pse = dse, Cse = jL, Ese = Tse;
function kse(e) {
  return Cse(e) ? Ese(e) : Pse(e);
}
var Mse = kse, Nse = tse, $se = jL, Dse = Mse, Ise = NL;
function Rse(e) {
  return function(t) {
    t = Ise(t);
    var n = $se(t) ? Dse(t) : void 0, r = n ? n[0] : t.charAt(0), i = n ? Nse(n, 1).join("") : t.slice(1);
    return r[e]() + i;
  };
}
var jse = Rse, Lse = jse, Bse = Lse("toUpperCase"), Fse = Bse;
const Jg = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(Fse);
function jt(e) {
  return function() {
    return e;
  };
}
const UL = Math.cos, qp = Math.sin, Ii = Math.sqrt, Xp = Math.PI, Qg = 2 * Xp, Ox = Math.PI, Ax = 2 * Ox, ys = 1e-6, Wse = Ax - ys;
function HL(e) {
  this._ += e[0];
  for (let t = 1, n = e.length; t < n; ++t)
    this._ += arguments[t] + e[t];
}
function zse(e) {
  let t = Math.floor(e);
  if (!(t >= 0)) throw new Error(`invalid digits: ${e}`);
  if (t > 15) return HL;
  const n = 10 ** t;
  return function(r) {
    this._ += r[0];
    for (let i = 1, o = r.length; i < o; ++i)
      this._ += Math.round(arguments[i] * n) / n + r[i];
  };
}
class Vse {
  constructor(t) {
    this._x0 = this._y0 = // start of current subpath
    this._x1 = this._y1 = null, this._ = "", this._append = t == null ? HL : zse(t);
  }
  moveTo(t, n) {
    this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}`;
  }
  closePath() {
    this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._append`Z`);
  }
  lineTo(t, n) {
    this._append`L${this._x1 = +t},${this._y1 = +n}`;
  }
  quadraticCurveTo(t, n, r, i) {
    this._append`Q${+t},${+n},${this._x1 = +r},${this._y1 = +i}`;
  }
  bezierCurveTo(t, n, r, i, o, a) {
    this._append`C${+t},${+n},${+r},${+i},${this._x1 = +o},${this._y1 = +a}`;
  }
  arcTo(t, n, r, i, o) {
    if (t = +t, n = +n, r = +r, i = +i, o = +o, o < 0) throw new Error(`negative radius: ${o}`);
    let a = this._x1, s = this._y1, l = r - t, c = i - n, f = a - t, d = s - n, p = f * f + d * d;
    if (this._x1 === null)
      this._append`M${this._x1 = t},${this._y1 = n}`;
    else if (p > ys) if (!(Math.abs(d * l - c * f) > ys) || !o)
      this._append`L${this._x1 = t},${this._y1 = n}`;
    else {
      let m = r - a, y = i - s, g = l * l + c * c, v = m * m + y * y, x = Math.sqrt(g), w = Math.sqrt(p), S = o * Math.tan((Ox - Math.acos((g + p - v) / (2 * x * w))) / 2), A = S / w, _ = S / x;
      Math.abs(A - 1) > ys && this._append`L${t + A * f},${n + A * d}`, this._append`A${o},${o},0,0,${+(d * m > f * y)},${this._x1 = t + _ * l},${this._y1 = n + _ * c}`;
    }
  }
  arc(t, n, r, i, o, a) {
    if (t = +t, n = +n, r = +r, a = !!a, r < 0) throw new Error(`negative radius: ${r}`);
    let s = r * Math.cos(i), l = r * Math.sin(i), c = t + s, f = n + l, d = 1 ^ a, p = a ? i - o : o - i;
    this._x1 === null ? this._append`M${c},${f}` : (Math.abs(this._x1 - c) > ys || Math.abs(this._y1 - f) > ys) && this._append`L${c},${f}`, r && (p < 0 && (p = p % Ax + Ax), p > Wse ? this._append`A${r},${r},0,1,${d},${t - s},${n - l}A${r},${r},0,1,${d},${this._x1 = c},${this._y1 = f}` : p > ys && this._append`A${r},${r},0,${+(p >= Ox)},${d},${this._x1 = t + r * Math.cos(o)},${this._y1 = n + r * Math.sin(o)}`);
  }
  rect(t, n, r, i) {
    this._append`M${this._x0 = this._x1 = +t},${this._y0 = this._y1 = +n}h${r = +r}v${+i}h${-r}Z`;
  }
  toString() {
    return this._;
  }
}
function z_(e) {
  let t = 3;
  return e.digits = function(n) {
    if (!arguments.length) return t;
    if (n == null)
      t = null;
    else {
      const r = Math.floor(n);
      if (!(r >= 0)) throw new RangeError(`invalid digits: ${n}`);
      t = r;
    }
    return e;
  }, () => new Vse(t);
}
function V_(e) {
  return typeof e == "object" && "length" in e ? e : Array.from(e);
}
function KL(e) {
  this._context = e;
}
KL.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._point = 0;
  },
  lineEnd: function() {
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(e, t) {
    switch (e = +e, t = +t, this._point) {
      case 0:
        this._point = 1, this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t);
        break;
      case 1:
        this._point = 2;
      default:
        this._context.lineTo(e, t);
        break;
    }
  }
};
function ey(e) {
  return new KL(e);
}
function GL(e) {
  return e[0];
}
function YL(e) {
  return e[1];
}
function qL(e, t) {
  var n = jt(!0), r = null, i = ey, o = null, a = z_(s);
  e = typeof e == "function" ? e : e === void 0 ? GL : jt(e), t = typeof t == "function" ? t : t === void 0 ? YL : jt(t);
  function s(l) {
    var c, f = (l = V_(l)).length, d, p = !1, m;
    for (r == null && (o = i(m = a())), c = 0; c <= f; ++c)
      !(c < f && n(d = l[c], c, l)) === p && ((p = !p) ? o.lineStart() : o.lineEnd()), p && o.point(+e(d, c, l), +t(d, c, l));
    if (m) return o = null, m + "" || null;
  }
  return s.x = function(l) {
    return arguments.length ? (e = typeof l == "function" ? l : jt(+l), s) : e;
  }, s.y = function(l) {
    return arguments.length ? (t = typeof l == "function" ? l : jt(+l), s) : t;
  }, s.defined = function(l) {
    return arguments.length ? (n = typeof l == "function" ? l : jt(!!l), s) : n;
  }, s.curve = function(l) {
    return arguments.length ? (i = l, r != null && (o = i(r)), s) : i;
  }, s.context = function(l) {
    return arguments.length ? (l == null ? r = o = null : o = i(r = l), s) : r;
  }, s;
}
function zh(e, t, n) {
  var r = null, i = jt(!0), o = null, a = ey, s = null, l = z_(c);
  e = typeof e == "function" ? e : e === void 0 ? GL : jt(+e), t = typeof t == "function" ? t : jt(t === void 0 ? 0 : +t), n = typeof n == "function" ? n : n === void 0 ? YL : jt(+n);
  function c(d) {
    var p, m, y, g = (d = V_(d)).length, v, x = !1, w, S = new Array(g), A = new Array(g);
    for (o == null && (s = a(w = l())), p = 0; p <= g; ++p) {
      if (!(p < g && i(v = d[p], p, d)) === x)
        if (x = !x)
          m = p, s.areaStart(), s.lineStart();
        else {
          for (s.lineEnd(), s.lineStart(), y = p - 1; y >= m; --y)
            s.point(S[y], A[y]);
          s.lineEnd(), s.areaEnd();
        }
      x && (S[p] = +e(v, p, d), A[p] = +t(v, p, d), s.point(r ? +r(v, p, d) : S[p], n ? +n(v, p, d) : A[p]));
    }
    if (w) return s = null, w + "" || null;
  }
  function f() {
    return qL().defined(i).curve(a).context(o);
  }
  return c.x = function(d) {
    return arguments.length ? (e = typeof d == "function" ? d : jt(+d), r = null, c) : e;
  }, c.x0 = function(d) {
    return arguments.length ? (e = typeof d == "function" ? d : jt(+d), c) : e;
  }, c.x1 = function(d) {
    return arguments.length ? (r = d == null ? null : typeof d == "function" ? d : jt(+d), c) : r;
  }, c.y = function(d) {
    return arguments.length ? (t = typeof d == "function" ? d : jt(+d), n = null, c) : t;
  }, c.y0 = function(d) {
    return arguments.length ? (t = typeof d == "function" ? d : jt(+d), c) : t;
  }, c.y1 = function(d) {
    return arguments.length ? (n = d == null ? null : typeof d == "function" ? d : jt(+d), c) : n;
  }, c.lineX0 = c.lineY0 = function() {
    return f().x(e).y(t);
  }, c.lineY1 = function() {
    return f().x(e).y(n);
  }, c.lineX1 = function() {
    return f().x(r).y(t);
  }, c.defined = function(d) {
    return arguments.length ? (i = typeof d == "function" ? d : jt(!!d), c) : i;
  }, c.curve = function(d) {
    return arguments.length ? (a = d, o != null && (s = a(o)), c) : a;
  }, c.context = function(d) {
    return arguments.length ? (d == null ? o = s = null : s = a(o = d), c) : o;
  }, c;
}
class XL {
  constructor(t, n) {
    this._context = t, this._x = n;
  }
  areaStart() {
    this._line = 0;
  }
  areaEnd() {
    this._line = NaN;
  }
  lineStart() {
    this._point = 0;
  }
  lineEnd() {
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  }
  point(t, n) {
    switch (t = +t, n = +n, this._point) {
      case 0: {
        this._point = 1, this._line ? this._context.lineTo(t, n) : this._context.moveTo(t, n);
        break;
      }
      case 1:
        this._point = 2;
      default: {
        this._x ? this._context.bezierCurveTo(this._x0 = (this._x0 + t) / 2, this._y0, this._x0, n, t, n) : this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + n) / 2, t, this._y0, t, n);
        break;
      }
    }
    this._x0 = t, this._y0 = n;
  }
}
function Use(e) {
  return new XL(e, !0);
}
function Hse(e) {
  return new XL(e, !1);
}
const U_ = {
  draw(e, t) {
    const n = Ii(t / Xp);
    e.moveTo(n, 0), e.arc(0, 0, n, 0, Qg);
  }
}, Kse = {
  draw(e, t) {
    const n = Ii(t / 5) / 2;
    e.moveTo(-3 * n, -n), e.lineTo(-n, -n), e.lineTo(-n, -3 * n), e.lineTo(n, -3 * n), e.lineTo(n, -n), e.lineTo(3 * n, -n), e.lineTo(3 * n, n), e.lineTo(n, n), e.lineTo(n, 3 * n), e.lineTo(-n, 3 * n), e.lineTo(-n, n), e.lineTo(-3 * n, n), e.closePath();
  }
}, ZL = Ii(1 / 3), Gse = ZL * 2, Yse = {
  draw(e, t) {
    const n = Ii(t / Gse), r = n * ZL;
    e.moveTo(0, -n), e.lineTo(r, 0), e.lineTo(0, n), e.lineTo(-r, 0), e.closePath();
  }
}, qse = {
  draw(e, t) {
    const n = Ii(t), r = -n / 2;
    e.rect(r, r, n, n);
  }
}, Xse = 0.8908130915292852, JL = qp(Xp / 10) / qp(7 * Xp / 10), Zse = qp(Qg / 10) * JL, Jse = -UL(Qg / 10) * JL, Qse = {
  draw(e, t) {
    const n = Ii(t * Xse), r = Zse * n, i = Jse * n;
    e.moveTo(0, -n), e.lineTo(r, i);
    for (let o = 1; o < 5; ++o) {
      const a = Qg * o / 5, s = UL(a), l = qp(a);
      e.lineTo(l * n, -s * n), e.lineTo(s * r - l * i, l * r + s * i);
    }
    e.closePath();
  }
}, Nb = Ii(3), ele = {
  draw(e, t) {
    const n = -Ii(t / (Nb * 3));
    e.moveTo(0, n * 2), e.lineTo(-Nb * n, -n), e.lineTo(Nb * n, -n), e.closePath();
  }
}, ai = -0.5, si = Ii(3) / 2, Tx = 1 / Ii(12), tle = (Tx / 2 + 1) * 3, nle = {
  draw(e, t) {
    const n = Ii(t / tle), r = n / 2, i = n * Tx, o = r, a = n * Tx + n, s = -o, l = a;
    e.moveTo(r, i), e.lineTo(o, a), e.lineTo(s, l), e.lineTo(ai * r - si * i, si * r + ai * i), e.lineTo(ai * o - si * a, si * o + ai * a), e.lineTo(ai * s - si * l, si * s + ai * l), e.lineTo(ai * r + si * i, ai * i - si * r), e.lineTo(ai * o + si * a, ai * a - si * o), e.lineTo(ai * s + si * l, ai * l - si * s), e.closePath();
  }
};
function rle(e, t) {
  let n = null, r = z_(i);
  e = typeof e == "function" ? e : jt(e || U_), t = typeof t == "function" ? t : jt(t === void 0 ? 64 : +t);
  function i() {
    let o;
    if (n || (n = o = r()), e.apply(this, arguments).draw(n, +t.apply(this, arguments)), o) return n = null, o + "" || null;
  }
  return i.type = function(o) {
    return arguments.length ? (e = typeof o == "function" ? o : jt(o), i) : e;
  }, i.size = function(o) {
    return arguments.length ? (t = typeof o == "function" ? o : jt(+o), i) : t;
  }, i.context = function(o) {
    return arguments.length ? (n = o ?? null, i) : n;
  }, i;
}
function Zp() {
}
function Jp(e, t, n) {
  e._context.bezierCurveTo(
    (2 * e._x0 + e._x1) / 3,
    (2 * e._y0 + e._y1) / 3,
    (e._x0 + 2 * e._x1) / 3,
    (e._y0 + 2 * e._y1) / 3,
    (e._x0 + 4 * e._x1 + t) / 6,
    (e._y0 + 4 * e._y1 + n) / 6
  );
}
function QL(e) {
  this._context = e;
}
QL.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 3:
        Jp(this, this._x1, this._y1);
      case 2:
        this._context.lineTo(this._x1, this._y1);
        break;
    }
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(e, t) {
    switch (e = +e, t = +t, this._point) {
      case 0:
        this._point = 1, this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t);
        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);
      default:
        Jp(this, e, t);
        break;
    }
    this._x0 = this._x1, this._x1 = e, this._y0 = this._y1, this._y1 = t;
  }
};
function ile(e) {
  return new QL(e);
}
function eB(e) {
  this._context = e;
}
eB.prototype = {
  areaStart: Zp,
  areaEnd: Zp,
  lineStart: 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;
  },
  lineEnd: 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;
      }
    }
  },
  point: function(e, t) {
    switch (e = +e, t = +t, this._point) {
      case 0:
        this._point = 1, this._x2 = e, this._y2 = t;
        break;
      case 1:
        this._point = 2, this._x3 = e, this._y3 = t;
        break;
      case 2:
        this._point = 3, this._x4 = e, this._y4 = t, this._context.moveTo((this._x0 + 4 * this._x1 + e) / 6, (this._y0 + 4 * this._y1 + t) / 6);
        break;
      default:
        Jp(this, e, t);
        break;
    }
    this._x0 = this._x1, this._x1 = e, this._y0 = this._y1, this._y1 = t;
  }
};
function ole(e) {
  return new eB(e);
}
function tB(e) {
  this._context = e;
}
tB.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0;
  },
  lineEnd: function() {
    (this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(e, t) {
    switch (e = +e, t = +t, this._point) {
      case 0:
        this._point = 1;
        break;
      case 1:
        this._point = 2;
        break;
      case 2:
        this._point = 3;
        var n = (this._x0 + 4 * this._x1 + e) / 6, r = (this._y0 + 4 * this._y1 + t) / 6;
        this._line ? this._context.lineTo(n, r) : this._context.moveTo(n, r);
        break;
      case 3:
        this._point = 4;
      default:
        Jp(this, e, t);
        break;
    }
    this._x0 = this._x1, this._x1 = e, this._y0 = this._y1, this._y1 = t;
  }
};
function ale(e) {
  return new tB(e);
}
function nB(e) {
  this._context = e;
}
nB.prototype = {
  areaStart: Zp,
  areaEnd: Zp,
  lineStart: function() {
    this._point = 0;
  },
  lineEnd: function() {
    this._point && this._context.closePath();
  },
  point: function(e, t) {
    e = +e, t = +t, this._point ? this._context.lineTo(e, t) : (this._point = 1, this._context.moveTo(e, t));
  }
};
function sle(e) {
  return new nB(e);
}
function YE(e) {
  return e < 0 ? -1 : 1;
}
function qE(e, t, n) {
  var r = e._x1 - e._x0, i = t - e._x1, o = (e._y1 - e._y0) / (r || i < 0 && -0), a = (n - e._y1) / (i || r < 0 && -0), s = (o * i + a * r) / (r + i);
  return (YE(o) + YE(a)) * Math.min(Math.abs(o), Math.abs(a), 0.5 * Math.abs(s)) || 0;
}
function XE(e, t) {
  var n = e._x1 - e._x0;
  return n ? (3 * (e._y1 - e._y0) / n - t) / 2 : t;
}
function $b(e, t, n) {
  var r = e._x0, i = e._y0, o = e._x1, a = e._y1, s = (o - r) / 3;
  e._context.bezierCurveTo(r + s, i + s * t, o - s, a - s * n, o, a);
}
function Qp(e) {
  this._context = e;
}
Qp.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN, this._point = 0;
  },
  lineEnd: function() {
    switch (this._point) {
      case 2:
        this._context.lineTo(this._x1, this._y1);
        break;
      case 3:
        $b(this, this._t0, XE(this, this._t0));
        break;
    }
    (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
  },
  point: function(e, t) {
    var n = NaN;
    if (e = +e, t = +t, !(e === this._x1 && t === this._y1)) {
      switch (this._point) {
        case 0:
          this._point = 1, this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t);
          break;
        case 1:
          this._point = 2;
          break;
        case 2:
          this._point = 3, $b(this, XE(this, n = qE(this, e, t)), n);
          break;
        default:
          $b(this, this._t0, n = qE(this, e, t));
          break;
      }
      this._x0 = this._x1, this._x1 = e, this._y0 = this._y1, this._y1 = t, this._t0 = n;
    }
  }
};
function rB(e) {
  this._context = new iB(e);
}
(rB.prototype = Object.create(Qp.prototype)).point = function(e, t) {
  Qp.prototype.point.call(this, t, e);
};
function iB(e) {
  this._context = e;
}
iB.prototype = {
  moveTo: function(e, t) {
    this._context.moveTo(t, e);
  },
  closePath: function() {
    this._context.closePath();
  },
  lineTo: function(e, t) {
    this._context.lineTo(t, e);
  },
  bezierCurveTo: function(e, t, n, r, i, o) {
    this._context.bezierCurveTo(t, e, r, n, o, i);
  }
};
function lle(e) {
  return new Qp(e);
}
function cle(e) {
  return new rB(e);
}
function oB(e) {
  this._context = e;
}
oB.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x = [], this._y = [];
  },
  lineEnd: function() {
    var e = this._x, t = this._y, n = e.length;
    if (n)
      if (this._line ? this._context.lineTo(e[0], t[0]) : this._context.moveTo(e[0], t[0]), n === 2)
        this._context.lineTo(e[1], t[1]);
      else
        for (var r = ZE(e), i = ZE(t), o = 0, a = 1; a < n; ++o, ++a)
          this._context.bezierCurveTo(r[0][o], i[0][o], r[1][o], i[1][o], e[a], t[a]);
    (this._line || this._line !== 0 && n === 1) && this._context.closePath(), this._line = 1 - this._line, this._x = this._y = null;
  },
  point: function(e, t) {
    this._x.push(+e), this._y.push(+t);
  }
};
function ZE(e) {
  var t, n = e.length - 1, r, i = new Array(n), o = new Array(n), a = new Array(n);
  for (i[0] = 0, o[0] = 2, a[0] = e[0] + 2 * e[1], t = 1; t < n - 1; ++t) i[t] = 1, o[t] = 4, a[t] = 4 * e[t] + 2 * e[t + 1];
  for (i[n - 1] = 2, o[n - 1] = 7, a[n - 1] = 8 * e[n - 1] + e[n], t = 1; t < n; ++t) r = i[t] / o[t - 1], o[t] -= r, a[t] -= r * a[t - 1];
  for (i[n - 1] = a[n - 1] / o[n - 1], t = n - 2; t >= 0; --t) i[t] = (a[t] - i[t + 1]) / o[t];
  for (o[n - 1] = (e[n] + i[n - 1]) / 2, t = 0; t < n - 1; ++t) o[t] = 2 * e[t + 1] - i[t + 1];
  return [i, o];
}
function ule(e) {
  return new oB(e);
}
function ty(e, t) {
  this._context = e, this._t = t;
}
ty.prototype = {
  areaStart: function() {
    this._line = 0;
  },
  areaEnd: function() {
    this._line = NaN;
  },
  lineStart: function() {
    this._x = this._y = NaN, this._point = 0;
  },
  lineEnd: function() {
    0 < this._t && this._t < 1 && this._point === 2 && this._context.lineTo(this._x, this._y), (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line >= 0 && (this._t = 1 - this._t, this._line = 1 - this._line);
  },
  point: function(e, t) {
    switch (e = +e, t = +t, this._point) {
      case 0:
        this._point = 1, this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t);
        break;
      case 1:
        this._point = 2;
      default: {
        if (this._t <= 0)
          this._context.lineTo(this._x, t), this._context.lineTo(e, t);
        else {
          var n = this._x * (1 - this._t) + e * this._t;
          this._context.lineTo(n, this._y), this._context.lineTo(n, t);
        }
        break;
      }
    }
    this._x = e, this._y = t;
  }
};
function fle(e) {
  return new ty(e, 0.5);
}
function dle(e) {
  return new ty(e, 0);
}
function hle(e) {
  return new ty(e, 1);
}
function oc(e, t) {
  if ((a = e.length) > 1)
    for (var n = 1, r, i, o = e[t[0]], a, s = o.length; n < a; ++n)
      for (i = o, o = e[t[n]], r = 0; r < s; ++r)
        o[r][1] += o[r][0] = isNaN(i[r][1]) ? i[r][0] : i[r][1];
}
function Px(e) {
  for (var t = e.length, n = new Array(t); --t >= 0; ) n[t] = t;
  return n;
}
function ple(e, t) {
  return e[t];
}
function mle(e) {
  const t = [];
  return t.key = e, t;
}
function gle() {
  var e = jt([]), t = Px, n = oc, r = ple;
  function i(o) {
    var a = Array.from(e.apply(this, arguments), mle), s, l = a.length, c = -1, f;
    for (const d of o)
      for (s = 0, ++c; s < l; ++s)
        (a[s][c] = [0, +r(d, a[s].key, c, o)]).data = d;
    for (s = 0, f = V_(t(a)); s < l; ++s)
      a[f[s]].index = s;
    return n(a, f), a;
  }
  return i.keys = function(o) {
    return arguments.length ? (e = typeof o == "function" ? o : jt(Array.from(o)), i) : e;
  }, i.value = function(o) {
    return arguments.length ? (r = typeof o == "function" ? o : jt(+o), i) : r;
  }, i.order = function(o) {
    return arguments.length ? (t = o == null ? Px : typeof o == "function" ? o : jt(Array.from(o)), i) : t;
  }, i.offset = function(o) {
    return arguments.length ? (n = o ?? oc, i) : n;
  }, i;
}
function yle(e, t) {
  if ((r = e.length) > 0) {
    for (var n, r, i = 0, o = e[0].length, a; i < o; ++i) {
      for (a = n = 0; n < r; ++n) a += e[n][i][1] || 0;
      if (a) for (n = 0; n < r; ++n) e[n][i][1] /= a;
    }
    oc(e, t);
  }
}
function vle(e, t) {
  if ((i = e.length) > 0) {
    for (var n = 0, r = e[t[0]], i, o = r.length; n < o; ++n) {
      for (var a = 0, s = 0; a < i; ++a) s += e[a][n][1] || 0;
      r[n][1] += r[n][0] = -s / 2;
    }
    oc(e, t);
  }
}
function ble(e, t) {
  if (!(!((a = e.length) > 0) || !((o = (i = e[t[0]]).length) > 0))) {
    for (var n = 0, r = 1, i, o, a; r < o; ++r) {
      for (var s = 0, l = 0, c = 0; s < a; ++s) {
        for (var f = e[t[s]], d = f[r][1] || 0, p = f[r - 1][1] || 0, m = (d - p) / 2, y = 0; y < s; ++y) {
          var g = e[t[y]], v = g[r][1] || 0, x = g[r - 1][1] || 0;
          m += v - x;
        }
        l += d, c += m * d;
      }
      i[r - 1][1] += i[r - 1][0] = n, l && (n -= c / l);
    }
    i[r - 1][1] += i[r - 1][0] = n, oc(e, t);
  }
}
function Pf(e) {
  "@babel/helpers - typeof";
  return Pf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Pf(e);
}
var xle = ["type", "size", "sizeType"];
function Cx() {
  return Cx = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Cx.apply(this, arguments);
}
function JE(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function QE(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? JE(Object(n), !0).forEach(function(r) {
      wle(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : JE(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function wle(e, t, n) {
  return t = _le(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function _le(e) {
  var t = Sle(e, "string");
  return Pf(t) == "symbol" ? t : t + "";
}
function Sle(e, t) {
  if (Pf(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Pf(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function Ole(e, t) {
  if (e == null) return {};
  var n = Ale(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function Ale(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
var aB = {
  symbolCircle: U_,
  symbolCross: Kse,
  symbolDiamond: Yse,
  symbolSquare: qse,
  symbolStar: Qse,
  symbolTriangle: ele,
  symbolWye: nle
}, Tle = Math.PI / 180, Ple = function(t) {
  var n = "symbol".concat(Jg(t));
  return aB[n] || U_;
}, Cle = function(t, n, r) {
  if (n === "area")
    return t;
  switch (r) {
    case "cross":
      return 5 * t * t / 9;
    case "diamond":
      return 0.5 * t * t / Math.sqrt(3);
    case "square":
      return t * t;
    case "star": {
      var i = 18 * Tle;
      return 1.25 * t * t * (Math.tan(i) - Math.tan(i * 2) * Math.pow(Math.tan(i), 2));
    }
    case "triangle":
      return Math.sqrt(3) * t * t / 4;
    case "wye":
      return (21 - 10 * Math.sqrt(3)) * t * t / 8;
    default:
      return Math.PI * t * t / 4;
  }
}, Ele = function(t, n) {
  aB["symbol".concat(Jg(t))] = n;
}, H_ = function(t) {
  var n = t.type, r = n === void 0 ? "circle" : n, i = t.size, o = i === void 0 ? 64 : i, a = t.sizeType, s = a === void 0 ? "area" : a, l = Ole(t, xle), c = QE(QE({}, l), {}, {
    type: r,
    size: o,
    sizeType: s
  }), f = function() {
    var v = Ple(r), x = rle().type(v).size(Cle(o, s, r));
    return x();
  }, d = c.className, p = c.cx, m = c.cy, y = Ee(c, !0);
  return p === +p && m === +m && o === +o ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", Cx({}, y, {
    className: Xe("recharts-symbols", d),
    transform: "translate(".concat(p, ", ").concat(m, ")"),
    d: f()
  })) : null;
};
H_.registerSymbol = Ele;
function ac(e) {
  "@babel/helpers - typeof";
  return ac = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, ac(e);
}
function Ex() {
  return Ex = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Ex.apply(this, arguments);
}
function ek(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function kle(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? ek(Object(n), !0).forEach(function(r) {
      Cf(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ek(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function Mle(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function Nle(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, lB(r.key), r);
  }
}
function $le(e, t, n) {
  return t && Nle(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function Dle(e, t, n) {
  return t = em(t), Ile(e, sB() ? Reflect.construct(t, n || [], em(e).constructor) : t.apply(e, n));
}
function Ile(e, t) {
  if (t && (ac(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return Rle(e);
}
function Rle(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function sB() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (sB = function() {
    return !!e;
  })();
}
function em(e) {
  return em = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, em(e);
}
function jle(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && kx(e, t);
}
function kx(e, t) {
  return kx = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, kx(e, t);
}
function Cf(e, t, n) {
  return t = lB(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function lB(e) {
  var t = Lle(e, "string");
  return ac(t) == "symbol" ? t : t + "";
}
function Lle(e, t) {
  if (ac(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (ac(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var li = 32, K_ = /* @__PURE__ */ function(e) {
  function t() {
    return Mle(this, t), Dle(this, t, arguments);
  }
  return jle(t, e), $le(t, [{
    key: "renderIcon",
    value: (
      /**
       * Render the path of icon
       * @param {Object} data Data of each legend item
       * @return {String} Path element
       */
      function(r) {
        var i = this.props.inactiveColor, o = li / 2, a = li / 6, s = li / 3, l = r.inactive ? i : r.color;
        if (r.type === "plainline")
          return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("line", {
            strokeWidth: 4,
            fill: "none",
            stroke: l,
            strokeDasharray: r.payload.strokeDasharray,
            x1: 0,
            y1: o,
            x2: li,
            y2: o,
            className: "recharts-legend-icon"
          });
        if (r.type === "line")
          return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", {
            strokeWidth: 4,
            fill: "none",
            stroke: l,
            d: "M0,".concat(o, "h").concat(s, `
            A`).concat(a, ",").concat(a, ",0,1,1,").concat(2 * s, ",").concat(o, `
            H`).concat(li, "M").concat(2 * s, ",").concat(o, `
            A`).concat(a, ",").concat(a, ",0,1,1,").concat(s, ",").concat(o),
            className: "recharts-legend-icon"
          });
        if (r.type === "rect")
          return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", {
            stroke: "none",
            fill: l,
            d: "M0,".concat(li / 8, "h").concat(li, "v").concat(li * 3 / 4, "h").concat(-li, "z"),
            className: "recharts-legend-icon"
          });
        if (/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(r.legendIcon)) {
          var c = kle({}, r);
          return delete c.legendIcon, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(r.legendIcon, c);
        }
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(H_, {
          fill: l,
          cx: o,
          cy: o,
          size: li,
          sizeType: "diameter",
          type: r.type
        });
      }
    )
    /**
     * Draw items of legend
     * @return {ReactElement} Items
     */
  }, {
    key: "renderItems",
    value: function() {
      var r = this, i = this.props, o = i.payload, a = i.iconSize, s = i.layout, l = i.formatter, c = i.inactiveColor, f = {
        x: 0,
        y: 0,
        width: li,
        height: li
      }, d = {
        display: s === "horizontal" ? "inline-block" : "block",
        marginRight: 10
      }, p = {
        display: "inline-block",
        verticalAlign: "middle",
        marginRight: 4
      };
      return o.map(function(m, y) {
        var g = m.formatter || l, v = Xe(Cf(Cf({
          "recharts-legend-item": !0
        }, "legend-item-".concat(y), !0), "inactive", m.inactive));
        if (m.type === "none")
          return null;
        var x = ze(m.value) ? null : m.value;
        Mi(
          !ze(m.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 w = m.inactive ? c : m.color;
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("li", Ex({
          className: v,
          style: d,
          key: "legend-item-".concat(y)
        }, zs(r.props, m, y)), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(xx, {
          width: a,
          height: a,
          viewBox: f,
          style: p
        }, r.renderIcon(m)), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", {
          className: "recharts-legend-item-text",
          style: {
            color: w
          }
        }, g ? g(x, m, y) : x));
      });
    }
  }, {
    key: "render",
    value: function() {
      var r = this.props, i = r.payload, o = r.layout, a = r.align;
      if (!i || !i.length)
        return null;
      var s = {
        padding: 0,
        margin: 0,
        textAlign: o === "horizontal" ? a : "left"
      };
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("ul", {
        className: "recharts-default-legend",
        style: s
      }, this.renderItems());
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent);
Cf(K_, "displayName", "Legend");
Cf(K_, "defaultProps", {
  iconSize: 14,
  layout: "horizontal",
  align: "center",
  verticalAlign: "middle",
  inactiveColor: "#ccc"
});
var Ble = qg;
function Fle() {
  this.__data__ = new Ble(), this.size = 0;
}
var Wle = Fle;
function zle(e) {
  var t = this.__data__, n = t.delete(e);
  return this.size = t.size, n;
}
var Vle = zle;
function Ule(e) {
  return this.__data__.get(e);
}
var Hle = Ule;
function Kle(e) {
  return this.__data__.has(e);
}
var Gle = Kle, Yle = qg, qle = I_, Xle = R_, Zle = 200;
function Jle(e, t) {
  var n = this.__data__;
  if (n instanceof Yle) {
    var r = n.__data__;
    if (!qle || r.length < Zle - 1)
      return r.push([e, t]), this.size = ++n.size, this;
    n = this.__data__ = new Xle(r);
  }
  return n.set(e, t), this.size = n.size, this;
}
var Qle = Jle, ece = qg, tce = Wle, nce = Vle, rce = Hle, ice = Gle, oce = Qle;
function Yc(e) {
  var t = this.__data__ = new ece(e);
  this.size = t.size;
}
Yc.prototype.clear = tce;
Yc.prototype.delete = nce;
Yc.prototype.get = rce;
Yc.prototype.has = ice;
Yc.prototype.set = oce;
var cB = Yc, ace = "__lodash_hash_undefined__";
function sce(e) {
  return this.__data__.set(e, ace), this;
}
var lce = sce;
function cce(e) {
  return this.__data__.has(e);
}
var uce = cce, fce = R_, dce = lce, hce = uce;
function tm(e) {
  var t = -1, n = e == null ? 0 : e.length;
  for (this.__data__ = new fce(); ++t < n; )
    this.add(e[t]);
}
tm.prototype.add = tm.prototype.push = dce;
tm.prototype.has = hce;
var uB = tm;
function pce(e, t) {
  for (var n = -1, r = e == null ? 0 : e.length; ++n < r; )
    if (t(e[n], n, e))
      return !0;
  return !1;
}
var fB = pce;
function mce(e, t) {
  return e.has(t);
}
var dB = mce, gce = uB, yce = fB, vce = dB, bce = 1, xce = 2;
function wce(e, t, n, r, i, o) {
  var a = n & bce, s = e.length, l = t.length;
  if (s != l && !(a && l > s))
    return !1;
  var c = o.get(e), f = o.get(t);
  if (c && f)
    return c == t && f == e;
  var d = -1, p = !0, m = n & xce ? new gce() : void 0;
  for (o.set(e, t), o.set(t, e); ++d < s; ) {
    var y = e[d], g = t[d];
    if (r)
      var v = a ? r(g, y, d, t, e, o) : r(y, g, d, e, t, o);
    if (v !== void 0) {
      if (v)
        continue;
      p = !1;
      break;
    }
    if (m) {
      if (!yce(t, function(x, w) {
        if (!vce(m, w) && (y === x || i(y, x, n, r, o)))
          return m.push(w);
      })) {
        p = !1;
        break;
      }
    } else if (!(y === g || i(y, g, n, r, o))) {
      p = !1;
      break;
    }
  }
  return o.delete(e), o.delete(t), p;
}
var hB = wce, _ce = ao, Sce = _ce.Uint8Array, Oce = Sce;
function Ace(e) {
  var t = -1, n = Array(e.size);
  return e.forEach(function(r, i) {
    n[++t] = [i, r];
  }), n;
}
var Tce = Ace;
function Pce(e) {
  var t = -1, n = Array(e.size);
  return e.forEach(function(r) {
    n[++t] = r;
  }), n;
}
var G_ = Pce, tk = Td, nk = Oce, Cce = D_, Ece = hB, kce = Tce, Mce = G_, Nce = 1, $ce = 2, Dce = "[object Boolean]", Ice = "[object Date]", Rce = "[object Error]", jce = "[object Map]", Lce = "[object Number]", Bce = "[object RegExp]", Fce = "[object Set]", Wce = "[object String]", zce = "[object Symbol]", Vce = "[object ArrayBuffer]", Uce = "[object DataView]", rk = tk ? tk.prototype : void 0, Db = rk ? rk.valueOf : void 0;
function Hce(e, t, n, r, i, o, a) {
  switch (n) {
    case Uce:
      if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset)
        return !1;
      e = e.buffer, t = t.buffer;
    case Vce:
      return !(e.byteLength != t.byteLength || !o(new nk(e), new nk(t)));
    case Dce:
    case Ice:
    case Lce:
      return Cce(+e, +t);
    case Rce:
      return e.name == t.name && e.message == t.message;
    case Bce:
    case Wce:
      return e == t + "";
    case jce:
      var s = kce;
    case Fce:
      var l = r & Nce;
      if (s || (s = Mce), e.size != t.size && !l)
        return !1;
      var c = a.get(e);
      if (c)
        return c == t;
      r |= $ce, a.set(e, t);
      var f = Ece(s(e), s(t), r, i, o, a);
      return a.delete(e), f;
    case zce:
      if (Db)
        return Db.call(e) == Db.call(t);
  }
  return !1;
}
var Kce = Hce;
function Gce(e, t) {
  for (var n = -1, r = t.length, i = e.length; ++n < r; )
    e[i + n] = t[n];
  return e;
}
var pB = Gce, Yce = pB, qce = Tr;
function Xce(e, t, n) {
  var r = t(e);
  return qce(e) ? r : Yce(r, n(e));
}
var Zce = Xce;
function Jce(e, t) {
  for (var n = -1, r = e == null ? 0 : e.length, i = 0, o = []; ++n < r; ) {
    var a = e[n];
    t(a, n, e) && (o[i++] = a);
  }
  return o;
}
var Qce = Jce;
function eue() {
  return [];
}
var tue = eue, nue = Qce, rue = tue, iue = Object.prototype, oue = iue.propertyIsEnumerable, ik = Object.getOwnPropertySymbols, aue = ik ? function(e) {
  return e == null ? [] : (e = Object(e), nue(ik(e), function(t) {
    return oue.call(e, t);
  }));
} : rue, sue = aue;
function lue(e, t) {
  for (var n = -1, r = Array(e); ++n < e; )
    r[n] = t(n);
  return r;
}
var cue = lue, uue = ea, fue = ta, due = "[object Arguments]";
function hue(e) {
  return fue(e) && uue(e) == due;
}
var pue = hue, ok = pue, mue = ta, mB = Object.prototype, gue = mB.hasOwnProperty, yue = mB.propertyIsEnumerable, vue = ok(/* @__PURE__ */ function() {
  return arguments;
}()) ? ok : function(e) {
  return mue(e) && gue.call(e, "callee") && !yue.call(e, "callee");
}, Y_ = vue, nm = { exports: {} };
function bue() {
  return !1;
}
var xue = bue;
nm.exports;
(function(e, t) {
  var n = ao, r = xue, i = t && !t.nodeType && t, o = i && !0 && e && !e.nodeType && e, a = o && o.exports === i, s = a ? n.Buffer : void 0, l = s ? s.isBuffer : void 0, c = l || r;
  e.exports = c;
})(nm, nm.exports);
var gB = nm.exports, wue = 9007199254740991, _ue = /^(?:0|[1-9]\d*)$/;
function Sue(e, t) {
  var n = typeof e;
  return t = t ?? wue, !!t && (n == "number" || n != "symbol" && _ue.test(e)) && e > -1 && e % 1 == 0 && e < t;
}
var q_ = Sue, Oue = 9007199254740991;
function Aue(e) {
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Oue;
}
var X_ = Aue, Tue = ea, Pue = X_, Cue = ta, Eue = "[object Arguments]", kue = "[object Array]", Mue = "[object Boolean]", Nue = "[object Date]", $ue = "[object Error]", Due = "[object Function]", Iue = "[object Map]", Rue = "[object Number]", jue = "[object Object]", Lue = "[object RegExp]", Bue = "[object Set]", Fue = "[object String]", Wue = "[object WeakMap]", zue = "[object ArrayBuffer]", Vue = "[object DataView]", Uue = "[object Float32Array]", Hue = "[object Float64Array]", Kue = "[object Int8Array]", Gue = "[object Int16Array]", Yue = "[object Int32Array]", que = "[object Uint8Array]", Xue = "[object Uint8ClampedArray]", Zue = "[object Uint16Array]", Jue = "[object Uint32Array]", zt = {};
zt[Uue] = zt[Hue] = zt[Kue] = zt[Gue] = zt[Yue] = zt[que] = zt[Xue] = zt[Zue] = zt[Jue] = !0;
zt[Eue] = zt[kue] = zt[zue] = zt[Mue] = zt[Vue] = zt[Nue] = zt[$ue] = zt[Due] = zt[Iue] = zt[Rue] = zt[jue] = zt[Lue] = zt[Bue] = zt[Fue] = zt[Wue] = !1;
function Que(e) {
  return Cue(e) && Pue(e.length) && !!zt[Tue(e)];
}
var efe = Que;
function tfe(e) {
  return function(t) {
    return e(t);
  };
}
var yB = tfe, rm = { exports: {} };
rm.exports;
(function(e, t) {
  var n = TL, r = t && !t.nodeType && t, i = r && !0 && e && !e.nodeType && e, o = i && i.exports === r, a = o && n.process, s = function() {
    try {
      var l = i && i.require && i.require("util").types;
      return l || a && a.binding && a.binding("util");
    } catch {
    }
  }();
  e.exports = s;
})(rm, rm.exports);
var nfe = rm.exports, rfe = efe, ife = yB, ak = nfe, sk = ak && ak.isTypedArray, ofe = sk ? ife(sk) : rfe, vB = ofe, afe = cue, sfe = Y_, lfe = Tr, cfe = gB, ufe = q_, ffe = vB, dfe = Object.prototype, hfe = dfe.hasOwnProperty;
function pfe(e, t) {
  var n = lfe(e), r = !n && sfe(e), i = !n && !r && cfe(e), o = !n && !r && !i && ffe(e), a = n || r || i || o, s = a ? afe(e.length, String) : [], l = s.length;
  for (var c in e)
    (t || hfe.call(e, c)) && !(a && // Safari 9 has enumerable `arguments.length` in strict mode.
    (c == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    i && (c == "offset" || c == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    o && (c == "buffer" || c == "byteLength" || c == "byteOffset") || // Skip index properties.
    ufe(c, l))) && s.push(c);
  return s;
}
var mfe = pfe, gfe = Object.prototype;
function yfe(e) {
  var t = e && e.constructor, n = typeof t == "function" && t.prototype || gfe;
  return e === n;
}
var vfe = yfe;
function bfe(e, t) {
  return function(n) {
    return e(t(n));
  };
}
var bB = bfe, xfe = bB, wfe = xfe(Object.keys, Object), _fe = wfe, Sfe = vfe, Ofe = _fe, Afe = Object.prototype, Tfe = Afe.hasOwnProperty;
function Pfe(e) {
  if (!Sfe(e))
    return Ofe(e);
  var t = [];
  for (var n in Object(e))
    Tfe.call(e, n) && n != "constructor" && t.push(n);
  return t;
}
var Cfe = Pfe, Efe = $_, kfe = X_;
function Mfe(e) {
  return e != null && kfe(e.length) && !Efe(e);
}
var Cd = Mfe, Nfe = mfe, $fe = Cfe, Dfe = Cd;
function Ife(e) {
  return Dfe(e) ? Nfe(e) : $fe(e);
}
var ny = Ife, Rfe = Zce, jfe = sue, Lfe = ny;
function Bfe(e) {
  return Rfe(e, Lfe, jfe);
}
var Ffe = Bfe, lk = Ffe, Wfe = 1, zfe = Object.prototype, Vfe = zfe.hasOwnProperty;
function Ufe(e, t, n, r, i, o) {
  var a = n & Wfe, s = lk(e), l = s.length, c = lk(t), f = c.length;
  if (l != f && !a)
    return !1;
  for (var d = l; d--; ) {
    var p = s[d];
    if (!(a ? p in t : Vfe.call(t, p)))
      return !1;
  }
  var m = o.get(e), y = o.get(t);
  if (m && y)
    return m == t && y == e;
  var g = !0;
  o.set(e, t), o.set(t, e);
  for (var v = a; ++d < l; ) {
    p = s[d];
    var x = e[p], w = t[p];
    if (r)
      var S = a ? r(w, x, p, t, e, o) : r(x, w, p, e, t, o);
    if (!(S === void 0 ? x === w || i(x, w, n, r, o) : S)) {
      g = !1;
      break;
    }
    v || (v = p == "constructor");
  }
  if (g && !v) {
    var A = e.constructor, _ = t.constructor;
    A != _ && "constructor" in e && "constructor" in t && !(typeof A == "function" && A instanceof A && typeof _ == "function" && _ instanceof _) && (g = !1);
  }
  return o.delete(e), o.delete(t), g;
}
var Hfe = Ufe, Kfe = el, Gfe = ao, Yfe = Kfe(Gfe, "DataView"), qfe = Yfe, Xfe = el, Zfe = ao, Jfe = Xfe(Zfe, "Promise"), Qfe = Jfe, ede = el, tde = ao, nde = ede(tde, "Set"), xB = nde, rde = el, ide = ao, ode = rde(ide, "WeakMap"), ade = ode, Mx = qfe, Nx = I_, $x = Qfe, Dx = xB, Ix = ade, wB = ea, qc = CL, ck = "[object Map]", sde = "[object Object]", uk = "[object Promise]", fk = "[object Set]", dk = "[object WeakMap]", hk = "[object DataView]", lde = qc(Mx), cde = qc(Nx), ude = qc($x), fde = qc(Dx), dde = qc(Ix), vs = wB;
(Mx && vs(new Mx(new ArrayBuffer(1))) != hk || Nx && vs(new Nx()) != ck || $x && vs($x.resolve()) != uk || Dx && vs(new Dx()) != fk || Ix && vs(new Ix()) != dk) && (vs = function(e) {
  var t = wB(e), n = t == sde ? e.constructor : void 0, r = n ? qc(n) : "";
  if (r)
    switch (r) {
      case lde:
        return hk;
      case cde:
        return ck;
      case ude:
        return uk;
      case fde:
        return fk;
      case dde:
        return dk;
    }
  return t;
});
var hde = vs, Ib = cB, pde = hB, mde = Kce, gde = Hfe, pk = hde, mk = Tr, gk = gB, yde = vB, vde = 1, yk = "[object Arguments]", vk = "[object Array]", Vh = "[object Object]", bde = Object.prototype, bk = bde.hasOwnProperty;
function xde(e, t, n, r, i, o) {
  var a = mk(e), s = mk(t), l = a ? vk : pk(e), c = s ? vk : pk(t);
  l = l == yk ? Vh : l, c = c == yk ? Vh : c;
  var f = l == Vh, d = c == Vh, p = l == c;
  if (p && gk(e)) {
    if (!gk(t))
      return !1;
    a = !0, f = !1;
  }
  if (p && !f)
    return o || (o = new Ib()), a || yde(e) ? pde(e, t, n, r, i, o) : mde(e, t, l, n, r, i, o);
  if (!(n & vde)) {
    var m = f && bk.call(e, "__wrapped__"), y = d && bk.call(t, "__wrapped__");
    if (m || y) {
      var g = m ? e.value() : e, v = y ? t.value() : t;
      return o || (o = new Ib()), i(g, v, n, r, o);
    }
  }
  return p ? (o || (o = new Ib()), gde(e, t, n, r, i, o)) : !1;
}
var wde = xde, _de = wde, xk = ta;
function _B(e, t, n, r, i) {
  return e === t ? !0 : e == null || t == null || !xk(e) && !xk(t) ? e !== e && t !== t : _de(e, t, n, r, _B, i);
}
var Z_ = _B, Sde = cB, Ode = Z_, Ade = 1, Tde = 2;
function Pde(e, t, n, r) {
  var i = n.length, o = i, a = !r;
  if (e == null)
    return !o;
  for (e = Object(e); i--; ) {
    var s = n[i];
    if (a && s[2] ? s[1] !== e[s[0]] : !(s[0] in e))
      return !1;
  }
  for (; ++i < o; ) {
    s = n[i];
    var l = s[0], c = e[l], f = s[1];
    if (a && s[2]) {
      if (c === void 0 && !(l in e))
        return !1;
    } else {
      var d = new Sde();
      if (r)
        var p = r(c, f, l, e, t, d);
      if (!(p === void 0 ? Ode(f, c, Ade | Tde, r, d) : p))
        return !1;
    }
  }
  return !0;
}
var Cde = Pde, Ede = Ka;
function kde(e) {
  return e === e && !Ede(e);
}
var SB = kde, Mde = SB, Nde = ny;
function $de(e) {
  for (var t = Nde(e), n = t.length; n--; ) {
    var r = t[n], i = e[r];
    t[n] = [r, i, Mde(i)];
  }
  return t;
}
var Dde = $de;
function Ide(e, t) {
  return function(n) {
    return n == null ? !1 : n[e] === t && (t !== void 0 || e in Object(n));
  };
}
var OB = Ide, Rde = Cde, jde = Dde, Lde = OB;
function Bde(e) {
  var t = jde(e);
  return t.length == 1 && t[0][2] ? Lde(t[0][0], t[0][1]) : function(n) {
    return n === e || Rde(n, e, t);
  };
}
var Fde = Bde;
function Wde(e, t) {
  return e != null && t in Object(e);
}
var zde = Wde, Vde = $L, Ude = Y_, Hde = Tr, Kde = q_, Gde = X_, Yde = Zg;
function qde(e, t, n) {
  t = Vde(t, e);
  for (var r = -1, i = t.length, o = !1; ++r < i; ) {
    var a = Yde(t[r]);
    if (!(o = e != null && n(e, a)))
      break;
    e = e[a];
  }
  return o || ++r != i ? o : (i = e == null ? 0 : e.length, !!i && Gde(i) && Kde(a, i) && (Hde(e) || Ude(e)));
}
var Xde = qde, Zde = zde, Jde = Xde;
function Qde(e, t) {
  return e != null && Jde(e, t, Zde);
}
var ehe = Qde, the = Z_, nhe = DL, rhe = ehe, ihe = N_, ohe = SB, ahe = OB, she = Zg, lhe = 1, che = 2;
function uhe(e, t) {
  return ihe(e) && ohe(t) ? ahe(she(e), t) : function(n) {
    var r = nhe(n, e);
    return r === void 0 && r === t ? rhe(n, e) : the(t, r, lhe | che);
  };
}
var fhe = uhe;
function dhe(e) {
  return e;
}
var Xc = dhe;
function hhe(e) {
  return function(t) {
    return t == null ? void 0 : t[e];
  };
}
var phe = hhe, mhe = B_;
function ghe(e) {
  return function(t) {
    return mhe(t, e);
  };
}
var yhe = ghe, vhe = phe, bhe = yhe, xhe = N_, whe = Zg;
function _he(e) {
  return xhe(e) ? vhe(whe(e)) : bhe(e);
}
var She = _he, Ohe = Fde, Ahe = fhe, The = Xc, Phe = Tr, Che = She;
function Ehe(e) {
  return typeof e == "function" ? e : e == null ? The : typeof e == "object" ? Phe(e) ? Ahe(e[0], e[1]) : Ohe(e) : Che(e);
}
var so = Ehe;
function khe(e, t, n, r) {
  for (var i = e.length, o = n + (r ? 1 : -1); r ? o-- : ++o < i; )
    if (t(e[o], o, e))
      return o;
  return -1;
}
var AB = khe;
function Mhe(e) {
  return e !== e;
}
var Nhe = Mhe;
function $he(e, t, n) {
  for (var r = n - 1, i = e.length; ++r < i; )
    if (e[r] === t)
      return r;
  return -1;
}
var Dhe = $he, Ihe = AB, Rhe = Nhe, jhe = Dhe;
function Lhe(e, t, n) {
  return t === t ? jhe(e, t, n) : Ihe(e, Rhe, n);
}
var Bhe = Lhe, Fhe = Bhe;
function Whe(e, t) {
  var n = e == null ? 0 : e.length;
  return !!n && Fhe(e, t, 0) > -1;
}
var zhe = Whe;
function Vhe(e, t, n) {
  for (var r = -1, i = e == null ? 0 : e.length; ++r < i; )
    if (n(t, e[r]))
      return !0;
  return !1;
}
var Uhe = Vhe;
function Hhe() {
}
var Khe = Hhe, Rb = xB, Ghe = Khe, Yhe = G_, qhe = 1 / 0, Xhe = Rb && 1 / Yhe(new Rb([, -0]))[1] == qhe ? function(e) {
  return new Rb(e);
} : Ghe, Zhe = Xhe, Jhe = uB, Qhe = zhe, epe = Uhe, tpe = dB, npe = Zhe, rpe = G_, ipe = 200;
function ope(e, t, n) {
  var r = -1, i = Qhe, o = e.length, a = !0, s = [], l = s;
  if (n)
    a = !1, i = epe;
  else if (o >= ipe) {
    var c = t ? null : npe(e);
    if (c)
      return rpe(c);
    a = !1, i = tpe, l = new Jhe();
  } else
    l = t ? [] : s;
  e:
    for (; ++r < o; ) {
      var f = e[r], d = t ? t(f) : f;
      if (f = n || f !== 0 ? f : 0, a && d === d) {
        for (var p = l.length; p--; )
          if (l[p] === d)
            continue e;
        t && l.push(d), s.push(f);
      } else i(l, d, n) || (l !== s && l.push(d), s.push(f));
    }
  return s;
}
var ape = ope, spe = so, lpe = ape;
function cpe(e, t) {
  return e && e.length ? lpe(e, spe(t)) : [];
}
var upe = cpe;
const wk = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(upe);
function TB(e, t, n) {
  return t === !0 ? wk(e, n) : ze(t) ? wk(e, t) : e;
}
function sc(e) {
  "@babel/helpers - typeof";
  return sc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, sc(e);
}
var fpe = ["ref"];
function _k(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function wo(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? _k(Object(n), !0).forEach(function(r) {
      ry(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : _k(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function dpe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function Sk(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, CB(r.key), r);
  }
}
function hpe(e, t, n) {
  return t && Sk(e.prototype, t), n && Sk(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function ppe(e, t, n) {
  return t = im(t), mpe(e, PB() ? Reflect.construct(t, n || [], im(e).constructor) : t.apply(e, n));
}
function mpe(e, t) {
  if (t && (sc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return gpe(e);
}
function gpe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function PB() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (PB = function() {
    return !!e;
  })();
}
function im(e) {
  return im = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, im(e);
}
function ype(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && Rx(e, t);
}
function Rx(e, t) {
  return Rx = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, Rx(e, t);
}
function ry(e, t, n) {
  return t = CB(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function CB(e) {
  var t = vpe(e, "string");
  return sc(t) == "symbol" ? t : t + "";
}
function vpe(e, t) {
  if (sc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (sc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function bpe(e, t) {
  if (e == null) return {};
  var n = xpe(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function xpe(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function wpe(e) {
  return e.value;
}
function _pe(e, t) {
  if (/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(e))
    return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(e, t);
  if (typeof e == "function")
    return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(e, t);
  t.ref;
  var n = bpe(t, fpe);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(K_, n);
}
var Ok = 1, Lo = /* @__PURE__ */ function(e) {
  function t() {
    var n;
    dpe(this, t);
    for (var r = arguments.length, i = new Array(r), o = 0; o < r; o++)
      i[o] = arguments[o];
    return n = ppe(this, t, [].concat(i)), ry(n, "lastBoundingBox", {
      width: -1,
      height: -1
    }), n;
  }
  return ype(t, e), hpe(t, [{
    key: "componentDidMount",
    value: function() {
      this.updateBBox();
    }
  }, {
    key: "componentDidUpdate",
    value: function() {
      this.updateBBox();
    }
  }, {
    key: "getBBox",
    value: function() {
      if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {
        var r = this.wrapperNode.getBoundingClientRect();
        return r.height = this.wrapperNode.offsetHeight, r.width = this.wrapperNode.offsetWidth, r;
      }
      return null;
    }
  }, {
    key: "updateBBox",
    value: function() {
      var r = this.props.onBBoxUpdate, i = this.getBBox();
      i ? (Math.abs(i.width - this.lastBoundingBox.width) > Ok || Math.abs(i.height - this.lastBoundingBox.height) > Ok) && (this.lastBoundingBox.width = i.width, this.lastBoundingBox.height = i.height, r && r(i)) : (this.lastBoundingBox.width !== -1 || this.lastBoundingBox.height !== -1) && (this.lastBoundingBox.width = -1, this.lastBoundingBox.height = -1, r && r(null));
    }
  }, {
    key: "getBBoxSnapshot",
    value: function() {
      return this.lastBoundingBox.width >= 0 && this.lastBoundingBox.height >= 0 ? wo({}, this.lastBoundingBox) : {
        width: 0,
        height: 0
      };
    }
  }, {
    key: "getDefaultPosition",
    value: function(r) {
      var i = this.props, o = i.layout, a = i.align, s = i.verticalAlign, l = i.margin, c = i.chartWidth, f = i.chartHeight, d, p;
      if (!r || (r.left === void 0 || r.left === null) && (r.right === void 0 || r.right === null))
        if (a === "center" && o === "vertical") {
          var m = this.getBBoxSnapshot();
          d = {
            left: ((c || 0) - m.width) / 2
          };
        } else
          d = a === "right" ? {
            right: l && l.right || 0
          } : {
            left: l && l.left || 0
          };
      if (!r || (r.top === void 0 || r.top === null) && (r.bottom === void 0 || r.bottom === null))
        if (s === "middle") {
          var y = this.getBBoxSnapshot();
          p = {
            top: ((f || 0) - y.height) / 2
          };
        } else
          p = s === "bottom" ? {
            bottom: l && l.bottom || 0
          } : {
            top: l && l.top || 0
          };
      return wo(wo({}, d), p);
    }
  }, {
    key: "render",
    value: function() {
      var r = this, i = this.props, o = i.content, a = i.width, s = i.height, l = i.wrapperStyle, c = i.payloadUniqBy, f = i.payload, d = wo(wo({
        position: "absolute",
        width: a || "auto",
        height: s || "auto"
      }, this.getDefaultPosition(l)), l);
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", {
        className: "recharts-legend-wrapper",
        style: d,
        ref: function(m) {
          r.wrapperNode = m;
        }
      }, _pe(o, wo(wo({}, this.props), {}, {
        payload: TB(f, c, wpe)
      })));
    }
  }], [{
    key: "getWithHeight",
    value: function(r, i) {
      var o = wo(wo({}, this.defaultProps), r.props), a = o.layout;
      return a === "vertical" && be(r.props.height) ? {
        height: r.props.height
      } : a === "horizontal" ? {
        width: r.props.width || i
      } : null;
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent);
ry(Lo, "displayName", "Legend");
ry(Lo, "defaultProps", {
  iconSize: 14,
  layout: "horizontal",
  align: "center",
  verticalAlign: "bottom"
});
var Ak = Td, Spe = Y_, Ope = Tr, Tk = Ak ? Ak.isConcatSpreadable : void 0;
function Ape(e) {
  return Ope(e) || Spe(e) || !!(Tk && e && e[Tk]);
}
var Tpe = Ape, Ppe = pB, Cpe = Tpe;
function EB(e, t, n, r, i) {
  var o = -1, a = e.length;
  for (n || (n = Cpe), i || (i = []); ++o < a; ) {
    var s = e[o];
    t > 0 && n(s) ? t > 1 ? EB(s, t - 1, n, r, i) : Ppe(i, s) : r || (i[i.length] = s);
  }
  return i;
}
var kB = EB;
function Epe(e) {
  return function(t, n, r) {
    for (var i = -1, o = Object(t), a = r(t), s = a.length; s--; ) {
      var l = a[e ? s : ++i];
      if (n(o[l], l, o) === !1)
        break;
    }
    return t;
  };
}
var kpe = Epe, Mpe = kpe, Npe = Mpe(), $pe = Npe, Dpe = $pe, Ipe = ny;
function Rpe(e, t) {
  return e && Dpe(e, t, Ipe);
}
var MB = Rpe, jpe = Cd;
function Lpe(e, t) {
  return function(n, r) {
    if (n == null)
      return n;
    if (!jpe(n))
      return e(n, r);
    for (var i = n.length, o = t ? i : -1, a = Object(n); (t ? o-- : ++o < i) && r(a[o], o, a) !== !1; )
      ;
    return n;
  };
}
var Bpe = Lpe, Fpe = MB, Wpe = Bpe, zpe = Wpe(Fpe), J_ = zpe, Vpe = J_, Upe = Cd;
function Hpe(e, t) {
  var n = -1, r = Upe(e) ? Array(e.length) : [];
  return Vpe(e, function(i, o, a) {
    r[++n] = t(i, o, a);
  }), r;
}
var NB = Hpe;
function Kpe(e, t) {
  var n = e.length;
  for (e.sort(t); n--; )
    e[n] = e[n].value;
  return e;
}
var Gpe = Kpe, Pk = zc;
function Ype(e, t) {
  if (e !== t) {
    var n = e !== void 0, r = e === null, i = e === e, o = Pk(e), a = t !== void 0, s = t === null, l = t === t, c = Pk(t);
    if (!s && !c && !o && e > t || o && a && l && !s && !c || r && a && l || !n && l || !i)
      return 1;
    if (!r && !o && !c && e < t || c && n && i && !r && !o || s && n && i || !a && i || !l)
      return -1;
  }
  return 0;
}
var qpe = Ype, Xpe = qpe;
function Zpe(e, t, n) {
  for (var r = -1, i = e.criteria, o = t.criteria, a = i.length, s = n.length; ++r < a; ) {
    var l = Xpe(i[r], o[r]);
    if (l) {
      if (r >= s)
        return l;
      var c = n[r];
      return l * (c == "desc" ? -1 : 1);
    }
  }
  return e.index - t.index;
}
var Jpe = Zpe, jb = L_, Qpe = B_, eme = so, tme = NB, nme = Gpe, rme = yB, ime = Jpe, ome = Xc, ame = Tr;
function sme(e, t, n) {
  t.length ? t = jb(t, function(o) {
    return ame(o) ? function(a) {
      return Qpe(a, o.length === 1 ? o[0] : o);
    } : o;
  }) : t = [ome];
  var r = -1;
  t = jb(t, rme(eme));
  var i = tme(e, function(o, a, s) {
    var l = jb(t, function(c) {
      return c(o);
    });
    return { criteria: l, index: ++r, value: o };
  });
  return nme(i, function(o, a) {
    return ime(o, a, n);
  });
}
var lme = sme;
function cme(e, t, n) {
  switch (n.length) {
    case 0:
      return e.call(t);
    case 1:
      return e.call(t, n[0]);
    case 2:
      return e.call(t, n[0], n[1]);
    case 3:
      return e.call(t, n[0], n[1], n[2]);
  }
  return e.apply(t, n);
}
var ume = cme, fme = ume, Ck = Math.max;
function dme(e, t, n) {
  return t = Ck(t === void 0 ? e.length - 1 : t, 0), function() {
    for (var r = arguments, i = -1, o = Ck(r.length - t, 0), a = Array(o); ++i < o; )
      a[i] = r[t + i];
    i = -1;
    for (var s = Array(t + 1); ++i < t; )
      s[i] = r[i];
    return s[t] = n(a), fme(e, this, s);
  };
}
var hme = dme;
function pme(e) {
  return function() {
    return e;
  };
}
var mme = pme, gme = el, yme = function() {
  try {
    var e = gme(Object, "defineProperty");
    return e({}, "", {}), e;
  } catch {
  }
}(), $B = yme, vme = mme, Ek = $B, bme = Xc, xme = Ek ? function(e, t) {
  return Ek(e, "toString", {
    configurable: !0,
    enumerable: !1,
    value: vme(t),
    writable: !0
  });
} : bme, wme = xme, _me = 800, Sme = 16, Ome = Date.now;
function Ame(e) {
  var t = 0, n = 0;
  return function() {
    var r = Ome(), i = Sme - (r - n);
    if (n = r, i > 0) {
      if (++t >= _me)
        return arguments[0];
    } else
      t = 0;
    return e.apply(void 0, arguments);
  };
}
var Tme = Ame, Pme = wme, Cme = Tme, Eme = Cme(Pme), kme = Eme, Mme = Xc, Nme = hme, $me = kme;
function Dme(e, t) {
  return $me(Nme(e, t, Mme), e + "");
}
var Ime = Dme, Rme = D_, jme = Cd, Lme = q_, Bme = Ka;
function Fme(e, t, n) {
  if (!Bme(n))
    return !1;
  var r = typeof t;
  return (r == "number" ? jme(n) && Lme(t, n.length) : r == "string" && t in n) ? Rme(n[t], e) : !1;
}
var iy = Fme, Wme = kB, zme = lme, Vme = Ime, kk = iy, Ume = Vme(function(e, t) {
  if (e == null)
    return [];
  var n = t.length;
  return n > 1 && kk(e, t[0], t[1]) ? t = [] : n > 2 && kk(t[0], t[1], t[2]) && (t = [t[0]]), zme(e, Wme(t, 1), []);
}), Hme = Ume;
const Q_ = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(Hme);
function Ef(e) {
  "@babel/helpers - typeof";
  return Ef = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Ef(e);
}
function jx() {
  return jx = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, jx.apply(this, arguments);
}
function Kme(e, t) {
  return Xme(e) || qme(e, t) || Yme(e, t) || Gme();
}
function Gme() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Yme(e, t) {
  if (e) {
    if (typeof e == "string") return Mk(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Mk(e, t);
  }
}
function Mk(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function qme(e, t) {
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (n != null) {
    var r, i, o, a, s = [], l = !0, c = !1;
    try {
      if (o = (n = n.call(e)).next, t !== 0) for (; !(l = (r = o.call(n)).done) && (s.push(r.value), s.length !== t); l = !0) ;
    } catch (f) {
      c = !0, i = f;
    } finally {
      try {
        if (!l && n.return != null && (a = n.return(), Object(a) !== a)) return;
      } finally {
        if (c) throw i;
      }
    }
    return s;
  }
}
function Xme(e) {
  if (Array.isArray(e)) return e;
}
function Nk(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function Lb(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? Nk(Object(n), !0).forEach(function(r) {
      Zme(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Nk(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function Zme(e, t, n) {
  return t = Jme(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function Jme(e) {
  var t = Qme(e, "string");
  return Ef(t) == "symbol" ? t : t + "";
}
function Qme(e, t) {
  if (Ef(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Ef(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function ege(e) {
  return Array.isArray(e) && On(e[0]) && On(e[1]) ? e.join(" ~ ") : e;
}
var tge = function(t) {
  var n = t.separator, r = n === void 0 ? " : " : n, i = t.contentStyle, o = i === void 0 ? {} : i, a = t.itemStyle, s = a === void 0 ? {} : a, l = t.labelStyle, c = l === void 0 ? {} : l, f = t.payload, d = t.formatter, p = t.itemSorter, m = t.wrapperClassName, y = t.labelClassName, g = t.label, v = t.labelFormatter, x = t.accessibilityLayer, w = x === void 0 ? !1 : x, S = function() {
    if (f && f.length) {
      var N = {
        padding: 0,
        margin: 0
      }, D = (p ? Q_(f, p) : f).map(function(j, F) {
        if (j.type === "none")
          return null;
        var W = Lb({
          display: "block",
          paddingTop: 4,
          paddingBottom: 4,
          color: j.color || "#000"
        }, s), z = j.formatter || d || ege, H = j.value, U = j.name, V = H, Y = U;
        if (z && V != null && Y != null) {
          var Q = z(H, U, j, F, f);
          if (Array.isArray(Q)) {
            var ne = Kme(Q, 2);
            V = ne[0], Y = ne[1];
          } else
            V = Q;
        }
        return (
          // eslint-disable-next-line react/no-array-index-key
          /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("li", {
            className: "recharts-tooltip-item",
            key: "tooltip-item-".concat(F),
            style: W
          }, On(Y) ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", {
            className: "recharts-tooltip-item-name"
          }, Y) : null, On(Y) ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", {
            className: "recharts-tooltip-item-separator"
          }, r) : null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", {
            className: "recharts-tooltip-item-value"
          }, V), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("span", {
            className: "recharts-tooltip-item-unit"
          }, j.unit || ""))
        );
      });
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("ul", {
        className: "recharts-tooltip-item-list",
        style: N
      }, D);
    }
    return null;
  }, A = Lb({
    margin: 0,
    padding: 10,
    backgroundColor: "#fff",
    border: "1px solid #ccc",
    whiteSpace: "nowrap"
  }, o), _ = Lb({
    margin: 0
  }, c), O = !Ue(g), P = O ? g : "", C = Xe("recharts-default-tooltip", m), k = Xe("recharts-tooltip-label", y);
  O && v && f !== void 0 && f !== null && (P = v(g, f));
  var I = w ? {
    role: "status",
    "aria-live": "assertive"
  } : {};
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", jx({
    className: C,
    style: A
  }, I), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("p", {
    className: k,
    style: _
  }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(P) ? P : "".concat(P)), S());
};
function kf(e) {
  "@babel/helpers - typeof";
  return kf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, kf(e);
}
function Uh(e, t, n) {
  return t = nge(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function nge(e) {
  var t = rge(e, "string");
  return kf(t) == "symbol" ? t : t + "";
}
function rge(e, t) {
  if (kf(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (kf(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var Cu = "recharts-tooltip-wrapper", ige = {
  visibility: "hidden"
};
function oge(e) {
  var t = e.coordinate, n = e.translateX, r = e.translateY;
  return Xe(Cu, Uh(Uh(Uh(Uh({}, "".concat(Cu, "-right"), be(n) && t && be(t.x) && n >= t.x), "".concat(Cu, "-left"), be(n) && t && be(t.x) && n < t.x), "".concat(Cu, "-bottom"), be(r) && t && be(t.y) && r >= t.y), "".concat(Cu, "-top"), be(r) && t && be(t.y) && r < t.y));
}
function $k(e) {
  var t = e.allowEscapeViewBox, n = e.coordinate, r = e.key, i = e.offsetTopLeft, o = e.position, a = e.reverseDirection, s = e.tooltipDimension, l = e.viewBox, c = e.viewBoxDimension;
  if (o && be(o[r]))
    return o[r];
  var f = n[r] - s - i, d = n[r] + i;
  if (t[r])
    return a[r] ? f : d;
  if (a[r]) {
    var p = f, m = l[r];
    return p < m ? Math.max(d, l[r]) : Math.max(f, l[r]);
  }
  var y = d + s, g = l[r] + c;
  return y > g ? Math.max(f, l[r]) : Math.max(d, l[r]);
}
function age(e) {
  var t = e.translateX, n = e.translateY, r = e.useTranslate3d;
  return {
    transform: r ? "translate3d(".concat(t, "px, ").concat(n, "px, 0)") : "translate(".concat(t, "px, ").concat(n, "px)")
  };
}
function sge(e) {
  var t = e.allowEscapeViewBox, n = e.coordinate, r = e.offsetTopLeft, i = e.position, o = e.reverseDirection, a = e.tooltipBox, s = e.useTranslate3d, l = e.viewBox, c, f, d;
  return a.height > 0 && a.width > 0 && n ? (f = $k({
    allowEscapeViewBox: t,
    coordinate: n,
    key: "x",
    offsetTopLeft: r,
    position: i,
    reverseDirection: o,
    tooltipDimension: a.width,
    viewBox: l,
    viewBoxDimension: l.width
  }), d = $k({
    allowEscapeViewBox: t,
    coordinate: n,
    key: "y",
    offsetTopLeft: r,
    position: i,
    reverseDirection: o,
    tooltipDimension: a.height,
    viewBox: l,
    viewBoxDimension: l.height
  }), c = age({
    translateX: f,
    translateY: d,
    useTranslate3d: s
  })) : c = ige, {
    cssProperties: c,
    cssClasses: oge({
      translateX: f,
      translateY: d,
      coordinate: n
    })
  };
}
function lc(e) {
  "@babel/helpers - typeof";
  return lc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, lc(e);
}
function Dk(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function Ik(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? Dk(Object(n), !0).forEach(function(r) {
      Bx(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Dk(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function lge(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function cge(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, IB(r.key), r);
  }
}
function uge(e, t, n) {
  return t && cge(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function fge(e, t, n) {
  return t = om(t), dge(e, DB() ? Reflect.construct(t, n || [], om(e).constructor) : t.apply(e, n));
}
function dge(e, t) {
  if (t && (lc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return hge(e);
}
function hge(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function DB() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (DB = function() {
    return !!e;
  })();
}
function om(e) {
  return om = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, om(e);
}
function pge(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && Lx(e, t);
}
function Lx(e, t) {
  return Lx = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, Lx(e, t);
}
function Bx(e, t, n) {
  return t = IB(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function IB(e) {
  var t = mge(e, "string");
  return lc(t) == "symbol" ? t : t + "";
}
function mge(e, t) {
  if (lc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (lc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var Rk = 1, gge = /* @__PURE__ */ function(e) {
  function t() {
    var n;
    lge(this, t);
    for (var r = arguments.length, i = new Array(r), o = 0; o < r; o++)
      i[o] = arguments[o];
    return n = fge(this, t, [].concat(i)), Bx(n, "state", {
      dismissed: !1,
      dismissedAtCoordinate: {
        x: 0,
        y: 0
      },
      lastBoundingBox: {
        width: -1,
        height: -1
      }
    }), Bx(n, "handleKeyDown", function(a) {
      if (a.key === "Escape") {
        var s, l, c, f;
        n.setState({
          dismissed: !0,
          dismissedAtCoordinate: {
            x: (s = (l = n.props.coordinate) === null || l === void 0 ? void 0 : l.x) !== null && s !== void 0 ? s : 0,
            y: (c = (f = n.props.coordinate) === null || f === void 0 ? void 0 : f.y) !== null && c !== void 0 ? c : 0
          }
        });
      }
    }), n;
  }
  return pge(t, e), uge(t, [{
    key: "updateBBox",
    value: function() {
      if (this.wrapperNode && this.wrapperNode.getBoundingClientRect) {
        var r = this.wrapperNode.getBoundingClientRect();
        (Math.abs(r.width - this.state.lastBoundingBox.width) > Rk || Math.abs(r.height - this.state.lastBoundingBox.height) > Rk) && this.setState({
          lastBoundingBox: {
            width: r.width,
            height: r.height
          }
        });
      } else (this.state.lastBoundingBox.width !== -1 || this.state.lastBoundingBox.height !== -1) && this.setState({
        lastBoundingBox: {
          width: -1,
          height: -1
        }
      });
    }
  }, {
    key: "componentDidMount",
    value: function() {
      document.addEventListener("keydown", this.handleKeyDown), this.updateBBox();
    }
  }, {
    key: "componentWillUnmount",
    value: function() {
      document.removeEventListener("keydown", this.handleKeyDown);
    }
  }, {
    key: "componentDidUpdate",
    value: function() {
      var r, i;
      this.props.active && this.updateBBox(), this.state.dismissed && (((r = this.props.coordinate) === null || r === void 0 ? void 0 : r.x) !== this.state.dismissedAtCoordinate.x || ((i = this.props.coordinate) === null || i === void 0 ? void 0 : i.y) !== this.state.dismissedAtCoordinate.y) && (this.state.dismissed = !1);
    }
  }, {
    key: "render",
    value: function() {
      var r = this, i = this.props, o = i.active, a = i.allowEscapeViewBox, s = i.animationDuration, l = i.animationEasing, c = i.children, f = i.coordinate, d = i.hasPayload, p = i.isAnimationActive, m = i.offset, y = i.position, g = i.reverseDirection, v = i.useTranslate3d, x = i.viewBox, w = i.wrapperStyle, S = sge({
        allowEscapeViewBox: a,
        coordinate: f,
        offsetTopLeft: m,
        position: y,
        reverseDirection: g,
        tooltipBox: this.state.lastBoundingBox,
        useTranslate3d: v,
        viewBox: x
      }), A = S.cssClasses, _ = S.cssProperties, O = Ik(Ik({
        transition: p && o ? "transform ".concat(s, "ms ").concat(l) : void 0
      }, _), {}, {
        pointerEvents: "none",
        visibility: !this.state.dismissed && o && d ? "visible" : "hidden",
        position: "absolute",
        top: 0,
        left: 0
      }, w);
      return (
        // This element allow listening to the `Escape` key.
        // See https://github.com/recharts/recharts/pull/2925
        /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", {
          tabIndex: -1,
          className: A,
          style: O,
          ref: function(C) {
            r.wrapperNode = C;
          }
        }, c)
      );
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent), yge = function() {
  return !(typeof window < "u" && window.document && window.document.createElement && window.setTimeout);
}, Ni = {
  isSsr: yge(),
  get: function(t) {
    return Ni[t];
  },
  set: function(t, n) {
    if (typeof t == "string")
      Ni[t] = n;
    else {
      var r = Object.keys(t);
      r && r.length && r.forEach(function(i) {
        Ni[i] = t[i];
      });
    }
  }
};
function cc(e) {
  "@babel/helpers - typeof";
  return cc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, cc(e);
}
function jk(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function Lk(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? jk(Object(n), !0).forEach(function(r) {
      eS(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : jk(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function vge(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function bge(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, jB(r.key), r);
  }
}
function xge(e, t, n) {
  return t && bge(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function wge(e, t, n) {
  return t = am(t), _ge(e, RB() ? Reflect.construct(t, n || [], am(e).constructor) : t.apply(e, n));
}
function _ge(e, t) {
  if (t && (cc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return Sge(e);
}
function Sge(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function RB() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (RB = function() {
    return !!e;
  })();
}
function am(e) {
  return am = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, am(e);
}
function Oge(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && Fx(e, t);
}
function Fx(e, t) {
  return Fx = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, Fx(e, t);
}
function eS(e, t, n) {
  return t = jB(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function jB(e) {
  var t = Age(e, "string");
  return cc(t) == "symbol" ? t : t + "";
}
function Age(e, t) {
  if (cc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (cc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function Tge(e) {
  return e.dataKey;
}
function Pge(e, t) {
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(e) ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(e, t) : typeof e == "function" ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(e, t) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(tge, t);
}
var Lr = /* @__PURE__ */ function(e) {
  function t() {
    return vge(this, t), wge(this, t, arguments);
  }
  return Oge(t, e), xge(t, [{
    key: "render",
    value: function() {
      var r = this, i = this.props, o = i.active, a = i.allowEscapeViewBox, s = i.animationDuration, l = i.animationEasing, c = i.content, f = i.coordinate, d = i.filterNull, p = i.isAnimationActive, m = i.offset, y = i.payload, g = i.payloadUniqBy, v = i.position, x = i.reverseDirection, w = i.useTranslate3d, S = i.viewBox, A = i.wrapperStyle, _ = y ?? [];
      d && _.length && (_ = TB(y.filter(function(P) {
        return P.value != null && (P.hide !== !0 || r.props.includeHidden);
      }), g, Tge));
      var O = _.length > 0;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(gge, {
        allowEscapeViewBox: a,
        animationDuration: s,
        animationEasing: l,
        isAnimationActive: p,
        active: o,
        coordinate: f,
        hasPayload: O,
        offset: m,
        position: v,
        reverseDirection: x,
        useTranslate3d: w,
        viewBox: S,
        wrapperStyle: A
      }, Pge(c, Lk(Lk({}, this.props), {}, {
        payload: _
      })));
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent);
eS(Lr, "displayName", "Tooltip");
eS(Lr, "defaultProps", {
  accessibilityLayer: !1,
  allowEscapeViewBox: {
    x: !1,
    y: !1
  },
  animationDuration: 400,
  animationEasing: "ease",
  contentStyle: {},
  coordinate: {
    x: 0,
    y: 0
  },
  cursor: !0,
  cursorStyle: {},
  filterNull: !0,
  isAnimationActive: !Ni.isSsr,
  itemStyle: {},
  labelStyle: {},
  offset: 10,
  reverseDirection: {
    x: !1,
    y: !1
  },
  separator: " : ",
  trigger: "hover",
  useTranslate3d: !1,
  viewBox: {
    x: 0,
    y: 0,
    height: 0,
    width: 0
  },
  wrapperStyle: {}
});
var Cge = ao, Ege = function() {
  return Cge.Date.now();
}, kge = Ege, Mge = /\s/;
function Nge(e) {
  for (var t = e.length; t-- && Mge.test(e.charAt(t)); )
    ;
  return t;
}
var $ge = Nge, Dge = $ge, Ige = /^\s+/;
function Rge(e) {
  return e && e.slice(0, Dge(e) + 1).replace(Ige, "");
}
var jge = Rge, Lge = jge, Bk = Ka, Bge = zc, Fk = NaN, Fge = /^[-+]0x[0-9a-f]+$/i, Wge = /^0b[01]+$/i, zge = /^0o[0-7]+$/i, Vge = parseInt;
function Uge(e) {
  if (typeof e == "number")
    return e;
  if (Bge(e))
    return Fk;
  if (Bk(e)) {
    var t = typeof e.valueOf == "function" ? e.valueOf() : e;
    e = Bk(t) ? t + "" : t;
  }
  if (typeof e != "string")
    return e === 0 ? e : +e;
  e = Lge(e);
  var n = Wge.test(e);
  return n || zge.test(e) ? Vge(e.slice(2), n ? 2 : 8) : Fge.test(e) ? Fk : +e;
}
var LB = Uge, Hge = Ka, Bb = kge, Wk = LB, Kge = "Expected a function", Gge = Math.max, Yge = Math.min;
function qge(e, t, n) {
  var r, i, o, a, s, l, c = 0, f = !1, d = !1, p = !0;
  if (typeof e != "function")
    throw new TypeError(Kge);
  t = Wk(t) || 0, Hge(n) && (f = !!n.leading, d = "maxWait" in n, o = d ? Gge(Wk(n.maxWait) || 0, t) : o, p = "trailing" in n ? !!n.trailing : p);
  function m(O) {
    var P = r, C = i;
    return r = i = void 0, c = O, a = e.apply(C, P), a;
  }
  function y(O) {
    return c = O, s = setTimeout(x, t), f ? m(O) : a;
  }
  function g(O) {
    var P = O - l, C = O - c, k = t - P;
    return d ? Yge(k, o - C) : k;
  }
  function v(O) {
    var P = O - l, C = O - c;
    return l === void 0 || P >= t || P < 0 || d && C >= o;
  }
  function x() {
    var O = Bb();
    if (v(O))
      return w(O);
    s = setTimeout(x, g(O));
  }
  function w(O) {
    return s = void 0, p && r ? m(O) : (r = i = void 0, a);
  }
  function S() {
    s !== void 0 && clearTimeout(s), c = 0, r = l = i = s = void 0;
  }
  function A() {
    return s === void 0 ? a : w(Bb());
  }
  function _() {
    var O = Bb(), P = v(O);
    if (r = arguments, i = this, l = O, P) {
      if (s === void 0)
        return y(l);
      if (d)
        return clearTimeout(s), s = setTimeout(x, t), m(l);
    }
    return s === void 0 && (s = setTimeout(x, t)), a;
  }
  return _.cancel = S, _.flush = A, _;
}
var Xge = qge, Zge = Xge, Jge = Ka, Qge = "Expected a function";
function eye(e, t, n) {
  var r = !0, i = !0;
  if (typeof e != "function")
    throw new TypeError(Qge);
  return Jge(n) && (r = "leading" in n ? !!n.leading : r, i = "trailing" in n ? !!n.trailing : i), Zge(e, t, {
    leading: r,
    maxWait: t,
    trailing: i
  });
}
var tye = eye;
const BB = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(tye);
function Mf(e) {
  "@babel/helpers - typeof";
  return Mf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Mf(e);
}
function zk(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function Hh(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? zk(Object(n), !0).forEach(function(r) {
      nye(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : zk(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function nye(e, t, n) {
  return t = rye(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function rye(e) {
  var t = iye(e, "string");
  return Mf(t) == "symbol" ? t : t + "";
}
function iye(e, t) {
  if (Mf(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Mf(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function oye(e, t) {
  return cye(e) || lye(e, t) || sye(e, t) || aye();
}
function aye() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function sye(e, t) {
  if (e) {
    if (typeof e == "string") return Vk(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Vk(e, t);
  }
}
function Vk(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function lye(e, t) {
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (n != null) {
    var r, i, o, a, s = [], l = !0, c = !1;
    try {
      if (o = (n = n.call(e)).next, t !== 0) for (; !(l = (r = o.call(n)).done) && (s.push(r.value), s.length !== t); l = !0) ;
    } catch (f) {
      c = !0, i = f;
    } finally {
      try {
        if (!l && n.return != null && (a = n.return(), Object(a) !== a)) return;
      } finally {
        if (c) throw i;
      }
    }
    return s;
  }
}
function cye(e) {
  if (Array.isArray(e)) return e;
}
var tS = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function(e, t) {
  var n = e.aspect, r = e.initialDimension, i = r === void 0 ? {
    width: -1,
    height: -1
  } : r, o = e.width, a = o === void 0 ? "100%" : o, s = e.height, l = s === void 0 ? "100%" : s, c = e.minWidth, f = c === void 0 ? 0 : c, d = e.minHeight, p = e.maxHeight, m = e.children, y = e.debounce, g = y === void 0 ? 0 : y, v = e.id, x = e.className, w = e.onResize, S = e.style, A = S === void 0 ? {} : S, _ = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null), O = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();
  O.current = w, (0,react__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle)(t, function() {
    return Object.defineProperty(_.current, "current", {
      get: function() {
        return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."), _.current;
      },
      configurable: !0
    });
  });
  var P = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({
    containerWidth: i.width,
    containerHeight: i.height
  }), C = oye(P, 2), k = C[0], I = C[1], $ = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function(D, j) {
    I(function(F) {
      var W = Math.round(D), z = Math.round(j);
      return F.containerWidth === W && F.containerHeight === z ? F : {
        containerWidth: W,
        containerHeight: z
      };
    });
  }, []);
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function() {
    var D = function(U) {
      var V, Y = U[0].contentRect, Q = Y.width, ne = Y.height;
      $(Q, ne), (V = O.current) === null || V === void 0 || V.call(O, Q, ne);
    };
    g > 0 && (D = BB(D, g, {
      trailing: !0,
      leading: !1
    }));
    var j = new ResizeObserver(D), F = _.current.getBoundingClientRect(), W = F.width, z = F.height;
    return $(W, z), j.observe(_.current), function() {
      j.disconnect();
    };
  }, [$, g]);
  var N = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function() {
    var D = k.containerWidth, j = k.containerHeight;
    if (D < 0 || j < 0)
      return null;
    Mi(Ss(a) || Ss(l), `The width(%s) and height(%s) are both fixed numbers,
       maybe you don't need to use a ResponsiveContainer.`, a, l), Mi(!n || n > 0, "The aspect(%s) must be greater than zero.", n);
    var F = Ss(a) ? D : a, W = Ss(l) ? j : l;
    n && n > 0 && (F ? W = F / n : W && (F = W * n), p && W > p && (W = p)), Mi(F > 0 || W > 0, `The width(%s) and height(%s) of chart should be greater than 0,
       please check the style of container, or the props width(%s) and height(%s),
       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
       height and width.`, F, W, a, l, f, d, n);
    var z = !Array.isArray(m) && jo(m.type).endsWith("Chart");
    return react__WEBPACK_IMPORTED_MODULE_1__.Children.map(m, function(H) {
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(H) ? /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(H, Hh({
        width: F,
        height: W
      }, z ? {
        style: Hh({
          height: "100%",
          width: "100%",
          maxHeight: W,
          maxWidth: F
        }, H.props.style)
      } : {})) : H;
    });
  }, [n, m, l, p, d, f, k, a]);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", {
    id: v ? "".concat(v) : void 0,
    className: Xe("recharts-responsive-container", x),
    style: Hh(Hh({}, A), {}, {
      width: a,
      height: l,
      minWidth: f,
      minHeight: d,
      maxHeight: p
    }),
    ref: _
  }, N);
}), nS = function(t) {
  return null;
};
nS.displayName = "Cell";
function Nf(e) {
  "@babel/helpers - typeof";
  return Nf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Nf(e);
}
function Uk(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function Wx(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? Uk(Object(n), !0).forEach(function(r) {
      uye(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Uk(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function uye(e, t, n) {
  return t = fye(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function fye(e) {
  var t = dye(e, "string");
  return Nf(t) == "symbol" ? t : t + "";
}
function dye(e, t) {
  if (Nf(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Nf(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var Sl = {
  widthCache: {},
  cacheCount: 0
}, hye = 2e3, pye = {
  position: "absolute",
  top: "-20000px",
  left: 0,
  padding: 0,
  margin: 0,
  border: "none",
  whiteSpace: "pre"
}, Hk = "recharts_measurement_span";
function mye(e) {
  var t = Wx({}, e);
  return Object.keys(t).forEach(function(n) {
    t[n] || delete t[n];
  }), t;
}
var tf = function(t) {
  var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
  if (t == null || Ni.isSsr)
    return {
      width: 0,
      height: 0
    };
  var r = mye(n), i = JSON.stringify({
    text: t,
    copyStyle: r
  });
  if (Sl.widthCache[i])
    return Sl.widthCache[i];
  try {
    var o = document.getElementById(Hk);
    o || (o = document.createElement("span"), o.setAttribute("id", Hk), o.setAttribute("aria-hidden", "true"), document.body.appendChild(o));
    var a = Wx(Wx({}, pye), r);
    Object.assign(o.style, a), o.textContent = "".concat(t);
    var s = o.getBoundingClientRect(), l = {
      width: s.width,
      height: s.height
    };
    return Sl.widthCache[i] = l, ++Sl.cacheCount > hye && (Sl.cacheCount = 0, Sl.widthCache = {}), l;
  } catch {
    return {
      width: 0,
      height: 0
    };
  }
}, gye = function(t) {
  return {
    top: t.top + window.scrollY - document.documentElement.clientTop,
    left: t.left + window.scrollX - document.documentElement.clientLeft
  };
};
function $f(e) {
  "@babel/helpers - typeof";
  return $f = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, $f(e);
}
function sm(e, t) {
  return xye(e) || bye(e, t) || vye(e, t) || yye();
}
function yye() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function vye(e, t) {
  if (e) {
    if (typeof e == "string") return Kk(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Kk(e, t);
  }
}
function Kk(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function bye(e, t) {
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (n != null) {
    var r, i, o, a, s = [], l = !0, c = !1;
    try {
      if (o = (n = n.call(e)).next, t === 0) {
        if (Object(n) !== n) return;
        l = !1;
      } else for (; !(l = (r = o.call(n)).done) && (s.push(r.value), s.length !== t); l = !0) ;
    } catch (f) {
      c = !0, i = f;
    } finally {
      try {
        if (!l && n.return != null && (a = n.return(), Object(a) !== a)) return;
      } finally {
        if (c) throw i;
      }
    }
    return s;
  }
}
function xye(e) {
  if (Array.isArray(e)) return e;
}
function wye(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function Gk(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, Sye(r.key), r);
  }
}
function _ye(e, t, n) {
  return t && Gk(e.prototype, t), n && Gk(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function Sye(e) {
  var t = Oye(e, "string");
  return $f(t) == "symbol" ? t : t + "";
}
function Oye(e, t) {
  if ($f(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t);
    if ($f(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return String(e);
}
var Yk = /(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/, qk = /(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/, Aye = /^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/, Tye = /(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/, FB = {
  cm: 96 / 2.54,
  mm: 96 / 25.4,
  pt: 96 / 72,
  pc: 96 / 6,
  in: 96,
  Q: 96 / (2.54 * 40),
  px: 1
}, Pye = Object.keys(FB), Ll = "NaN";
function Cye(e, t) {
  return e * FB[t];
}
var Kh = /* @__PURE__ */ function() {
  function e(t, n) {
    wye(this, e), this.num = t, this.unit = n, this.num = t, this.unit = n, Number.isNaN(t) && (this.unit = ""), n !== "" && !Aye.test(n) && (this.num = NaN, this.unit = ""), Pye.includes(n) && (this.num = Cye(t, n), this.unit = "px");
  }
  return _ye(e, [{
    key: "add",
    value: function(n) {
      return this.unit !== n.unit ? new e(NaN, "") : new e(this.num + n.num, this.unit);
    }
  }, {
    key: "subtract",
    value: function(n) {
      return this.unit !== n.unit ? new e(NaN, "") : new e(this.num - n.num, this.unit);
    }
  }, {
    key: "multiply",
    value: function(n) {
      return this.unit !== "" && n.unit !== "" && this.unit !== n.unit ? new e(NaN, "") : new e(this.num * n.num, this.unit || n.unit);
    }
  }, {
    key: "divide",
    value: function(n) {
      return this.unit !== "" && n.unit !== "" && this.unit !== n.unit ? new e(NaN, "") : new e(this.num / n.num, this.unit || n.unit);
    }
  }, {
    key: "toString",
    value: function() {
      return "".concat(this.num).concat(this.unit);
    }
  }, {
    key: "isNaN",
    value: function() {
      return Number.isNaN(this.num);
    }
  }], [{
    key: "parse",
    value: function(n) {
      var r, i = (r = Tye.exec(n)) !== null && r !== void 0 ? r : [], o = sm(i, 3), a = o[1], s = o[2];
      return new e(parseFloat(a), s ?? "");
    }
  }]);
}();
function WB(e) {
  if (e.includes(Ll))
    return Ll;
  for (var t = e; t.includes("*") || t.includes("/"); ) {
    var n, r = (n = Yk.exec(t)) !== null && n !== void 0 ? n : [], i = sm(r, 4), o = i[1], a = i[2], s = i[3], l = Kh.parse(o ?? ""), c = Kh.parse(s ?? ""), f = a === "*" ? l.multiply(c) : l.divide(c);
    if (f.isNaN())
      return Ll;
    t = t.replace(Yk, f.toString());
  }
  for (; t.includes("+") || /.-\d+(?:\.\d+)?/.test(t); ) {
    var d, p = (d = qk.exec(t)) !== null && d !== void 0 ? d : [], m = sm(p, 4), y = m[1], g = m[2], v = m[3], x = Kh.parse(y ?? ""), w = Kh.parse(v ?? ""), S = g === "+" ? x.add(w) : x.subtract(w);
    if (S.isNaN())
      return Ll;
    t = t.replace(qk, S.toString());
  }
  return t;
}
var Xk = /\(([^()]*)\)/;
function Eye(e) {
  for (var t = e; t.includes("("); ) {
    var n = Xk.exec(t), r = sm(n, 2), i = r[1];
    t = t.replace(Xk, WB(i));
  }
  return t;
}
function kye(e) {
  var t = e.replace(/\s+/g, "");
  return t = Eye(t), t = WB(t), t;
}
function Mye(e) {
  try {
    return kye(e);
  } catch {
    return Ll;
  }
}
function Fb(e) {
  var t = Mye(e.slice(5, -1));
  return t === Ll ? "" : t;
}
var Nye = ["x", "y", "lineHeight", "capHeight", "scaleToFit", "textAnchor", "verticalAnchor", "fill"], $ye = ["dx", "dy", "angle", "className", "breakAll"];
function zx() {
  return zx = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, zx.apply(this, arguments);
}
function Zk(e, t) {
  if (e == null) return {};
  var n = Dye(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function Dye(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function Jk(e, t) {
  return Lye(e) || jye(e, t) || Rye(e, t) || Iye();
}
function Iye() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Rye(e, t) {
  if (e) {
    if (typeof e == "string") return Qk(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Qk(e, t);
  }
}
function Qk(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function jye(e, t) {
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (n != null) {
    var r, i, o, a, s = [], l = !0, c = !1;
    try {
      if (o = (n = n.call(e)).next, t === 0) {
        if (Object(n) !== n) return;
        l = !1;
      } else for (; !(l = (r = o.call(n)).done) && (s.push(r.value), s.length !== t); l = !0) ;
    } catch (f) {
      c = !0, i = f;
    } finally {
      try {
        if (!l && n.return != null && (a = n.return(), Object(a) !== a)) return;
      } finally {
        if (c) throw i;
      }
    }
    return s;
  }
}
function Lye(e) {
  if (Array.isArray(e)) return e;
}
var zB = /[ \f\n\r\t\v\u2028\u2029]+/, VB = function(t) {
  var n = t.children, r = t.breakAll, i = t.style;
  try {
    var o = [];
    Ue(n) || (r ? o = n.toString().split("") : o = n.toString().split(zB));
    var a = o.map(function(l) {
      return {
        word: l,
        width: tf(l, i).width
      };
    }), s = r ? 0 : tf(" ", i).width;
    return {
      wordsWithComputedWidth: a,
      spaceWidth: s
    };
  } catch {
    return null;
  }
}, Bye = function(t, n, r, i, o) {
  var a = t.maxLines, s = t.children, l = t.style, c = t.breakAll, f = be(a), d = s, p = function() {
    var F = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
    return F.reduce(function(W, z) {
      var H = z.word, U = z.width, V = W[W.length - 1];
      if (V && (i == null || o || V.width + U + r < Number(i)))
        V.words.push(H), V.width += U + r;
      else {
        var Y = {
          words: [H],
          width: U
        };
        W.push(Y);
      }
      return W;
    }, []);
  }, m = p(n), y = function(F) {
    return F.reduce(function(W, z) {
      return W.width > z.width ? W : z;
    });
  };
  if (!f)
    return m;
  for (var g = "…", v = function(F) {
    var W = d.slice(0, F), z = VB({
      breakAll: c,
      style: l,
      children: W + g
    }).wordsWithComputedWidth, H = p(z), U = H.length > a || y(H).width > Number(i);
    return [U, H];
  }, x = 0, w = d.length - 1, S = 0, A; x <= w && S <= d.length - 1; ) {
    var _ = Math.floor((x + w) / 2), O = _ - 1, P = v(O), C = Jk(P, 2), k = C[0], I = C[1], $ = v(_), N = Jk($, 1), D = N[0];
    if (!k && !D && (x = _ + 1), k && D && (w = _ - 1), !k && D) {
      A = I;
      break;
    }
    S++;
  }
  return A || m;
}, eM = function(t) {
  var n = Ue(t) ? [] : t.toString().split(zB);
  return [{
    words: n
  }];
}, Fye = function(t) {
  var n = t.width, r = t.scaleToFit, i = t.children, o = t.style, a = t.breakAll, s = t.maxLines;
  if ((n || r) && !Ni.isSsr) {
    var l, c, f = VB({
      breakAll: a,
      children: i,
      style: o
    });
    if (f) {
      var d = f.wordsWithComputedWidth, p = f.spaceWidth;
      l = d, c = p;
    } else
      return eM(i);
    return Bye({
      breakAll: a,
      children: i,
      maxLines: s,
      style: o
    }, l, c, n, r);
  }
  return eM(i);
}, tM = "#808080", Vs = function(t) {
  var n = t.x, r = n === void 0 ? 0 : n, i = t.y, o = i === void 0 ? 0 : i, a = t.lineHeight, s = a === void 0 ? "1em" : a, l = t.capHeight, c = l === void 0 ? "0.71em" : l, f = t.scaleToFit, d = f === void 0 ? !1 : f, p = t.textAnchor, m = p === void 0 ? "start" : p, y = t.verticalAnchor, g = y === void 0 ? "end" : y, v = t.fill, x = v === void 0 ? tM : v, w = Zk(t, Nye), S = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(function() {
    return Fye({
      breakAll: w.breakAll,
      children: w.children,
      maxLines: w.maxLines,
      scaleToFit: d,
      style: w.style,
      width: w.width
    });
  }, [w.breakAll, w.children, w.maxLines, d, w.style, w.width]), A = w.dx, _ = w.dy, O = w.angle, P = w.className, C = w.breakAll, k = Zk(w, $ye);
  if (!On(r) || !On(o))
    return null;
  var I = r + (be(A) ? A : 0), $ = o + (be(_) ? _ : 0), N;
  switch (g) {
    case "start":
      N = Fb("calc(".concat(c, ")"));
      break;
    case "middle":
      N = Fb("calc(".concat((S.length - 1) / 2, " * -").concat(s, " + (").concat(c, " / 2))"));
      break;
    default:
      N = Fb("calc(".concat(S.length - 1, " * -").concat(s, ")"));
      break;
  }
  var D = [];
  if (d) {
    var j = S[0].width, F = w.width;
    D.push("scale(".concat((be(F) ? F / j : 1) / j, ")"));
  }
  return O && D.push("rotate(".concat(O, ", ").concat(I, ", ").concat($, ")")), D.length && (k.transform = D.join(" ")), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("text", zx({}, Ee(k, !0), {
    x: I,
    y: $,
    className: Xe("recharts-text", P),
    textAnchor: m,
    fill: x.includes("url") ? tM : x
  }), S.map(function(W, z) {
    var H = W.words.join(C ? "" : " ");
    return (
      // duplicate words will cause duplicate keys
      // eslint-disable-next-line react/no-array-index-key
      /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("tspan", {
        x: I,
        dy: z === 0 ? N : s,
        key: "".concat(H, "-").concat(z)
      }, H)
    );
  }));
};
function Na(e, t) {
  return e == null || t == null ? NaN : e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
}
function Wye(e, t) {
  return e == null || t == null ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
}
function rS(e) {
  let t, n, r;
  e.length !== 2 ? (t = Na, n = (s, l) => Na(e(s), l), r = (s, l) => e(s) - l) : (t = e === Na || e === Wye ? e : zye, n = e, r = e);
  function i(s, l, c = 0, f = s.length) {
    if (c < f) {
      if (t(l, l) !== 0) return f;
      do {
        const d = c + f >>> 1;
        n(s[d], l) < 0 ? c = d + 1 : f = d;
      } while (c < f);
    }
    return c;
  }
  function o(s, l, c = 0, f = s.length) {
    if (c < f) {
      if (t(l, l) !== 0) return f;
      do {
        const d = c + f >>> 1;
        n(s[d], l) <= 0 ? c = d + 1 : f = d;
      } while (c < f);
    }
    return c;
  }
  function a(s, l, c = 0, f = s.length) {
    const d = i(s, l, c, f - 1);
    return d > c && r(s[d - 1], l) > -r(s[d], l) ? d - 1 : d;
  }
  return { left: i, center: a, right: o };
}
function zye() {
  return 0;
}
function UB(e) {
  return e === null ? NaN : +e;
}
function* Vye(e, t) {
  for (let n of e)
    n != null && (n = +n) >= n && (yield n);
}
const Uye = rS(Na), Ed = Uye.right;
rS(UB).center;
class nM extends Map {
  constructor(t, n = Gye) {
    if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: n } }), t != null) for (const [r, i] of t) this.set(r, i);
  }
  get(t) {
    return super.get(rM(this, t));
  }
  has(t) {
    return super.has(rM(this, t));
  }
  set(t, n) {
    return super.set(Hye(this, t), n);
  }
  delete(t) {
    return super.delete(Kye(this, t));
  }
}
function rM({ _intern: e, _key: t }, n) {
  const r = t(n);
  return e.has(r) ? e.get(r) : n;
}
function Hye({ _intern: e, _key: t }, n) {
  const r = t(n);
  return e.has(r) ? e.get(r) : (e.set(r, n), n);
}
function Kye({ _intern: e, _key: t }, n) {
  const r = t(n);
  return e.has(r) && (n = e.get(r), e.delete(r)), n;
}
function Gye(e) {
  return e !== null && typeof e == "object" ? e.valueOf() : e;
}
function Yye(e = Na) {
  if (e === Na) return HB;
  if (typeof e != "function") throw new TypeError("compare is not a function");
  return (t, n) => {
    const r = e(t, n);
    return r || r === 0 ? r : (e(n, n) === 0) - (e(t, t) === 0);
  };
}
function HB(e, t) {
  return (e == null || !(e >= e)) - (t == null || !(t >= t)) || (e < t ? -1 : e > t ? 1 : 0);
}
const qye = Math.sqrt(50), Xye = Math.sqrt(10), Zye = Math.sqrt(2);
function lm(e, t, n) {
  const r = (t - e) / Math.max(0, n), i = Math.floor(Math.log10(r)), o = r / Math.pow(10, i), a = o >= qye ? 10 : o >= Xye ? 5 : o >= Zye ? 2 : 1;
  let s, l, c;
  return i < 0 ? (c = Math.pow(10, -i) / a, s = Math.round(e * c), l = Math.round(t * c), s / c < e && ++s, l / c > t && --l, c = -c) : (c = Math.pow(10, i) * a, s = Math.round(e / c), l = Math.round(t / c), s * c < e && ++s, l * c > t && --l), l < s && 0.5 <= n && n < 2 ? lm(e, t, n * 2) : [s, l, c];
}
function Vx(e, t, n) {
  if (t = +t, e = +e, n = +n, !(n > 0)) return [];
  if (e === t) return [e];
  const r = t < e, [i, o, a] = r ? lm(t, e, n) : lm(e, t, n);
  if (!(o >= i)) return [];
  const s = o - i + 1, l = new Array(s);
  if (r)
    if (a < 0) for (let c = 0; c < s; ++c) l[c] = (o - c) / -a;
    else for (let c = 0; c < s; ++c) l[c] = (o - c) * a;
  else if (a < 0) for (let c = 0; c < s; ++c) l[c] = (i + c) / -a;
  else for (let c = 0; c < s; ++c) l[c] = (i + c) * a;
  return l;
}
function Ux(e, t, n) {
  return t = +t, e = +e, n = +n, lm(e, t, n)[2];
}
function Hx(e, t, n) {
  t = +t, e = +e, n = +n;
  const r = t < e, i = r ? Ux(t, e, n) : Ux(e, t, n);
  return (r ? -1 : 1) * (i < 0 ? 1 / -i : i);
}
function iM(e, t) {
  let n;
  for (const r of e)
    r != null && (n < r || n === void 0 && r >= r) && (n = r);
  return n;
}
function oM(e, t) {
  let n;
  for (const r of e)
    r != null && (n > r || n === void 0 && r >= r) && (n = r);
  return n;
}
function KB(e, t, n = 0, r = 1 / 0, i) {
  if (t = Math.floor(t), n = Math.floor(Math.max(0, n)), r = Math.floor(Math.min(e.length - 1, r)), !(n <= t && t <= r)) return e;
  for (i = i === void 0 ? HB : Yye(i); r > n; ) {
    if (r - n > 600) {
      const l = r - n + 1, c = t - n + 1, f = Math.log(l), d = 0.5 * Math.exp(2 * f / 3), p = 0.5 * Math.sqrt(f * d * (l - d) / l) * (c - l / 2 < 0 ? -1 : 1), m = Math.max(n, Math.floor(t - c * d / l + p)), y = Math.min(r, Math.floor(t + (l - c) * d / l + p));
      KB(e, t, m, y, i);
    }
    const o = e[t];
    let a = n, s = r;
    for (Eu(e, n, t), i(e[r], o) > 0 && Eu(e, n, r); a < s; ) {
      for (Eu(e, a, s), ++a, --s; i(e[a], o) < 0; ) ++a;
      for (; i(e[s], o) > 0; ) --s;
    }
    i(e[n], o) === 0 ? Eu(e, n, s) : (++s, Eu(e, s, r)), s <= t && (n = s + 1), t <= s && (r = s - 1);
  }
  return e;
}
function Eu(e, t, n) {
  const r = e[t];
  e[t] = e[n], e[n] = r;
}
function Jye(e, t, n) {
  if (e = Float64Array.from(Vye(e)), !(!(r = e.length) || isNaN(t = +t))) {
    if (t <= 0 || r < 2) return oM(e);
    if (t >= 1) return iM(e);
    var r, i = (r - 1) * t, o = Math.floor(i), a = iM(KB(e, o).subarray(0, o + 1)), s = oM(e.subarray(o + 1));
    return a + (s - a) * (i - o);
  }
}
function Qye(e, t, n = UB) {
  if (!(!(r = e.length) || isNaN(t = +t))) {
    if (t <= 0 || r < 2) return +n(e[0], 0, e);
    if (t >= 1) return +n(e[r - 1], r - 1, e);
    var r, i = (r - 1) * t, o = Math.floor(i), a = +n(e[o], o, e), s = +n(e[o + 1], o + 1, e);
    return a + (s - a) * (i - o);
  }
}
function eve(e, t, n) {
  e = +e, t = +t, n = (i = arguments.length) < 2 ? (t = e, e = 0, 1) : i < 3 ? 1 : +n;
  for (var r = -1, i = Math.max(0, Math.ceil((t - e) / n)) | 0, o = new Array(i); ++r < i; )
    o[r] = e + r * n;
  return o;
}
function gi(e, t) {
  switch (arguments.length) {
    case 0:
      break;
    case 1:
      this.range(e);
      break;
    default:
      this.range(t).domain(e);
      break;
  }
  return this;
}
function na(e, t) {
  switch (arguments.length) {
    case 0:
      break;
    case 1: {
      typeof e == "function" ? this.interpolator(e) : this.range(e);
      break;
    }
    default: {
      this.domain(e), typeof t == "function" ? this.interpolator(t) : this.range(t);
      break;
    }
  }
  return this;
}
const Kx = Symbol("implicit");
function iS() {
  var e = new nM(), t = [], n = [], r = Kx;
  function i(o) {
    let a = e.get(o);
    if (a === void 0) {
      if (r !== Kx) return r;
      e.set(o, a = t.push(o) - 1);
    }
    return n[a % n.length];
  }
  return i.domain = function(o) {
    if (!arguments.length) return t.slice();
    t = [], e = new nM();
    for (const a of o)
      e.has(a) || e.set(a, t.push(a) - 1);
    return i;
  }, i.range = function(o) {
    return arguments.length ? (n = Array.from(o), i) : n.slice();
  }, i.unknown = function(o) {
    return arguments.length ? (r = o, i) : r;
  }, i.copy = function() {
    return iS(t, n).unknown(r);
  }, gi.apply(i, arguments), i;
}
function Df() {
  var e = iS().unknown(void 0), t = e.domain, n = e.range, r = 0, i = 1, o, a, s = !1, l = 0, c = 0, f = 0.5;
  delete e.unknown;
  function d() {
    var p = t().length, m = i < r, y = m ? i : r, g = m ? r : i;
    o = (g - y) / Math.max(1, p - l + c * 2), s && (o = Math.floor(o)), y += (g - y - o * (p - l)) * f, a = o * (1 - l), s && (y = Math.round(y), a = Math.round(a));
    var v = eve(p).map(function(x) {
      return y + o * x;
    });
    return n(m ? v.reverse() : v);
  }
  return e.domain = function(p) {
    return arguments.length ? (t(p), d()) : t();
  }, e.range = function(p) {
    return arguments.length ? ([r, i] = p, r = +r, i = +i, d()) : [r, i];
  }, e.rangeRound = function(p) {
    return [r, i] = p, r = +r, i = +i, s = !0, d();
  }, e.bandwidth = function() {
    return a;
  }, e.step = function() {
    return o;
  }, e.round = function(p) {
    return arguments.length ? (s = !!p, d()) : s;
  }, e.padding = function(p) {
    return arguments.length ? (l = Math.min(1, c = +p), d()) : l;
  }, e.paddingInner = function(p) {
    return arguments.length ? (l = Math.min(1, p), d()) : l;
  }, e.paddingOuter = function(p) {
    return arguments.length ? (c = +p, d()) : c;
  }, e.align = function(p) {
    return arguments.length ? (f = Math.max(0, Math.min(1, p)), d()) : f;
  }, e.copy = function() {
    return Df(t(), [r, i]).round(s).paddingInner(l).paddingOuter(c).align(f);
  }, gi.apply(d(), arguments);
}
function GB(e) {
  var t = e.copy;
  return e.padding = e.paddingOuter, delete e.paddingInner, delete e.paddingOuter, e.copy = function() {
    return GB(t());
  }, e;
}
function nf() {
  return GB(Df.apply(null, arguments).paddingInner(1));
}
function oS(e, t, n) {
  e.prototype = t.prototype = n, n.constructor = e;
}
function YB(e, t) {
  var n = Object.create(e.prototype);
  for (var r in t) n[r] = t[r];
  return n;
}
function kd() {
}
var If = 0.7, cm = 1 / If, ql = "\\s*([+-]?\\d+)\\s*", Rf = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", Zi = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", tve = /^#([0-9a-f]{3,8})$/, nve = new RegExp(`^rgb\\(${ql},${ql},${ql}\\)$`), rve = new RegExp(`^rgb\\(${Zi},${Zi},${Zi}\\)$`), ive = new RegExp(`^rgba\\(${ql},${ql},${ql},${Rf}\\)$`), ove = new RegExp(`^rgba\\(${Zi},${Zi},${Zi},${Rf}\\)$`), ave = new RegExp(`^hsl\\(${Rf},${Zi},${Zi}\\)$`), sve = new RegExp(`^hsla\\(${Rf},${Zi},${Zi},${Rf}\\)$`), aM = {
  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
};
oS(kd, jf, {
  copy(e) {
    return Object.assign(new this.constructor(), this, e);
  },
  displayable() {
    return this.rgb().displayable();
  },
  hex: sM,
  // Deprecated! Use color.formatHex.
  formatHex: sM,
  formatHex8: lve,
  formatHsl: cve,
  formatRgb: lM,
  toString: lM
});
function sM() {
  return this.rgb().formatHex();
}
function lve() {
  return this.rgb().formatHex8();
}
function cve() {
  return qB(this).formatHsl();
}
function lM() {
  return this.rgb().formatRgb();
}
function jf(e) {
  var t, n;
  return e = (e + "").trim().toLowerCase(), (t = tve.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? cM(t) : n === 3 ? new _r(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? Gh(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? Gh(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = nve.exec(e)) ? new _r(t[1], t[2], t[3], 1) : (t = rve.exec(e)) ? new _r(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = ive.exec(e)) ? Gh(t[1], t[2], t[3], t[4]) : (t = ove.exec(e)) ? Gh(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = ave.exec(e)) ? dM(t[1], t[2] / 100, t[3] / 100, 1) : (t = sve.exec(e)) ? dM(t[1], t[2] / 100, t[3] / 100, t[4]) : aM.hasOwnProperty(e) ? cM(aM[e]) : e === "transparent" ? new _r(NaN, NaN, NaN, 0) : null;
}
function cM(e) {
  return new _r(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
}
function Gh(e, t, n, r) {
  return r <= 0 && (e = t = n = NaN), new _r(e, t, n, r);
}
function uve(e) {
  return e instanceof kd || (e = jf(e)), e ? (e = e.rgb(), new _r(e.r, e.g, e.b, e.opacity)) : new _r();
}
function Gx(e, t, n, r) {
  return arguments.length === 1 ? uve(e) : new _r(e, t, n, r ?? 1);
}
function _r(e, t, n, r) {
  this.r = +e, this.g = +t, this.b = +n, this.opacity = +r;
}
oS(_r, Gx, YB(kd, {
  brighter(e) {
    return e = e == null ? cm : Math.pow(cm, e), new _r(this.r * e, this.g * e, this.b * e, this.opacity);
  },
  darker(e) {
    return e = e == null ? If : Math.pow(If, e), new _r(this.r * e, this.g * e, this.b * e, this.opacity);
  },
  rgb() {
    return this;
  },
  clamp() {
    return new _r(Ns(this.r), Ns(this.g), Ns(this.b), um(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: uM,
  // Deprecated! Use color.formatHex.
  formatHex: uM,
  formatHex8: fve,
  formatRgb: fM,
  toString: fM
}));
function uM() {
  return `#${Os(this.r)}${Os(this.g)}${Os(this.b)}`;
}
function fve() {
  return `#${Os(this.r)}${Os(this.g)}${Os(this.b)}${Os((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
}
function fM() {
  const e = um(this.opacity);
  return `${e === 1 ? "rgb(" : "rgba("}${Ns(this.r)}, ${Ns(this.g)}, ${Ns(this.b)}${e === 1 ? ")" : `, ${e})`}`;
}
function um(e) {
  return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
}
function Ns(e) {
  return Math.max(0, Math.min(255, Math.round(e) || 0));
}
function Os(e) {
  return e = Ns(e), (e < 16 ? "0" : "") + e.toString(16);
}
function dM(e, t, n, r) {
  return r <= 0 ? e = t = n = NaN : n <= 0 || n >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new Ci(e, t, n, r);
}
function qB(e) {
  if (e instanceof Ci) return new Ci(e.h, e.s, e.l, e.opacity);
  if (e instanceof kd || (e = jf(e)), !e) return new Ci();
  if (e instanceof Ci) return e;
  e = e.rgb();
  var t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.min(t, n, r), o = Math.max(t, n, r), a = NaN, s = o - i, l = (o + i) / 2;
  return s ? (t === o ? a = (n - r) / s + (n < r) * 6 : n === o ? a = (r - t) / s + 2 : a = (t - n) / s + 4, s /= l < 0.5 ? o + i : 2 - o - i, a *= 60) : s = l > 0 && l < 1 ? 0 : a, new Ci(a, s, l, e.opacity);
}
function dve(e, t, n, r) {
  return arguments.length === 1 ? qB(e) : new Ci(e, t, n, r ?? 1);
}
function Ci(e, t, n, r) {
  this.h = +e, this.s = +t, this.l = +n, this.opacity = +r;
}
oS(Ci, dve, YB(kd, {
  brighter(e) {
    return e = e == null ? cm : Math.pow(cm, e), new Ci(this.h, this.s, this.l * e, this.opacity);
  },
  darker(e) {
    return e = e == null ? If : Math.pow(If, e), new Ci(this.h, this.s, this.l * e, this.opacity);
  },
  rgb() {
    var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * t, i = 2 * n - r;
    return new _r(
      Wb(e >= 240 ? e - 240 : e + 120, i, r),
      Wb(e, i, r),
      Wb(e < 120 ? e + 240 : e - 120, i, r),
      this.opacity
    );
  },
  clamp() {
    return new Ci(hM(this.h), Yh(this.s), Yh(this.l), um(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 e = um(this.opacity);
    return `${e === 1 ? "hsl(" : "hsla("}${hM(this.h)}, ${Yh(this.s) * 100}%, ${Yh(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
  }
}));
function hM(e) {
  return e = (e || 0) % 360, e < 0 ? e + 360 : e;
}
function Yh(e) {
  return Math.max(0, Math.min(1, e || 0));
}
function Wb(e, t, n) {
  return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255;
}
const aS = (e) => () => e;
function hve(e, t) {
  return function(n) {
    return e + n * t;
  };
}
function pve(e, t, n) {
  return e = Math.pow(e, n), t = Math.pow(t, n) - e, n = 1 / n, function(r) {
    return Math.pow(e + r * t, n);
  };
}
function mve(e) {
  return (e = +e) == 1 ? XB : function(t, n) {
    return n - t ? pve(t, n, e) : aS(isNaN(t) ? n : t);
  };
}
function XB(e, t) {
  var n = t - e;
  return n ? hve(e, n) : aS(isNaN(e) ? t : e);
}
const pM = function e(t) {
  var n = mve(t);
  function r(i, o) {
    var a = n((i = Gx(i)).r, (o = Gx(o)).r), s = n(i.g, o.g), l = n(i.b, o.b), c = XB(i.opacity, o.opacity);
    return function(f) {
      return i.r = a(f), i.g = s(f), i.b = l(f), i.opacity = c(f), i + "";
    };
  }
  return r.gamma = e, r;
}(1);
function gve(e, t) {
  t || (t = []);
  var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), i;
  return function(o) {
    for (i = 0; i < n; ++i) r[i] = e[i] * (1 - o) + t[i] * o;
    return r;
  };
}
function yve(e) {
  return ArrayBuffer.isView(e) && !(e instanceof DataView);
}
function vve(e, t) {
  var n = t ? t.length : 0, r = e ? Math.min(n, e.length) : 0, i = new Array(r), o = new Array(n), a;
  for (a = 0; a < r; ++a) i[a] = Zc(e[a], t[a]);
  for (; a < n; ++a) o[a] = t[a];
  return function(s) {
    for (a = 0; a < r; ++a) o[a] = i[a](s);
    return o;
  };
}
function bve(e, t) {
  var n = /* @__PURE__ */ new Date();
  return e = +e, t = +t, function(r) {
    return n.setTime(e * (1 - r) + t * r), n;
  };
}
function fm(e, t) {
  return e = +e, t = +t, function(n) {
    return e * (1 - n) + t * n;
  };
}
function xve(e, t) {
  var n = {}, r = {}, i;
  (e === null || typeof e != "object") && (e = {}), (t === null || typeof t != "object") && (t = {});
  for (i in t)
    i in e ? n[i] = Zc(e[i], t[i]) : r[i] = t[i];
  return function(o) {
    for (i in n) r[i] = n[i](o);
    return r;
  };
}
var Yx = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, zb = new RegExp(Yx.source, "g");
function wve(e) {
  return function() {
    return e;
  };
}
function _ve(e) {
  return function(t) {
    return e(t) + "";
  };
}
function Sve(e, t) {
  var n = Yx.lastIndex = zb.lastIndex = 0, r, i, o, a = -1, s = [], l = [];
  for (e = e + "", t = t + ""; (r = Yx.exec(e)) && (i = zb.exec(t)); )
    (o = i.index) > n && (o = t.slice(n, o), s[a] ? s[a] += o : s[++a] = o), (r = r[0]) === (i = i[0]) ? s[a] ? s[a] += i : s[++a] = i : (s[++a] = null, l.push({ i: a, x: fm(r, i) })), n = zb.lastIndex;
  return n < t.length && (o = t.slice(n), s[a] ? s[a] += o : s[++a] = o), s.length < 2 ? l[0] ? _ve(l[0].x) : wve(t) : (t = l.length, function(c) {
    for (var f = 0, d; f < t; ++f) s[(d = l[f]).i] = d.x(c);
    return s.join("");
  });
}
function Zc(e, t) {
  var n = typeof t, r;
  return t == null || n === "boolean" ? aS(t) : (n === "number" ? fm : n === "string" ? (r = jf(t)) ? (t = r, pM) : Sve : t instanceof jf ? pM : t instanceof Date ? bve : yve(t) ? gve : Array.isArray(t) ? vve : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? xve : fm)(e, t);
}
function sS(e, t) {
  return e = +e, t = +t, function(n) {
    return Math.round(e * (1 - n) + t * n);
  };
}
function Ove(e, t) {
  t === void 0 && (t = e, e = Zc);
  for (var n = 0, r = t.length - 1, i = t[0], o = new Array(r < 0 ? 0 : r); n < r; ) o[n] = e(i, i = t[++n]);
  return function(a) {
    var s = Math.max(0, Math.min(r - 1, Math.floor(a *= r)));
    return o[s](a - s);
  };
}
function Ave(e) {
  return function() {
    return e;
  };
}
function dm(e) {
  return +e;
}
var mM = [0, 1];
function hr(e) {
  return e;
}
function qx(e, t) {
  return (t -= e = +e) ? function(n) {
    return (n - e) / t;
  } : Ave(isNaN(t) ? NaN : 0.5);
}
function Tve(e, t) {
  var n;
  return e > t && (n = e, e = t, t = n), function(r) {
    return Math.max(e, Math.min(t, r));
  };
}
function Pve(e, t, n) {
  var r = e[0], i = e[1], o = t[0], a = t[1];
  return i < r ? (r = qx(i, r), o = n(a, o)) : (r = qx(r, i), o = n(o, a)), function(s) {
    return o(r(s));
  };
}
function Cve(e, t, n) {
  var r = Math.min(e.length, t.length) - 1, i = new Array(r), o = new Array(r), a = -1;
  for (e[r] < e[0] && (e = e.slice().reverse(), t = t.slice().reverse()); ++a < r; )
    i[a] = qx(e[a], e[a + 1]), o[a] = n(t[a], t[a + 1]);
  return function(s) {
    var l = Ed(e, s, 1, r) - 1;
    return o[l](i[l](s));
  };
}
function Md(e, t) {
  return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());
}
function oy() {
  var e = mM, t = mM, n = Zc, r, i, o, a = hr, s, l, c;
  function f() {
    var p = Math.min(e.length, t.length);
    return a !== hr && (a = Tve(e[0], e[p - 1])), s = p > 2 ? Cve : Pve, l = c = null, d;
  }
  function d(p) {
    return p == null || isNaN(p = +p) ? o : (l || (l = s(e.map(r), t, n)))(r(a(p)));
  }
  return d.invert = function(p) {
    return a(i((c || (c = s(t, e.map(r), fm)))(p)));
  }, d.domain = function(p) {
    return arguments.length ? (e = Array.from(p, dm), f()) : e.slice();
  }, d.range = function(p) {
    return arguments.length ? (t = Array.from(p), f()) : t.slice();
  }, d.rangeRound = function(p) {
    return t = Array.from(p), n = sS, f();
  }, d.clamp = function(p) {
    return arguments.length ? (a = p ? !0 : hr, f()) : a !== hr;
  }, d.interpolate = function(p) {
    return arguments.length ? (n = p, f()) : n;
  }, d.unknown = function(p) {
    return arguments.length ? (o = p, d) : o;
  }, function(p, m) {
    return r = p, i = m, f();
  };
}
function lS() {
  return oy()(hr, hr);
}
function Eve(e) {
  return Math.abs(e = Math.round(e)) >= 1e21 ? e.toLocaleString("en").replace(/,/g, "") : e.toString(10);
}
function hm(e, t) {
  if ((n = (e = t ? e.toExponential(t - 1) : e.toExponential()).indexOf("e")) < 0) return null;
  var n, r = e.slice(0, n);
  return [
    r.length > 1 ? r[0] + r.slice(2) : r,
    +e.slice(n + 1)
  ];
}
function uc(e) {
  return e = hm(Math.abs(e)), e ? e[1] : NaN;
}
function kve(e, t) {
  return function(n, r) {
    for (var i = n.length, o = [], a = 0, s = e[0], l = 0; i > 0 && s > 0 && (l + s + 1 > r && (s = Math.max(1, r - l)), o.push(n.substring(i -= s, i + s)), !((l += s + 1) > r)); )
      s = e[a = (a + 1) % e.length];
    return o.reverse().join(t);
  };
}
function Mve(e) {
  return function(t) {
    return t.replace(/[0-9]/g, function(n) {
      return e[+n];
    });
  };
}
var Nve = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
function Lf(e) {
  if (!(t = Nve.exec(e))) throw new Error("invalid format: " + e);
  var t;
  return new cS({
    fill: t[1],
    align: t[2],
    sign: t[3],
    symbol: t[4],
    zero: t[5],
    width: t[6],
    comma: t[7],
    precision: t[8] && t[8].slice(1),
    trim: t[9],
    type: t[10]
  });
}
Lf.prototype = cS.prototype;
function cS(e) {
  this.fill = e.fill === void 0 ? " " : e.fill + "", this.align = e.align === void 0 ? ">" : e.align + "", this.sign = e.sign === void 0 ? "-" : e.sign + "", this.symbol = e.symbol === void 0 ? "" : e.symbol + "", this.zero = !!e.zero, this.width = e.width === void 0 ? void 0 : +e.width, this.comma = !!e.comma, this.precision = e.precision === void 0 ? void 0 : +e.precision, this.trim = !!e.trim, this.type = e.type === void 0 ? "" : e.type + "";
}
cS.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 $ve(e) {
  e: for (var t = e.length, n = 1, r = -1, i; n < t; ++n)
    switch (e[n]) {
      case ".":
        r = i = n;
        break;
      case "0":
        r === 0 && (r = n), i = n;
        break;
      default:
        if (!+e[n]) break e;
        r > 0 && (r = 0);
        break;
    }
  return r > 0 ? e.slice(0, r) + e.slice(i + 1) : e;
}
var ZB;
function Dve(e, t) {
  var n = hm(e, t);
  if (!n) return e + "";
  var r = n[0], i = n[1], o = i - (ZB = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, a = r.length;
  return o === a ? r : o > a ? r + new Array(o - a + 1).join("0") : o > 0 ? r.slice(0, o) + "." + r.slice(o) : "0." + new Array(1 - o).join("0") + hm(e, Math.max(0, t + o - 1))[0];
}
function gM(e, t) {
  var n = hm(e, t);
  if (!n) return e + "";
  var r = n[0], i = n[1];
  return i < 0 ? "0." + new Array(-i).join("0") + r : r.length > i + 1 ? r.slice(0, i + 1) + "." + r.slice(i + 1) : r + new Array(i - r.length + 2).join("0");
}
const yM = {
  "%": (e, t) => (e * 100).toFixed(t),
  b: (e) => Math.round(e).toString(2),
  c: (e) => e + "",
  d: Eve,
  e: (e, t) => e.toExponential(t),
  f: (e, t) => e.toFixed(t),
  g: (e, t) => e.toPrecision(t),
  o: (e) => Math.round(e).toString(8),
  p: (e, t) => gM(e * 100, t),
  r: gM,
  s: Dve,
  X: (e) => Math.round(e).toString(16).toUpperCase(),
  x: (e) => Math.round(e).toString(16)
};
function vM(e) {
  return e;
}
var bM = Array.prototype.map, xM = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
function Ive(e) {
  var t = e.grouping === void 0 || e.thousands === void 0 ? vM : kve(bM.call(e.grouping, Number), e.thousands + ""), n = e.currency === void 0 ? "" : e.currency[0] + "", r = e.currency === void 0 ? "" : e.currency[1] + "", i = e.decimal === void 0 ? "." : e.decimal + "", o = e.numerals === void 0 ? vM : Mve(bM.call(e.numerals, String)), a = e.percent === void 0 ? "%" : e.percent + "", s = e.minus === void 0 ? "−" : e.minus + "", l = e.nan === void 0 ? "NaN" : e.nan + "";
  function c(d) {
    d = Lf(d);
    var p = d.fill, m = d.align, y = d.sign, g = d.symbol, v = d.zero, x = d.width, w = d.comma, S = d.precision, A = d.trim, _ = d.type;
    _ === "n" ? (w = !0, _ = "g") : yM[_] || (S === void 0 && (S = 12), A = !0, _ = "g"), (v || p === "0" && m === "=") && (v = !0, p = "0", m = "=");
    var O = g === "$" ? n : g === "#" && /[boxX]/.test(_) ? "0" + _.toLowerCase() : "", P = g === "$" ? r : /[%p]/.test(_) ? a : "", C = yM[_], k = /[defgprs%]/.test(_);
    S = S === void 0 ? 6 : /[gprs]/.test(_) ? Math.max(1, Math.min(21, S)) : Math.max(0, Math.min(20, S));
    function I($) {
      var N = O, D = P, j, F, W;
      if (_ === "c")
        D = C($) + D, $ = "";
      else {
        $ = +$;
        var z = $ < 0 || 1 / $ < 0;
        if ($ = isNaN($) ? l : C(Math.abs($), S), A && ($ = $ve($)), z && +$ == 0 && y !== "+" && (z = !1), N = (z ? y === "(" ? y : s : y === "-" || y === "(" ? "" : y) + N, D = (_ === "s" ? xM[8 + ZB / 3] : "") + D + (z && y === "(" ? ")" : ""), k) {
          for (j = -1, F = $.length; ++j < F; )
            if (W = $.charCodeAt(j), 48 > W || W > 57) {
              D = (W === 46 ? i + $.slice(j + 1) : $.slice(j)) + D, $ = $.slice(0, j);
              break;
            }
        }
      }
      w && !v && ($ = t($, 1 / 0));
      var H = N.length + $.length + D.length, U = H < x ? new Array(x - H + 1).join(p) : "";
      switch (w && v && ($ = t(U + $, U.length ? x - D.length : 1 / 0), U = ""), m) {
        case "<":
          $ = N + $ + D + U;
          break;
        case "=":
          $ = N + U + $ + D;
          break;
        case "^":
          $ = U.slice(0, H = U.length >> 1) + N + $ + D + U.slice(H);
          break;
        default:
          $ = U + N + $ + D;
          break;
      }
      return o($);
    }
    return I.toString = function() {
      return d + "";
    }, I;
  }
  function f(d, p) {
    var m = c((d = Lf(d), d.type = "f", d)), y = Math.max(-8, Math.min(8, Math.floor(uc(p) / 3))) * 3, g = Math.pow(10, -y), v = xM[8 + y / 3];
    return function(x) {
      return m(g * x) + v;
    };
  }
  return {
    format: c,
    formatPrefix: f
  };
}
var qh, uS, JB;
Rve({
  thousands: ",",
  grouping: [3],
  currency: ["$", ""]
});
function Rve(e) {
  return qh = Ive(e), uS = qh.format, JB = qh.formatPrefix, qh;
}
function jve(e) {
  return Math.max(0, -uc(Math.abs(e)));
}
function Lve(e, t) {
  return Math.max(0, Math.max(-8, Math.min(8, Math.floor(uc(t) / 3))) * 3 - uc(Math.abs(e)));
}
function Bve(e, t) {
  return e = Math.abs(e), t = Math.abs(t) - e, Math.max(0, uc(t) - uc(e)) + 1;
}
function QB(e, t, n, r) {
  var i = Hx(e, t, n), o;
  switch (r = Lf(r ?? ",f"), r.type) {
    case "s": {
      var a = Math.max(Math.abs(e), Math.abs(t));
      return r.precision == null && !isNaN(o = Lve(i, a)) && (r.precision = o), JB(r, a);
    }
    case "":
    case "e":
    case "g":
    case "p":
    case "r": {
      r.precision == null && !isNaN(o = Bve(i, Math.max(Math.abs(e), Math.abs(t)))) && (r.precision = o - (r.type === "e"));
      break;
    }
    case "f":
    case "%": {
      r.precision == null && !isNaN(o = jve(i)) && (r.precision = o - (r.type === "%") * 2);
      break;
    }
  }
  return uS(r);
}
function Ga(e) {
  var t = e.domain;
  return e.ticks = function(n) {
    var r = t();
    return Vx(r[0], r[r.length - 1], n ?? 10);
  }, e.tickFormat = function(n, r) {
    var i = t();
    return QB(i[0], i[i.length - 1], n ?? 10, r);
  }, e.nice = function(n) {
    n == null && (n = 10);
    var r = t(), i = 0, o = r.length - 1, a = r[i], s = r[o], l, c, f = 10;
    for (s < a && (c = a, a = s, s = c, c = i, i = o, o = c); f-- > 0; ) {
      if (c = Ux(a, s, n), c === l)
        return r[i] = a, r[o] = s, t(r);
      if (c > 0)
        a = Math.floor(a / c) * c, s = Math.ceil(s / c) * c;
      else if (c < 0)
        a = Math.ceil(a * c) / c, s = Math.floor(s * c) / c;
      else
        break;
      l = c;
    }
    return e;
  }, e;
}
function pm() {
  var e = lS();
  return e.copy = function() {
    return Md(e, pm());
  }, gi.apply(e, arguments), Ga(e);
}
function eF(e) {
  var t;
  function n(r) {
    return r == null || isNaN(r = +r) ? t : r;
  }
  return n.invert = n, n.domain = n.range = function(r) {
    return arguments.length ? (e = Array.from(r, dm), n) : e.slice();
  }, n.unknown = function(r) {
    return arguments.length ? (t = r, n) : t;
  }, n.copy = function() {
    return eF(e).unknown(t);
  }, e = arguments.length ? Array.from(e, dm) : [0, 1], Ga(n);
}
function tF(e, t) {
  e = e.slice();
  var n = 0, r = e.length - 1, i = e[n], o = e[r], a;
  return o < i && (a = n, n = r, r = a, a = i, i = o, o = a), e[n] = t.floor(i), e[r] = t.ceil(o), e;
}
function wM(e) {
  return Math.log(e);
}
function _M(e) {
  return Math.exp(e);
}
function Fve(e) {
  return -Math.log(-e);
}
function Wve(e) {
  return -Math.exp(-e);
}
function zve(e) {
  return isFinite(e) ? +("1e" + e) : e < 0 ? 0 : e;
}
function Vve(e) {
  return e === 10 ? zve : e === Math.E ? Math.exp : (t) => Math.pow(e, t);
}
function Uve(e) {
  return e === Math.E ? Math.log : e === 10 && Math.log10 || e === 2 && Math.log2 || (e = Math.log(e), (t) => Math.log(t) / e);
}
function SM(e) {
  return (t, n) => -e(-t, n);
}
function fS(e) {
  const t = e(wM, _M), n = t.domain;
  let r = 10, i, o;
  function a() {
    return i = Uve(r), o = Vve(r), n()[0] < 0 ? (i = SM(i), o = SM(o), e(Fve, Wve)) : e(wM, _M), t;
  }
  return t.base = function(s) {
    return arguments.length ? (r = +s, a()) : r;
  }, t.domain = function(s) {
    return arguments.length ? (n(s), a()) : n();
  }, t.ticks = (s) => {
    const l = n();
    let c = l[0], f = l[l.length - 1];
    const d = f < c;
    d && ([c, f] = [f, c]);
    let p = i(c), m = i(f), y, g;
    const v = s == null ? 10 : +s;
    let x = [];
    if (!(r % 1) && m - p < v) {
      if (p = Math.floor(p), m = Math.ceil(m), c > 0) {
        for (; p <= m; ++p)
          for (y = 1; y < r; ++y)
            if (g = p < 0 ? y / o(-p) : y * o(p), !(g < c)) {
              if (g > f) break;
              x.push(g);
            }
      } else for (; p <= m; ++p)
        for (y = r - 1; y >= 1; --y)
          if (g = p > 0 ? y / o(-p) : y * o(p), !(g < c)) {
            if (g > f) break;
            x.push(g);
          }
      x.length * 2 < v && (x = Vx(c, f, v));
    } else
      x = Vx(p, m, Math.min(m - p, v)).map(o);
    return d ? x.reverse() : x;
  }, t.tickFormat = (s, l) => {
    if (s == null && (s = 10), l == null && (l = r === 10 ? "s" : ","), typeof l != "function" && (!(r % 1) && (l = Lf(l)).precision == null && (l.trim = !0), l = uS(l)), s === 1 / 0) return l;
    const c = Math.max(1, r * s / t.ticks().length);
    return (f) => {
      let d = f / o(Math.round(i(f)));
      return d * r < r - 0.5 && (d *= r), d <= c ? l(f) : "";
    };
  }, t.nice = () => n(tF(n(), {
    floor: (s) => o(Math.floor(i(s))),
    ceil: (s) => o(Math.ceil(i(s)))
  })), t;
}
function nF() {
  const e = fS(oy()).domain([1, 10]);
  return e.copy = () => Md(e, nF()).base(e.base()), gi.apply(e, arguments), e;
}
function OM(e) {
  return function(t) {
    return Math.sign(t) * Math.log1p(Math.abs(t / e));
  };
}
function AM(e) {
  return function(t) {
    return Math.sign(t) * Math.expm1(Math.abs(t)) * e;
  };
}
function dS(e) {
  var t = 1, n = e(OM(t), AM(t));
  return n.constant = function(r) {
    return arguments.length ? e(OM(t = +r), AM(t)) : t;
  }, Ga(n);
}
function rF() {
  var e = dS(oy());
  return e.copy = function() {
    return Md(e, rF()).constant(e.constant());
  }, gi.apply(e, arguments);
}
function TM(e) {
  return function(t) {
    return t < 0 ? -Math.pow(-t, e) : Math.pow(t, e);
  };
}
function Hve(e) {
  return e < 0 ? -Math.sqrt(-e) : Math.sqrt(e);
}
function Kve(e) {
  return e < 0 ? -e * e : e * e;
}
function hS(e) {
  var t = e(hr, hr), n = 1;
  function r() {
    return n === 1 ? e(hr, hr) : n === 0.5 ? e(Hve, Kve) : e(TM(n), TM(1 / n));
  }
  return t.exponent = function(i) {
    return arguments.length ? (n = +i, r()) : n;
  }, Ga(t);
}
function pS() {
  var e = hS(oy());
  return e.copy = function() {
    return Md(e, pS()).exponent(e.exponent());
  }, gi.apply(e, arguments), e;
}
function Gve() {
  return pS.apply(null, arguments).exponent(0.5);
}
function PM(e) {
  return Math.sign(e) * e * e;
}
function Yve(e) {
  return Math.sign(e) * Math.sqrt(Math.abs(e));
}
function iF() {
  var e = lS(), t = [0, 1], n = !1, r;
  function i(o) {
    var a = Yve(e(o));
    return isNaN(a) ? r : n ? Math.round(a) : a;
  }
  return i.invert = function(o) {
    return e.invert(PM(o));
  }, i.domain = function(o) {
    return arguments.length ? (e.domain(o), i) : e.domain();
  }, i.range = function(o) {
    return arguments.length ? (e.range((t = Array.from(o, dm)).map(PM)), i) : t.slice();
  }, i.rangeRound = function(o) {
    return i.range(o).round(!0);
  }, i.round = function(o) {
    return arguments.length ? (n = !!o, i) : n;
  }, i.clamp = function(o) {
    return arguments.length ? (e.clamp(o), i) : e.clamp();
  }, i.unknown = function(o) {
    return arguments.length ? (r = o, i) : r;
  }, i.copy = function() {
    return iF(e.domain(), t).round(n).clamp(e.clamp()).unknown(r);
  }, gi.apply(i, arguments), Ga(i);
}
function oF() {
  var e = [], t = [], n = [], r;
  function i() {
    var a = 0, s = Math.max(1, t.length);
    for (n = new Array(s - 1); ++a < s; ) n[a - 1] = Qye(e, a / s);
    return o;
  }
  function o(a) {
    return a == null || isNaN(a = +a) ? r : t[Ed(n, a)];
  }
  return o.invertExtent = function(a) {
    var s = t.indexOf(a);
    return s < 0 ? [NaN, NaN] : [
      s > 0 ? n[s - 1] : e[0],
      s < n.length ? n[s] : e[e.length - 1]
    ];
  }, o.domain = function(a) {
    if (!arguments.length) return e.slice();
    e = [];
    for (let s of a) s != null && !isNaN(s = +s) && e.push(s);
    return e.sort(Na), i();
  }, o.range = function(a) {
    return arguments.length ? (t = Array.from(a), i()) : t.slice();
  }, o.unknown = function(a) {
    return arguments.length ? (r = a, o) : r;
  }, o.quantiles = function() {
    return n.slice();
  }, o.copy = function() {
    return oF().domain(e).range(t).unknown(r);
  }, gi.apply(o, arguments);
}
function aF() {
  var e = 0, t = 1, n = 1, r = [0.5], i = [0, 1], o;
  function a(l) {
    return l != null && l <= l ? i[Ed(r, l, 0, n)] : o;
  }
  function s() {
    var l = -1;
    for (r = new Array(n); ++l < n; ) r[l] = ((l + 1) * t - (l - n) * e) / (n + 1);
    return a;
  }
  return a.domain = function(l) {
    return arguments.length ? ([e, t] = l, e = +e, t = +t, s()) : [e, t];
  }, a.range = function(l) {
    return arguments.length ? (n = (i = Array.from(l)).length - 1, s()) : i.slice();
  }, a.invertExtent = function(l) {
    var c = i.indexOf(l);
    return c < 0 ? [NaN, NaN] : c < 1 ? [e, r[0]] : c >= n ? [r[n - 1], t] : [r[c - 1], r[c]];
  }, a.unknown = function(l) {
    return arguments.length && (o = l), a;
  }, a.thresholds = function() {
    return r.slice();
  }, a.copy = function() {
    return aF().domain([e, t]).range(i).unknown(o);
  }, gi.apply(Ga(a), arguments);
}
function sF() {
  var e = [0.5], t = [0, 1], n, r = 1;
  function i(o) {
    return o != null && o <= o ? t[Ed(e, o, 0, r)] : n;
  }
  return i.domain = function(o) {
    return arguments.length ? (e = Array.from(o), r = Math.min(e.length, t.length - 1), i) : e.slice();
  }, i.range = function(o) {
    return arguments.length ? (t = Array.from(o), r = Math.min(e.length, t.length - 1), i) : t.slice();
  }, i.invertExtent = function(o) {
    var a = t.indexOf(o);
    return [e[a - 1], e[a]];
  }, i.unknown = function(o) {
    return arguments.length ? (n = o, i) : n;
  }, i.copy = function() {
    return sF().domain(e).range(t).unknown(n);
  }, gi.apply(i, arguments);
}
const Vb = /* @__PURE__ */ new Date(), Ub = /* @__PURE__ */ new Date();
function Pn(e, t, n, r) {
  function i(o) {
    return e(o = arguments.length === 0 ? /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(+o)), o;
  }
  return i.floor = (o) => (e(o = /* @__PURE__ */ new Date(+o)), o), i.ceil = (o) => (e(o = new Date(o - 1)), t(o, 1), e(o), o), i.round = (o) => {
    const a = i(o), s = i.ceil(o);
    return o - a < s - o ? a : s;
  }, i.offset = (o, a) => (t(o = /* @__PURE__ */ new Date(+o), a == null ? 1 : Math.floor(a)), o), i.range = (o, a, s) => {
    const l = [];
    if (o = i.ceil(o), s = s == null ? 1 : Math.floor(s), !(o < a) || !(s > 0)) return l;
    let c;
    do
      l.push(c = /* @__PURE__ */ new Date(+o)), t(o, s), e(o);
    while (c < o && o < a);
    return l;
  }, i.filter = (o) => Pn((a) => {
    if (a >= a) for (; e(a), !o(a); ) a.setTime(a - 1);
  }, (a, s) => {
    if (a >= a)
      if (s < 0) for (; ++s <= 0; )
        for (; t(a, -1), !o(a); )
          ;
      else for (; --s >= 0; )
        for (; t(a, 1), !o(a); )
          ;
  }), n && (i.count = (o, a) => (Vb.setTime(+o), Ub.setTime(+a), e(Vb), e(Ub), Math.floor(n(Vb, Ub))), i.every = (o) => (o = Math.floor(o), !isFinite(o) || !(o > 0) ? null : o > 1 ? i.filter(r ? (a) => r(a) % o === 0 : (a) => i.count(0, a) % o === 0) : i)), i;
}
const mm = Pn(() => {
}, (e, t) => {
  e.setTime(+e + t);
}, (e, t) => t - e);
mm.every = (e) => (e = Math.floor(e), !isFinite(e) || !(e > 0) ? null : e > 1 ? Pn((t) => {
  t.setTime(Math.floor(t / e) * e);
}, (t, n) => {
  t.setTime(+t + n * e);
}, (t, n) => (n - t) / e) : mm);
mm.range;
const Eo = 1e3, di = Eo * 60, ko = di * 60, Ho = ko * 24, mS = Ho * 7, CM = Ho * 30, Hb = Ho * 365, As = Pn((e) => {
  e.setTime(e - e.getMilliseconds());
}, (e, t) => {
  e.setTime(+e + t * Eo);
}, (e, t) => (t - e) / Eo, (e) => e.getUTCSeconds());
As.range;
const gS = Pn((e) => {
  e.setTime(e - e.getMilliseconds() - e.getSeconds() * Eo);
}, (e, t) => {
  e.setTime(+e + t * di);
}, (e, t) => (t - e) / di, (e) => e.getMinutes());
gS.range;
const yS = Pn((e) => {
  e.setUTCSeconds(0, 0);
}, (e, t) => {
  e.setTime(+e + t * di);
}, (e, t) => (t - e) / di, (e) => e.getUTCMinutes());
yS.range;
const vS = Pn((e) => {
  e.setTime(e - e.getMilliseconds() - e.getSeconds() * Eo - e.getMinutes() * di);
}, (e, t) => {
  e.setTime(+e + t * ko);
}, (e, t) => (t - e) / ko, (e) => e.getHours());
vS.range;
const bS = Pn((e) => {
  e.setUTCMinutes(0, 0, 0);
}, (e, t) => {
  e.setTime(+e + t * ko);
}, (e, t) => (t - e) / ko, (e) => e.getUTCHours());
bS.range;
const Nd = Pn(
  (e) => e.setHours(0, 0, 0, 0),
  (e, t) => e.setDate(e.getDate() + t),
  (e, t) => (t - e - (t.getTimezoneOffset() - e.getTimezoneOffset()) * di) / Ho,
  (e) => e.getDate() - 1
);
Nd.range;
const ay = Pn((e) => {
  e.setUTCHours(0, 0, 0, 0);
}, (e, t) => {
  e.setUTCDate(e.getUTCDate() + t);
}, (e, t) => (t - e) / Ho, (e) => e.getUTCDate() - 1);
ay.range;
const lF = Pn((e) => {
  e.setUTCHours(0, 0, 0, 0);
}, (e, t) => {
  e.setUTCDate(e.getUTCDate() + t);
}, (e, t) => (t - e) / Ho, (e) => Math.floor(e / Ho));
lF.range;
function nl(e) {
  return Pn((t) => {
    t.setDate(t.getDate() - (t.getDay() + 7 - e) % 7), t.setHours(0, 0, 0, 0);
  }, (t, n) => {
    t.setDate(t.getDate() + n * 7);
  }, (t, n) => (n - t - (n.getTimezoneOffset() - t.getTimezoneOffset()) * di) / mS);
}
const sy = nl(0), gm = nl(1), qve = nl(2), Xve = nl(3), fc = nl(4), Zve = nl(5), Jve = nl(6);
sy.range;
gm.range;
qve.range;
Xve.range;
fc.range;
Zve.range;
Jve.range;
function rl(e) {
  return Pn((t) => {
    t.setUTCDate(t.getUTCDate() - (t.getUTCDay() + 7 - e) % 7), t.setUTCHours(0, 0, 0, 0);
  }, (t, n) => {
    t.setUTCDate(t.getUTCDate() + n * 7);
  }, (t, n) => (n - t) / mS);
}
const ly = rl(0), ym = rl(1), Qve = rl(2), ebe = rl(3), dc = rl(4), tbe = rl(5), nbe = rl(6);
ly.range;
ym.range;
Qve.range;
ebe.range;
dc.range;
tbe.range;
nbe.range;
const xS = Pn((e) => {
  e.setDate(1), e.setHours(0, 0, 0, 0);
}, (e, t) => {
  e.setMonth(e.getMonth() + t);
}, (e, t) => t.getMonth() - e.getMonth() + (t.getFullYear() - e.getFullYear()) * 12, (e) => e.getMonth());
xS.range;
const wS = Pn((e) => {
  e.setUTCDate(1), e.setUTCHours(0, 0, 0, 0);
}, (e, t) => {
  e.setUTCMonth(e.getUTCMonth() + t);
}, (e, t) => t.getUTCMonth() - e.getUTCMonth() + (t.getUTCFullYear() - e.getUTCFullYear()) * 12, (e) => e.getUTCMonth());
wS.range;
const Ko = Pn((e) => {
  e.setMonth(0, 1), e.setHours(0, 0, 0, 0);
}, (e, t) => {
  e.setFullYear(e.getFullYear() + t);
}, (e, t) => t.getFullYear() - e.getFullYear(), (e) => e.getFullYear());
Ko.every = (e) => !isFinite(e = Math.floor(e)) || !(e > 0) ? null : Pn((t) => {
  t.setFullYear(Math.floor(t.getFullYear() / e) * e), t.setMonth(0, 1), t.setHours(0, 0, 0, 0);
}, (t, n) => {
  t.setFullYear(t.getFullYear() + n * e);
});
Ko.range;
const Go = Pn((e) => {
  e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
}, (e, t) => {
  e.setUTCFullYear(e.getUTCFullYear() + t);
}, (e, t) => t.getUTCFullYear() - e.getUTCFullYear(), (e) => e.getUTCFullYear());
Go.every = (e) => !isFinite(e = Math.floor(e)) || !(e > 0) ? null : Pn((t) => {
  t.setUTCFullYear(Math.floor(t.getUTCFullYear() / e) * e), t.setUTCMonth(0, 1), t.setUTCHours(0, 0, 0, 0);
}, (t, n) => {
  t.setUTCFullYear(t.getUTCFullYear() + n * e);
});
Go.range;
function cF(e, t, n, r, i, o) {
  const a = [
    [As, 1, Eo],
    [As, 5, 5 * Eo],
    [As, 15, 15 * Eo],
    [As, 30, 30 * Eo],
    [o, 1, di],
    [o, 5, 5 * di],
    [o, 15, 15 * di],
    [o, 30, 30 * di],
    [i, 1, ko],
    [i, 3, 3 * ko],
    [i, 6, 6 * ko],
    [i, 12, 12 * ko],
    [r, 1, Ho],
    [r, 2, 2 * Ho],
    [n, 1, mS],
    [t, 1, CM],
    [t, 3, 3 * CM],
    [e, 1, Hb]
  ];
  function s(c, f, d) {
    const p = f < c;
    p && ([c, f] = [f, c]);
    const m = d && typeof d.range == "function" ? d : l(c, f, d), y = m ? m.range(c, +f + 1) : [];
    return p ? y.reverse() : y;
  }
  function l(c, f, d) {
    const p = Math.abs(f - c) / d, m = rS(([, , v]) => v).right(a, p);
    if (m === a.length) return e.every(Hx(c / Hb, f / Hb, d));
    if (m === 0) return mm.every(Math.max(Hx(c, f, d), 1));
    const [y, g] = a[p / a[m - 1][2] < a[m][2] / p ? m - 1 : m];
    return y.every(g);
  }
  return [s, l];
}
const [rbe, ibe] = cF(Go, wS, ly, lF, bS, yS), [obe, abe] = cF(Ko, xS, sy, Nd, vS, gS);
function Kb(e) {
  if (0 <= e.y && e.y < 100) {
    var t = new Date(-1, e.m, e.d, e.H, e.M, e.S, e.L);
    return t.setFullYear(e.y), t;
  }
  return new Date(e.y, e.m, e.d, e.H, e.M, e.S, e.L);
}
function Gb(e) {
  if (0 <= e.y && e.y < 100) {
    var t = new Date(Date.UTC(-1, e.m, e.d, e.H, e.M, e.S, e.L));
    return t.setUTCFullYear(e.y), t;
  }
  return new Date(Date.UTC(e.y, e.m, e.d, e.H, e.M, e.S, e.L));
}
function ku(e, t, n) {
  return { y: e, m: t, d: n, H: 0, M: 0, S: 0, L: 0 };
}
function sbe(e) {
  var t = e.dateTime, n = e.date, r = e.time, i = e.periods, o = e.days, a = e.shortDays, s = e.months, l = e.shortMonths, c = Mu(i), f = Nu(i), d = Mu(o), p = Nu(o), m = Mu(a), y = Nu(a), g = Mu(s), v = Nu(s), x = Mu(l), w = Nu(l), S = {
    a: z,
    A: H,
    b: U,
    B: V,
    c: null,
    d: DM,
    e: DM,
    f: kbe,
    g: Fbe,
    G: zbe,
    H: Pbe,
    I: Cbe,
    j: Ebe,
    L: uF,
    m: Mbe,
    M: Nbe,
    p: Y,
    q: Q,
    Q: jM,
    s: LM,
    S: $be,
    u: Dbe,
    U: Ibe,
    V: Rbe,
    w: jbe,
    W: Lbe,
    x: null,
    X: null,
    y: Bbe,
    Y: Wbe,
    Z: Vbe,
    "%": RM
  }, A = {
    a: ne,
    A: re,
    b: ce,
    B: oe,
    c: null,
    d: IM,
    e: IM,
    f: Gbe,
    g: r0e,
    G: o0e,
    H: Ube,
    I: Hbe,
    j: Kbe,
    L: dF,
    m: Ybe,
    M: qbe,
    p: fe,
    q: ae,
    Q: jM,
    s: LM,
    S: Xbe,
    u: Zbe,
    U: Jbe,
    V: Qbe,
    w: e0e,
    W: t0e,
    x: null,
    X: null,
    y: n0e,
    Y: i0e,
    Z: a0e,
    "%": RM
  }, _ = {
    a: I,
    A: $,
    b: N,
    B: D,
    c: j,
    d: NM,
    e: NM,
    f: Sbe,
    g: MM,
    G: kM,
    H: $M,
    I: $M,
    j: bbe,
    L: _be,
    m: vbe,
    M: xbe,
    p: k,
    q: ybe,
    Q: Abe,
    s: Tbe,
    S: wbe,
    u: dbe,
    U: hbe,
    V: pbe,
    w: fbe,
    W: mbe,
    x: F,
    X: W,
    y: MM,
    Y: kM,
    Z: gbe,
    "%": Obe
  };
  S.x = O(n, S), S.X = O(r, S), S.c = O(t, S), A.x = O(n, A), A.X = O(r, A), A.c = O(t, A);
  function O(ee, se) {
    return function(ge) {
      var X = [], $e = -1, de = 0, ke = ee.length, it, lt, Xn;
      for (ge instanceof Date || (ge = /* @__PURE__ */ new Date(+ge)); ++$e < ke; )
        ee.charCodeAt($e) === 37 && (X.push(ee.slice(de, $e)), (lt = EM[it = ee.charAt(++$e)]) != null ? it = ee.charAt(++$e) : lt = it === "e" ? " " : "0", (Xn = se[it]) && (it = Xn(ge, lt)), X.push(it), de = $e + 1);
      return X.push(ee.slice(de, $e)), X.join("");
    };
  }
  function P(ee, se) {
    return function(ge) {
      var X = ku(1900, void 0, 1), $e = C(X, ee, ge += "", 0), de, ke;
      if ($e != ge.length) return null;
      if ("Q" in X) return new Date(X.Q);
      if ("s" in X) return new Date(X.s * 1e3 + ("L" in X ? X.L : 0));
      if (se && !("Z" in X) && (X.Z = 0), "p" in X && (X.H = X.H % 12 + X.p * 12), X.m === void 0 && (X.m = "q" in X ? X.q : 0), "V" in X) {
        if (X.V < 1 || X.V > 53) return null;
        "w" in X || (X.w = 1), "Z" in X ? (de = Gb(ku(X.y, 0, 1)), ke = de.getUTCDay(), de = ke > 4 || ke === 0 ? ym.ceil(de) : ym(de), de = ay.offset(de, (X.V - 1) * 7), X.y = de.getUTCFullYear(), X.m = de.getUTCMonth(), X.d = de.getUTCDate() + (X.w + 6) % 7) : (de = Kb(ku(X.y, 0, 1)), ke = de.getDay(), de = ke > 4 || ke === 0 ? gm.ceil(de) : gm(de), de = Nd.offset(de, (X.V - 1) * 7), X.y = de.getFullYear(), X.m = de.getMonth(), X.d = de.getDate() + (X.w + 6) % 7);
      } else ("W" in X || "U" in X) && ("w" in X || (X.w = "u" in X ? X.u % 7 : "W" in X ? 1 : 0), ke = "Z" in X ? Gb(ku(X.y, 0, 1)).getUTCDay() : Kb(ku(X.y, 0, 1)).getDay(), X.m = 0, X.d = "W" in X ? (X.w + 6) % 7 + X.W * 7 - (ke + 5) % 7 : X.w + X.U * 7 - (ke + 6) % 7);
      return "Z" in X ? (X.H += X.Z / 100 | 0, X.M += X.Z % 100, Gb(X)) : Kb(X);
    };
  }
  function C(ee, se, ge, X) {
    for (var $e = 0, de = se.length, ke = ge.length, it, lt; $e < de; ) {
      if (X >= ke) return -1;
      if (it = se.charCodeAt($e++), it === 37) {
        if (it = se.charAt($e++), lt = _[it in EM ? se.charAt($e++) : it], !lt || (X = lt(ee, ge, X)) < 0) return -1;
      } else if (it != ge.charCodeAt(X++))
        return -1;
    }
    return X;
  }
  function k(ee, se, ge) {
    var X = c.exec(se.slice(ge));
    return X ? (ee.p = f.get(X[0].toLowerCase()), ge + X[0].length) : -1;
  }
  function I(ee, se, ge) {
    var X = m.exec(se.slice(ge));
    return X ? (ee.w = y.get(X[0].toLowerCase()), ge + X[0].length) : -1;
  }
  function $(ee, se, ge) {
    var X = d.exec(se.slice(ge));
    return X ? (ee.w = p.get(X[0].toLowerCase()), ge + X[0].length) : -1;
  }
  function N(ee, se, ge) {
    var X = x.exec(se.slice(ge));
    return X ? (ee.m = w.get(X[0].toLowerCase()), ge + X[0].length) : -1;
  }
  function D(ee, se, ge) {
    var X = g.exec(se.slice(ge));
    return X ? (ee.m = v.get(X[0].toLowerCase()), ge + X[0].length) : -1;
  }
  function j(ee, se, ge) {
    return C(ee, t, se, ge);
  }
  function F(ee, se, ge) {
    return C(ee, n, se, ge);
  }
  function W(ee, se, ge) {
    return C(ee, r, se, ge);
  }
  function z(ee) {
    return a[ee.getDay()];
  }
  function H(ee) {
    return o[ee.getDay()];
  }
  function U(ee) {
    return l[ee.getMonth()];
  }
  function V(ee) {
    return s[ee.getMonth()];
  }
  function Y(ee) {
    return i[+(ee.getHours() >= 12)];
  }
  function Q(ee) {
    return 1 + ~~(ee.getMonth() / 3);
  }
  function ne(ee) {
    return a[ee.getUTCDay()];
  }
  function re(ee) {
    return o[ee.getUTCDay()];
  }
  function ce(ee) {
    return l[ee.getUTCMonth()];
  }
  function oe(ee) {
    return s[ee.getUTCMonth()];
  }
  function fe(ee) {
    return i[+(ee.getUTCHours() >= 12)];
  }
  function ae(ee) {
    return 1 + ~~(ee.getUTCMonth() / 3);
  }
  return {
    format: function(ee) {
      var se = O(ee += "", S);
      return se.toString = function() {
        return ee;
      }, se;
    },
    parse: function(ee) {
      var se = P(ee += "", !1);
      return se.toString = function() {
        return ee;
      }, se;
    },
    utcFormat: function(ee) {
      var se = O(ee += "", A);
      return se.toString = function() {
        return ee;
      }, se;
    },
    utcParse: function(ee) {
      var se = P(ee += "", !0);
      return se.toString = function() {
        return ee;
      }, se;
    }
  };
}
var EM = { "-": "", _: " ", 0: "0" }, Rn = /^\s*\d+/, lbe = /^%/, cbe = /[\\^$*+?|[\]().{}]/g;
function pt(e, t, n) {
  var r = e < 0 ? "-" : "", i = (r ? -e : e) + "", o = i.length;
  return r + (o < n ? new Array(n - o + 1).join(t) + i : i);
}
function ube(e) {
  return e.replace(cbe, "\\$&");
}
function Mu(e) {
  return new RegExp("^(?:" + e.map(ube).join("|") + ")", "i");
}
function Nu(e) {
  return new Map(e.map((t, n) => [t.toLowerCase(), n]));
}
function fbe(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 1));
  return r ? (e.w = +r[0], n + r[0].length) : -1;
}
function dbe(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 1));
  return r ? (e.u = +r[0], n + r[0].length) : -1;
}
function hbe(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 2));
  return r ? (e.U = +r[0], n + r[0].length) : -1;
}
function pbe(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 2));
  return r ? (e.V = +r[0], n + r[0].length) : -1;
}
function mbe(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 2));
  return r ? (e.W = +r[0], n + r[0].length) : -1;
}
function kM(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 4));
  return r ? (e.y = +r[0], n + r[0].length) : -1;
}
function MM(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 2));
  return r ? (e.y = +r[0] + (+r[0] > 68 ? 1900 : 2e3), n + r[0].length) : -1;
}
function gbe(e, t, n) {
  var r = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n, n + 6));
  return r ? (e.Z = r[1] ? 0 : -(r[2] + (r[3] || "00")), n + r[0].length) : -1;
}
function ybe(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 1));
  return r ? (e.q = r[0] * 3 - 3, n + r[0].length) : -1;
}
function vbe(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 2));
  return r ? (e.m = r[0] - 1, n + r[0].length) : -1;
}
function NM(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 2));
  return r ? (e.d = +r[0], n + r[0].length) : -1;
}
function bbe(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 3));
  return r ? (e.m = 0, e.d = +r[0], n + r[0].length) : -1;
}
function $M(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 2));
  return r ? (e.H = +r[0], n + r[0].length) : -1;
}
function xbe(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 2));
  return r ? (e.M = +r[0], n + r[0].length) : -1;
}
function wbe(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 2));
  return r ? (e.S = +r[0], n + r[0].length) : -1;
}
function _be(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 3));
  return r ? (e.L = +r[0], n + r[0].length) : -1;
}
function Sbe(e, t, n) {
  var r = Rn.exec(t.slice(n, n + 6));
  return r ? (e.L = Math.floor(r[0] / 1e3), n + r[0].length) : -1;
}
function Obe(e, t, n) {
  var r = lbe.exec(t.slice(n, n + 1));
  return r ? n + r[0].length : -1;
}
function Abe(e, t, n) {
  var r = Rn.exec(t.slice(n));
  return r ? (e.Q = +r[0], n + r[0].length) : -1;
}
function Tbe(e, t, n) {
  var r = Rn.exec(t.slice(n));
  return r ? (e.s = +r[0], n + r[0].length) : -1;
}
function DM(e, t) {
  return pt(e.getDate(), t, 2);
}
function Pbe(e, t) {
  return pt(e.getHours(), t, 2);
}
function Cbe(e, t) {
  return pt(e.getHours() % 12 || 12, t, 2);
}
function Ebe(e, t) {
  return pt(1 + Nd.count(Ko(e), e), t, 3);
}
function uF(e, t) {
  return pt(e.getMilliseconds(), t, 3);
}
function kbe(e, t) {
  return uF(e, t) + "000";
}
function Mbe(e, t) {
  return pt(e.getMonth() + 1, t, 2);
}
function Nbe(e, t) {
  return pt(e.getMinutes(), t, 2);
}
function $be(e, t) {
  return pt(e.getSeconds(), t, 2);
}
function Dbe(e) {
  var t = e.getDay();
  return t === 0 ? 7 : t;
}
function Ibe(e, t) {
  return pt(sy.count(Ko(e) - 1, e), t, 2);
}
function fF(e) {
  var t = e.getDay();
  return t >= 4 || t === 0 ? fc(e) : fc.ceil(e);
}
function Rbe(e, t) {
  return e = fF(e), pt(fc.count(Ko(e), e) + (Ko(e).getDay() === 4), t, 2);
}
function jbe(e) {
  return e.getDay();
}
function Lbe(e, t) {
  return pt(gm.count(Ko(e) - 1, e), t, 2);
}
function Bbe(e, t) {
  return pt(e.getFullYear() % 100, t, 2);
}
function Fbe(e, t) {
  return e = fF(e), pt(e.getFullYear() % 100, t, 2);
}
function Wbe(e, t) {
  return pt(e.getFullYear() % 1e4, t, 4);
}
function zbe(e, t) {
  var n = e.getDay();
  return e = n >= 4 || n === 0 ? fc(e) : fc.ceil(e), pt(e.getFullYear() % 1e4, t, 4);
}
function Vbe(e) {
  var t = e.getTimezoneOffset();
  return (t > 0 ? "-" : (t *= -1, "+")) + pt(t / 60 | 0, "0", 2) + pt(t % 60, "0", 2);
}
function IM(e, t) {
  return pt(e.getUTCDate(), t, 2);
}
function Ube(e, t) {
  return pt(e.getUTCHours(), t, 2);
}
function Hbe(e, t) {
  return pt(e.getUTCHours() % 12 || 12, t, 2);
}
function Kbe(e, t) {
  return pt(1 + ay.count(Go(e), e), t, 3);
}
function dF(e, t) {
  return pt(e.getUTCMilliseconds(), t, 3);
}
function Gbe(e, t) {
  return dF(e, t) + "000";
}
function Ybe(e, t) {
  return pt(e.getUTCMonth() + 1, t, 2);
}
function qbe(e, t) {
  return pt(e.getUTCMinutes(), t, 2);
}
function Xbe(e, t) {
  return pt(e.getUTCSeconds(), t, 2);
}
function Zbe(e) {
  var t = e.getUTCDay();
  return t === 0 ? 7 : t;
}
function Jbe(e, t) {
  return pt(ly.count(Go(e) - 1, e), t, 2);
}
function hF(e) {
  var t = e.getUTCDay();
  return t >= 4 || t === 0 ? dc(e) : dc.ceil(e);
}
function Qbe(e, t) {
  return e = hF(e), pt(dc.count(Go(e), e) + (Go(e).getUTCDay() === 4), t, 2);
}
function e0e(e) {
  return e.getUTCDay();
}
function t0e(e, t) {
  return pt(ym.count(Go(e) - 1, e), t, 2);
}
function n0e(e, t) {
  return pt(e.getUTCFullYear() % 100, t, 2);
}
function r0e(e, t) {
  return e = hF(e), pt(e.getUTCFullYear() % 100, t, 2);
}
function i0e(e, t) {
  return pt(e.getUTCFullYear() % 1e4, t, 4);
}
function o0e(e, t) {
  var n = e.getUTCDay();
  return e = n >= 4 || n === 0 ? dc(e) : dc.ceil(e), pt(e.getUTCFullYear() % 1e4, t, 4);
}
function a0e() {
  return "+0000";
}
function RM() {
  return "%";
}
function jM(e) {
  return +e;
}
function LM(e) {
  return Math.floor(+e / 1e3);
}
var Ol, pF, mF;
s0e({
  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 s0e(e) {
  return Ol = sbe(e), pF = Ol.format, Ol.parse, mF = Ol.utcFormat, Ol.utcParse, Ol;
}
function l0e(e) {
  return new Date(e);
}
function c0e(e) {
  return e instanceof Date ? +e : +/* @__PURE__ */ new Date(+e);
}
function _S(e, t, n, r, i, o, a, s, l, c) {
  var f = lS(), d = f.invert, p = f.domain, m = c(".%L"), y = c(":%S"), g = c("%I:%M"), v = c("%I %p"), x = c("%a %d"), w = c("%b %d"), S = c("%B"), A = c("%Y");
  function _(O) {
    return (l(O) < O ? m : s(O) < O ? y : a(O) < O ? g : o(O) < O ? v : r(O) < O ? i(O) < O ? x : w : n(O) < O ? S : A)(O);
  }
  return f.invert = function(O) {
    return new Date(d(O));
  }, f.domain = function(O) {
    return arguments.length ? p(Array.from(O, c0e)) : p().map(l0e);
  }, f.ticks = function(O) {
    var P = p();
    return e(P[0], P[P.length - 1], O ?? 10);
  }, f.tickFormat = function(O, P) {
    return P == null ? _ : c(P);
  }, f.nice = function(O) {
    var P = p();
    return (!O || typeof O.range != "function") && (O = t(P[0], P[P.length - 1], O ?? 10)), O ? p(tF(P, O)) : f;
  }, f.copy = function() {
    return Md(f, _S(e, t, n, r, i, o, a, s, l, c));
  }, f;
}
function u0e() {
  return gi.apply(_S(obe, abe, Ko, xS, sy, Nd, vS, gS, As, pF).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
}
function f0e() {
  return gi.apply(_S(rbe, ibe, Go, wS, ly, ay, bS, yS, As, mF).domain([Date.UTC(2e3, 0, 1), Date.UTC(2e3, 0, 2)]), arguments);
}
function cy() {
  var e = 0, t = 1, n, r, i, o, a = hr, s = !1, l;
  function c(d) {
    return d == null || isNaN(d = +d) ? l : a(i === 0 ? 0.5 : (d = (o(d) - n) * i, s ? Math.max(0, Math.min(1, d)) : d));
  }
  c.domain = function(d) {
    return arguments.length ? ([e, t] = d, n = o(e = +e), r = o(t = +t), i = n === r ? 0 : 1 / (r - n), c) : [e, t];
  }, c.clamp = function(d) {
    return arguments.length ? (s = !!d, c) : s;
  }, c.interpolator = function(d) {
    return arguments.length ? (a = d, c) : a;
  };
  function f(d) {
    return function(p) {
      var m, y;
      return arguments.length ? ([m, y] = p, a = d(m, y), c) : [a(0), a(1)];
    };
  }
  return c.range = f(Zc), c.rangeRound = f(sS), c.unknown = function(d) {
    return arguments.length ? (l = d, c) : l;
  }, function(d) {
    return o = d, n = d(e), r = d(t), i = n === r ? 0 : 1 / (r - n), c;
  };
}
function Ya(e, t) {
  return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown());
}
function gF() {
  var e = Ga(cy()(hr));
  return e.copy = function() {
    return Ya(e, gF());
  }, na.apply(e, arguments);
}
function yF() {
  var e = fS(cy()).domain([1, 10]);
  return e.copy = function() {
    return Ya(e, yF()).base(e.base());
  }, na.apply(e, arguments);
}
function vF() {
  var e = dS(cy());
  return e.copy = function() {
    return Ya(e, vF()).constant(e.constant());
  }, na.apply(e, arguments);
}
function SS() {
  var e = hS(cy());
  return e.copy = function() {
    return Ya(e, SS()).exponent(e.exponent());
  }, na.apply(e, arguments);
}
function d0e() {
  return SS.apply(null, arguments).exponent(0.5);
}
function bF() {
  var e = [], t = hr;
  function n(r) {
    if (r != null && !isNaN(r = +r)) return t((Ed(e, r, 1) - 1) / (e.length - 1));
  }
  return n.domain = function(r) {
    if (!arguments.length) return e.slice();
    e = [];
    for (let i of r) i != null && !isNaN(i = +i) && e.push(i);
    return e.sort(Na), n;
  }, n.interpolator = function(r) {
    return arguments.length ? (t = r, n) : t;
  }, n.range = function() {
    return e.map((r, i) => t(i / (e.length - 1)));
  }, n.quantiles = function(r) {
    return Array.from({ length: r + 1 }, (i, o) => Jye(e, o / r));
  }, n.copy = function() {
    return bF(t).domain(e);
  }, na.apply(n, arguments);
}
function uy() {
  var e = 0, t = 0.5, n = 1, r = 1, i, o, a, s, l, c = hr, f, d = !1, p;
  function m(g) {
    return isNaN(g = +g) ? p : (g = 0.5 + ((g = +f(g)) - o) * (r * g < r * o ? s : l), c(d ? Math.max(0, Math.min(1, g)) : g));
  }
  m.domain = function(g) {
    return arguments.length ? ([e, t, n] = g, i = f(e = +e), o = f(t = +t), a = f(n = +n), s = i === o ? 0 : 0.5 / (o - i), l = o === a ? 0 : 0.5 / (a - o), r = o < i ? -1 : 1, m) : [e, t, n];
  }, m.clamp = function(g) {
    return arguments.length ? (d = !!g, m) : d;
  }, m.interpolator = function(g) {
    return arguments.length ? (c = g, m) : c;
  };
  function y(g) {
    return function(v) {
      var x, w, S;
      return arguments.length ? ([x, w, S] = v, c = Ove(g, [x, w, S]), m) : [c(0), c(0.5), c(1)];
    };
  }
  return m.range = y(Zc), m.rangeRound = y(sS), m.unknown = function(g) {
    return arguments.length ? (p = g, m) : p;
  }, function(g) {
    return f = g, i = g(e), o = g(t), a = g(n), s = i === o ? 0 : 0.5 / (o - i), l = o === a ? 0 : 0.5 / (a - o), r = o < i ? -1 : 1, m;
  };
}
function xF() {
  var e = Ga(uy()(hr));
  return e.copy = function() {
    return Ya(e, xF());
  }, na.apply(e, arguments);
}
function wF() {
  var e = fS(uy()).domain([0.1, 1, 10]);
  return e.copy = function() {
    return Ya(e, wF()).base(e.base());
  }, na.apply(e, arguments);
}
function _F() {
  var e = dS(uy());
  return e.copy = function() {
    return Ya(e, _F()).constant(e.constant());
  }, na.apply(e, arguments);
}
function OS() {
  var e = hS(uy());
  return e.copy = function() {
    return Ya(e, OS()).exponent(e.exponent());
  }, na.apply(e, arguments);
}
function h0e() {
  return OS.apply(null, arguments).exponent(0.5);
}
const BM = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  scaleBand: Df,
  scaleDiverging: xF,
  scaleDivergingLog: wF,
  scaleDivergingPow: OS,
  scaleDivergingSqrt: h0e,
  scaleDivergingSymlog: _F,
  scaleIdentity: eF,
  scaleImplicit: Kx,
  scaleLinear: pm,
  scaleLog: nF,
  scaleOrdinal: iS,
  scalePoint: nf,
  scalePow: pS,
  scaleQuantile: oF,
  scaleQuantize: aF,
  scaleRadial: iF,
  scaleSequential: gF,
  scaleSequentialLog: yF,
  scaleSequentialPow: SS,
  scaleSequentialQuantile: bF,
  scaleSequentialSqrt: d0e,
  scaleSequentialSymlog: vF,
  scaleSqrt: Gve,
  scaleSymlog: rF,
  scaleThreshold: sF,
  scaleTime: u0e,
  scaleUtc: f0e,
  tickFormat: QB
}, Symbol.toStringTag, { value: "Module" }));
var p0e = zc;
function m0e(e, t, n) {
  for (var r = -1, i = e.length; ++r < i; ) {
    var o = e[r], a = t(o);
    if (a != null && (s === void 0 ? a === a && !p0e(a) : n(a, s)))
      var s = a, l = o;
  }
  return l;
}
var fy = m0e;
function g0e(e, t) {
  return e > t;
}
var SF = g0e, y0e = fy, v0e = SF, b0e = Xc;
function x0e(e) {
  return e && e.length ? y0e(e, b0e, v0e) : void 0;
}
var w0e = x0e;
const Ta = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(w0e);
function _0e(e, t) {
  return e < t;
}
var OF = _0e, S0e = fy, O0e = OF, A0e = Xc;
function T0e(e) {
  return e && e.length ? S0e(e, A0e, O0e) : void 0;
}
var P0e = T0e;
const dy = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(P0e);
var C0e = L_, E0e = so, k0e = NB, M0e = Tr;
function N0e(e, t) {
  var n = M0e(e) ? C0e : k0e;
  return n(e, E0e(t));
}
var $0e = N0e, D0e = kB, I0e = $0e;
function R0e(e, t) {
  return D0e(I0e(e, t), 1);
}
var j0e = R0e;
const L0e = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(j0e);
var B0e = Z_;
function F0e(e, t) {
  return B0e(e, t);
}
var W0e = F0e;
const Us = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(W0e);
var Jc = 1e9, z0e = {
  // 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"
}, TS, Xt = !0, pi = "[DecimalError] ", $s = pi + "Invalid argument: ", AS = pi + "Exponent out of range: ", Qc = Math.floor, bs = Math.pow, V0e = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, Wr, Mn = 1e7, Vt = 7, AF = 9007199254740991, vm = Qc(AF / Vt), Pe = {};
Pe.absoluteValue = Pe.abs = function() {
  var e = new this.constructor(this);
  return e.s && (e.s = 1), e;
};
Pe.comparedTo = Pe.cmp = function(e) {
  var t, n, r, i, o = this;
  if (e = new o.constructor(e), o.s !== e.s) return o.s || -e.s;
  if (o.e !== e.e) return o.e > e.e ^ o.s < 0 ? 1 : -1;
  for (r = o.d.length, i = e.d.length, t = 0, n = r < i ? r : i; t < n; ++t)
    if (o.d[t] !== e.d[t]) return o.d[t] > e.d[t] ^ o.s < 0 ? 1 : -1;
  return r === i ? 0 : r > i ^ o.s < 0 ? 1 : -1;
};
Pe.decimalPlaces = Pe.dp = function() {
  var e = this, t = e.d.length - 1, n = (t - e.e) * Vt;
  if (t = e.d[t], t) for (; t % 10 == 0; t /= 10) n--;
  return n < 0 ? 0 : n;
};
Pe.dividedBy = Pe.div = function(e) {
  return Bo(this, new this.constructor(e));
};
Pe.dividedToIntegerBy = Pe.idiv = function(e) {
  var t = this, n = t.constructor;
  return $t(Bo(t, new n(e), 0, 1), n.precision);
};
Pe.equals = Pe.eq = function(e) {
  return !this.cmp(e);
};
Pe.exponent = function() {
  return gn(this);
};
Pe.greaterThan = Pe.gt = function(e) {
  return this.cmp(e) > 0;
};
Pe.greaterThanOrEqualTo = Pe.gte = function(e) {
  return this.cmp(e) >= 0;
};
Pe.isInteger = Pe.isint = function() {
  return this.e > this.d.length - 2;
};
Pe.isNegative = Pe.isneg = function() {
  return this.s < 0;
};
Pe.isPositive = Pe.ispos = function() {
  return this.s > 0;
};
Pe.isZero = function() {
  return this.s === 0;
};
Pe.lessThan = Pe.lt = function(e) {
  return this.cmp(e) < 0;
};
Pe.lessThanOrEqualTo = Pe.lte = function(e) {
  return this.cmp(e) < 1;
};
Pe.logarithm = Pe.log = function(e) {
  var t, n = this, r = n.constructor, i = r.precision, o = i + 5;
  if (e === void 0)
    e = new r(10);
  else if (e = new r(e), e.s < 1 || e.eq(Wr)) throw Error(pi + "NaN");
  if (n.s < 1) throw Error(pi + (n.s ? "NaN" : "-Infinity"));
  return n.eq(Wr) ? new r(0) : (Xt = !1, t = Bo(Bf(n, o), Bf(e, o), o), Xt = !0, $t(t, i));
};
Pe.minus = Pe.sub = function(e) {
  var t = this;
  return e = new t.constructor(e), t.s == e.s ? CF(t, e) : TF(t, (e.s = -e.s, e));
};
Pe.modulo = Pe.mod = function(e) {
  var t, n = this, r = n.constructor, i = r.precision;
  if (e = new r(e), !e.s) throw Error(pi + "NaN");
  return n.s ? (Xt = !1, t = Bo(n, e, 0, 1).times(e), Xt = !0, n.minus(t)) : $t(new r(n), i);
};
Pe.naturalExponential = Pe.exp = function() {
  return PF(this);
};
Pe.naturalLogarithm = Pe.ln = function() {
  return Bf(this);
};
Pe.negated = Pe.neg = function() {
  var e = new this.constructor(this);
  return e.s = -e.s || 0, e;
};
Pe.plus = Pe.add = function(e) {
  var t = this;
  return e = new t.constructor(e), t.s == e.s ? TF(t, e) : CF(t, (e.s = -e.s, e));
};
Pe.precision = Pe.sd = function(e) {
  var t, n, r, i = this;
  if (e !== void 0 && e !== !!e && e !== 1 && e !== 0) throw Error($s + e);
  if (t = gn(i) + 1, r = i.d.length - 1, n = r * Vt + 1, r = i.d[r], r) {
    for (; r % 10 == 0; r /= 10) n--;
    for (r = i.d[0]; r >= 10; r /= 10) n++;
  }
  return e && t > n ? t : n;
};
Pe.squareRoot = Pe.sqrt = function() {
  var e, t, n, r, i, o, a, s = this, l = s.constructor;
  if (s.s < 1) {
    if (!s.s) return new l(0);
    throw Error(pi + "NaN");
  }
  for (e = gn(s), Xt = !1, i = Math.sqrt(+s), i == 0 || i == 1 / 0 ? (t = Ui(s.d), (t.length + e) % 2 == 0 && (t += "0"), i = Math.sqrt(t), e = Qc((e + 1) / 2) - (e < 0 || e % 2), i == 1 / 0 ? t = "5e" + e : (t = i.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + e), r = new l(t)) : r = new l(i.toString()), n = l.precision, i = a = n + 3; ; )
    if (o = r, r = o.plus(Bo(s, o, a + 2)).times(0.5), Ui(o.d).slice(0, a) === (t = Ui(r.d)).slice(0, a)) {
      if (t = t.slice(a - 3, a + 1), i == a && t == "4999") {
        if ($t(o, n + 1, 0), o.times(o).eq(s)) {
          r = o;
          break;
        }
      } else if (t != "9999")
        break;
      a += 4;
    }
  return Xt = !0, $t(r, n);
};
Pe.times = Pe.mul = function(e) {
  var t, n, r, i, o, a, s, l, c, f = this, d = f.constructor, p = f.d, m = (e = new d(e)).d;
  if (!f.s || !e.s) return new d(0);
  for (e.s *= f.s, n = f.e + e.e, l = p.length, c = m.length, l < c && (o = p, p = m, m = o, a = l, l = c, c = a), o = [], a = l + c, r = a; r--; ) o.push(0);
  for (r = c; --r >= 0; ) {
    for (t = 0, i = l + r; i > r; )
      s = o[i] + m[r] * p[i - r - 1] + t, o[i--] = s % Mn | 0, t = s / Mn | 0;
    o[i] = (o[i] + t) % Mn | 0;
  }
  for (; !o[--a]; ) o.pop();
  return t ? ++n : o.shift(), e.d = o, e.e = n, Xt ? $t(e, d.precision) : e;
};
Pe.toDecimalPlaces = Pe.todp = function(e, t) {
  var n = this, r = n.constructor;
  return n = new r(n), e === void 0 ? n : (ro(e, 0, Jc), t === void 0 ? t = r.rounding : ro(t, 0, 8), $t(n, e + gn(n) + 1, t));
};
Pe.toExponential = function(e, t) {
  var n, r = this, i = r.constructor;
  return e === void 0 ? n = Hs(r, !0) : (ro(e, 0, Jc), t === void 0 ? t = i.rounding : ro(t, 0, 8), r = $t(new i(r), e + 1, t), n = Hs(r, !0, e + 1)), n;
};
Pe.toFixed = function(e, t) {
  var n, r, i = this, o = i.constructor;
  return e === void 0 ? Hs(i) : (ro(e, 0, Jc), t === void 0 ? t = o.rounding : ro(t, 0, 8), r = $t(new o(i), e + gn(i) + 1, t), n = Hs(r.abs(), !1, e + gn(r) + 1), i.isneg() && !i.isZero() ? "-" + n : n);
};
Pe.toInteger = Pe.toint = function() {
  var e = this, t = e.constructor;
  return $t(new t(e), gn(e) + 1, t.rounding);
};
Pe.toNumber = function() {
  return +this;
};
Pe.toPower = Pe.pow = function(e) {
  var t, n, r, i, o, a, s = this, l = s.constructor, c = 12, f = +(e = new l(e));
  if (!e.s) return new l(Wr);
  if (s = new l(s), !s.s) {
    if (e.s < 1) throw Error(pi + "Infinity");
    return s;
  }
  if (s.eq(Wr)) return s;
  if (r = l.precision, e.eq(Wr)) return $t(s, r);
  if (t = e.e, n = e.d.length - 1, a = t >= n, o = s.s, a) {
    if ((n = f < 0 ? -f : f) <= AF) {
      for (i = new l(Wr), t = Math.ceil(r / Vt + 4), Xt = !1; n % 2 && (i = i.times(s), WM(i.d, t)), n = Qc(n / 2), n !== 0; )
        s = s.times(s), WM(s.d, t);
      return Xt = !0, e.s < 0 ? new l(Wr).div(i) : $t(i, r);
    }
  } else if (o < 0) throw Error(pi + "NaN");
  return o = o < 0 && e.d[Math.max(t, n)] & 1 ? -1 : 1, s.s = 1, Xt = !1, i = e.times(Bf(s, r + c)), Xt = !0, i = PF(i), i.s = o, i;
};
Pe.toPrecision = function(e, t) {
  var n, r, i = this, o = i.constructor;
  return e === void 0 ? (n = gn(i), r = Hs(i, n <= o.toExpNeg || n >= o.toExpPos)) : (ro(e, 1, Jc), t === void 0 ? t = o.rounding : ro(t, 0, 8), i = $t(new o(i), e, t), n = gn(i), r = Hs(i, e <= n || n <= o.toExpNeg, e)), r;
};
Pe.toSignificantDigits = Pe.tosd = function(e, t) {
  var n = this, r = n.constructor;
  return e === void 0 ? (e = r.precision, t = r.rounding) : (ro(e, 1, Jc), t === void 0 ? t = r.rounding : ro(t, 0, 8)), $t(new r(n), e, t);
};
Pe.toString = Pe.valueOf = Pe.val = Pe.toJSON = Pe[Symbol.for("nodejs.util.inspect.custom")] = function() {
  var e = this, t = gn(e), n = e.constructor;
  return Hs(e, t <= n.toExpNeg || t >= n.toExpPos);
};
function TF(e, t) {
  var n, r, i, o, a, s, l, c, f = e.constructor, d = f.precision;
  if (!e.s || !t.s)
    return t.s || (t = new f(e)), Xt ? $t(t, d) : t;
  if (l = e.d, c = t.d, a = e.e, i = t.e, l = l.slice(), o = a - i, o) {
    for (o < 0 ? (r = l, o = -o, s = c.length) : (r = c, i = a, s = l.length), a = Math.ceil(d / Vt), s = a > s ? a + 1 : s + 1, o > s && (o = s, r.length = 1), r.reverse(); o--; ) r.push(0);
    r.reverse();
  }
  for (s = l.length, o = c.length, s - o < 0 && (o = s, r = c, c = l, l = r), n = 0; o; )
    n = (l[--o] = l[o] + c[o] + n) / Mn | 0, l[o] %= Mn;
  for (n && (l.unshift(n), ++i), s = l.length; l[--s] == 0; ) l.pop();
  return t.d = l, t.e = i, Xt ? $t(t, d) : t;
}
function ro(e, t, n) {
  if (e !== ~~e || e < t || e > n)
    throw Error($s + e);
}
function Ui(e) {
  var t, n, r, i = e.length - 1, o = "", a = e[0];
  if (i > 0) {
    for (o += a, t = 1; t < i; t++)
      r = e[t] + "", n = Vt - r.length, n && (o += _a(n)), o += r;
    a = e[t], r = a + "", n = Vt - r.length, n && (o += _a(n));
  } else if (a === 0)
    return "0";
  for (; a % 10 === 0; ) a /= 10;
  return o + a;
}
var Bo = /* @__PURE__ */ function() {
  function e(r, i) {
    var o, a = 0, s = r.length;
    for (r = r.slice(); s--; )
      o = r[s] * i + a, r[s] = o % Mn | 0, a = o / Mn | 0;
    return a && r.unshift(a), r;
  }
  function t(r, i, o, a) {
    var s, l;
    if (o != a)
      l = o > a ? 1 : -1;
    else
      for (s = l = 0; s < o; s++)
        if (r[s] != i[s]) {
          l = r[s] > i[s] ? 1 : -1;
          break;
        }
    return l;
  }
  function n(r, i, o) {
    for (var a = 0; o--; )
      r[o] -= a, a = r[o] < i[o] ? 1 : 0, r[o] = a * Mn + r[o] - i[o];
    for (; !r[0] && r.length > 1; ) r.shift();
  }
  return function(r, i, o, a) {
    var s, l, c, f, d, p, m, y, g, v, x, w, S, A, _, O, P, C, k = r.constructor, I = r.s == i.s ? 1 : -1, $ = r.d, N = i.d;
    if (!r.s) return new k(r);
    if (!i.s) throw Error(pi + "Division by zero");
    for (l = r.e - i.e, P = N.length, _ = $.length, m = new k(I), y = m.d = [], c = 0; N[c] == ($[c] || 0); ) ++c;
    if (N[c] > ($[c] || 0) && --l, o == null ? w = o = k.precision : a ? w = o + (gn(r) - gn(i)) + 1 : w = o, w < 0) return new k(0);
    if (w = w / Vt + 2 | 0, c = 0, P == 1)
      for (f = 0, N = N[0], w++; (c < _ || f) && w--; c++)
        S = f * Mn + ($[c] || 0), y[c] = S / N | 0, f = S % N | 0;
    else {
      for (f = Mn / (N[0] + 1) | 0, f > 1 && (N = e(N, f), $ = e($, f), P = N.length, _ = $.length), A = P, g = $.slice(0, P), v = g.length; v < P; ) g[v++] = 0;
      C = N.slice(), C.unshift(0), O = N[0], N[1] >= Mn / 2 && ++O;
      do
        f = 0, s = t(N, g, P, v), s < 0 ? (x = g[0], P != v && (x = x * Mn + (g[1] || 0)), f = x / O | 0, f > 1 ? (f >= Mn && (f = Mn - 1), d = e(N, f), p = d.length, v = g.length, s = t(d, g, p, v), s == 1 && (f--, n(d, P < p ? C : N, p))) : (f == 0 && (s = f = 1), d = N.slice()), p = d.length, p < v && d.unshift(0), n(g, d, v), s == -1 && (v = g.length, s = t(N, g, P, v), s < 1 && (f++, n(g, P < v ? C : N, v))), v = g.length) : s === 0 && (f++, g = [0]), y[c++] = f, s && g[0] ? g[v++] = $[A] || 0 : (g = [$[A]], v = 1);
      while ((A++ < _ || g[0] !== void 0) && w--);
    }
    return y[0] || y.shift(), m.e = l, $t(m, a ? o + gn(m) + 1 : o);
  };
}();
function PF(e, t) {
  var n, r, i, o, a, s, l = 0, c = 0, f = e.constructor, d = f.precision;
  if (gn(e) > 16) throw Error(AS + gn(e));
  if (!e.s) return new f(Wr);
  for (t == null ? (Xt = !1, s = d) : s = t, a = new f(0.03125); e.abs().gte(0.1); )
    e = e.times(a), c += 5;
  for (r = Math.log(bs(2, c)) / Math.LN10 * 2 + 5 | 0, s += r, n = i = o = new f(Wr), f.precision = s; ; ) {
    if (i = $t(i.times(e), s), n = n.times(++l), a = o.plus(Bo(i, n, s)), Ui(a.d).slice(0, s) === Ui(o.d).slice(0, s)) {
      for (; c--; ) o = $t(o.times(o), s);
      return f.precision = d, t == null ? (Xt = !0, $t(o, d)) : o;
    }
    o = a;
  }
}
function gn(e) {
  for (var t = e.e * Vt, n = e.d[0]; n >= 10; n /= 10) t++;
  return t;
}
function Yb(e, t, n) {
  if (t > e.LN10.sd())
    throw Xt = !0, n && (e.precision = n), Error(pi + "LN10 precision limit exceeded");
  return $t(new e(e.LN10), t);
}
function _a(e) {
  for (var t = ""; e--; ) t += "0";
  return t;
}
function Bf(e, t) {
  var n, r, i, o, a, s, l, c, f, d = 1, p = 10, m = e, y = m.d, g = m.constructor, v = g.precision;
  if (m.s < 1) throw Error(pi + (m.s ? "NaN" : "-Infinity"));
  if (m.eq(Wr)) return new g(0);
  if (t == null ? (Xt = !1, c = v) : c = t, m.eq(10))
    return t == null && (Xt = !0), Yb(g, c);
  if (c += p, g.precision = c, n = Ui(y), r = n.charAt(0), o = gn(m), Math.abs(o) < 15e14) {
    for (; r < 7 && r != 1 || r == 1 && n.charAt(1) > 3; )
      m = m.times(e), n = Ui(m.d), r = n.charAt(0), d++;
    o = gn(m), r > 1 ? (m = new g("0." + n), o++) : m = new g(r + "." + n.slice(1));
  } else
    return l = Yb(g, c + 2, v).times(o + ""), m = Bf(new g(r + "." + n.slice(1)), c - p).plus(l), g.precision = v, t == null ? (Xt = !0, $t(m, v)) : m;
  for (s = a = m = Bo(m.minus(Wr), m.plus(Wr), c), f = $t(m.times(m), c), i = 3; ; ) {
    if (a = $t(a.times(f), c), l = s.plus(Bo(a, new g(i), c)), Ui(l.d).slice(0, c) === Ui(s.d).slice(0, c))
      return s = s.times(2), o !== 0 && (s = s.plus(Yb(g, c + 2, v).times(o + ""))), s = Bo(s, new g(d), c), g.precision = v, t == null ? (Xt = !0, $t(s, v)) : s;
    s = l, i += 2;
  }
}
function FM(e, t) {
  var n, r, i;
  for ((n = t.indexOf(".")) > -1 && (t = t.replace(".", "")), (r = t.search(/e/i)) > 0 ? (n < 0 && (n = r), n += +t.slice(r + 1), t = t.substring(0, r)) : n < 0 && (n = t.length), r = 0; t.charCodeAt(r) === 48; ) ++r;
  for (i = t.length; t.charCodeAt(i - 1) === 48; ) --i;
  if (t = t.slice(r, i), t) {
    if (i -= r, n = n - r - 1, e.e = Qc(n / Vt), e.d = [], r = (n + 1) % Vt, n < 0 && (r += Vt), r < i) {
      for (r && e.d.push(+t.slice(0, r)), i -= Vt; r < i; ) e.d.push(+t.slice(r, r += Vt));
      t = t.slice(r), r = Vt - t.length;
    } else
      r -= i;
    for (; r--; ) t += "0";
    if (e.d.push(+t), Xt && (e.e > vm || e.e < -vm)) throw Error(AS + n);
  } else
    e.s = 0, e.e = 0, e.d = [0];
  return e;
}
function $t(e, t, n) {
  var r, i, o, a, s, l, c, f, d = e.d;
  for (a = 1, o = d[0]; o >= 10; o /= 10) a++;
  if (r = t - a, r < 0)
    r += Vt, i = t, c = d[f = 0];
  else {
    if (f = Math.ceil((r + 1) / Vt), o = d.length, f >= o) return e;
    for (c = o = d[f], a = 1; o >= 10; o /= 10) a++;
    r %= Vt, i = r - Vt + a;
  }
  if (n !== void 0 && (o = bs(10, a - i - 1), s = c / o % 10 | 0, l = t < 0 || d[f + 1] !== void 0 || c % o, l = n < 4 ? (s || l) && (n == 0 || n == (e.s < 0 ? 3 : 2)) : s > 5 || s == 5 && (n == 4 || l || n == 6 && // Check whether the digit to the left of the rounding digit is odd.
  (r > 0 ? i > 0 ? c / bs(10, a - i) : 0 : d[f - 1]) % 10 & 1 || n == (e.s < 0 ? 8 : 7))), t < 1 || !d[0])
    return l ? (o = gn(e), d.length = 1, t = t - o - 1, d[0] = bs(10, (Vt - t % Vt) % Vt), e.e = Qc(-t / Vt) || 0) : (d.length = 1, d[0] = e.e = e.s = 0), e;
  if (r == 0 ? (d.length = f, o = 1, f--) : (d.length = f + 1, o = bs(10, Vt - r), d[f] = i > 0 ? (c / bs(10, a - i) % bs(10, i) | 0) * o : 0), l)
    for (; ; )
      if (f == 0) {
        (d[0] += o) == Mn && (d[0] = 1, ++e.e);
        break;
      } else {
        if (d[f] += o, d[f] != Mn) break;
        d[f--] = 0, o = 1;
      }
  for (r = d.length; d[--r] === 0; ) d.pop();
  if (Xt && (e.e > vm || e.e < -vm))
    throw Error(AS + gn(e));
  return e;
}
function CF(e, t) {
  var n, r, i, o, a, s, l, c, f, d, p = e.constructor, m = p.precision;
  if (!e.s || !t.s)
    return t.s ? t.s = -t.s : t = new p(e), Xt ? $t(t, m) : t;
  if (l = e.d, d = t.d, r = t.e, c = e.e, l = l.slice(), a = c - r, a) {
    for (f = a < 0, f ? (n = l, a = -a, s = d.length) : (n = d, r = c, s = l.length), i = Math.max(Math.ceil(m / Vt), s) + 2, a > i && (a = i, n.length = 1), n.reverse(), i = a; i--; ) n.push(0);
    n.reverse();
  } else {
    for (i = l.length, s = d.length, f = i < s, f && (s = i), i = 0; i < s; i++)
      if (l[i] != d[i]) {
        f = l[i] < d[i];
        break;
      }
    a = 0;
  }
  for (f && (n = l, l = d, d = n, t.s = -t.s), s = l.length, i = d.length - s; i > 0; --i) l[s++] = 0;
  for (i = d.length; i > a; ) {
    if (l[--i] < d[i]) {
      for (o = i; o && l[--o] === 0; ) l[o] = Mn - 1;
      --l[o], l[i] += Mn;
    }
    l[i] -= d[i];
  }
  for (; l[--s] === 0; ) l.pop();
  for (; l[0] === 0; l.shift()) --r;
  return l[0] ? (t.d = l, t.e = r, Xt ? $t(t, m) : t) : new p(0);
}
function Hs(e, t, n) {
  var r, i = gn(e), o = Ui(e.d), a = o.length;
  return t ? (n && (r = n - a) > 0 ? o = o.charAt(0) + "." + o.slice(1) + _a(r) : a > 1 && (o = o.charAt(0) + "." + o.slice(1)), o = o + (i < 0 ? "e" : "e+") + i) : i < 0 ? (o = "0." + _a(-i - 1) + o, n && (r = n - a) > 0 && (o += _a(r))) : i >= a ? (o += _a(i + 1 - a), n && (r = n - i - 1) > 0 && (o = o + "." + _a(r))) : ((r = i + 1) < a && (o = o.slice(0, r) + "." + o.slice(r)), n && (r = n - a) > 0 && (i + 1 === a && (o += "."), o += _a(r))), e.s < 0 ? "-" + o : o;
}
function WM(e, t) {
  if (e.length > t)
    return e.length = t, !0;
}
function EF(e) {
  var t, n, r;
  function i(o) {
    var a = this;
    if (!(a instanceof i)) return new i(o);
    if (a.constructor = i, o instanceof i) {
      a.s = o.s, a.e = o.e, a.d = (o = o.d) ? o.slice() : o;
      return;
    }
    if (typeof o == "number") {
      if (o * 0 !== 0)
        throw Error($s + o);
      if (o > 0)
        a.s = 1;
      else if (o < 0)
        o = -o, a.s = -1;
      else {
        a.s = 0, a.e = 0, a.d = [0];
        return;
      }
      if (o === ~~o && o < 1e7) {
        a.e = 0, a.d = [o];
        return;
      }
      return FM(a, o.toString());
    } else if (typeof o != "string")
      throw Error($s + o);
    if (o.charCodeAt(0) === 45 ? (o = o.slice(1), a.s = -1) : a.s = 1, V0e.test(o)) FM(a, o);
    else throw Error($s + o);
  }
  if (i.prototype = Pe, i.ROUND_UP = 0, i.ROUND_DOWN = 1, i.ROUND_CEIL = 2, i.ROUND_FLOOR = 3, i.ROUND_HALF_UP = 4, i.ROUND_HALF_DOWN = 5, i.ROUND_HALF_EVEN = 6, i.ROUND_HALF_CEIL = 7, i.ROUND_HALF_FLOOR = 8, i.clone = EF, i.config = i.set = U0e, e === void 0 && (e = {}), e)
    for (r = ["precision", "rounding", "toExpNeg", "toExpPos", "LN10"], t = 0; t < r.length; ) e.hasOwnProperty(n = r[t++]) || (e[n] = this[n]);
  return i.config(e), i;
}
function U0e(e) {
  if (!e || typeof e != "object")
    throw Error(pi + "Object expected");
  var t, n, r, i = [
    "precision",
    1,
    Jc,
    "rounding",
    0,
    8,
    "toExpNeg",
    -1 / 0,
    0,
    "toExpPos",
    0,
    1 / 0
  ];
  for (t = 0; t < i.length; t += 3)
    if ((r = e[n = i[t]]) !== void 0)
      if (Qc(r) === r && r >= i[t + 1] && r <= i[t + 2]) this[n] = r;
      else throw Error($s + n + ": " + r);
  if ((r = e[n = "LN10"]) !== void 0)
    if (r == Math.LN10) this[n] = new this(r);
    else throw Error($s + n + ": " + r);
  return this;
}
var TS = EF(z0e);
Wr = new TS(1);
const Pt = TS;
function H0e(e) {
  return q0e(e) || Y0e(e) || G0e(e) || K0e();
}
function K0e() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function G0e(e, t) {
  if (e) {
    if (typeof e == "string") return Xx(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Xx(e, t);
  }
}
function Y0e(e) {
  if (typeof Symbol < "u" && Symbol.iterator in Object(e)) return Array.from(e);
}
function q0e(e) {
  if (Array.isArray(e)) return Xx(e);
}
function Xx(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++)
    r[n] = e[n];
  return r;
}
var X0e = function(t) {
  return t;
}, kF = {
  "@@functional/placeholder": !0
}, MF = function(t) {
  return t === kF;
}, zM = function(t) {
  return function n() {
    return arguments.length === 0 || arguments.length === 1 && MF(arguments.length <= 0 ? void 0 : arguments[0]) ? n : t.apply(void 0, arguments);
  };
}, Z0e = function e(t, n) {
  return t === 1 ? n : zM(function() {
    for (var r = arguments.length, i = new Array(r), o = 0; o < r; o++)
      i[o] = arguments[o];
    var a = i.filter(function(s) {
      return s !== kF;
    }).length;
    return a >= t ? n.apply(void 0, i) : e(t - a, zM(function() {
      for (var s = arguments.length, l = new Array(s), c = 0; c < s; c++)
        l[c] = arguments[c];
      var f = i.map(function(d) {
        return MF(d) ? l.shift() : d;
      });
      return n.apply(void 0, H0e(f).concat(l));
    }));
  });
}, hy = function(t) {
  return Z0e(t.length, t);
}, Zx = function(t, n) {
  for (var r = [], i = t; i < n; ++i)
    r[i - t] = i;
  return r;
}, J0e = hy(function(e, t) {
  return Array.isArray(t) ? t.map(e) : Object.keys(t).map(function(n) {
    return t[n];
  }).map(e);
}), Q0e = function() {
  for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
    n[r] = arguments[r];
  if (!n.length)
    return X0e;
  var i = n.reverse(), o = i[0], a = i.slice(1);
  return function() {
    return a.reduce(function(s, l) {
      return l(s);
    }, o.apply(void 0, arguments));
  };
}, Jx = function(t) {
  return Array.isArray(t) ? t.reverse() : t.split("").reverse.join("");
}, NF = function(t) {
  var n = null, r = null;
  return function() {
    for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
      o[a] = arguments[a];
    return n && o.every(function(s, l) {
      return s === n[l];
    }) || (n = o, r = t.apply(void 0, o)), r;
  };
};
function exe(e) {
  var t;
  return e === 0 ? t = 1 : t = Math.floor(new Pt(e).abs().log(10).toNumber()) + 1, t;
}
function txe(e, t, n) {
  for (var r = new Pt(e), i = 0, o = []; r.lt(t) && i < 1e5; )
    o.push(r.toNumber()), r = r.add(n), i++;
  return o;
}
var nxe = hy(function(e, t, n) {
  var r = +e, i = +t;
  return r + n * (i - r);
}), rxe = hy(function(e, t, n) {
  var r = t - +e;
  return r = r || 1 / 0, (n - e) / r;
}), ixe = hy(function(e, t, n) {
  var r = t - +e;
  return r = r || 1 / 0, Math.max(0, Math.min(1, (n - e) / r));
});
const py = {
  rangeStep: txe,
  getDigitCount: exe,
  interpolateNumber: nxe,
  uninterpolateNumber: rxe,
  uninterpolateTruncation: ixe
};
function Qx(e) {
  return sxe(e) || axe(e) || $F(e) || oxe();
}
function oxe() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function axe(e) {
  if (typeof Symbol < "u" && Symbol.iterator in Object(e)) return Array.from(e);
}
function sxe(e) {
  if (Array.isArray(e)) return ew(e);
}
function Ff(e, t) {
  return uxe(e) || cxe(e, t) || $F(e, t) || lxe();
}
function lxe() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function $F(e, t) {
  if (e) {
    if (typeof e == "string") return ew(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ew(e, t);
  }
}
function ew(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++)
    r[n] = e[n];
  return r;
}
function cxe(e, t) {
  if (!(typeof Symbol > "u" || !(Symbol.iterator in Object(e)))) {
    var n = [], r = !0, i = !1, o = void 0;
    try {
      for (var a = e[Symbol.iterator](), s; !(r = (s = a.next()).done) && (n.push(s.value), !(t && n.length === t)); r = !0)
        ;
    } catch (l) {
      i = !0, o = l;
    } finally {
      try {
        !r && a.return != null && a.return();
      } finally {
        if (i) throw o;
      }
    }
    return n;
  }
}
function uxe(e) {
  if (Array.isArray(e)) return e;
}
function DF(e) {
  var t = Ff(e, 2), n = t[0], r = t[1], i = n, o = r;
  return n > r && (i = r, o = n), [i, o];
}
function IF(e, t, n) {
  if (e.lte(0))
    return new Pt(0);
  var r = py.getDigitCount(e.toNumber()), i = new Pt(10).pow(r), o = e.div(i), a = r !== 1 ? 0.05 : 0.1, s = new Pt(Math.ceil(o.div(a).toNumber())).add(n).mul(a), l = s.mul(i);
  return t ? l : new Pt(Math.ceil(l));
}
function fxe(e, t, n) {
  var r = 1, i = new Pt(e);
  if (!i.isint() && n) {
    var o = Math.abs(e);
    o < 1 ? (r = new Pt(10).pow(py.getDigitCount(e) - 1), i = new Pt(Math.floor(i.div(r).toNumber())).mul(r)) : o > 1 && (i = new Pt(Math.floor(e)));
  } else e === 0 ? i = new Pt(Math.floor((t - 1) / 2)) : n || (i = new Pt(Math.floor(e)));
  var a = Math.floor((t - 1) / 2), s = Q0e(J0e(function(l) {
    return i.add(new Pt(l - a).mul(r)).toNumber();
  }), Zx);
  return s(0, t);
}
function RF(e, t, n, r) {
  var i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0;
  if (!Number.isFinite((t - e) / (n - 1)))
    return {
      step: new Pt(0),
      tickMin: new Pt(0),
      tickMax: new Pt(0)
    };
  var o = IF(new Pt(t).sub(e).div(n - 1), r, i), a;
  e <= 0 && t >= 0 ? a = new Pt(0) : (a = new Pt(e).add(t).div(2), a = a.sub(new Pt(a).mod(o)));
  var s = Math.ceil(a.sub(e).div(o).toNumber()), l = Math.ceil(new Pt(t).sub(a).div(o).toNumber()), c = s + l + 1;
  return c > n ? RF(e, t, n, r, i + 1) : (c < n && (l = t > 0 ? l + (n - c) : l, s = t > 0 ? s : s + (n - c)), {
    step: o,
    tickMin: a.sub(new Pt(s).mul(o)),
    tickMax: a.add(new Pt(l).mul(o))
  });
}
function dxe(e) {
  var t = Ff(e, 2), n = t[0], r = t[1], i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 6, o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, a = Math.max(i, 2), s = DF([n, r]), l = Ff(s, 2), c = l[0], f = l[1];
  if (c === -1 / 0 || f === 1 / 0) {
    var d = f === 1 / 0 ? [c].concat(Qx(Zx(0, i - 1).map(function() {
      return 1 / 0;
    }))) : [].concat(Qx(Zx(0, i - 1).map(function() {
      return -1 / 0;
    })), [f]);
    return n > r ? Jx(d) : d;
  }
  if (c === f)
    return fxe(c, i, o);
  var p = RF(c, f, a, o), m = p.step, y = p.tickMin, g = p.tickMax, v = py.rangeStep(y, g.add(new Pt(0.1).mul(m)), m);
  return n > r ? Jx(v) : v;
}
function hxe(e, t) {
  var n = Ff(e, 2), r = n[0], i = n[1], o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, a = DF([r, i]), s = Ff(a, 2), l = s[0], c = s[1];
  if (l === -1 / 0 || c === 1 / 0)
    return [r, i];
  if (l === c)
    return [l];
  var f = Math.max(t, 2), d = IF(new Pt(c).sub(l).div(f - 1), o, 0), p = [].concat(Qx(py.rangeStep(new Pt(l), new Pt(c).sub(new Pt(0.99).mul(d)), d)), [c]);
  return r > i ? Jx(p) : p;
}
var pxe = NF(dxe), mxe = NF(hxe), gxe = "development" === "production", qb = "Invariant failed";
function Sr(e, t) {
  if (gxe)
    throw new Error(qb);
  var n = typeof t == "function" ? t() : t, r = n ? "".concat(qb, ": ").concat(n) : qb;
  throw new Error(r);
}
var yxe = ["offset", "layout", "width", "dataKey", "data", "dataPointFormatter", "xAxis", "yAxis"];
function hc(e) {
  "@babel/helpers - typeof";
  return hc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, hc(e);
}
function bm() {
  return bm = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, bm.apply(this, arguments);
}
function vxe(e, t) {
  return _xe(e) || wxe(e, t) || xxe(e, t) || bxe();
}
function bxe() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function xxe(e, t) {
  if (e) {
    if (typeof e == "string") return VM(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return VM(e, t);
  }
}
function VM(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function wxe(e, t) {
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (n != null) {
    var r, i, o, a, s = [], l = !0, c = !1;
    try {
      if (o = (n = n.call(e)).next, t !== 0) for (; !(l = (r = o.call(n)).done) && (s.push(r.value), s.length !== t); l = !0) ;
    } catch (f) {
      c = !0, i = f;
    } finally {
      try {
        if (!l && n.return != null && (a = n.return(), Object(a) !== a)) return;
      } finally {
        if (c) throw i;
      }
    }
    return s;
  }
}
function _xe(e) {
  if (Array.isArray(e)) return e;
}
function Sxe(e, t) {
  if (e == null) return {};
  var n = Oxe(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function Oxe(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function Axe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function Txe(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, BF(r.key), r);
  }
}
function Pxe(e, t, n) {
  return t && Txe(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function Cxe(e, t, n) {
  return t = xm(t), Exe(e, jF() ? Reflect.construct(t, n || [], xm(e).constructor) : t.apply(e, n));
}
function Exe(e, t) {
  if (t && (hc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return kxe(e);
}
function kxe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function jF() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (jF = function() {
    return !!e;
  })();
}
function xm(e) {
  return xm = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, xm(e);
}
function Mxe(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && tw(e, t);
}
function tw(e, t) {
  return tw = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, tw(e, t);
}
function LF(e, t, n) {
  return t = BF(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function BF(e) {
  var t = Nxe(e, "string");
  return hc(t) == "symbol" ? t : t + "";
}
function Nxe(e, t) {
  if (hc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (hc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var $d = /* @__PURE__ */ function(e) {
  function t() {
    return Axe(this, t), Cxe(this, t, arguments);
  }
  return Mxe(t, e), Pxe(t, [{
    key: "render",
    value: function() {
      var r = this.props, i = r.offset, o = r.layout, a = r.width, s = r.dataKey, l = r.data, c = r.dataPointFormatter, f = r.xAxis, d = r.yAxis, p = Sxe(r, yxe), m = Ee(p, !1);
      this.props.direction === "x" && f.type !== "number" && ( true ? Sr(!1, 'ErrorBar requires Axis type property to be "number".') : 0);
      var y = l.map(function(g) {
        var v = c(g, s), x = v.x, w = v.y, S = v.value, A = v.errorVal;
        if (!A)
          return null;
        var _ = [], O, P;
        if (Array.isArray(A)) {
          var C = vxe(A, 2);
          O = C[0], P = C[1];
        } else
          O = P = A;
        if (o === "vertical") {
          var k = f.scale, I = w + i, $ = I + a, N = I - a, D = k(S - O), j = k(S + P);
          _.push({
            x1: j,
            y1: $,
            x2: j,
            y2: N
          }), _.push({
            x1: D,
            y1: I,
            x2: j,
            y2: I
          }), _.push({
            x1: D,
            y1: $,
            x2: D,
            y2: N
          });
        } else if (o === "horizontal") {
          var F = d.scale, W = x + i, z = W - a, H = W + a, U = F(S - O), V = F(S + P);
          _.push({
            x1: z,
            y1: V,
            x2: H,
            y2: V
          }), _.push({
            x1: W,
            y1: U,
            x2: W,
            y2: V
          }), _.push({
            x1: z,
            y1: U,
            x2: H,
            y2: U
          });
        }
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, bm({
          className: "recharts-errorBar",
          key: "bar-".concat(_.map(function(Y) {
            return "".concat(Y.x1, "-").concat(Y.x2, "-").concat(Y.y1, "-").concat(Y.y2);
          }))
        }, m), _.map(function(Y) {
          return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("line", bm({}, Y, {
            key: "line-".concat(Y.x1, "-").concat(Y.x2, "-").concat(Y.y1, "-").concat(Y.y2)
          }));
        }));
      });
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: "recharts-errorBars"
      }, y);
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.Component);
LF($d, "defaultProps", {
  stroke: "black",
  strokeWidth: 1.5,
  width: 5,
  offset: 0,
  layout: "horizontal"
});
LF($d, "displayName", "ErrorBar");
function Wf(e) {
  "@babel/helpers - typeof";
  return Wf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Wf(e);
}
function UM(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function cs(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? UM(Object(n), !0).forEach(function(r) {
      $xe(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : UM(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function $xe(e, t, n) {
  return t = Dxe(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function Dxe(e) {
  var t = Ixe(e, "string");
  return Wf(t) == "symbol" ? t : t + "";
}
function Ixe(e, t) {
  if (Wf(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Wf(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var FF = function(t) {
  var n = t.children, r = t.formattedGraphicalItems, i = t.legendWidth, o = t.legendContent, a = jr(n, Lo);
  if (!a)
    return null;
  var s = Lo.defaultProps, l = s !== void 0 ? cs(cs({}, s), a.props) : {}, c;
  return a.props && a.props.payload ? c = a.props && a.props.payload : o === "children" ? c = (r || []).reduce(function(f, d) {
    var p = d.item, m = d.props, y = m.sectors || m.data || [];
    return f.concat(y.map(function(g) {
      return {
        type: a.props.iconType || p.props.legendType,
        value: g.name,
        color: g.fill,
        payload: g
      };
    }));
  }, []) : c = (r || []).map(function(f) {
    var d = f.item, p = d.type.defaultProps, m = p !== void 0 ? cs(cs({}, p), d.props) : {}, y = m.dataKey, g = m.name, v = m.legendType, x = m.hide;
    return {
      inactive: x,
      dataKey: y,
      type: l.iconType || v || "square",
      color: PS(d),
      value: g || y,
      // @ts-expect-error property strokeDasharray is required in Payload but optional in props
      payload: m
    };
  }), cs(cs(cs({}, l), Lo.getWithHeight(a, i)), {}, {
    payload: c,
    item: a
  });
};
function zf(e) {
  "@babel/helpers - typeof";
  return zf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, zf(e);
}
function HM(e) {
  return Bxe(e) || Lxe(e) || jxe(e) || Rxe();
}
function Rxe() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function jxe(e, t) {
  if (e) {
    if (typeof e == "string") return nw(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return nw(e, t);
  }
}
function Lxe(e) {
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function Bxe(e) {
  if (Array.isArray(e)) return nw(e);
}
function nw(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function KM(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function rn(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? KM(Object(n), !0).forEach(function(r) {
      Xl(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : KM(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function Xl(e, t, n) {
  return t = Fxe(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function Fxe(e) {
  var t = Wxe(e, "string");
  return zf(t) == "symbol" ? t : t + "";
}
function Wxe(e, t) {
  if (zf(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (zf(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function cn(e, t, n) {
  return Ue(e) || Ue(t) ? n : On(t) ? zr(e, t, n) : ze(t) ? t(e) : n;
}
function rf(e, t, n, r) {
  var i = L0e(e, function(s) {
    return cn(s, t);
  });
  if (n === "number") {
    var o = i.filter(function(s) {
      return be(s) || parseFloat(s);
    });
    return o.length ? [dy(o), Ta(o)] : [1 / 0, -1 / 0];
  }
  var a = r ? i.filter(function(s) {
    return !Ue(s);
  }) : i;
  return a.map(function(s) {
    return On(s) || s instanceof Date ? s : "";
  });
}
var zxe = function(t) {
  var n, r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], i = arguments.length > 2 ? arguments[2] : void 0, o = arguments.length > 3 ? arguments[3] : void 0, a = -1, s = (n = r == null ? void 0 : r.length) !== null && n !== void 0 ? n : 0;
  if (s <= 1)
    return 0;
  if (o && o.axisType === "angleAxis" && Math.abs(Math.abs(o.range[1] - o.range[0]) - 360) <= 1e-6)
    for (var l = o.range, c = 0; c < s; c++) {
      var f = c > 0 ? i[c - 1].coordinate : i[s - 1].coordinate, d = i[c].coordinate, p = c >= s - 1 ? i[0].coordinate : i[c + 1].coordinate, m = void 0;
      if (fr(d - f) !== fr(p - d)) {
        var y = [];
        if (fr(p - d) === fr(l[1] - l[0])) {
          m = p;
          var g = d + l[1] - l[0];
          y[0] = Math.min(g, (g + f) / 2), y[1] = Math.max(g, (g + f) / 2);
        } else {
          m = f;
          var v = p + l[1] - l[0];
          y[0] = Math.min(d, (v + d) / 2), y[1] = Math.max(d, (v + d) / 2);
        }
        var x = [Math.min(d, (m + d) / 2), Math.max(d, (m + d) / 2)];
        if (t > x[0] && t <= x[1] || t >= y[0] && t <= y[1]) {
          a = i[c].index;
          break;
        }
      } else {
        var w = Math.min(f, p), S = Math.max(f, p);
        if (t > (w + d) / 2 && t <= (S + d) / 2) {
          a = i[c].index;
          break;
        }
      }
    }
  else
    for (var A = 0; A < s; A++)
      if (A === 0 && t <= (r[A].coordinate + r[A + 1].coordinate) / 2 || A > 0 && A < s - 1 && t > (r[A].coordinate + r[A - 1].coordinate) / 2 && t <= (r[A].coordinate + r[A + 1].coordinate) / 2 || A === s - 1 && t > (r[A].coordinate + r[A - 1].coordinate) / 2) {
        a = r[A].index;
        break;
      }
  return a;
}, PS = function(t) {
  var n, r = t, i = r.type.displayName, o = (n = t.type) !== null && n !== void 0 && n.defaultProps ? rn(rn({}, t.type.defaultProps), t.props) : t.props, a = o.stroke, s = o.fill, l;
  switch (i) {
    case "Line":
      l = a;
      break;
    case "Area":
    case "Radar":
      l = a && a !== "none" ? a : s;
      break;
    default:
      l = s;
      break;
  }
  return l;
}, Vxe = function(t) {
  var n = t.barSize, r = t.totalSize, i = t.stackGroups, o = i === void 0 ? {} : i;
  if (!o)
    return {};
  for (var a = {}, s = Object.keys(o), l = 0, c = s.length; l < c; l++)
    for (var f = o[s[l]].stackGroups, d = Object.keys(f), p = 0, m = d.length; p < m; p++) {
      var y = f[d[p]], g = y.items, v = y.cateAxisId, x = g.filter(function(P) {
        return jo(P.type).indexOf("Bar") >= 0;
      });
      if (x && x.length) {
        var w = x[0].type.defaultProps, S = w !== void 0 ? rn(rn({}, w), x[0].props) : x[0].props, A = S.barSize, _ = S[v];
        a[_] || (a[_] = []);
        var O = Ue(A) ? n : A;
        a[_].push({
          item: x[0],
          stackList: x.slice(1),
          barSize: Ue(O) ? void 0 : dr(O, r, 0)
        });
      }
    }
  return a;
}, Uxe = function(t) {
  var n = t.barGap, r = t.barCategoryGap, i = t.bandSize, o = t.sizeList, a = o === void 0 ? [] : o, s = t.maxBarSize, l = a.length;
  if (l < 1) return null;
  var c = dr(n, i, 0, !0), f, d = [];
  if (a[0].barSize === +a[0].barSize) {
    var p = !1, m = i / l, y = a.reduce(function(A, _) {
      return A + _.barSize || 0;
    }, 0);
    y += (l - 1) * c, y >= i && (y -= (l - 1) * c, c = 0), y >= i && m > 0 && (p = !0, m *= 0.9, y = l * m);
    var g = (i - y) / 2 >> 0, v = {
      offset: g - c,
      size: 0
    };
    f = a.reduce(function(A, _) {
      var O = {
        item: _.item,
        position: {
          offset: v.offset + v.size + c,
          // @ts-expect-error the type check above does not check for type number explicitly
          size: p ? m : _.barSize
        }
      }, P = [].concat(HM(A), [O]);
      return v = P[P.length - 1].position, _.stackList && _.stackList.length && _.stackList.forEach(function(C) {
        P.push({
          item: C,
          position: v
        });
      }), P;
    }, d);
  } else {
    var x = dr(r, i, 0, !0);
    i - 2 * x - (l - 1) * c <= 0 && (c = 0);
    var w = (i - 2 * x - (l - 1) * c) / l;
    w > 1 && (w >>= 0);
    var S = s === +s ? Math.min(w, s) : w;
    f = a.reduce(function(A, _, O) {
      var P = [].concat(HM(A), [{
        item: _.item,
        position: {
          offset: x + (w + c) * O + (w - S) / 2,
          size: S
        }
      }]);
      return _.stackList && _.stackList.length && _.stackList.forEach(function(C) {
        P.push({
          item: C,
          position: P[P.length - 1].position
        });
      }), P;
    }, d);
  }
  return f;
}, Hxe = function(t, n, r, i) {
  var o = r.children, a = r.width, s = r.margin, l = a - (s.left || 0) - (s.right || 0), c = FF({
    children: o,
    legendWidth: l
  });
  if (c) {
    var f = i || {}, d = f.width, p = f.height, m = c.align, y = c.verticalAlign, g = c.layout;
    if ((g === "vertical" || g === "horizontal" && y === "middle") && m !== "center" && be(t[m]))
      return rn(rn({}, t), {}, Xl({}, m, t[m] + (d || 0)));
    if ((g === "horizontal" || g === "vertical" && m === "center") && y !== "middle" && be(t[y]))
      return rn(rn({}, t), {}, Xl({}, y, t[y] + (p || 0)));
  }
  return t;
}, Kxe = function(t, n, r) {
  return Ue(n) ? !0 : t === "horizontal" ? n === "yAxis" : t === "vertical" || r === "x" ? n === "xAxis" : r === "y" ? n === "yAxis" : !0;
}, WF = function(t, n, r, i, o) {
  var a = n.props.children, s = Vr(a, $d).filter(function(c) {
    return Kxe(i, o, c.props.direction);
  });
  if (s && s.length) {
    var l = s.map(function(c) {
      return c.props.dataKey;
    });
    return t.reduce(function(c, f) {
      var d = cn(f, r);
      if (Ue(d)) return c;
      var p = Array.isArray(d) ? [dy(d), Ta(d)] : [d, d], m = l.reduce(function(y, g) {
        var v = cn(f, g, 0), x = p[0] - Math.abs(Array.isArray(v) ? v[0] : v), w = p[1] + Math.abs(Array.isArray(v) ? v[1] : v);
        return [Math.min(x, y[0]), Math.max(w, y[1])];
      }, [1 / 0, -1 / 0]);
      return [Math.min(m[0], c[0]), Math.max(m[1], c[1])];
    }, [1 / 0, -1 / 0]);
  }
  return null;
}, Gxe = function(t, n, r, i, o) {
  var a = n.map(function(s) {
    return WF(t, s, r, o, i);
  }).filter(function(s) {
    return !Ue(s);
  });
  return a && a.length ? a.reduce(function(s, l) {
    return [Math.min(s[0], l[0]), Math.max(s[1], l[1])];
  }, [1 / 0, -1 / 0]) : null;
}, zF = function(t, n, r, i, o) {
  var a = n.map(function(l) {
    var c = l.props.dataKey;
    return r === "number" && c && WF(t, l, c, i) || rf(t, c, r, o);
  });
  if (r === "number")
    return a.reduce(
      // @ts-expect-error if (type === number) means that the domain is numerical type
      // - but this link is missing in the type definition
      function(l, c) {
        return [Math.min(l[0], c[0]), Math.max(l[1], c[1])];
      },
      [1 / 0, -1 / 0]
    );
  var s = {};
  return a.reduce(function(l, c) {
    for (var f = 0, d = c.length; f < d; f++)
      s[c[f]] || (s[c[f]] = !0, l.push(c[f]));
    return l;
  }, []);
}, VF = function(t, n) {
  return t === "horizontal" && n === "xAxis" || t === "vertical" && n === "yAxis" || t === "centric" && n === "angleAxis" || t === "radial" && n === "radiusAxis";
}, UF = function(t, n, r, i) {
  if (i)
    return t.map(function(l) {
      return l.coordinate;
    });
  var o, a, s = t.map(function(l) {
    return l.coordinate === n && (o = !0), l.coordinate === r && (a = !0), l.coordinate;
  });
  return o || s.push(n), a || s.push(r), s;
}, Mo = function(t, n, r) {
  if (!t) return null;
  var i = t.scale, o = t.duplicateDomain, a = t.type, s = t.range, l = t.realScaleType === "scaleBand" ? i.bandwidth() / 2 : 2, c = (n || r) && a === "category" && i.bandwidth ? i.bandwidth() / l : 0;
  if (c = t.axisType === "angleAxis" && (s == null ? void 0 : s.length) >= 2 ? fr(s[0] - s[1]) * 2 * c : c, n && (t.ticks || t.niceTicks)) {
    var f = (t.ticks || t.niceTicks).map(function(d) {
      var p = o ? o.indexOf(d) : d;
      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: i(p) + c,
        value: d,
        offset: c
      };
    });
    return f.filter(function(d) {
      return !Gc(d.coordinate);
    });
  }
  return t.isCategorical && t.categoricalDomain ? t.categoricalDomain.map(function(d, p) {
    return {
      coordinate: i(d) + c,
      value: d,
      index: p,
      offset: c
    };
  }) : i.ticks && !r ? i.ticks(t.tickCount).map(function(d) {
    return {
      coordinate: i(d) + c,
      value: d,
      offset: c
    };
  }) : i.domain().map(function(d, p) {
    return {
      coordinate: i(d) + c,
      value: o ? o[d] : d,
      index: p,
      offset: c
    };
  });
}, Xb = /* @__PURE__ */ new WeakMap(), Xh = function(t, n) {
  if (typeof n != "function")
    return t;
  Xb.has(t) || Xb.set(t, /* @__PURE__ */ new WeakMap());
  var r = Xb.get(t);
  if (r.has(n))
    return r.get(n);
  var i = function() {
    t.apply(void 0, arguments), n.apply(void 0, arguments);
  };
  return r.set(n, i), i;
}, HF = function(t, n, r) {
  var i = t.scale, o = t.type, a = t.layout, s = t.axisType;
  if (i === "auto")
    return a === "radial" && s === "radiusAxis" ? {
      scale: Df(),
      realScaleType: "band"
    } : a === "radial" && s === "angleAxis" ? {
      scale: pm(),
      realScaleType: "linear"
    } : o === "category" && n && (n.indexOf("LineChart") >= 0 || n.indexOf("AreaChart") >= 0 || n.indexOf("ComposedChart") >= 0 && !r) ? {
      scale: nf(),
      realScaleType: "point"
    } : o === "category" ? {
      scale: Df(),
      realScaleType: "band"
    } : {
      scale: pm(),
      realScaleType: "linear"
    };
  if (Pd(i)) {
    var l = "scale".concat(Jg(i));
    return {
      scale: (BM[l] || nf)(),
      realScaleType: BM[l] ? l : "point"
    };
  }
  return ze(i) ? {
    scale: i
  } : {
    scale: nf(),
    realScaleType: "point"
  };
}, GM = 1e-4, KF = function(t) {
  var n = t.domain();
  if (!(!n || n.length <= 2)) {
    var r = n.length, i = t.range(), o = Math.min(i[0], i[1]) - GM, a = Math.max(i[0], i[1]) + GM, s = t(n[0]), l = t(n[r - 1]);
    (s < o || s > a || l < o || l > a) && t.domain([n[0], n[r - 1]]);
  }
}, Yxe = function(t, n) {
  if (!t)
    return null;
  for (var r = 0, i = t.length; r < i; r++)
    if (t[r].item === n)
      return t[r].position;
  return null;
}, qxe = function(t, n) {
  if (!n || n.length !== 2 || !be(n[0]) || !be(n[1]))
    return t;
  var r = Math.min(n[0], n[1]), i = Math.max(n[0], n[1]), o = [t[0], t[1]];
  return (!be(t[0]) || t[0] < r) && (o[0] = r), (!be(t[1]) || t[1] > i) && (o[1] = i), o[0] > i && (o[0] = i), o[1] < r && (o[1] = r), o;
}, Xxe = function(t) {
  var n = t.length;
  if (!(n <= 0))
    for (var r = 0, i = t[0].length; r < i; ++r)
      for (var o = 0, a = 0, s = 0; s < n; ++s) {
        var l = Gc(t[s][r][1]) ? t[s][r][0] : t[s][r][1];
        l >= 0 ? (t[s][r][0] = o, t[s][r][1] = o + l, o = t[s][r][1]) : (t[s][r][0] = a, t[s][r][1] = a + l, a = t[s][r][1]);
      }
}, Zxe = function(t) {
  var n = t.length;
  if (!(n <= 0))
    for (var r = 0, i = t[0].length; r < i; ++r)
      for (var o = 0, a = 0; a < n; ++a) {
        var s = Gc(t[a][r][1]) ? t[a][r][0] : t[a][r][1];
        s >= 0 ? (t[a][r][0] = o, t[a][r][1] = o + s, o = t[a][r][1]) : (t[a][r][0] = 0, t[a][r][1] = 0);
      }
}, Jxe = {
  sign: Xxe,
  // @ts-expect-error definitelytyped types are incorrect
  expand: yle,
  // @ts-expect-error definitelytyped types are incorrect
  none: oc,
  // @ts-expect-error definitelytyped types are incorrect
  silhouette: vle,
  // @ts-expect-error definitelytyped types are incorrect
  wiggle: ble,
  positive: Zxe
}, Qxe = function(t, n, r) {
  var i = n.map(function(s) {
    return s.props.dataKey;
  }), o = Jxe[r], a = gle().keys(i).value(function(s, l) {
    return +cn(s, l, 0);
  }).order(Px).offset(o);
  return a(t);
}, ewe = function(t, n, r, i, o, a) {
  if (!t)
    return null;
  var s = a ? n.reverse() : n, l = {}, c = s.reduce(function(d, p) {
    var m, y = (m = p.type) !== null && m !== void 0 && m.defaultProps ? rn(rn({}, p.type.defaultProps), p.props) : p.props, g = y.stackId, v = y.hide;
    if (v)
      return d;
    var x = y[r], w = d[x] || {
      hasStack: !1,
      stackGroups: {}
    };
    if (On(g)) {
      var S = w.stackGroups[g] || {
        numericAxisId: r,
        cateAxisId: i,
        items: []
      };
      S.items.push(p), w.hasStack = !0, w.stackGroups[g] = S;
    } else
      w.stackGroups[tl("_stackId_")] = {
        numericAxisId: r,
        cateAxisId: i,
        items: [p]
      };
    return rn(rn({}, d), {}, Xl({}, x, w));
  }, l), f = {};
  return Object.keys(c).reduce(function(d, p) {
    var m = c[p];
    if (m.hasStack) {
      var y = {};
      m.stackGroups = Object.keys(m.stackGroups).reduce(function(g, v) {
        var x = m.stackGroups[v];
        return rn(rn({}, g), {}, Xl({}, v, {
          numericAxisId: r,
          cateAxisId: i,
          items: x.items,
          stackedData: Qxe(t, x.items, o)
        }));
      }, y);
    }
    return rn(rn({}, d), {}, Xl({}, p, m));
  }, f);
}, GF = function(t, n) {
  var r = n.realScaleType, i = n.type, o = n.tickCount, a = n.originalDomain, s = n.allowDecimals, l = r || n.scale;
  if (l !== "auto" && l !== "linear")
    return null;
  if (o && i === "number" && a && (a[0] === "auto" || a[1] === "auto")) {
    var c = t.domain();
    if (!c.length)
      return null;
    var f = pxe(c, o, s);
    return t.domain([dy(f), Ta(f)]), {
      niceTicks: f
    };
  }
  if (o && i === "number") {
    var d = t.domain(), p = mxe(d, o, s);
    return {
      niceTicks: p
    };
  }
  return null;
};
function wm(e) {
  var t = e.axis, n = e.ticks, r = e.bandSize, i = e.entry, o = e.index, a = e.dataKey;
  if (t.type === "category") {
    if (!t.allowDuplicatedCategory && t.dataKey && !Ue(i[t.dataKey])) {
      var s = Gp(n, "value", i[t.dataKey]);
      if (s)
        return s.coordinate + r / 2;
    }
    return n[o] ? n[o].coordinate + r / 2 : null;
  }
  var l = cn(i, Ue(a) ? t.dataKey : a);
  return Ue(l) ? null : t.scale(l);
}
var YM = function(t) {
  var n = t.axis, r = t.ticks, i = t.offset, o = t.bandSize, a = t.entry, s = t.index;
  if (n.type === "category")
    return r[s] ? r[s].coordinate + i : null;
  var l = cn(a, n.dataKey, n.domain[s]);
  return Ue(l) ? null : n.scale(l) - o / 2 + i;
}, twe = function(t) {
  var n = t.numericAxis, r = n.scale.domain();
  if (n.type === "number") {
    var i = Math.min(r[0], r[1]), o = Math.max(r[0], r[1]);
    return i <= 0 && o >= 0 ? 0 : o < 0 ? o : i;
  }
  return r[0];
}, nwe = function(t, n) {
  var r, i = (r = t.type) !== null && r !== void 0 && r.defaultProps ? rn(rn({}, t.type.defaultProps), t.props) : t.props, o = i.stackId;
  if (On(o)) {
    var a = n[o];
    if (a) {
      var s = a.items.indexOf(t);
      return s >= 0 ? a.stackedData[s] : null;
    }
  }
  return null;
}, rwe = function(t) {
  return t.reduce(function(n, r) {
    return [dy(r.concat([n[0]]).filter(be)), Ta(r.concat([n[1]]).filter(be))];
  }, [1 / 0, -1 / 0]);
}, YF = function(t, n, r) {
  return Object.keys(t).reduce(function(i, o) {
    var a = t[o], s = a.stackedData, l = s.reduce(function(c, f) {
      var d = rwe(f.slice(n, r + 1));
      return [Math.min(c[0], d[0]), Math.max(c[1], d[1])];
    }, [1 / 0, -1 / 0]);
    return [Math.min(l[0], i[0]), Math.max(l[1], i[1])];
  }, [1 / 0, -1 / 0]).map(function(i) {
    return i === 1 / 0 || i === -1 / 0 ? 0 : i;
  });
}, qM = /^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/, XM = /^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/, rw = function(t, n, r) {
  if (ze(t))
    return t(n, r);
  if (!Array.isArray(t))
    return n;
  var i = [];
  if (be(t[0]))
    i[0] = r ? t[0] : Math.min(t[0], n[0]);
  else if (qM.test(t[0])) {
    var o = +qM.exec(t[0])[1];
    i[0] = n[0] - o;
  } else ze(t[0]) ? i[0] = t[0](n[0]) : i[0] = n[0];
  if (be(t[1]))
    i[1] = r ? t[1] : Math.max(t[1], n[1]);
  else if (XM.test(t[1])) {
    var a = +XM.exec(t[1])[1];
    i[1] = n[1] + a;
  } else ze(t[1]) ? i[1] = t[1](n[1]) : i[1] = n[1];
  return i;
}, _m = function(t, n, r) {
  if (t && t.scale && t.scale.bandwidth) {
    var i = t.scale.bandwidth();
    if (!r || i > 0)
      return i;
  }
  if (t && n && n.length >= 2) {
    for (var o = Q_(n, function(d) {
      return d.coordinate;
    }), a = 1 / 0, s = 1, l = o.length; s < l; s++) {
      var c = o[s], f = o[s - 1];
      a = Math.min((c.coordinate || 0) - (f.coordinate || 0), a);
    }
    return a === 1 / 0 ? 0 : a;
  }
  return r ? void 0 : 0;
}, ZM = function(t, n, r) {
  return !t || !t.length || Us(t, zr(r, "type.defaultProps.domain")) ? n : t;
}, qF = function(t, n) {
  var r = t.type.defaultProps ? rn(rn({}, t.type.defaultProps), t.props) : t.props, i = r.dataKey, o = r.name, a = r.unit, s = r.formatter, l = r.tooltipType, c = r.chartType, f = r.hide;
  return rn(rn({}, Ee(t, !1)), {}, {
    dataKey: i,
    unit: a,
    formatter: s,
    name: o || i,
    color: PS(t),
    value: cn(n, i),
    type: l,
    payload: n,
    chartType: c,
    hide: f
  });
};
function Vf(e) {
  "@babel/helpers - typeof";
  return Vf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Vf(e);
}
function JM(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function _o(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? JM(Object(n), !0).forEach(function(r) {
      XF(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : JM(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function XF(e, t, n) {
  return t = iwe(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function iwe(e) {
  var t = owe(e, "string");
  return Vf(t) == "symbol" ? t : t + "";
}
function owe(e, t) {
  if (Vf(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Vf(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function awe(e, t) {
  return uwe(e) || cwe(e, t) || lwe(e, t) || swe();
}
function swe() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function lwe(e, t) {
  if (e) {
    if (typeof e == "string") return QM(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return QM(e, t);
  }
}
function QM(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function cwe(e, t) {
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (n != null) {
    var r, i, o, a, s = [], l = !0, c = !1;
    try {
      if (o = (n = n.call(e)).next, t !== 0) for (; !(l = (r = o.call(n)).done) && (s.push(r.value), s.length !== t); l = !0) ;
    } catch (f) {
      c = !0, i = f;
    } finally {
      try {
        if (!l && n.return != null && (a = n.return(), Object(a) !== a)) return;
      } finally {
        if (c) throw i;
      }
    }
    return s;
  }
}
function uwe(e) {
  if (Array.isArray(e)) return e;
}
var Sm = Math.PI / 180, fwe = function(t) {
  return t * 180 / Math.PI;
}, Bt = function(t, n, r, i) {
  return {
    x: t + Math.cos(-Sm * i) * r,
    y: n + Math.sin(-Sm * i) * r
  };
}, ZF = function(t, n) {
  var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0
  };
  return Math.min(Math.abs(t - (r.left || 0) - (r.right || 0)), Math.abs(n - (r.top || 0) - (r.bottom || 0))) / 2;
}, dwe = function(t, n, r, i, o) {
  var a = t.width, s = t.height, l = t.startAngle, c = t.endAngle, f = dr(t.cx, a, a / 2), d = dr(t.cy, s, s / 2), p = ZF(a, s, r), m = dr(t.innerRadius, p, 0), y = dr(t.outerRadius, p, p * 0.8), g = Object.keys(n);
  return g.reduce(function(v, x) {
    var w = n[x], S = w.domain, A = w.reversed, _;
    if (Ue(w.range))
      i === "angleAxis" ? _ = [l, c] : i === "radiusAxis" && (_ = [m, y]), A && (_ = [_[1], _[0]]);
    else {
      _ = w.range;
      var O = _, P = awe(O, 2);
      l = P[0], c = P[1];
    }
    var C = HF(w, o), k = C.realScaleType, I = C.scale;
    I.domain(S).range(_), KF(I);
    var $ = GF(I, _o(_o({}, w), {}, {
      realScaleType: k
    })), N = _o(_o(_o({}, w), $), {}, {
      range: _,
      radius: y,
      realScaleType: k,
      scale: I,
      cx: f,
      cy: d,
      innerRadius: m,
      outerRadius: y,
      startAngle: l,
      endAngle: c
    });
    return _o(_o({}, v), {}, XF({}, x, N));
  }, {});
}, hwe = function(t, n) {
  var r = t.x, i = t.y, o = n.x, a = n.y;
  return Math.sqrt(Math.pow(r - o, 2) + Math.pow(i - a, 2));
}, pwe = function(t, n) {
  var r = t.x, i = t.y, o = n.cx, a = n.cy, s = hwe({
    x: r,
    y: i
  }, {
    x: o,
    y: a
  });
  if (s <= 0)
    return {
      radius: s
    };
  var l = (r - o) / s, c = Math.acos(l);
  return i > a && (c = 2 * Math.PI - c), {
    radius: s,
    angle: fwe(c),
    angleInRadian: c
  };
}, mwe = function(t) {
  var n = t.startAngle, r = t.endAngle, i = Math.floor(n / 360), o = Math.floor(r / 360), a = Math.min(i, o);
  return {
    startAngle: n - a * 360,
    endAngle: r - a * 360
  };
}, gwe = function(t, n) {
  var r = n.startAngle, i = n.endAngle, o = Math.floor(r / 360), a = Math.floor(i / 360), s = Math.min(o, a);
  return t + s * 360;
}, eN = function(t, n) {
  var r = t.x, i = t.y, o = pwe({
    x: r,
    y: i
  }, n), a = o.radius, s = o.angle, l = n.innerRadius, c = n.outerRadius;
  if (a < l || a > c)
    return !1;
  if (a === 0)
    return !0;
  var f = mwe(n), d = f.startAngle, p = f.endAngle, m = s, y;
  if (d <= p) {
    for (; m > p; )
      m -= 360;
    for (; m < d; )
      m += 360;
    y = m >= d && m <= p;
  } else {
    for (; m > d; )
      m -= 360;
    for (; m < p; )
      m += 360;
    y = m >= p && m <= d;
  }
  return y ? _o(_o({}, n), {}, {
    radius: a,
    angle: gwe(m, n)
  }) : null;
}, JF = function(t) {
  return !/* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(t) && !ze(t) && typeof t != "boolean" ? t.className : "";
};
function Uf(e) {
  "@babel/helpers - typeof";
  return Uf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Uf(e);
}
var ywe = ["offset"];
function vwe(e) {
  return _we(e) || wwe(e) || xwe(e) || bwe();
}
function bwe() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function xwe(e, t) {
  if (e) {
    if (typeof e == "string") return iw(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return iw(e, t);
  }
}
function wwe(e) {
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function _we(e) {
  if (Array.isArray(e)) return iw(e);
}
function iw(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function Swe(e, t) {
  if (e == null) return {};
  var n = Owe(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function Owe(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function tN(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function xn(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? tN(Object(n), !0).forEach(function(r) {
      Awe(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : tN(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function Awe(e, t, n) {
  return t = Twe(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function Twe(e) {
  var t = Pwe(e, "string");
  return Uf(t) == "symbol" ? t : t + "";
}
function Pwe(e, t) {
  if (Uf(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Uf(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function Hf() {
  return Hf = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Hf.apply(this, arguments);
}
var Cwe = function(t) {
  var n = t.value, r = t.formatter, i = Ue(t.children) ? n : t.children;
  return ze(r) ? r(i) : i;
}, Ewe = function(t, n) {
  var r = fr(n - t), i = Math.min(Math.abs(n - t), 360);
  return r * i;
}, kwe = function(t, n, r) {
  var i = t.position, o = t.viewBox, a = t.offset, s = t.className, l = o, c = l.cx, f = l.cy, d = l.innerRadius, p = l.outerRadius, m = l.startAngle, y = l.endAngle, g = l.clockWise, v = (d + p) / 2, x = Ewe(m, y), w = x >= 0 ? 1 : -1, S, A;
  i === "insideStart" ? (S = m + w * a, A = g) : i === "insideEnd" ? (S = y - w * a, A = !g) : i === "end" && (S = y + w * a, A = g), A = x <= 0 ? A : !A;
  var _ = Bt(c, f, v, S), O = Bt(c, f, v, S + (A ? 1 : -1) * 359), P = "M".concat(_.x, ",").concat(_.y, `
    A`).concat(v, ",").concat(v, ",0,1,").concat(A ? 0 : 1, `,
    `).concat(O.x, ",").concat(O.y), C = Ue(t.id) ? tl("recharts-radial-line-") : t.id;
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("text", Hf({}, r, {
    dominantBaseline: "central",
    className: Xe("recharts-radial-bar-label", s)
  }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("defs", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", {
    id: C,
    d: P
  })), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("textPath", {
    xlinkHref: "#".concat(C)
  }, n));
}, Mwe = function(t) {
  var n = t.viewBox, r = t.offset, i = t.position, o = n, a = o.cx, s = o.cy, l = o.innerRadius, c = o.outerRadius, f = o.startAngle, d = o.endAngle, p = (f + d) / 2;
  if (i === "outside") {
    var m = Bt(a, s, c + r, p), y = m.x, g = m.y;
    return {
      x: y,
      y: g,
      textAnchor: y >= a ? "start" : "end",
      verticalAnchor: "middle"
    };
  }
  if (i === "center")
    return {
      x: a,
      y: s,
      textAnchor: "middle",
      verticalAnchor: "middle"
    };
  if (i === "centerTop")
    return {
      x: a,
      y: s,
      textAnchor: "middle",
      verticalAnchor: "start"
    };
  if (i === "centerBottom")
    return {
      x: a,
      y: s,
      textAnchor: "middle",
      verticalAnchor: "end"
    };
  var v = (l + c) / 2, x = Bt(a, s, v, p), w = x.x, S = x.y;
  return {
    x: w,
    y: S,
    textAnchor: "middle",
    verticalAnchor: "middle"
  };
}, Nwe = function(t) {
  var n = t.viewBox, r = t.parentViewBox, i = t.offset, o = t.position, a = n, s = a.x, l = a.y, c = a.width, f = a.height, d = f >= 0 ? 1 : -1, p = d * i, m = d > 0 ? "end" : "start", y = d > 0 ? "start" : "end", g = c >= 0 ? 1 : -1, v = g * i, x = g > 0 ? "end" : "start", w = g > 0 ? "start" : "end";
  if (o === "top") {
    var S = {
      x: s + c / 2,
      y: l - d * i,
      textAnchor: "middle",
      verticalAnchor: m
    };
    return xn(xn({}, S), r ? {
      height: Math.max(l - r.y, 0),
      width: c
    } : {});
  }
  if (o === "bottom") {
    var A = {
      x: s + c / 2,
      y: l + f + p,
      textAnchor: "middle",
      verticalAnchor: y
    };
    return xn(xn({}, A), r ? {
      height: Math.max(r.y + r.height - (l + f), 0),
      width: c
    } : {});
  }
  if (o === "left") {
    var _ = {
      x: s - v,
      y: l + f / 2,
      textAnchor: x,
      verticalAnchor: "middle"
    };
    return xn(xn({}, _), r ? {
      width: Math.max(_.x - r.x, 0),
      height: f
    } : {});
  }
  if (o === "right") {
    var O = {
      x: s + c + v,
      y: l + f / 2,
      textAnchor: w,
      verticalAnchor: "middle"
    };
    return xn(xn({}, O), r ? {
      width: Math.max(r.x + r.width - O.x, 0),
      height: f
    } : {});
  }
  var P = r ? {
    width: c,
    height: f
  } : {};
  return o === "insideLeft" ? xn({
    x: s + v,
    y: l + f / 2,
    textAnchor: w,
    verticalAnchor: "middle"
  }, P) : o === "insideRight" ? xn({
    x: s + c - v,
    y: l + f / 2,
    textAnchor: x,
    verticalAnchor: "middle"
  }, P) : o === "insideTop" ? xn({
    x: s + c / 2,
    y: l + p,
    textAnchor: "middle",
    verticalAnchor: y
  }, P) : o === "insideBottom" ? xn({
    x: s + c / 2,
    y: l + f - p,
    textAnchor: "middle",
    verticalAnchor: m
  }, P) : o === "insideTopLeft" ? xn({
    x: s + v,
    y: l + p,
    textAnchor: w,
    verticalAnchor: y
  }, P) : o === "insideTopRight" ? xn({
    x: s + c - v,
    y: l + p,
    textAnchor: x,
    verticalAnchor: y
  }, P) : o === "insideBottomLeft" ? xn({
    x: s + v,
    y: l + f - p,
    textAnchor: w,
    verticalAnchor: m
  }, P) : o === "insideBottomRight" ? xn({
    x: s + c - v,
    y: l + f - p,
    textAnchor: x,
    verticalAnchor: m
  }, P) : Vc(o) && (be(o.x) || Ss(o.x)) && (be(o.y) || Ss(o.y)) ? xn({
    x: s + dr(o.x, c),
    y: l + dr(o.y, f),
    textAnchor: "end",
    verticalAnchor: "end"
  }, P) : xn({
    x: s + c / 2,
    y: l + f / 2,
    textAnchor: "middle",
    verticalAnchor: "middle"
  }, P);
}, $we = function(t) {
  return "cx" in t && be(t.cx);
};
function Sn(e) {
  var t = e.offset, n = t === void 0 ? 5 : t, r = Swe(e, ywe), i = xn({
    offset: n
  }, r), o = i.viewBox, a = i.position, s = i.value, l = i.children, c = i.content, f = i.className, d = f === void 0 ? "" : f, p = i.textBreakAll;
  if (!o || Ue(s) && Ue(l) && !/* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(c) && !ze(c))
    return null;
  if (/* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(c))
    return /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(c, i);
  var m;
  if (ze(c)) {
    if (m = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(c, i), /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(m))
      return m;
  } else
    m = Cwe(i);
  var y = $we(o), g = Ee(i, !0);
  if (y && (a === "insideStart" || a === "insideEnd" || a === "end"))
    return kwe(i, m, g);
  var v = y ? Mwe(i) : Nwe(i);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Vs, Hf({
    className: Xe("recharts-label", d)
  }, g, v, {
    breakAll: p
  }), m);
}
Sn.displayName = "Label";
var QF = function(t) {
  var n = t.cx, r = t.cy, i = t.angle, o = t.startAngle, a = t.endAngle, s = t.r, l = t.radius, c = t.innerRadius, f = t.outerRadius, d = t.x, p = t.y, m = t.top, y = t.left, g = t.width, v = t.height, x = t.clockWise, w = t.labelViewBox;
  if (w)
    return w;
  if (be(g) && be(v)) {
    if (be(d) && be(p))
      return {
        x: d,
        y: p,
        width: g,
        height: v
      };
    if (be(m) && be(y))
      return {
        x: m,
        y,
        width: g,
        height: v
      };
  }
  return be(d) && be(p) ? {
    x: d,
    y: p,
    width: 0,
    height: 0
  } : be(n) && be(r) ? {
    cx: n,
    cy: r,
    startAngle: o || i || 0,
    endAngle: a || i || 0,
    innerRadius: c || 0,
    outerRadius: f || l || s || 0,
    clockWise: x
  } : t.viewBox ? t.viewBox : {};
}, Dwe = function(t, n) {
  return t ? t === !0 ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Sn, {
    key: "label-implicit",
    viewBox: n
  }) : On(t) ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Sn, {
    key: "label-implicit",
    viewBox: n,
    value: t
  }) : /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(t) ? t.type === Sn ? /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(t, {
    key: "label-implicit",
    viewBox: n
  }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Sn, {
    key: "label-implicit",
    content: t,
    viewBox: n
  }) : ze(t) ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Sn, {
    key: "label-implicit",
    content: t,
    viewBox: n
  }) : Vc(t) ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Sn, Hf({
    viewBox: n
  }, t, {
    key: "label-implicit"
  })) : null : null;
}, Iwe = function(t, n) {
  var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0;
  if (!t || !t.children && r && !t.label)
    return null;
  var i = t.children, o = QF(t), a = Vr(i, Sn).map(function(l, c) {
    return /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(l, {
      viewBox: n || o,
      // eslint-disable-next-line react/no-array-index-key
      key: "label-".concat(c)
    });
  });
  if (!r)
    return a;
  var s = Dwe(t.label, n || o);
  return [s].concat(vwe(a));
};
Sn.parseViewBox = QF;
Sn.renderCallByParent = Iwe;
function Rwe(e) {
  var t = e == null ? 0 : e.length;
  return t ? e[t - 1] : void 0;
}
var jwe = Rwe;
const Lwe = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(jwe);
function Kf(e) {
  "@babel/helpers - typeof";
  return Kf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Kf(e);
}
var Bwe = ["valueAccessor"], Fwe = ["data", "dataKey", "clockWise", "id", "textBreakAll"];
function Wwe(e) {
  return Hwe(e) || Uwe(e) || Vwe(e) || zwe();
}
function zwe() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Vwe(e, t) {
  if (e) {
    if (typeof e == "string") return ow(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ow(e, t);
  }
}
function Uwe(e) {
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function Hwe(e) {
  if (Array.isArray(e)) return ow(e);
}
function ow(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function Om() {
  return Om = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Om.apply(this, arguments);
}
function nN(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function rN(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? nN(Object(n), !0).forEach(function(r) {
      Kwe(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : nN(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function Kwe(e, t, n) {
  return t = Gwe(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function Gwe(e) {
  var t = Ywe(e, "string");
  return Kf(t) == "symbol" ? t : t + "";
}
function Ywe(e, t) {
  if (Kf(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Kf(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function iN(e, t) {
  if (e == null) return {};
  var n = qwe(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function qwe(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
var Xwe = function(t) {
  return Array.isArray(t.value) ? Lwe(t.value) : t.value;
};
function Ji(e) {
  var t = e.valueAccessor, n = t === void 0 ? Xwe : t, r = iN(e, Bwe), i = r.data, o = r.dataKey, a = r.clockWise, s = r.id, l = r.textBreakAll, c = iN(r, Fwe);
  return !i || !i.length ? null : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
    className: "recharts-label-list"
  }, i.map(function(f, d) {
    var p = Ue(o) ? n(f, d) : cn(f && f.payload, o), m = Ue(s) ? {} : {
      id: "".concat(s, "-").concat(d)
    };
    return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Sn, Om({}, Ee(f, !0), c, m, {
      parentViewBox: f.parentViewBox,
      value: p,
      textBreakAll: l,
      viewBox: Sn.parseViewBox(Ue(a) ? f : rN(rN({}, f), {}, {
        clockWise: a
      })),
      key: "label-".concat(d),
      index: d
    }));
  }));
}
Ji.displayName = "LabelList";
function Zwe(e, t) {
  return e ? e === !0 ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Ji, {
    key: "labelList-implicit",
    data: t
  }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(e) || ze(e) ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Ji, {
    key: "labelList-implicit",
    data: t,
    content: e
  }) : Vc(e) ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Ji, Om({
    data: t
  }, e, {
    key: "labelList-implicit"
  })) : null : null;
}
function Jwe(e, t) {
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0;
  if (!e || !e.children && n && !e.label)
    return null;
  var r = e.children, i = Vr(r, Ji).map(function(a, s) {
    return /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(a, {
      data: t,
      // eslint-disable-next-line react/no-array-index-key
      key: "labelList-".concat(s)
    });
  });
  if (!n)
    return i;
  var o = Zwe(e.label, t);
  return [o].concat(Wwe(i));
}
Ji.renderCallByParent = Jwe;
function Gf(e) {
  "@babel/helpers - typeof";
  return Gf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Gf(e);
}
function aw() {
  return aw = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, aw.apply(this, arguments);
}
function oN(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function aN(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? oN(Object(n), !0).forEach(function(r) {
      Qwe(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : oN(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function Qwe(e, t, n) {
  return t = e1e(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function e1e(e) {
  var t = t1e(e, "string");
  return Gf(t) == "symbol" ? t : t + "";
}
function t1e(e, t) {
  if (Gf(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Gf(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var n1e = function(t, n) {
  var r = fr(n - t), i = Math.min(Math.abs(n - t), 359.999);
  return r * i;
}, Zh = function(t) {
  var n = t.cx, r = t.cy, i = t.radius, o = t.angle, a = t.sign, s = t.isExternal, l = t.cornerRadius, c = t.cornerIsExternal, f = l * (s ? 1 : -1) + i, d = Math.asin(l / f) / Sm, p = c ? o : o + a * d, m = Bt(n, r, f, p), y = Bt(n, r, i, p), g = c ? o - a * d : o, v = Bt(n, r, f * Math.cos(d * Sm), g);
  return {
    center: m,
    circleTangency: y,
    lineTangency: v,
    theta: d
  };
}, eW = function(t) {
  var n = t.cx, r = t.cy, i = t.innerRadius, o = t.outerRadius, a = t.startAngle, s = t.endAngle, l = n1e(a, s), c = a + l, f = Bt(n, r, o, a), d = Bt(n, r, o, c), p = "M ".concat(f.x, ",").concat(f.y, `
    A `).concat(o, ",").concat(o, `,0,
    `).concat(+(Math.abs(l) > 180), ",").concat(+(a > c), `,
    `).concat(d.x, ",").concat(d.y, `
  `);
  if (i > 0) {
    var m = Bt(n, r, i, a), y = Bt(n, r, i, c);
    p += "L ".concat(y.x, ",").concat(y.y, `
            A `).concat(i, ",").concat(i, `,0,
            `).concat(+(Math.abs(l) > 180), ",").concat(+(a <= c), `,
            `).concat(m.x, ",").concat(m.y, " Z");
  } else
    p += "L ".concat(n, ",").concat(r, " Z");
  return p;
}, r1e = function(t) {
  var n = t.cx, r = t.cy, i = t.innerRadius, o = t.outerRadius, a = t.cornerRadius, s = t.forceCornerRadius, l = t.cornerIsExternal, c = t.startAngle, f = t.endAngle, d = fr(f - c), p = Zh({
    cx: n,
    cy: r,
    radius: o,
    angle: c,
    sign: d,
    cornerRadius: a,
    cornerIsExternal: l
  }), m = p.circleTangency, y = p.lineTangency, g = p.theta, v = Zh({
    cx: n,
    cy: r,
    radius: o,
    angle: f,
    sign: -d,
    cornerRadius: a,
    cornerIsExternal: l
  }), x = v.circleTangency, w = v.lineTangency, S = v.theta, A = l ? Math.abs(c - f) : Math.abs(c - f) - g - S;
  if (A < 0)
    return s ? "M ".concat(y.x, ",").concat(y.y, `
        a`).concat(a, ",").concat(a, ",0,0,1,").concat(a * 2, `,0
        a`).concat(a, ",").concat(a, ",0,0,1,").concat(-a * 2, `,0
      `) : eW({
      cx: n,
      cy: r,
      innerRadius: i,
      outerRadius: o,
      startAngle: c,
      endAngle: f
    });
  var _ = "M ".concat(y.x, ",").concat(y.y, `
    A`).concat(a, ",").concat(a, ",0,0,").concat(+(d < 0), ",").concat(m.x, ",").concat(m.y, `
    A`).concat(o, ",").concat(o, ",0,").concat(+(A > 180), ",").concat(+(d < 0), ",").concat(x.x, ",").concat(x.y, `
    A`).concat(a, ",").concat(a, ",0,0,").concat(+(d < 0), ",").concat(w.x, ",").concat(w.y, `
  `);
  if (i > 0) {
    var O = Zh({
      cx: n,
      cy: r,
      radius: i,
      angle: c,
      sign: d,
      isExternal: !0,
      cornerRadius: a,
      cornerIsExternal: l
    }), P = O.circleTangency, C = O.lineTangency, k = O.theta, I = Zh({
      cx: n,
      cy: r,
      radius: i,
      angle: f,
      sign: -d,
      isExternal: !0,
      cornerRadius: a,
      cornerIsExternal: l
    }), $ = I.circleTangency, N = I.lineTangency, D = I.theta, j = l ? Math.abs(c - f) : Math.abs(c - f) - k - D;
    if (j < 0 && a === 0)
      return "".concat(_, "L").concat(n, ",").concat(r, "Z");
    _ += "L".concat(N.x, ",").concat(N.y, `
      A`).concat(a, ",").concat(a, ",0,0,").concat(+(d < 0), ",").concat($.x, ",").concat($.y, `
      A`).concat(i, ",").concat(i, ",0,").concat(+(j > 180), ",").concat(+(d > 0), ",").concat(P.x, ",").concat(P.y, `
      A`).concat(a, ",").concat(a, ",0,0,").concat(+(d < 0), ",").concat(C.x, ",").concat(C.y, "Z");
  } else
    _ += "L".concat(n, ",").concat(r, "Z");
  return _;
}, i1e = {
  cx: 0,
  cy: 0,
  innerRadius: 0,
  outerRadius: 0,
  startAngle: 0,
  endAngle: 0,
  cornerRadius: 0,
  forceCornerRadius: !1,
  cornerIsExternal: !1
}, tW = function(t) {
  var n = aN(aN({}, i1e), t), r = n.cx, i = n.cy, o = n.innerRadius, a = n.outerRadius, s = n.cornerRadius, l = n.forceCornerRadius, c = n.cornerIsExternal, f = n.startAngle, d = n.endAngle, p = n.className;
  if (a < o || f === d)
    return null;
  var m = Xe("recharts-sector", p), y = a - o, g = dr(s, y, 0, !0), v;
  return g > 0 && Math.abs(f - d) < 360 ? v = r1e({
    cx: r,
    cy: i,
    innerRadius: o,
    outerRadius: a,
    cornerRadius: Math.min(g, y / 2),
    forceCornerRadius: l,
    cornerIsExternal: c,
    startAngle: f,
    endAngle: d
  }) : v = eW({
    cx: r,
    cy: i,
    innerRadius: o,
    outerRadius: a,
    startAngle: f,
    endAngle: d
  }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", aw({}, Ee(n, !0), {
    className: m,
    d: v,
    role: "img"
  }));
};
function Yf(e) {
  "@babel/helpers - typeof";
  return Yf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Yf(e);
}
function sw() {
  return sw = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, sw.apply(this, arguments);
}
function sN(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function lN(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? sN(Object(n), !0).forEach(function(r) {
      o1e(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : sN(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function o1e(e, t, n) {
  return t = a1e(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function a1e(e) {
  var t = s1e(e, "string");
  return Yf(t) == "symbol" ? t : t + "";
}
function s1e(e, t) {
  if (Yf(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Yf(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var cN = {
  curveBasisClosed: ole,
  curveBasisOpen: ale,
  curveBasis: ile,
  curveBumpX: Use,
  curveBumpY: Hse,
  curveLinearClosed: sle,
  curveLinear: ey,
  curveMonotoneX: lle,
  curveMonotoneY: cle,
  curveNatural: ule,
  curveStep: fle,
  curveStepAfter: hle,
  curveStepBefore: dle
}, Jh = function(t) {
  return t.x === +t.x && t.y === +t.y;
}, $u = function(t) {
  return t.x;
}, Du = function(t) {
  return t.y;
}, l1e = function(t, n) {
  if (ze(t))
    return t;
  var r = "curve".concat(Jg(t));
  return (r === "curveMonotone" || r === "curveBump") && n ? cN["".concat(r).concat(n === "vertical" ? "Y" : "X")] : cN[r] || ey;
}, c1e = function(t) {
  var n = t.type, r = n === void 0 ? "linear" : n, i = t.points, o = i === void 0 ? [] : i, a = t.baseLine, s = t.layout, l = t.connectNulls, c = l === void 0 ? !1 : l, f = l1e(r, s), d = c ? o.filter(function(g) {
    return Jh(g);
  }) : o, p;
  if (Array.isArray(a)) {
    var m = c ? a.filter(function(g) {
      return Jh(g);
    }) : a, y = d.map(function(g, v) {
      return lN(lN({}, g), {}, {
        base: m[v]
      });
    });
    return s === "vertical" ? p = zh().y(Du).x1($u).x0(function(g) {
      return g.base.x;
    }) : p = zh().x($u).y1(Du).y0(function(g) {
      return g.base.y;
    }), p.defined(Jh).curve(f), p(y);
  }
  return s === "vertical" && be(a) ? p = zh().y(Du).x1($u).x0(a) : be(a) ? p = zh().x($u).y1(Du).y0(a) : p = qL().x($u).y(Du), p.defined(Jh).curve(f), p(d);
}, Ds = function(t) {
  var n = t.className, r = t.points, i = t.path, o = t.pathRef;
  if ((!r || !r.length) && !i)
    return null;
  var a = r && r.length ? c1e(t) : i;
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", sw({}, Ee(t, !1), Yp(t), {
    className: Xe("recharts-curve", n),
    d: a,
    ref: o
  }));
}, lw = { exports: {} }, Qh = { exports: {} }, wt = {};
/** @license React v16.13.1
 * 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 uN;
function u1e() {
  if (uN) return wt;
  uN = 1;
  var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, n = e ? Symbol.for("react.portal") : 60106, r = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, o = e ? Symbol.for("react.profiler") : 60114, a = e ? Symbol.for("react.provider") : 60109, s = e ? Symbol.for("react.context") : 60110, l = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, f = e ? Symbol.for("react.forward_ref") : 60112, d = e ? Symbol.for("react.suspense") : 60113, p = e ? Symbol.for("react.suspense_list") : 60120, m = e ? Symbol.for("react.memo") : 60115, y = e ? Symbol.for("react.lazy") : 60116, g = e ? Symbol.for("react.block") : 60121, v = e ? Symbol.for("react.fundamental") : 60117, x = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119;
  function S(_) {
    if (typeof _ == "object" && _ !== null) {
      var O = _.$$typeof;
      switch (O) {
        case t:
          switch (_ = _.type, _) {
            case l:
            case c:
            case r:
            case o:
            case i:
            case d:
              return _;
            default:
              switch (_ = _ && _.$$typeof, _) {
                case s:
                case f:
                case y:
                case m:
                case a:
                  return _;
                default:
                  return O;
              }
          }
        case n:
          return O;
      }
    }
  }
  function A(_) {
    return S(_) === c;
  }
  return wt.AsyncMode = l, wt.ConcurrentMode = c, wt.ContextConsumer = s, wt.ContextProvider = a, wt.Element = t, wt.ForwardRef = f, wt.Fragment = r, wt.Lazy = y, wt.Memo = m, wt.Portal = n, wt.Profiler = o, wt.StrictMode = i, wt.Suspense = d, wt.isAsyncMode = function(_) {
    return A(_) || S(_) === l;
  }, wt.isConcurrentMode = A, wt.isContextConsumer = function(_) {
    return S(_) === s;
  }, wt.isContextProvider = function(_) {
    return S(_) === a;
  }, wt.isElement = function(_) {
    return typeof _ == "object" && _ !== null && _.$$typeof === t;
  }, wt.isForwardRef = function(_) {
    return S(_) === f;
  }, wt.isFragment = function(_) {
    return S(_) === r;
  }, wt.isLazy = function(_) {
    return S(_) === y;
  }, wt.isMemo = function(_) {
    return S(_) === m;
  }, wt.isPortal = function(_) {
    return S(_) === n;
  }, wt.isProfiler = function(_) {
    return S(_) === o;
  }, wt.isStrictMode = function(_) {
    return S(_) === i;
  }, wt.isSuspense = function(_) {
    return S(_) === d;
  }, wt.isValidElementType = function(_) {
    return typeof _ == "string" || typeof _ == "function" || _ === r || _ === c || _ === o || _ === i || _ === d || _ === p || typeof _ == "object" && _ !== null && (_.$$typeof === y || _.$$typeof === m || _.$$typeof === a || _.$$typeof === s || _.$$typeof === f || _.$$typeof === v || _.$$typeof === x || _.$$typeof === w || _.$$typeof === g);
  }, wt.typeOf = S, wt;
}
var _t = {};
/** @license React v16.13.1
 * react-is.development.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 fN;
function f1e() {
  return fN || (fN = 1,  true && function() {
    var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, n = e ? Symbol.for("react.portal") : 60106, r = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, o = e ? Symbol.for("react.profiler") : 60114, a = e ? Symbol.for("react.provider") : 60109, s = e ? Symbol.for("react.context") : 60110, l = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, f = e ? Symbol.for("react.forward_ref") : 60112, d = e ? Symbol.for("react.suspense") : 60113, p = e ? Symbol.for("react.suspense_list") : 60120, m = e ? Symbol.for("react.memo") : 60115, y = e ? Symbol.for("react.lazy") : 60116, g = e ? Symbol.for("react.block") : 60121, v = e ? Symbol.for("react.fundamental") : 60117, x = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119;
    function S(X) {
      return typeof X == "string" || typeof X == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
      X === r || X === c || X === o || X === i || X === d || X === p || typeof X == "object" && X !== null && (X.$$typeof === y || X.$$typeof === m || X.$$typeof === a || X.$$typeof === s || X.$$typeof === f || X.$$typeof === v || X.$$typeof === x || X.$$typeof === w || X.$$typeof === g);
    }
    function A(X) {
      if (typeof X == "object" && X !== null) {
        var $e = X.$$typeof;
        switch ($e) {
          case t:
            var de = X.type;
            switch (de) {
              case l:
              case c:
              case r:
              case o:
              case i:
              case d:
                return de;
              default:
                var ke = de && de.$$typeof;
                switch (ke) {
                  case s:
                  case f:
                  case y:
                  case m:
                  case a:
                    return ke;
                  default:
                    return $e;
                }
            }
          case n:
            return $e;
        }
      }
    }
    var _ = l, O = c, P = s, C = a, k = t, I = f, $ = r, N = y, D = m, j = n, F = o, W = i, z = d, H = !1;
    function U(X) {
      return H || (H = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), V(X) || A(X) === l;
    }
    function V(X) {
      return A(X) === c;
    }
    function Y(X) {
      return A(X) === s;
    }
    function Q(X) {
      return A(X) === a;
    }
    function ne(X) {
      return typeof X == "object" && X !== null && X.$$typeof === t;
    }
    function re(X) {
      return A(X) === f;
    }
    function ce(X) {
      return A(X) === r;
    }
    function oe(X) {
      return A(X) === y;
    }
    function fe(X) {
      return A(X) === m;
    }
    function ae(X) {
      return A(X) === n;
    }
    function ee(X) {
      return A(X) === o;
    }
    function se(X) {
      return A(X) === i;
    }
    function ge(X) {
      return A(X) === d;
    }
    _t.AsyncMode = _, _t.ConcurrentMode = O, _t.ContextConsumer = P, _t.ContextProvider = C, _t.Element = k, _t.ForwardRef = I, _t.Fragment = $, _t.Lazy = N, _t.Memo = D, _t.Portal = j, _t.Profiler = F, _t.StrictMode = W, _t.Suspense = z, _t.isAsyncMode = U, _t.isConcurrentMode = V, _t.isContextConsumer = Y, _t.isContextProvider = Q, _t.isElement = ne, _t.isForwardRef = re, _t.isFragment = ce, _t.isLazy = oe, _t.isMemo = fe, _t.isPortal = ae, _t.isProfiler = ee, _t.isStrictMode = se, _t.isSuspense = ge, _t.isValidElementType = S, _t.typeOf = A;
  }()), _t;
}
var dN;
function nW() {
  return dN || (dN = 1,  false ? 0 : Qh.exports = f1e()), Qh.exports;
}
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var Zb, hN;
function d1e() {
  if (hN) return Zb;
  hN = 1;
  var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
  function r(o) {
    if (o == null)
      throw new TypeError("Object.assign cannot be called with null or undefined");
    return Object(o);
  }
  function i() {
    try {
      if (!Object.assign)
        return !1;
      var o = new String("abc");
      if (o[5] = "de", Object.getOwnPropertyNames(o)[0] === "5")
        return !1;
      for (var a = {}, s = 0; s < 10; s++)
        a["_" + String.fromCharCode(s)] = s;
      var l = Object.getOwnPropertyNames(a).map(function(f) {
        return a[f];
      });
      if (l.join("") !== "0123456789")
        return !1;
      var c = {};
      return "abcdefghijklmnopqrst".split("").forEach(function(f) {
        c[f] = f;
      }), Object.keys(Object.assign({}, c)).join("") === "abcdefghijklmnopqrst";
    } catch {
      return !1;
    }
  }
  return Zb = i() ? Object.assign : function(o, a) {
    for (var s, l = r(o), c, f = 1; f < arguments.length; f++) {
      s = Object(arguments[f]);
      for (var d in s)
        t.call(s, d) && (l[d] = s[d]);
      if (e) {
        c = e(s);
        for (var p = 0; p < c.length; p++)
          n.call(s, c[p]) && (l[c[p]] = s[c[p]]);
      }
    }
    return l;
  }, Zb;
}
var Jb, pN;
function CS() {
  if (pN) return Jb;
  pN = 1;
  var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
  return Jb = e, Jb;
}
var Qb, mN;
function rW() {
  return mN || (mN = 1, Qb = Function.call.bind(Object.prototype.hasOwnProperty)), Qb;
}
var e0, gN;
function h1e() {
  if (gN) return e0;
  gN = 1;
  var e = function() {
  };
  if (true) {
    var t = CS(), n = {}, r = rW();
    e = function(o) {
      var a = "Warning: " + o;
      typeof console < "u" && console.error(a);
      try {
        throw new Error(a);
      } catch {
      }
    };
  }
  function i(o, a, s, l, c) {
    if (true) {
      for (var f in o)
        if (r(o, f)) {
          var d;
          try {
            if (typeof o[f] != "function") {
              var p = Error(
                (l || "React class") + ": " + s + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof o[f] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
              );
              throw p.name = "Invariant Violation", p;
            }
            d = o[f](a, f, l, s, null, t);
          } catch (y) {
            d = y;
          }
          if (d && !(d instanceof Error) && e(
            (l || "React class") + ": type specification of " + s + " `" + f + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof d + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
          ), d instanceof Error && !(d.message in n)) {
            n[d.message] = !0;
            var m = c ? c() : "";
            e(
              "Failed " + s + " type: " + d.message + (m ?? "")
            );
          }
        }
    }
  }
  return i.resetWarningCache = function() {
     true && (n = {});
  }, e0 = i, e0;
}
var t0, yN;
function p1e() {
  if (yN) return t0;
  yN = 1;
  var e = nW(), t = d1e(), n = CS(), r = rW(), i = h1e(), o = function() {
  };
   true && (o = function(s) {
    var l = "Warning: " + s;
    typeof console < "u" && console.error(l);
    try {
      throw new Error(l);
    } catch {
    }
  });
  function a() {
    return null;
  }
  return t0 = function(s, l) {
    var c = typeof Symbol == "function" && Symbol.iterator, f = "@@iterator";
    function d(V) {
      var Y = V && (c && V[c] || V[f]);
      if (typeof Y == "function")
        return Y;
    }
    var p = "<<anonymous>>", m = {
      array: x("array"),
      bigint: x("bigint"),
      bool: x("boolean"),
      func: x("function"),
      number: x("number"),
      object: x("object"),
      string: x("string"),
      symbol: x("symbol"),
      any: w(),
      arrayOf: S,
      element: A(),
      elementType: _(),
      instanceOf: O,
      node: I(),
      objectOf: C,
      oneOf: P,
      oneOfType: k,
      shape: N,
      exact: D
    };
    function y(V, Y) {
      return V === Y ? V !== 0 || 1 / V === 1 / Y : V !== V && Y !== Y;
    }
    function g(V, Y) {
      this.message = V, this.data = Y && typeof Y == "object" ? Y : {}, this.stack = "";
    }
    g.prototype = Error.prototype;
    function v(V) {
      if (true)
        var Y = {}, Q = 0;
      function ne(ce, oe, fe, ae, ee, se, ge) {
        if (ae = ae || p, se = se || fe, ge !== n) {
          if (l) {
            var X = 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"
            );
            throw X.name = "Invariant Violation", X;
          } else if ( true && typeof console < "u") {
            var $e = ae + ":" + fe;
            !Y[$e] && // Avoid spamming the console because they are often not actionable except for lib authors
            Q < 3 && (o(
              "You are manually calling a React.PropTypes validation function for the `" + se + "` prop on `" + ae + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
            ), Y[$e] = !0, Q++);
          }
        }
        return oe[fe] == null ? ce ? oe[fe] === null ? new g("The " + ee + " `" + se + "` is marked as required " + ("in `" + ae + "`, but its value is `null`.")) : new g("The " + ee + " `" + se + "` is marked as required in " + ("`" + ae + "`, but its value is `undefined`.")) : null : V(oe, fe, ae, ee, se);
      }
      var re = ne.bind(null, !1);
      return re.isRequired = ne.bind(null, !0), re;
    }
    function x(V) {
      function Y(Q, ne, re, ce, oe, fe) {
        var ae = Q[ne], ee = W(ae);
        if (ee !== V) {
          var se = z(ae);
          return new g(
            "Invalid " + ce + " `" + oe + "` of type " + ("`" + se + "` supplied to `" + re + "`, expected ") + ("`" + V + "`."),
            { expectedType: V }
          );
        }
        return null;
      }
      return v(Y);
    }
    function w() {
      return v(a);
    }
    function S(V) {
      function Y(Q, ne, re, ce, oe) {
        if (typeof V != "function")
          return new g("Property `" + oe + "` of component `" + re + "` has invalid PropType notation inside arrayOf.");
        var fe = Q[ne];
        if (!Array.isArray(fe)) {
          var ae = W(fe);
          return new g("Invalid " + ce + " `" + oe + "` of type " + ("`" + ae + "` supplied to `" + re + "`, expected an array."));
        }
        for (var ee = 0; ee < fe.length; ee++) {
          var se = V(fe, ee, re, ce, oe + "[" + ee + "]", n);
          if (se instanceof Error)
            return se;
        }
        return null;
      }
      return v(Y);
    }
    function A() {
      function V(Y, Q, ne, re, ce) {
        var oe = Y[Q];
        if (!s(oe)) {
          var fe = W(oe);
          return new g("Invalid " + re + " `" + ce + "` of type " + ("`" + fe + "` supplied to `" + ne + "`, expected a single ReactElement."));
        }
        return null;
      }
      return v(V);
    }
    function _() {
      function V(Y, Q, ne, re, ce) {
        var oe = Y[Q];
        if (!e.isValidElementType(oe)) {
          var fe = W(oe);
          return new g("Invalid " + re + " `" + ce + "` of type " + ("`" + fe + "` supplied to `" + ne + "`, expected a single ReactElement type."));
        }
        return null;
      }
      return v(V);
    }
    function O(V) {
      function Y(Q, ne, re, ce, oe) {
        if (!(Q[ne] instanceof V)) {
          var fe = V.name || p, ae = U(Q[ne]);
          return new g("Invalid " + ce + " `" + oe + "` of type " + ("`" + ae + "` supplied to `" + re + "`, expected ") + ("instance of `" + fe + "`."));
        }
        return null;
      }
      return v(Y);
    }
    function P(V) {
      if (!Array.isArray(V))
        return  true && (arguments.length > 1 ? o(
          "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
        ) : o("Invalid argument supplied to oneOf, expected an array.")), a;
      function Y(Q, ne, re, ce, oe) {
        for (var fe = Q[ne], ae = 0; ae < V.length; ae++)
          if (y(fe, V[ae]))
            return null;
        var ee = JSON.stringify(V, function(ge, X) {
          var $e = z(X);
          return $e === "symbol" ? String(X) : X;
        });
        return new g("Invalid " + ce + " `" + oe + "` of value `" + String(fe) + "` " + ("supplied to `" + re + "`, expected one of " + ee + "."));
      }
      return v(Y);
    }
    function C(V) {
      function Y(Q, ne, re, ce, oe) {
        if (typeof V != "function")
          return new g("Property `" + oe + "` of component `" + re + "` has invalid PropType notation inside objectOf.");
        var fe = Q[ne], ae = W(fe);
        if (ae !== "object")
          return new g("Invalid " + ce + " `" + oe + "` of type " + ("`" + ae + "` supplied to `" + re + "`, expected an object."));
        for (var ee in fe)
          if (r(fe, ee)) {
            var se = V(fe, ee, re, ce, oe + "." + ee, n);
            if (se instanceof Error)
              return se;
          }
        return null;
      }
      return v(Y);
    }
    function k(V) {
      if (!Array.isArray(V))
        return  true && o("Invalid argument supplied to oneOfType, expected an instance of array."), a;
      for (var Y = 0; Y < V.length; Y++) {
        var Q = V[Y];
        if (typeof Q != "function")
          return o(
            "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + H(Q) + " at index " + Y + "."
          ), a;
      }
      function ne(re, ce, oe, fe, ae) {
        for (var ee = [], se = 0; se < V.length; se++) {
          var ge = V[se], X = ge(re, ce, oe, fe, ae, n);
          if (X == null)
            return null;
          X.data && r(X.data, "expectedType") && ee.push(X.data.expectedType);
        }
        var $e = ee.length > 0 ? ", expected one of type [" + ee.join(", ") + "]" : "";
        return new g("Invalid " + fe + " `" + ae + "` supplied to " + ("`" + oe + "`" + $e + "."));
      }
      return v(ne);
    }
    function I() {
      function V(Y, Q, ne, re, ce) {
        return j(Y[Q]) ? null : new g("Invalid " + re + " `" + ce + "` supplied to " + ("`" + ne + "`, expected a ReactNode."));
      }
      return v(V);
    }
    function $(V, Y, Q, ne, re) {
      return new g(
        (V || "React class") + ": " + Y + " type `" + Q + "." + ne + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + re + "`."
      );
    }
    function N(V) {
      function Y(Q, ne, re, ce, oe) {
        var fe = Q[ne], ae = W(fe);
        if (ae !== "object")
          return new g("Invalid " + ce + " `" + oe + "` of type `" + ae + "` " + ("supplied to `" + re + "`, expected `object`."));
        for (var ee in V) {
          var se = V[ee];
          if (typeof se != "function")
            return $(re, ce, oe, ee, z(se));
          var ge = se(fe, ee, re, ce, oe + "." + ee, n);
          if (ge)
            return ge;
        }
        return null;
      }
      return v(Y);
    }
    function D(V) {
      function Y(Q, ne, re, ce, oe) {
        var fe = Q[ne], ae = W(fe);
        if (ae !== "object")
          return new g("Invalid " + ce + " `" + oe + "` of type `" + ae + "` " + ("supplied to `" + re + "`, expected `object`."));
        var ee = t({}, Q[ne], V);
        for (var se in ee) {
          var ge = V[se];
          if (r(V, se) && typeof ge != "function")
            return $(re, ce, oe, se, z(ge));
          if (!ge)
            return new g(
              "Invalid " + ce + " `" + oe + "` key `" + se + "` supplied to `" + re + "`.\nBad object: " + JSON.stringify(Q[ne], null, "  ") + `
Valid keys: ` + JSON.stringify(Object.keys(V), null, "  ")
            );
          var X = ge(fe, se, re, ce, oe + "." + se, n);
          if (X)
            return X;
        }
        return null;
      }
      return v(Y);
    }
    function j(V) {
      switch (typeof V) {
        case "number":
        case "string":
        case "undefined":
          return !0;
        case "boolean":
          return !V;
        case "object":
          if (Array.isArray(V))
            return V.every(j);
          if (V === null || s(V))
            return !0;
          var Y = d(V);
          if (Y) {
            var Q = Y.call(V), ne;
            if (Y !== V.entries) {
              for (; !(ne = Q.next()).done; )
                if (!j(ne.value))
                  return !1;
            } else
              for (; !(ne = Q.next()).done; ) {
                var re = ne.value;
                if (re && !j(re[1]))
                  return !1;
              }
          } else
            return !1;
          return !0;
        default:
          return !1;
      }
    }
    function F(V, Y) {
      return V === "symbol" ? !0 : Y ? Y["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && Y instanceof Symbol : !1;
    }
    function W(V) {
      var Y = typeof V;
      return Array.isArray(V) ? "array" : V instanceof RegExp ? "object" : F(Y, V) ? "symbol" : Y;
    }
    function z(V) {
      if (typeof V > "u" || V === null)
        return "" + V;
      var Y = W(V);
      if (Y === "object") {
        if (V instanceof Date)
          return "date";
        if (V instanceof RegExp)
          return "regexp";
      }
      return Y;
    }
    function H(V) {
      var Y = z(V);
      switch (Y) {
        case "array":
        case "object":
          return "an " + Y;
        case "boolean":
        case "date":
        case "regexp":
          return "a " + Y;
        default:
          return Y;
      }
    }
    function U(V) {
      return !V.constructor || !V.constructor.name ? p : V.constructor.name;
    }
    return m.checkPropTypes = i, m.resetWarningCache = i.resetWarningCache, m.PropTypes = m, m;
  }, t0;
}
var n0, vN;
function m1e() {
  if (vN) return n0;
  vN = 1;
  var e = CS();
  function t() {
  }
  function n() {
  }
  return n.resetWarningCache = t, n0 = function() {
    function r(a, s, l, c, f, d) {
      if (d !== e) {
        var p = 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"
        );
        throw p.name = "Invariant Violation", p;
      }
    }
    r.isRequired = r;
    function i() {
      return r;
    }
    var o = {
      array: r,
      bigint: r,
      bool: r,
      func: r,
      number: r,
      object: r,
      string: r,
      symbol: r,
      any: r,
      arrayOf: i,
      element: r,
      elementType: r,
      instanceOf: i,
      node: r,
      objectOf: i,
      oneOf: i,
      oneOfType: i,
      shape: i,
      exact: i,
      checkPropTypes: n,
      resetWarningCache: t
    };
    return o.PropTypes = o, o;
  }, n0;
}
if (true) {
  var g1e = nW(), y1e = !0;
  lw.exports = p1e()(g1e.isElement, y1e);
} else
  // removed by dead control flow
{}
var v1e = lw.exports;
const Qe = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(v1e);
var b1e = Object.getOwnPropertyNames, x1e = Object.getOwnPropertySymbols, w1e = Object.prototype.hasOwnProperty;
function bN(e, t) {
  return function(r, i, o) {
    return e(r, i, o) && t(r, i, o);
  };
}
function ep(e) {
  return function(n, r, i) {
    if (!n || !r || typeof n != "object" || typeof r != "object")
      return e(n, r, i);
    var o = i.cache, a = o.get(n), s = o.get(r);
    if (a && s)
      return a === r && s === n;
    o.set(n, r), o.set(r, n);
    var l = e(n, r, i);
    return o.delete(n), o.delete(r), l;
  };
}
function xN(e) {
  return b1e(e).concat(x1e(e));
}
var iW = Object.hasOwn || function(e, t) {
  return w1e.call(e, t);
};
function eu(e, t) {
  return e || t ? e === t : e === t || e !== e && t !== t;
}
var oW = "_owner", wN = Object.getOwnPropertyDescriptor, _N = Object.keys;
function _1e(e, t, n) {
  var r = e.length;
  if (t.length !== r)
    return !1;
  for (; r-- > 0; )
    if (!n.equals(e[r], t[r], r, r, e, t, n))
      return !1;
  return !0;
}
function S1e(e, t) {
  return eu(e.getTime(), t.getTime());
}
function SN(e, t, n) {
  if (e.size !== t.size)
    return !1;
  for (var r = {}, i = e.entries(), o = 0, a, s; (a = i.next()) && !a.done; ) {
    for (var l = t.entries(), c = !1, f = 0; (s = l.next()) && !s.done; ) {
      var d = a.value, p = d[0], m = d[1], y = s.value, g = y[0], v = y[1];
      !c && !r[f] && (c = n.equals(p, g, o, f, e, t, n) && n.equals(m, v, p, g, e, t, n)) && (r[f] = !0), f++;
    }
    if (!c)
      return !1;
    o++;
  }
  return !0;
}
function O1e(e, t, n) {
  var r = _N(e), i = r.length;
  if (_N(t).length !== i)
    return !1;
  for (var o; i-- > 0; )
    if (o = r[i], o === oW && (e.$$typeof || t.$$typeof) && e.$$typeof !== t.$$typeof || !iW(t, o) || !n.equals(e[o], t[o], o, o, e, t, n))
      return !1;
  return !0;
}
function Iu(e, t, n) {
  var r = xN(e), i = r.length;
  if (xN(t).length !== i)
    return !1;
  for (var o, a, s; i-- > 0; )
    if (o = r[i], o === oW && (e.$$typeof || t.$$typeof) && e.$$typeof !== t.$$typeof || !iW(t, o) || !n.equals(e[o], t[o], o, o, e, t, n) || (a = wN(e, o), s = wN(t, o), (a || s) && (!a || !s || a.configurable !== s.configurable || a.enumerable !== s.enumerable || a.writable !== s.writable)))
      return !1;
  return !0;
}
function A1e(e, t) {
  return eu(e.valueOf(), t.valueOf());
}
function T1e(e, t) {
  return e.source === t.source && e.flags === t.flags;
}
function ON(e, t, n) {
  if (e.size !== t.size)
    return !1;
  for (var r = {}, i = e.values(), o, a; (o = i.next()) && !o.done; ) {
    for (var s = t.values(), l = !1, c = 0; (a = s.next()) && !a.done; )
      !l && !r[c] && (l = n.equals(o.value, a.value, o.value, a.value, e, t, n)) && (r[c] = !0), c++;
    if (!l)
      return !1;
  }
  return !0;
}
function P1e(e, t) {
  var n = e.length;
  if (t.length !== n)
    return !1;
  for (; n-- > 0; )
    if (e[n] !== t[n])
      return !1;
  return !0;
}
var C1e = "[object Arguments]", E1e = "[object Boolean]", k1e = "[object Date]", M1e = "[object Map]", N1e = "[object Number]", $1e = "[object Object]", D1e = "[object RegExp]", I1e = "[object Set]", R1e = "[object String]", j1e = Array.isArray, AN = typeof ArrayBuffer == "function" && ArrayBuffer.isView ? ArrayBuffer.isView : null, TN = Object.assign, L1e = Object.prototype.toString.call.bind(Object.prototype.toString);
function B1e(e) {
  var t = e.areArraysEqual, n = e.areDatesEqual, r = e.areMapsEqual, i = e.areObjectsEqual, o = e.arePrimitiveWrappersEqual, a = e.areRegExpsEqual, s = e.areSetsEqual, l = e.areTypedArraysEqual;
  return function(f, d, p) {
    if (f === d)
      return !0;
    if (f == null || d == null || typeof f != "object" || typeof d != "object")
      return f !== f && d !== d;
    var m = f.constructor;
    if (m !== d.constructor)
      return !1;
    if (m === Object)
      return i(f, d, p);
    if (j1e(f))
      return t(f, d, p);
    if (AN != null && AN(f))
      return l(f, d, p);
    if (m === Date)
      return n(f, d, p);
    if (m === RegExp)
      return a(f, d, p);
    if (m === Map)
      return r(f, d, p);
    if (m === Set)
      return s(f, d, p);
    var y = L1e(f);
    return y === k1e ? n(f, d, p) : y === D1e ? a(f, d, p) : y === M1e ? r(f, d, p) : y === I1e ? s(f, d, p) : y === $1e ? typeof f.then != "function" && typeof d.then != "function" && i(f, d, p) : y === C1e ? i(f, d, p) : y === E1e || y === N1e || y === R1e ? o(f, d, p) : !1;
  };
}
function F1e(e) {
  var t = e.circular, n = e.createCustomConfig, r = e.strict, i = {
    areArraysEqual: r ? Iu : _1e,
    areDatesEqual: S1e,
    areMapsEqual: r ? bN(SN, Iu) : SN,
    areObjectsEqual: r ? Iu : O1e,
    arePrimitiveWrappersEqual: A1e,
    areRegExpsEqual: T1e,
    areSetsEqual: r ? bN(ON, Iu) : ON,
    areTypedArraysEqual: r ? Iu : P1e
  };
  if (n && (i = TN({}, i, n(i))), t) {
    var o = ep(i.areArraysEqual), a = ep(i.areMapsEqual), s = ep(i.areObjectsEqual), l = ep(i.areSetsEqual);
    i = TN({}, i, {
      areArraysEqual: o,
      areMapsEqual: a,
      areObjectsEqual: s,
      areSetsEqual: l
    });
  }
  return i;
}
function W1e(e) {
  return function(t, n, r, i, o, a, s) {
    return e(t, n, s);
  };
}
function z1e(e) {
  var t = e.circular, n = e.comparator, r = e.createState, i = e.equals, o = e.strict;
  if (r)
    return function(l, c) {
      var f = r(), d = f.cache, p = d === void 0 ? t ? /* @__PURE__ */ new WeakMap() : void 0 : d, m = f.meta;
      return n(l, c, {
        cache: p,
        equals: i,
        meta: m,
        strict: o
      });
    };
  if (t)
    return function(l, c) {
      return n(l, c, {
        cache: /* @__PURE__ */ new WeakMap(),
        equals: i,
        meta: void 0,
        strict: o
      });
    };
  var a = {
    cache: void 0,
    equals: i,
    meta: void 0,
    strict: o
  };
  return function(l, c) {
    return n(l, c, a);
  };
}
var V1e = qa();
qa({ strict: !0 });
qa({ circular: !0 });
qa({
  circular: !0,
  strict: !0
});
qa({
  createInternalComparator: function() {
    return eu;
  }
});
qa({
  strict: !0,
  createInternalComparator: function() {
    return eu;
  }
});
qa({
  circular: !0,
  createInternalComparator: function() {
    return eu;
  }
});
qa({
  circular: !0,
  createInternalComparator: function() {
    return eu;
  },
  strict: !0
});
function qa(e) {
  e === void 0 && (e = {});
  var t = e.circular, n = t === void 0 ? !1 : t, r = e.createInternalComparator, i = e.createState, o = e.strict, a = o === void 0 ? !1 : o, s = F1e(e), l = B1e(s), c = r ? r(l) : W1e(l);
  return z1e({ circular: n, comparator: l, createState: i, equals: c, strict: a });
}
function U1e(e) {
  typeof requestAnimationFrame < "u" && requestAnimationFrame(e);
}
function PN(e) {
  var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = -1, r = function i(o) {
    n < 0 && (n = o), o - n > t ? (e(o), n = -1) : U1e(i);
  };
  requestAnimationFrame(r);
}
function cw(e) {
  "@babel/helpers - typeof";
  return cw = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, cw(e);
}
function H1e(e) {
  return q1e(e) || Y1e(e) || G1e(e) || K1e();
}
function K1e() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function G1e(e, t) {
  if (e) {
    if (typeof e == "string") return CN(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return CN(e, t);
  }
}
function CN(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function Y1e(e) {
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function q1e(e) {
  if (Array.isArray(e)) return e;
}
function X1e() {
  var e = {}, t = function() {
    return null;
  }, n = !1, r = function i(o) {
    if (!n) {
      if (Array.isArray(o)) {
        if (!o.length)
          return;
        var a = o, s = H1e(a), l = s[0], c = s.slice(1);
        if (typeof l == "number") {
          PN(i.bind(null, c), l);
          return;
        }
        i(l), PN(i.bind(null, c));
        return;
      }
      cw(o) === "object" && (e = o, t(e)), typeof o == "function" && o();
    }
  };
  return {
    stop: function() {
      n = !0;
    },
    start: function(o) {
      n = !1, r(o);
    },
    subscribe: function(o) {
      return t = o, function() {
        t = function() {
          return null;
        };
      };
    }
  };
}
function qf(e) {
  "@babel/helpers - typeof";
  return qf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, qf(e);
}
function EN(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function kN(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? EN(Object(n), !0).forEach(function(r) {
      aW(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : EN(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function aW(e, t, n) {
  return t = Z1e(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function Z1e(e) {
  var t = J1e(e, "string");
  return qf(t) === "symbol" ? t : String(t);
}
function J1e(e, t) {
  if (qf(e) !== "object" || e === null) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (qf(r) !== "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var Q1e = function(t, n) {
  return [Object.keys(t), Object.keys(n)].reduce(function(r, i) {
    return r.filter(function(o) {
      return i.includes(o);
    });
  });
}, e_e = function(t) {
  return t;
}, t_e = function(t) {
  return t.replace(/([A-Z])/g, function(n) {
    return "-".concat(n.toLowerCase());
  });
}, of = function(t, n) {
  return Object.keys(n).reduce(function(r, i) {
    return kN(kN({}, r), {}, aW({}, i, t(i, n[i])));
  }, {});
}, MN = function(t, n, r) {
  return t.map(function(i) {
    return "".concat(t_e(i), " ").concat(n, "ms ").concat(r);
  }).join(",");
}, n_e = "development" !== "production", Am = function(t, n, r, i, o, a, s, l) {
  if (n_e && typeof console < "u" && console.warn && (n === void 0 && console.warn("LogUtils requires an error message argument"), !t))
    if (n === void 0)
      console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
    else {
      var c = [r, i, o, a, s, l], f = 0;
      console.warn(n.replace(/%s/g, function() {
        return c[f++];
      }));
    }
};
function r_e(e, t) {
  return a_e(e) || o_e(e, t) || sW(e, t) || i_e();
}
function i_e() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function o_e(e, t) {
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (n != null) {
    var r, i, o, a, s = [], l = !0, c = !1;
    try {
      if (o = (n = n.call(e)).next, t !== 0) for (; !(l = (r = o.call(n)).done) && (s.push(r.value), s.length !== t); l = !0) ;
    } catch (f) {
      c = !0, i = f;
    } finally {
      try {
        if (!l && n.return != null && (a = n.return(), Object(a) !== a)) return;
      } finally {
        if (c) throw i;
      }
    }
    return s;
  }
}
function a_e(e) {
  if (Array.isArray(e)) return e;
}
function s_e(e) {
  return u_e(e) || c_e(e) || sW(e) || l_e();
}
function l_e() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function sW(e, t) {
  if (e) {
    if (typeof e == "string") return uw(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return uw(e, t);
  }
}
function c_e(e) {
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function u_e(e) {
  if (Array.isArray(e)) return uw(e);
}
function uw(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
var Tm = 1e-4, lW = function(t, n) {
  return [0, 3 * t, 3 * n - 6 * t, 3 * t - 3 * n + 1];
}, cW = function(t, n) {
  return t.map(function(r, i) {
    return r * Math.pow(n, i);
  }).reduce(function(r, i) {
    return r + i;
  });
}, NN = function(t, n) {
  return function(r) {
    var i = lW(t, n);
    return cW(i, r);
  };
}, f_e = function(t, n) {
  return function(r) {
    var i = lW(t, n), o = [].concat(s_e(i.map(function(a, s) {
      return a * s;
    }).slice(1)), [0]);
    return cW(o, r);
  };
}, $N = function() {
  for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
    n[r] = arguments[r];
  var i = n[0], o = n[1], a = n[2], s = n[3];
  if (n.length === 1)
    switch (n[0]) {
      case "linear":
        i = 0, o = 0, a = 1, s = 1;
        break;
      case "ease":
        i = 0.25, o = 0.1, a = 0.25, s = 1;
        break;
      case "ease-in":
        i = 0.42, o = 0, a = 1, s = 1;
        break;
      case "ease-out":
        i = 0.42, o = 0, a = 0.58, s = 1;
        break;
      case "ease-in-out":
        i = 0, o = 0, a = 0.58, s = 1;
        break;
      default: {
        var l = n[0].split("(");
        if (l[0] === "cubic-bezier" && l[1].split(")")[0].split(",").length === 4) {
          var c = l[1].split(")")[0].split(",").map(function(v) {
            return parseFloat(v);
          }), f = r_e(c, 4);
          i = f[0], o = f[1], a = f[2], s = f[3];
        } else
          Am(!1, "[configBezier]: arguments should be one of oneOf 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', instead received %s", n);
      }
    }
  Am([i, a, o, s].every(function(v) {
    return typeof v == "number" && v >= 0 && v <= 1;
  }), "[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s", n);
  var d = NN(i, a), p = NN(o, s), m = f_e(i, a), y = function(x) {
    return x > 1 ? 1 : x < 0 ? 0 : x;
  }, g = function(x) {
    for (var w = x > 1 ? 1 : x, S = w, A = 0; A < 8; ++A) {
      var _ = d(S) - w, O = m(S);
      if (Math.abs(_ - w) < Tm || O < Tm)
        return p(S);
      S = y(S - _ / O);
    }
    return p(S);
  };
  return g.isStepper = !1, g;
}, d_e = function() {
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = t.stiff, r = n === void 0 ? 100 : n, i = t.damping, o = i === void 0 ? 8 : i, a = t.dt, s = a === void 0 ? 17 : a, l = function(f, d, p) {
    var m = -(f - d) * r, y = p * o, g = p + (m - y) * s / 1e3, v = p * s / 1e3 + f;
    return Math.abs(v - d) < Tm && Math.abs(g) < Tm ? [d, 0] : [v, g];
  };
  return l.isStepper = !0, l.dt = s, l;
}, h_e = function() {
  for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
    n[r] = arguments[r];
  var i = n[0];
  if (typeof i == "string")
    switch (i) {
      case "ease":
      case "ease-in-out":
      case "ease-out":
      case "ease-in":
      case "linear":
        return $N(i);
      case "spring":
        return d_e();
      default:
        if (i.split("(")[0] === "cubic-bezier")
          return $N(i);
        Am(!1, "[configEasing]: first argument should be one of 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', 'linear' and 'spring', instead  received %s", n);
    }
  return typeof i == "function" ? i : (Am(!1, "[configEasing]: first argument type should be function or string, instead received %s", n), null);
};
function Xf(e) {
  "@babel/helpers - typeof";
  return Xf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Xf(e);
}
function DN(e) {
  return g_e(e) || m_e(e) || uW(e) || p_e();
}
function p_e() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function m_e(e) {
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function g_e(e) {
  if (Array.isArray(e)) return dw(e);
}
function IN(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function Wn(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? IN(Object(n), !0).forEach(function(r) {
      fw(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : IN(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function fw(e, t, n) {
  return t = y_e(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function y_e(e) {
  var t = v_e(e, "string");
  return Xf(t) === "symbol" ? t : String(t);
}
function v_e(e, t) {
  if (Xf(e) !== "object" || e === null) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Xf(r) !== "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function b_e(e, t) {
  return __e(e) || w_e(e, t) || uW(e, t) || x_e();
}
function x_e() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function uW(e, t) {
  if (e) {
    if (typeof e == "string") return dw(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return dw(e, t);
  }
}
function dw(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function w_e(e, t) {
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (n != null) {
    var r, i, o, a, s = [], l = !0, c = !1;
    try {
      if (o = (n = n.call(e)).next, t !== 0) for (; !(l = (r = o.call(n)).done) && (s.push(r.value), s.length !== t); l = !0) ;
    } catch (f) {
      c = !0, i = f;
    } finally {
      try {
        if (!l && n.return != null && (a = n.return(), Object(a) !== a)) return;
      } finally {
        if (c) throw i;
      }
    }
    return s;
  }
}
function __e(e) {
  if (Array.isArray(e)) return e;
}
var Pm = function(t, n, r) {
  return t + (n - t) * r;
}, hw = function(t) {
  var n = t.from, r = t.to;
  return n !== r;
}, S_e = function e(t, n, r) {
  var i = of(function(o, a) {
    if (hw(a)) {
      var s = t(a.from, a.to, a.velocity), l = b_e(s, 2), c = l[0], f = l[1];
      return Wn(Wn({}, a), {}, {
        from: c,
        velocity: f
      });
    }
    return a;
  }, n);
  return r < 1 ? of(function(o, a) {
    return hw(a) ? Wn(Wn({}, a), {}, {
      velocity: Pm(a.velocity, i[o].velocity, r),
      from: Pm(a.from, i[o].from, r)
    }) : a;
  }, n) : e(t, i, r - 1);
};
const O_e = function(e, t, n, r, i) {
  var o = Q1e(e, t), a = o.reduce(function(v, x) {
    return Wn(Wn({}, v), {}, fw({}, x, [e[x], t[x]]));
  }, {}), s = o.reduce(function(v, x) {
    return Wn(Wn({}, v), {}, fw({}, x, {
      from: e[x],
      velocity: 0,
      to: t[x]
    }));
  }, {}), l = -1, c, f, d = function() {
    return null;
  }, p = function() {
    return of(function(x, w) {
      return w.from;
    }, s);
  }, m = function() {
    return !Object.values(s).filter(hw).length;
  }, y = function(x) {
    c || (c = x);
    var w = x - c, S = w / n.dt;
    s = S_e(n, s, S), i(Wn(Wn(Wn({}, e), t), p())), c = x, m() || (l = requestAnimationFrame(d));
  }, g = function(x) {
    f || (f = x);
    var w = (x - f) / r, S = of(function(_, O) {
      return Pm.apply(void 0, DN(O).concat([n(w)]));
    }, a);
    if (i(Wn(Wn(Wn({}, e), t), S)), w < 1)
      l = requestAnimationFrame(d);
    else {
      var A = of(function(_, O) {
        return Pm.apply(void 0, DN(O).concat([n(1)]));
      }, a);
      i(Wn(Wn(Wn({}, e), t), A));
    }
  };
  return d = n.isStepper ? y : g, function() {
    return requestAnimationFrame(d), function() {
      cancelAnimationFrame(l);
    };
  };
};
function pc(e) {
  "@babel/helpers - typeof";
  return pc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, pc(e);
}
var A_e = ["children", "begin", "duration", "attributeName", "easing", "isActive", "steps", "from", "to", "canBegin", "onAnimationEnd", "shouldReAnimate", "onAnimationReStart"];
function T_e(e, t) {
  if (e == null) return {};
  var n = P_e(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function P_e(e, t) {
  if (e == null) return {};
  var n = {}, r = Object.keys(e), i, o;
  for (o = 0; o < r.length; o++)
    i = r[o], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
  return n;
}
function r0(e) {
  return M_e(e) || k_e(e) || E_e(e) || C_e();
}
function C_e() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function E_e(e, t) {
  if (e) {
    if (typeof e == "string") return pw(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return pw(e, t);
  }
}
function k_e(e) {
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function M_e(e) {
  if (Array.isArray(e)) return pw(e);
}
function pw(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function RN(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function wi(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? RN(Object(n), !0).forEach(function(r) {
      Vu(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : RN(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function Vu(e, t, n) {
  return t = fW(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function N_e(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function $_e(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, fW(r.key), r);
  }
}
function D_e(e, t, n) {
  return t && $_e(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function fW(e) {
  var t = I_e(e, "string");
  return pc(t) === "symbol" ? t : String(t);
}
function I_e(e, t) {
  if (pc(e) !== "object" || e === null) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (pc(r) !== "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function R_e(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && mw(e, t);
}
function mw(e, t) {
  return mw = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, mw(e, t);
}
function j_e(e) {
  var t = L_e();
  return function() {
    var r = Cm(e), i;
    if (t) {
      var o = Cm(this).constructor;
      i = Reflect.construct(r, arguments, o);
    } else
      i = r.apply(this, arguments);
    return gw(this, i);
  };
}
function gw(e, t) {
  if (t && (pc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return yw(e);
}
function yw(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function L_e() {
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
  if (typeof Proxy == "function") return !0;
  try {
    return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    })), !0;
  } catch {
    return !1;
  }
}
function Cm(e) {
  return Cm = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, Cm(e);
}
var $i = /* @__PURE__ */ function(e) {
  R_e(n, e);
  var t = j_e(n);
  function n(r, i) {
    var o;
    N_e(this, n), o = t.call(this, r, i);
    var a = o.props, s = a.isActive, l = a.attributeName, c = a.from, f = a.to, d = a.steps, p = a.children, m = a.duration;
    if (o.handleStyleChange = o.handleStyleChange.bind(yw(o)), o.changeStyle = o.changeStyle.bind(yw(o)), !s || m <= 0)
      return o.state = {
        style: {}
      }, typeof p == "function" && (o.state = {
        style: f
      }), gw(o);
    if (d && d.length)
      o.state = {
        style: d[0].style
      };
    else if (c) {
      if (typeof p == "function")
        return o.state = {
          style: c
        }, gw(o);
      o.state = {
        style: l ? Vu({}, l, c) : c
      };
    } else
      o.state = {
        style: {}
      };
    return o;
  }
  return D_e(n, [{
    key: "componentDidMount",
    value: function() {
      var i = this.props, o = i.isActive, a = i.canBegin;
      this.mounted = !0, !(!o || !a) && this.runAnimation(this.props);
    }
  }, {
    key: "componentDidUpdate",
    value: function(i) {
      var o = this.props, a = o.isActive, s = o.canBegin, l = o.attributeName, c = o.shouldReAnimate, f = o.to, d = o.from, p = this.state.style;
      if (s) {
        if (!a) {
          var m = {
            style: l ? Vu({}, l, f) : f
          };
          this.state && p && (l && p[l] !== f || !l && p !== f) && this.setState(m);
          return;
        }
        if (!(V1e(i.to, f) && i.canBegin && i.isActive)) {
          var y = !i.canBegin || !i.isActive;
          this.manager && this.manager.stop(), this.stopJSAnimation && this.stopJSAnimation();
          var g = y || c ? d : i.to;
          if (this.state && p) {
            var v = {
              style: l ? Vu({}, l, g) : g
            };
            (l && p[l] !== g || !l && p !== g) && this.setState(v);
          }
          this.runAnimation(wi(wi({}, this.props), {}, {
            from: g,
            begin: 0
          }));
        }
      }
    }
  }, {
    key: "componentWillUnmount",
    value: function() {
      this.mounted = !1;
      var i = this.props.onAnimationEnd;
      this.unSubscribe && this.unSubscribe(), this.manager && (this.manager.stop(), this.manager = null), this.stopJSAnimation && this.stopJSAnimation(), i && i();
    }
  }, {
    key: "handleStyleChange",
    value: function(i) {
      this.changeStyle(i);
    }
  }, {
    key: "changeStyle",
    value: function(i) {
      this.mounted && this.setState({
        style: i
      });
    }
  }, {
    key: "runJSAnimation",
    value: function(i) {
      var o = this, a = i.from, s = i.to, l = i.duration, c = i.easing, f = i.begin, d = i.onAnimationEnd, p = i.onAnimationStart, m = O_e(a, s, h_e(c), l, this.changeStyle), y = function() {
        o.stopJSAnimation = m();
      };
      this.manager.start([p, f, y, l, d]);
    }
  }, {
    key: "runStepAnimation",
    value: function(i) {
      var o = this, a = i.steps, s = i.begin, l = i.onAnimationStart, c = a[0], f = c.style, d = c.duration, p = d === void 0 ? 0 : d, m = function(g, v, x) {
        if (x === 0)
          return g;
        var w = v.duration, S = v.easing, A = S === void 0 ? "ease" : S, _ = v.style, O = v.properties, P = v.onAnimationEnd, C = x > 0 ? a[x - 1] : v, k = O || Object.keys(_);
        if (typeof A == "function" || A === "spring")
          return [].concat(r0(g), [o.runJSAnimation.bind(o, {
            from: C.style,
            to: _,
            duration: w,
            easing: A
          }), w]);
        var I = MN(k, w, A), $ = wi(wi(wi({}, C.style), _), {}, {
          transition: I
        });
        return [].concat(r0(g), [$, w, P]).filter(e_e);
      };
      return this.manager.start([l].concat(r0(a.reduce(m, [f, Math.max(p, s)])), [i.onAnimationEnd]));
    }
  }, {
    key: "runAnimation",
    value: function(i) {
      this.manager || (this.manager = X1e());
      var o = i.begin, a = i.duration, s = i.attributeName, l = i.to, c = i.easing, f = i.onAnimationStart, d = i.onAnimationEnd, p = i.steps, m = i.children, y = this.manager;
      if (this.unSubscribe = y.subscribe(this.handleStyleChange), typeof c == "function" || typeof m == "function" || c === "spring") {
        this.runJSAnimation(i);
        return;
      }
      if (p.length > 1) {
        this.runStepAnimation(i);
        return;
      }
      var g = s ? Vu({}, s, l) : l, v = MN(Object.keys(g), a, c);
      y.start([f, o, wi(wi({}, g), {}, {
        transition: v
      }), a, d]);
    }
  }, {
    key: "render",
    value: function() {
      var i = this.props, o = i.children;
      i.begin;
      var a = i.duration;
      i.attributeName, i.easing;
      var s = i.isActive;
      i.steps, i.from, i.to, i.canBegin, i.onAnimationEnd, i.shouldReAnimate, i.onAnimationReStart;
      var l = T_e(i, A_e), c = react__WEBPACK_IMPORTED_MODULE_1__.Children.count(o), f = this.state.style;
      if (typeof o == "function")
        return o(f);
      if (!s || c === 0 || a <= 0)
        return o;
      var d = function(m) {
        var y = m.props, g = y.style, v = g === void 0 ? {} : g, x = y.className, w = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(m, wi(wi({}, l), {}, {
          style: wi(wi({}, v), f),
          className: x
        }));
        return w;
      };
      return c === 1 ? d(react__WEBPACK_IMPORTED_MODULE_1__.Children.only(o)) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_1__.Children.map(o, function(p) {
        return d(p);
      }));
    }
  }]), n;
}(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent);
$i.displayName = "Animate";
$i.defaultProps = {
  begin: 0,
  duration: 1e3,
  from: "",
  to: "",
  attributeName: "",
  easing: "ease",
  isActive: !0,
  canBegin: !0,
  steps: [],
  onAnimationEnd: function() {
  },
  onAnimationStart: function() {
  }
};
$i.propTypes = {
  from: Qe.oneOfType([Qe.object, Qe.string]),
  to: Qe.oneOfType([Qe.object, Qe.string]),
  attributeName: Qe.string,
  // animation duration
  duration: Qe.number,
  begin: Qe.number,
  easing: Qe.oneOfType([Qe.string, Qe.func]),
  steps: Qe.arrayOf(Qe.shape({
    duration: Qe.number.isRequired,
    style: Qe.object.isRequired,
    easing: Qe.oneOfType([Qe.oneOf(["ease", "ease-in", "ease-out", "ease-in-out", "linear"]), Qe.func]),
    // transition css properties(dash case), optional
    properties: Qe.arrayOf("string"),
    onAnimationEnd: Qe.func
  })),
  children: Qe.oneOfType([Qe.node, Qe.func]),
  isActive: Qe.bool,
  canBegin: Qe.bool,
  onAnimationEnd: Qe.func,
  // decide if it should reanimate with initial from style when props change
  shouldReAnimate: Qe.bool,
  onAnimationStart: Qe.func,
  onAnimationReStart: Qe.func
};
Qe.object, Qe.object, Qe.object, Qe.element;
Qe.object, Qe.object, Qe.object, Qe.oneOfType([Qe.array, Qe.element]), Qe.any;
function Zf(e) {
  "@babel/helpers - typeof";
  return Zf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Zf(e);
}
function Em() {
  return Em = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Em.apply(this, arguments);
}
function B_e(e, t) {
  return V_e(e) || z_e(e, t) || W_e(e, t) || F_e();
}
function F_e() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function W_e(e, t) {
  if (e) {
    if (typeof e == "string") return jN(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return jN(e, t);
  }
}
function jN(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function z_e(e, t) {
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (n != null) {
    var r, i, o, a, s = [], l = !0, c = !1;
    try {
      if (o = (n = n.call(e)).next, t !== 0) for (; !(l = (r = o.call(n)).done) && (s.push(r.value), s.length !== t); l = !0) ;
    } catch (f) {
      c = !0, i = f;
    } finally {
      try {
        if (!l && n.return != null && (a = n.return(), Object(a) !== a)) return;
      } finally {
        if (c) throw i;
      }
    }
    return s;
  }
}
function V_e(e) {
  if (Array.isArray(e)) return e;
}
function LN(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function BN(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? LN(Object(n), !0).forEach(function(r) {
      U_e(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : LN(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function U_e(e, t, n) {
  return t = H_e(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function H_e(e) {
  var t = K_e(e, "string");
  return Zf(t) == "symbol" ? t : t + "";
}
function K_e(e, t) {
  if (Zf(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Zf(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var FN = function(t, n, r, i, o) {
  var a = Math.min(Math.abs(r) / 2, Math.abs(i) / 2), s = i >= 0 ? 1 : -1, l = r >= 0 ? 1 : -1, c = i >= 0 && r >= 0 || i < 0 && r < 0 ? 1 : 0, f;
  if (a > 0 && o instanceof Array) {
    for (var d = [0, 0, 0, 0], p = 0, m = 4; p < m; p++)
      d[p] = o[p] > a ? a : o[p];
    f = "M".concat(t, ",").concat(n + s * d[0]), d[0] > 0 && (f += "A ".concat(d[0], ",").concat(d[0], ",0,0,").concat(c, ",").concat(t + l * d[0], ",").concat(n)), f += "L ".concat(t + r - l * d[1], ",").concat(n), d[1] > 0 && (f += "A ".concat(d[1], ",").concat(d[1], ",0,0,").concat(c, `,
        `).concat(t + r, ",").concat(n + s * d[1])), f += "L ".concat(t + r, ",").concat(n + i - s * d[2]), d[2] > 0 && (f += "A ".concat(d[2], ",").concat(d[2], ",0,0,").concat(c, `,
        `).concat(t + r - l * d[2], ",").concat(n + i)), f += "L ".concat(t + l * d[3], ",").concat(n + i), d[3] > 0 && (f += "A ".concat(d[3], ",").concat(d[3], ",0,0,").concat(c, `,
        `).concat(t, ",").concat(n + i - s * d[3])), f += "Z";
  } else if (a > 0 && o === +o && o > 0) {
    var y = Math.min(a, o);
    f = "M ".concat(t, ",").concat(n + s * y, `
            A `).concat(y, ",").concat(y, ",0,0,").concat(c, ",").concat(t + l * y, ",").concat(n, `
            L `).concat(t + r - l * y, ",").concat(n, `
            A `).concat(y, ",").concat(y, ",0,0,").concat(c, ",").concat(t + r, ",").concat(n + s * y, `
            L `).concat(t + r, ",").concat(n + i - s * y, `
            A `).concat(y, ",").concat(y, ",0,0,").concat(c, ",").concat(t + r - l * y, ",").concat(n + i, `
            L `).concat(t + l * y, ",").concat(n + i, `
            A `).concat(y, ",").concat(y, ",0,0,").concat(c, ",").concat(t, ",").concat(n + i - s * y, " Z");
  } else
    f = "M ".concat(t, ",").concat(n, " h ").concat(r, " v ").concat(i, " h ").concat(-r, " Z");
  return f;
}, G_e = function(t, n) {
  if (!t || !n)
    return !1;
  var r = t.x, i = t.y, o = n.x, a = n.y, s = n.width, l = n.height;
  if (Math.abs(s) > 0 && Math.abs(l) > 0) {
    var c = Math.min(o, o + s), f = Math.max(o, o + s), d = Math.min(a, a + l), p = Math.max(a, a + l);
    return r >= c && r <= f && i >= d && i <= p;
  }
  return !1;
}, Y_e = {
  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: !1,
  isUpdateAnimationActive: !1,
  animationBegin: 0,
  animationDuration: 1500,
  animationEasing: "ease"
}, ES = function(t) {
  var n = BN(BN({}, Y_e), t), r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(-1), o = B_e(i, 2), a = o[0], s = o[1];
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function() {
    if (r.current && r.current.getTotalLength)
      try {
        var A = r.current.getTotalLength();
        A && s(A);
      } catch {
      }
  }, []);
  var l = n.x, c = n.y, f = n.width, d = n.height, p = n.radius, m = n.className, y = n.animationEasing, g = n.animationDuration, v = n.animationBegin, x = n.isAnimationActive, w = n.isUpdateAnimationActive;
  if (l !== +l || c !== +c || f !== +f || d !== +d || f === 0 || d === 0)
    return null;
  var S = Xe("recharts-rectangle", m);
  return w ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement($i, {
    canBegin: a > 0,
    from: {
      width: f,
      height: d,
      x: l,
      y: c
    },
    to: {
      width: f,
      height: d,
      x: l,
      y: c
    },
    duration: g,
    animationEasing: y,
    isActive: w
  }, function(A) {
    var _ = A.width, O = A.height, P = A.x, C = A.y;
    return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement($i, {
      canBegin: a > 0,
      from: "0px ".concat(a === -1 ? 1 : a, "px"),
      to: "".concat(a, "px 0px"),
      attributeName: "strokeDasharray",
      begin: v,
      duration: g,
      isActive: x,
      easing: y
    }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", Em({}, Ee(n, !0), {
      className: S,
      d: FN(P, C, _, O, p),
      ref: r
    })));
  }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", Em({}, Ee(n, !0), {
    className: S,
    d: FN(l, c, f, d, p)
  }));
}, q_e = ["points", "className", "baseLinePoints", "connectNulls"];
function Bl() {
  return Bl = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Bl.apply(this, arguments);
}
function X_e(e, t) {
  if (e == null) return {};
  var n = Z_e(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function Z_e(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function WN(e) {
  return tSe(e) || eSe(e) || Q_e(e) || J_e();
}
function J_e() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Q_e(e, t) {
  if (e) {
    if (typeof e == "string") return vw(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return vw(e, t);
  }
}
function eSe(e) {
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function tSe(e) {
  if (Array.isArray(e)) return vw(e);
}
function vw(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
var zN = function(t) {
  return t && t.x === +t.x && t.y === +t.y;
}, nSe = function() {
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], n = [[]];
  return t.forEach(function(r) {
    zN(r) ? n[n.length - 1].push(r) : n[n.length - 1].length > 0 && n.push([]);
  }), zN(t[0]) && n[n.length - 1].push(t[0]), n[n.length - 1].length <= 0 && (n = n.slice(0, -1)), n;
}, af = function(t, n) {
  var r = nSe(t);
  n && (r = [r.reduce(function(o, a) {
    return [].concat(WN(o), WN(a));
  }, [])]);
  var i = r.map(function(o) {
    return o.reduce(function(a, s, l) {
      return "".concat(a).concat(l === 0 ? "M" : "L").concat(s.x, ",").concat(s.y);
    }, "");
  }).join("");
  return r.length === 1 ? "".concat(i, "Z") : i;
}, rSe = function(t, n, r) {
  var i = af(t, r);
  return "".concat(i.slice(-1) === "Z" ? i.slice(0, -1) : i, "L").concat(af(n.reverse(), r).slice(1));
}, iSe = function(t) {
  var n = t.points, r = t.className, i = t.baseLinePoints, o = t.connectNulls, a = X_e(t, q_e);
  if (!n || !n.length)
    return null;
  var s = Xe("recharts-polygon", r);
  if (i && i.length) {
    var l = a.stroke && a.stroke !== "none", c = rSe(n, i, o);
    return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("g", {
      className: s
    }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", Bl({}, Ee(a, !0), {
      fill: c.slice(-1) === "Z" ? a.fill : "none",
      stroke: "none",
      d: c
    })), l ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", Bl({}, Ee(a, !0), {
      fill: "none",
      d: af(n, o)
    })) : null, l ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", Bl({}, Ee(a, !0), {
      fill: "none",
      d: af(i, o)
    })) : null);
  }
  var f = af(n, o);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", Bl({}, Ee(a, !0), {
    fill: f.slice(-1) === "Z" ? a.fill : "none",
    className: s,
    d: f
  }));
};
function bw() {
  return bw = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, bw.apply(this, arguments);
}
var Dd = function(t) {
  var n = t.cx, r = t.cy, i = t.r, o = t.className, a = Xe("recharts-dot", o);
  return n === +n && r === +r && i === +i ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("circle", bw({}, Ee(t, !1), Yp(t), {
    className: a,
    cx: n,
    cy: r,
    r: i
  })) : null;
};
function Jf(e) {
  "@babel/helpers - typeof";
  return Jf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Jf(e);
}
var oSe = ["x", "y", "top", "left", "width", "height", "className"];
function xw() {
  return xw = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, xw.apply(this, arguments);
}
function VN(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function aSe(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? VN(Object(n), !0).forEach(function(r) {
      sSe(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : VN(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function sSe(e, t, n) {
  return t = lSe(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function lSe(e) {
  var t = cSe(e, "string");
  return Jf(t) == "symbol" ? t : t + "";
}
function cSe(e, t) {
  if (Jf(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Jf(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function uSe(e, t) {
  if (e == null) return {};
  var n = fSe(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function fSe(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
var dSe = function(t, n, r, i, o, a) {
  return "M".concat(t, ",").concat(o, "v").concat(i, "M").concat(a, ",").concat(n, "h").concat(r);
}, hSe = function(t) {
  var n = t.x, r = n === void 0 ? 0 : n, i = t.y, o = i === void 0 ? 0 : i, a = t.top, s = a === void 0 ? 0 : a, l = t.left, c = l === void 0 ? 0 : l, f = t.width, d = f === void 0 ? 0 : f, p = t.height, m = p === void 0 ? 0 : p, y = t.className, g = uSe(t, oSe), v = aSe({
    x: r,
    y: o,
    top: s,
    left: c,
    width: d,
    height: m
  }, g);
  return !be(r) || !be(o) || !be(d) || !be(m) || !be(s) || !be(c) ? null : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", xw({}, Ee(v, !0), {
    className: Xe("recharts-cross", y),
    d: dSe(r, o, d, m, s, c)
  }));
}, pSe = fy, mSe = SF, gSe = so;
function ySe(e, t) {
  return e && e.length ? pSe(e, gSe(t), mSe) : void 0;
}
var vSe = ySe;
const bSe = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(vSe);
var xSe = fy, wSe = so, _Se = OF;
function SSe(e, t) {
  return e && e.length ? xSe(e, wSe(t), _Se) : void 0;
}
var OSe = SSe;
const ASe = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(OSe);
var TSe = ["cx", "cy", "angle", "ticks", "axisLine"], PSe = ["ticks", "tick", "angle", "tickFormatter", "stroke"];
function mc(e) {
  "@babel/helpers - typeof";
  return mc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, mc(e);
}
function sf() {
  return sf = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, sf.apply(this, arguments);
}
function UN(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function us(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? UN(Object(n), !0).forEach(function(r) {
      my(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : UN(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function HN(e, t) {
  if (e == null) return {};
  var n = CSe(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function CSe(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function ESe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function KN(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, hW(r.key), r);
  }
}
function kSe(e, t, n) {
  return t && KN(e.prototype, t), n && KN(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function MSe(e, t, n) {
  return t = km(t), NSe(e, dW() ? Reflect.construct(t, n || [], km(e).constructor) : t.apply(e, n));
}
function NSe(e, t) {
  if (t && (mc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return $Se(e);
}
function $Se(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function dW() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (dW = function() {
    return !!e;
  })();
}
function km(e) {
  return km = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, km(e);
}
function DSe(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && ww(e, t);
}
function ww(e, t) {
  return ww = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, ww(e, t);
}
function my(e, t, n) {
  return t = hW(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function hW(e) {
  var t = ISe(e, "string");
  return mc(t) == "symbol" ? t : t + "";
}
function ISe(e, t) {
  if (mc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (mc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var gy = /* @__PURE__ */ function(e) {
  function t() {
    return ESe(this, t), MSe(this, t, arguments);
  }
  return DSe(t, e), kSe(t, [{
    key: "getTickValueCoord",
    value: (
      /**
       * Calculate the coordinate of tick
       * @param  {Number} coordinate The radius of tick
       * @return {Object} (x, y)
       */
      function(r) {
        var i = r.coordinate, o = this.props, a = o.angle, s = o.cx, l = o.cy;
        return Bt(s, l, i, a);
      }
    )
  }, {
    key: "getTickTextAnchor",
    value: function() {
      var r = this.props.orientation, i;
      switch (r) {
        case "left":
          i = "end";
          break;
        case "right":
          i = "start";
          break;
        default:
          i = "middle";
          break;
      }
      return i;
    }
  }, {
    key: "getViewBox",
    value: function() {
      var r = this.props, i = r.cx, o = r.cy, a = r.angle, s = r.ticks, l = bSe(s, function(f) {
        return f.coordinate || 0;
      }), c = ASe(s, function(f) {
        return f.coordinate || 0;
      });
      return {
        cx: i,
        cy: o,
        startAngle: a,
        endAngle: a,
        innerRadius: c.coordinate || 0,
        outerRadius: l.coordinate || 0
      };
    }
  }, {
    key: "renderAxisLine",
    value: function() {
      var r = this.props, i = r.cx, o = r.cy, a = r.angle, s = r.ticks, l = r.axisLine, c = HN(r, TSe), f = s.reduce(function(y, g) {
        return [Math.min(y[0], g.coordinate), Math.max(y[1], g.coordinate)];
      }, [1 / 0, -1 / 0]), d = Bt(i, o, f[0], a), p = Bt(i, o, f[1], a), m = us(us(us({}, Ee(c, !1)), {}, {
        fill: "none"
      }, Ee(l, !1)), {}, {
        x1: d.x,
        y1: d.y,
        x2: p.x,
        y2: p.y
      });
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("line", sf({
        className: "recharts-polar-radius-axis-line"
      }, m));
    }
  }, {
    key: "renderTicks",
    value: function() {
      var r = this, i = this.props, o = i.ticks, a = i.tick, s = i.angle, l = i.tickFormatter, c = i.stroke, f = HN(i, PSe), d = this.getTickTextAnchor(), p = Ee(f, !1), m = Ee(a, !1), y = o.map(function(g, v) {
        var x = r.getTickValueCoord(g), w = us(us(us(us({
          textAnchor: d,
          transform: "rotate(".concat(90 - s, ", ").concat(x.x, ", ").concat(x.y, ")")
        }, p), {}, {
          stroke: "none",
          fill: c
        }, m), {}, {
          index: v
        }, x), {}, {
          payload: g
        });
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, sf({
          className: Xe("recharts-polar-radius-axis-tick", JF(a)),
          key: "tick-".concat(g.coordinate)
        }, zs(r.props, g, v)), t.renderTickItem(a, w, l ? l(g.value, v) : g.value));
      });
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: "recharts-polar-radius-axis-ticks"
      }, y);
    }
  }, {
    key: "render",
    value: function() {
      var r = this.props, i = r.ticks, o = r.axisLine, a = r.tick;
      return !i || !i.length ? null : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: Xe("recharts-polar-radius-axis", this.props.className)
      }, o && this.renderAxisLine(), a && this.renderTicks(), Sn.renderCallByParent(this.props, this.getViewBox()));
    }
  }], [{
    key: "renderTickItem",
    value: function(r, i, o) {
      var a;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(r) ? a = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(r, i) : ze(r) ? a = r(i) : a = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Vs, sf({}, i, {
        className: "recharts-polar-radius-axis-tick-value"
      }), o), a;
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent);
my(gy, "displayName", "PolarRadiusAxis");
my(gy, "axisType", "radiusAxis");
my(gy, "defaultProps", {
  type: "number",
  radiusAxisId: 0,
  cx: 0,
  cy: 0,
  angle: 0,
  orientation: "right",
  stroke: "#ccc",
  axisLine: !0,
  tick: !0,
  tickCount: 5,
  allowDataOverflow: !1,
  scale: "auto",
  allowDuplicatedCategory: !0
});
function gc(e) {
  "@babel/helpers - typeof";
  return gc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, gc(e);
}
function xs() {
  return xs = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, xs.apply(this, arguments);
}
function GN(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function fs(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? GN(Object(n), !0).forEach(function(r) {
      yy(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : GN(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function RSe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function YN(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, mW(r.key), r);
  }
}
function jSe(e, t, n) {
  return t && YN(e.prototype, t), n && YN(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function LSe(e, t, n) {
  return t = Mm(t), BSe(e, pW() ? Reflect.construct(t, n || [], Mm(e).constructor) : t.apply(e, n));
}
function BSe(e, t) {
  if (t && (gc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return FSe(e);
}
function FSe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function pW() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (pW = function() {
    return !!e;
  })();
}
function Mm(e) {
  return Mm = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, Mm(e);
}
function WSe(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && _w(e, t);
}
function _w(e, t) {
  return _w = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, _w(e, t);
}
function yy(e, t, n) {
  return t = mW(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function mW(e) {
  var t = zSe(e, "string");
  return gc(t) == "symbol" ? t : t + "";
}
function zSe(e, t) {
  if (gc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (gc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var VSe = Math.PI / 180, qN = 1e-5, vy = /* @__PURE__ */ function(e) {
  function t() {
    return RSe(this, t), LSe(this, t, arguments);
  }
  return WSe(t, e), jSe(t, [{
    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
       */
      function(r) {
        var i = this.props, o = i.cx, a = i.cy, s = i.radius, l = i.orientation, c = i.tickSize, f = c || 8, d = Bt(o, a, s, r.coordinate), p = Bt(o, a, s + (l === "inner" ? -1 : 1) * f, r.coordinate);
        return {
          x1: d.x,
          y1: d.y,
          x2: p.x,
          y2: p.y
        };
      }
    )
    /**
     * Get the text-anchor of each tick
     * @param  {Object} data Data of ticks
     * @return {String} text-anchor
     */
  }, {
    key: "getTickTextAnchor",
    value: function(r) {
      var i = this.props.orientation, o = Math.cos(-r.coordinate * VSe), a;
      return o > qN ? a = i === "outer" ? "start" : "end" : o < -qN ? a = i === "outer" ? "end" : "start" : a = "middle", a;
    }
  }, {
    key: "renderAxisLine",
    value: function() {
      var r = this.props, i = r.cx, o = r.cy, a = r.radius, s = r.axisLine, l = r.axisLineType, c = fs(fs({}, Ee(this.props, !1)), {}, {
        fill: "none"
      }, Ee(s, !1));
      if (l === "circle")
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Dd, xs({
          className: "recharts-polar-angle-axis-line"
        }, c, {
          cx: i,
          cy: o,
          r: a
        }));
      var f = this.props.ticks, d = f.map(function(p) {
        return Bt(i, o, a, p.coordinate);
      });
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(iSe, xs({
        className: "recharts-polar-angle-axis-line"
      }, c, {
        points: d
      }));
    }
  }, {
    key: "renderTicks",
    value: function() {
      var r = this, i = this.props, o = i.ticks, a = i.tick, s = i.tickLine, l = i.tickFormatter, c = i.stroke, f = Ee(this.props, !1), d = Ee(a, !1), p = fs(fs({}, f), {}, {
        fill: "none"
      }, Ee(s, !1)), m = o.map(function(y, g) {
        var v = r.getTickLineCoord(y), x = r.getTickTextAnchor(y), w = fs(fs(fs({
          textAnchor: x
        }, f), {}, {
          stroke: "none",
          fill: c
        }, d), {}, {
          index: g,
          payload: y,
          x: v.x2,
          y: v.y2
        });
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, xs({
          className: Xe("recharts-polar-angle-axis-tick", JF(a)),
          key: "tick-".concat(y.coordinate)
        }, zs(r.props, y, g)), s && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("line", xs({
          className: "recharts-polar-angle-axis-tick-line"
        }, p, v)), a && t.renderTickItem(a, w, l ? l(y.value, g) : y.value));
      });
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: "recharts-polar-angle-axis-ticks"
      }, m);
    }
  }, {
    key: "render",
    value: function() {
      var r = this.props, i = r.ticks, o = r.radius, a = r.axisLine;
      return o <= 0 || !i || !i.length ? null : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: Xe("recharts-polar-angle-axis", this.props.className)
      }, a && this.renderAxisLine(), this.renderTicks());
    }
  }], [{
    key: "renderTickItem",
    value: function(r, i, o) {
      var a;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(r) ? a = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(r, i) : ze(r) ? a = r(i) : a = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Vs, xs({}, i, {
        className: "recharts-polar-angle-axis-tick-value"
      }), o), a;
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent);
yy(vy, "displayName", "PolarAngleAxis");
yy(vy, "axisType", "angleAxis");
yy(vy, "defaultProps", {
  type: "category",
  angleAxisId: 0,
  scale: "auto",
  cx: 0,
  cy: 0,
  orientation: "outer",
  axisLine: !0,
  tickLine: !0,
  tickSize: 8,
  tick: !0,
  hide: !1,
  allowDuplicatedCategory: !0
});
var USe = bB, HSe = USe(Object.getPrototypeOf, Object), KSe = HSe, GSe = ea, YSe = KSe, qSe = ta, XSe = "[object Object]", ZSe = Function.prototype, JSe = Object.prototype, gW = ZSe.toString, QSe = JSe.hasOwnProperty, eOe = gW.call(Object);
function tOe(e) {
  if (!qSe(e) || GSe(e) != XSe)
    return !1;
  var t = YSe(e);
  if (t === null)
    return !0;
  var n = QSe.call(t, "constructor") && t.constructor;
  return typeof n == "function" && n instanceof n && gW.call(n) == eOe;
}
var nOe = tOe;
const rOe = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(nOe);
var iOe = ea, oOe = ta, aOe = "[object Boolean]";
function sOe(e) {
  return e === !0 || e === !1 || oOe(e) && iOe(e) == aOe;
}
var lOe = sOe;
const cOe = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(lOe);
function Qf(e) {
  "@babel/helpers - typeof";
  return Qf = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Qf(e);
}
function Nm() {
  return Nm = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Nm.apply(this, arguments);
}
function uOe(e, t) {
  return pOe(e) || hOe(e, t) || dOe(e, t) || fOe();
}
function fOe() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function dOe(e, t) {
  if (e) {
    if (typeof e == "string") return XN(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return XN(e, t);
  }
}
function XN(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function hOe(e, t) {
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (n != null) {
    var r, i, o, a, s = [], l = !0, c = !1;
    try {
      if (o = (n = n.call(e)).next, t !== 0) for (; !(l = (r = o.call(n)).done) && (s.push(r.value), s.length !== t); l = !0) ;
    } catch (f) {
      c = !0, i = f;
    } finally {
      try {
        if (!l && n.return != null && (a = n.return(), Object(a) !== a)) return;
      } finally {
        if (c) throw i;
      }
    }
    return s;
  }
}
function pOe(e) {
  if (Array.isArray(e)) return e;
}
function ZN(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function JN(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? ZN(Object(n), !0).forEach(function(r) {
      mOe(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ZN(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function mOe(e, t, n) {
  return t = gOe(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function gOe(e) {
  var t = yOe(e, "string");
  return Qf(t) == "symbol" ? t : t + "";
}
function yOe(e, t) {
  if (Qf(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Qf(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var QN = function(t, n, r, i, o) {
  var a = r - i, s;
  return s = "M ".concat(t, ",").concat(n), s += "L ".concat(t + r, ",").concat(n), s += "L ".concat(t + r - a / 2, ",").concat(n + o), s += "L ".concat(t + r - a / 2 - i, ",").concat(n + o), s += "L ".concat(t, ",").concat(n, " Z"), s;
}, vOe = {
  x: 0,
  y: 0,
  upperWidth: 0,
  lowerWidth: 0,
  height: 0,
  isUpdateAnimationActive: !1,
  animationBegin: 0,
  animationDuration: 1500,
  animationEasing: "ease"
}, bOe = function(t) {
  var n = JN(JN({}, vOe), t), r = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(), i = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(-1), o = uOe(i, 2), a = o[0], s = o[1];
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function() {
    if (r.current && r.current.getTotalLength)
      try {
        var S = r.current.getTotalLength();
        S && s(S);
      } catch {
      }
  }, []);
  var l = n.x, c = n.y, f = n.upperWidth, d = n.lowerWidth, p = n.height, m = n.className, y = n.animationEasing, g = n.animationDuration, v = n.animationBegin, x = n.isUpdateAnimationActive;
  if (l !== +l || c !== +c || f !== +f || d !== +d || p !== +p || f === 0 && d === 0 || p === 0)
    return null;
  var w = Xe("recharts-trapezoid", m);
  return x ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement($i, {
    canBegin: a > 0,
    from: {
      upperWidth: 0,
      lowerWidth: 0,
      height: p,
      x: l,
      y: c
    },
    to: {
      upperWidth: f,
      lowerWidth: d,
      height: p,
      x: l,
      y: c
    },
    duration: g,
    animationEasing: y,
    isActive: x
  }, function(S) {
    var A = S.upperWidth, _ = S.lowerWidth, O = S.height, P = S.x, C = S.y;
    return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement($i, {
      canBegin: a > 0,
      from: "0px ".concat(a === -1 ? 1 : a, "px"),
      to: "".concat(a, "px 0px"),
      attributeName: "strokeDasharray",
      begin: v,
      duration: g,
      easing: y
    }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", Nm({}, Ee(n, !0), {
      className: w,
      d: QN(P, C, A, _, O),
      ref: r
    })));
  }) : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("g", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("path", Nm({}, Ee(n, !0), {
    className: w,
    d: QN(l, c, f, d, p)
  })));
}, xOe = ["option", "shapeType", "propTransformer", "activeClassName", "isActive"];
function ed(e) {
  "@babel/helpers - typeof";
  return ed = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, ed(e);
}
function wOe(e, t) {
  if (e == null) return {};
  var n = _Oe(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function _Oe(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function e$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function $m(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? e$(Object(n), !0).forEach(function(r) {
      SOe(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : e$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function SOe(e, t, n) {
  return t = OOe(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function OOe(e) {
  var t = AOe(e, "string");
  return ed(t) == "symbol" ? t : t + "";
}
function AOe(e, t) {
  if (ed(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (ed(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function TOe(e, t) {
  return $m($m({}, t), e);
}
function POe(e, t) {
  return e === "symbols";
}
function t$(e) {
  var t = e.shapeType, n = e.elementProps;
  switch (t) {
    case "rectangle":
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(ES, n);
    case "trapezoid":
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(bOe, n);
    case "sector":
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(tW, n);
    case "symbols":
      if (POe(t))
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(H_, n);
      break;
    default:
      return null;
  }
}
function COe(e) {
  return /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(e) ? e.props : e;
}
function yW(e) {
  var t = e.option, n = e.shapeType, r = e.propTransformer, i = r === void 0 ? TOe : r, o = e.activeClassName, a = o === void 0 ? "recharts-active-shape" : o, s = e.isActive, l = wOe(e, xOe), c;
  if (/* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(t))
    c = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(t, $m($m({}, l), COe(t)));
  else if (ze(t))
    c = t(l);
  else if (rOe(t) && !cOe(t)) {
    var f = i(t, l);
    c = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(t$, {
      shapeType: n,
      elementProps: f
    });
  } else {
    var d = l;
    c = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(t$, {
      shapeType: n,
      elementProps: d
    });
  }
  return s ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
    className: a
  }, c) : c;
}
function by(e, t) {
  return t != null && "trapezoids" in e.props;
}
function xy(e, t) {
  return t != null && "sectors" in e.props;
}
function td(e, t) {
  return t != null && "points" in e.props;
}
function EOe(e, t) {
  var n, r, i = e.x === (t == null || (n = t.labelViewBox) === null || n === void 0 ? void 0 : n.x) || e.x === t.x, o = e.y === (t == null || (r = t.labelViewBox) === null || r === void 0 ? void 0 : r.y) || e.y === t.y;
  return i && o;
}
function kOe(e, t) {
  var n = e.endAngle === t.endAngle, r = e.startAngle === t.startAngle;
  return n && r;
}
function MOe(e, t) {
  var n = e.x === t.x, r = e.y === t.y, i = e.z === t.z;
  return n && r && i;
}
function NOe(e, t) {
  var n;
  return by(e, t) ? n = EOe : xy(e, t) ? n = kOe : td(e, t) && (n = MOe), n;
}
function $Oe(e, t) {
  var n;
  return by(e, t) ? n = "trapezoids" : xy(e, t) ? n = "sectors" : td(e, t) && (n = "points"), n;
}
function DOe(e, t) {
  if (by(e, t)) {
    var n;
    return (n = t.tooltipPayload) === null || n === void 0 || (n = n[0]) === null || n === void 0 || (n = n.payload) === null || n === void 0 ? void 0 : n.payload;
  }
  if (xy(e, t)) {
    var r;
    return (r = t.tooltipPayload) === null || r === void 0 || (r = r[0]) === null || r === void 0 || (r = r.payload) === null || r === void 0 ? void 0 : r.payload;
  }
  return td(e, t) ? t.payload : {};
}
function IOe(e) {
  var t = e.activeTooltipItem, n = e.graphicalItem, r = e.itemData, i = $Oe(n, t), o = DOe(n, t), a = r.filter(function(l, c) {
    var f = Us(o, l), d = n.props[i].filter(function(y) {
      var g = NOe(n, t);
      return g(y, t);
    }), p = n.props[i].indexOf(d[d.length - 1]), m = c === p;
    return f && m;
  }), s = r.indexOf(a[a.length - 1]);
  return s;
}
var dp;
function yc(e) {
  "@babel/helpers - typeof";
  return yc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, yc(e);
}
function Fl() {
  return Fl = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Fl.apply(this, arguments);
}
function n$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function Rt(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? n$(Object(n), !0).forEach(function(r) {
      fi(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : n$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function ROe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function r$(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, bW(r.key), r);
  }
}
function jOe(e, t, n) {
  return t && r$(e.prototype, t), n && r$(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function LOe(e, t, n) {
  return t = Dm(t), BOe(e, vW() ? Reflect.construct(t, n || [], Dm(e).constructor) : t.apply(e, n));
}
function BOe(e, t) {
  if (t && (yc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return FOe(e);
}
function FOe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function vW() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (vW = function() {
    return !!e;
  })();
}
function Dm(e) {
  return Dm = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, Dm(e);
}
function WOe(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && Sw(e, t);
}
function Sw(e, t) {
  return Sw = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, Sw(e, t);
}
function fi(e, t, n) {
  return t = bW(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function bW(e) {
  var t = zOe(e, "string");
  return yc(t) == "symbol" ? t : t + "";
}
function zOe(e, t) {
  if (yc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (yc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var ra = /* @__PURE__ */ function(e) {
  function t(n) {
    var r;
    return ROe(this, t), r = LOe(this, t, [n]), fi(r, "pieRef", null), fi(r, "sectorRefs", []), fi(r, "id", tl("recharts-pie-")), fi(r, "handleAnimationEnd", function() {
      var i = r.props.onAnimationEnd;
      r.setState({
        isAnimationFinished: !0
      }), ze(i) && i();
    }), fi(r, "handleAnimationStart", function() {
      var i = r.props.onAnimationStart;
      r.setState({
        isAnimationFinished: !1
      }), ze(i) && i();
    }), r.state = {
      isAnimationFinished: !n.isAnimationActive,
      prevIsAnimationActive: n.isAnimationActive,
      prevAnimationId: n.animationId,
      sectorToFocus: 0
    }, r;
  }
  return WOe(t, e), jOe(t, [{
    key: "isActiveIndex",
    value: function(r) {
      var i = this.props.activeIndex;
      return Array.isArray(i) ? i.indexOf(r) !== -1 : r === i;
    }
  }, {
    key: "hasActiveIndex",
    value: function() {
      var r = this.props.activeIndex;
      return Array.isArray(r) ? r.length !== 0 : r || r === 0;
    }
  }, {
    key: "renderLabels",
    value: function(r) {
      var i = this.props.isAnimationActive;
      if (i && !this.state.isAnimationFinished)
        return null;
      var o = this.props, a = o.label, s = o.labelLine, l = o.dataKey, c = o.valueKey, f = Ee(this.props, !1), d = Ee(a, !1), p = Ee(s, !1), m = a && a.offsetRadius || 20, y = r.map(function(g, v) {
        var x = (g.startAngle + g.endAngle) / 2, w = Bt(g.cx, g.cy, g.outerRadius + m, x), S = Rt(Rt(Rt(Rt({}, f), g), {}, {
          stroke: "none"
        }, d), {}, {
          index: v,
          textAnchor: t.getTextAnchor(w.x, g.cx)
        }, w), A = Rt(Rt(Rt(Rt({}, f), g), {}, {
          fill: "none",
          stroke: g.fill
        }, p), {}, {
          index: v,
          points: [Bt(g.cx, g.cy, g.outerRadius, x), w]
        }), _ = l;
        return Ue(l) && Ue(c) ? _ = "value" : Ue(l) && (_ = c), // eslint-disable-next-line react/no-array-index-key
        /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
          key: "label-".concat(g.startAngle, "-").concat(g.endAngle, "-").concat(g.midAngle, "-").concat(v)
        }, s && t.renderLabelLineItem(s, A, "line"), t.renderLabelItem(a, S, cn(g, _)));
      });
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: "recharts-pie-labels"
      }, y);
    }
  }, {
    key: "renderSectorsStatically",
    value: function(r) {
      var i = this, o = this.props, a = o.activeShape, s = o.blendStroke, l = o.inactiveShape;
      return r.map(function(c, f) {
        if ((c == null ? void 0 : c.startAngle) === 0 && (c == null ? void 0 : c.endAngle) === 0 && r.length !== 1) return null;
        var d = i.isActiveIndex(f), p = l && i.hasActiveIndex() ? l : null, m = d ? a : p, y = Rt(Rt({}, c), {}, {
          stroke: s ? c.fill : c.stroke,
          tabIndex: -1
        });
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, Fl({
          ref: function(v) {
            v && !i.sectorRefs.includes(v) && i.sectorRefs.push(v);
          },
          tabIndex: -1,
          className: "recharts-pie-sector"
        }, zs(i.props, c, f), {
          // eslint-disable-next-line react/no-array-index-key
          key: "sector-".concat(c == null ? void 0 : c.startAngle, "-").concat(c == null ? void 0 : c.endAngle, "-").concat(c.midAngle, "-").concat(f)
        }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(yW, Fl({
          option: m,
          isActive: d,
          shapeType: "sector"
        }, y)));
      });
    }
  }, {
    key: "renderSectorsWithAnimation",
    value: function() {
      var r = this, i = this.props, o = i.sectors, a = i.isAnimationActive, s = i.animationBegin, l = i.animationDuration, c = i.animationEasing, f = i.animationId, d = this.state, p = d.prevSectors, m = d.prevIsAnimationActive;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement($i, {
        begin: s,
        duration: l,
        isActive: a,
        easing: c,
        from: {
          t: 0
        },
        to: {
          t: 1
        },
        key: "pie-".concat(f, "-").concat(m),
        onAnimationStart: this.handleAnimationStart,
        onAnimationEnd: this.handleAnimationEnd
      }, function(y) {
        var g = y.t, v = [], x = o && o[0], w = x.startAngle;
        return o.forEach(function(S, A) {
          var _ = p && p[A], O = A > 0 ? zr(S, "paddingAngle", 0) : 0;
          if (_) {
            var P = _n(_.endAngle - _.startAngle, S.endAngle - S.startAngle), C = Rt(Rt({}, S), {}, {
              startAngle: w + O,
              endAngle: w + P(g) + O
            });
            v.push(C), w = C.endAngle;
          } else {
            var k = S.endAngle, I = S.startAngle, $ = _n(0, k - I), N = $(g), D = Rt(Rt({}, S), {}, {
              startAngle: w + O,
              endAngle: w + N + O
            });
            v.push(D), w = D.endAngle;
          }
        }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, null, r.renderSectorsStatically(v));
      });
    }
  }, {
    key: "attachKeyboardHandlers",
    value: function(r) {
      var i = this;
      r.onkeydown = function(o) {
        if (!o.altKey)
          switch (o.key) {
            case "ArrowLeft": {
              var a = ++i.state.sectorToFocus % i.sectorRefs.length;
              i.sectorRefs[a].focus(), i.setState({
                sectorToFocus: a
              });
              break;
            }
            case "ArrowRight": {
              var s = --i.state.sectorToFocus < 0 ? i.sectorRefs.length - 1 : i.state.sectorToFocus % i.sectorRefs.length;
              i.sectorRefs[s].focus(), i.setState({
                sectorToFocus: s
              });
              break;
            }
            case "Escape": {
              i.sectorRefs[i.state.sectorToFocus].blur(), i.setState({
                sectorToFocus: 0
              });
              break;
            }
          }
      };
    }
  }, {
    key: "renderSectors",
    value: function() {
      var r = this.props, i = r.sectors, o = r.isAnimationActive, a = this.state.prevSectors;
      return o && i && i.length && (!a || !Us(a, i)) ? this.renderSectorsWithAnimation() : this.renderSectorsStatically(i);
    }
  }, {
    key: "componentDidMount",
    value: function() {
      this.pieRef && this.attachKeyboardHandlers(this.pieRef);
    }
  }, {
    key: "render",
    value: function() {
      var r = this, i = this.props, o = i.hide, a = i.sectors, s = i.className, l = i.label, c = i.cx, f = i.cy, d = i.innerRadius, p = i.outerRadius, m = i.isAnimationActive, y = this.state.isAnimationFinished;
      if (o || !a || !a.length || !be(c) || !be(f) || !be(d) || !be(p))
        return null;
      var g = Xe("recharts-pie", s);
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        tabIndex: this.props.rootTabIndex,
        className: g,
        ref: function(x) {
          r.pieRef = x;
        }
      }, this.renderSectors(), l && this.renderLabels(a), Sn.renderCallByParent(this.props, null, !1), (!m || y) && Ji.renderCallByParent(this.props, a, !1));
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function(r, i) {
      return i.prevIsAnimationActive !== r.isAnimationActive ? {
        prevIsAnimationActive: r.isAnimationActive,
        prevAnimationId: r.animationId,
        curSectors: r.sectors,
        prevSectors: [],
        isAnimationFinished: !0
      } : r.isAnimationActive && r.animationId !== i.prevAnimationId ? {
        prevAnimationId: r.animationId,
        curSectors: r.sectors,
        prevSectors: i.curSectors,
        isAnimationFinished: !0
      } : r.sectors !== i.curSectors ? {
        curSectors: r.sectors,
        isAnimationFinished: !0
      } : null;
    }
  }, {
    key: "getTextAnchor",
    value: function(r, i) {
      return r > i ? "start" : r < i ? "end" : "middle";
    }
  }, {
    key: "renderLabelLineItem",
    value: function(r, i, o) {
      if (/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(r))
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(r, i);
      if (ze(r))
        return r(i);
      var a = Xe("recharts-pie-label-line", typeof r != "boolean" ? r.className : "");
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Ds, Fl({}, i, {
        key: o,
        type: "linear",
        className: a
      }));
    }
  }, {
    key: "renderLabelItem",
    value: function(r, i, o) {
      if (/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(r))
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(r, i);
      var a = o;
      if (ze(r) && (a = r(i), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(a)))
        return a;
      var s = Xe("recharts-pie-label-text", typeof r != "boolean" && !ze(r) ? r.className : "");
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Vs, Fl({}, i, {
        alignmentBaseline: "middle",
        className: s
      }), a);
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent);
dp = ra;
fi(ra, "displayName", "Pie");
fi(ra, "defaultProps", {
  stroke: "#fff",
  fill: "#808080",
  legendType: "rect",
  cx: "50%",
  cy: "50%",
  startAngle: 0,
  endAngle: 360,
  innerRadius: 0,
  outerRadius: "80%",
  paddingAngle: 0,
  labelLine: !0,
  hide: !1,
  minAngle: 0,
  isAnimationActive: !Ni.isSsr,
  animationBegin: 400,
  animationDuration: 1500,
  animationEasing: "ease",
  nameKey: "name",
  blendStroke: !1,
  rootTabIndex: 0
});
fi(ra, "parseDeltaAngle", function(e, t) {
  var n = fr(t - e), r = Math.min(Math.abs(t - e), 360);
  return n * r;
});
fi(ra, "getRealPieData", function(e) {
  var t = e.data, n = e.children, r = Ee(e, !1), i = Vr(n, nS);
  return t && t.length ? t.map(function(o, a) {
    return Rt(Rt(Rt({
      payload: o
    }, r), o), i && i[a] && i[a].props);
  }) : i && i.length ? i.map(function(o) {
    return Rt(Rt({}, r), o.props);
  }) : [];
});
fi(ra, "parseCoordinateOfPie", function(e, t) {
  var n = t.top, r = t.left, i = t.width, o = t.height, a = ZF(i, o), s = r + dr(e.cx, i, i / 2), l = n + dr(e.cy, o, o / 2), c = dr(e.innerRadius, a, 0), f = dr(e.outerRadius, a, a * 0.8), d = e.maxRadius || Math.sqrt(i * i + o * o) / 2;
  return {
    cx: s,
    cy: l,
    innerRadius: c,
    outerRadius: f,
    maxRadius: d
  };
});
fi(ra, "getComposedData", function(e) {
  var t = e.item, n = e.offset, r = t.type.defaultProps !== void 0 ? Rt(Rt({}, t.type.defaultProps), t.props) : t.props, i = dp.getRealPieData(r);
  if (!i || !i.length)
    return null;
  var o = r.cornerRadius, a = r.startAngle, s = r.endAngle, l = r.paddingAngle, c = r.dataKey, f = r.nameKey, d = r.valueKey, p = r.tooltipType, m = Math.abs(r.minAngle), y = dp.parseCoordinateOfPie(r, n), g = dp.parseDeltaAngle(a, s), v = Math.abs(g), x = c;
  Ue(c) && Ue(d) ? (Mi(!1, `Use "dataKey" to specify the value of pie,
      the props "valueKey" will be deprecated in 1.1.0`), x = "value") : Ue(c) && (Mi(!1, `Use "dataKey" to specify the value of pie,
      the props "valueKey" will be deprecated in 1.1.0`), x = d);
  var w = i.filter(function(C) {
    return cn(C, x, 0) !== 0;
  }).length, S = (v >= 360 ? w : w - 1) * l, A = v - w * m - S, _ = i.reduce(function(C, k) {
    var I = cn(k, x, 0);
    return C + (be(I) ? I : 0);
  }, 0), O;
  if (_ > 0) {
    var P;
    O = i.map(function(C, k) {
      var I = cn(C, x, 0), $ = cn(C, f, k), N = (be(I) ? I : 0) / _, D;
      k ? D = P.endAngle + fr(g) * l * (I !== 0 ? 1 : 0) : D = a;
      var j = D + fr(g) * ((I !== 0 ? m : 0) + N * A), F = (D + j) / 2, W = (y.innerRadius + y.outerRadius) / 2, z = [{
        name: $,
        value: I,
        payload: C,
        dataKey: x,
        type: p
      }], H = Bt(y.cx, y.cy, W, F);
      return P = Rt(Rt(Rt({
        percent: N,
        cornerRadius: o,
        name: $,
        tooltipPayload: z,
        midAngle: F,
        middleRadius: W,
        tooltipPosition: H
      }, C), y), {}, {
        value: cn(C, x),
        startAngle: D,
        endAngle: j,
        payload: C,
        paddingAngle: fr(g) * l
      }), P;
    });
  }
  return Rt(Rt({}, y), {}, {
    sectors: O,
    data: i
  });
});
var VOe = Math.ceil, UOe = Math.max;
function HOe(e, t, n, r) {
  for (var i = -1, o = UOe(VOe((t - e) / (n || 1)), 0), a = Array(o); o--; )
    a[r ? o : ++i] = e, e += n;
  return a;
}
var KOe = HOe, GOe = LB, i$ = 1 / 0, YOe = 17976931348623157e292;
function qOe(e) {
  if (!e)
    return e === 0 ? e : 0;
  if (e = GOe(e), e === i$ || e === -i$) {
    var t = e < 0 ? -1 : 1;
    return t * YOe;
  }
  return e === e ? e : 0;
}
var xW = qOe, XOe = KOe, ZOe = iy, i0 = xW;
function JOe(e) {
  return function(t, n, r) {
    return r && typeof r != "number" && ZOe(t, n, r) && (n = r = void 0), t = i0(t), n === void 0 ? (n = t, t = 0) : n = i0(n), r = r === void 0 ? t < n ? 1 : -1 : i0(r), XOe(t, n, r, e);
  };
}
var QOe = JOe, eAe = QOe, tAe = eAe(), nAe = tAe;
const Im = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(nAe);
function nd(e) {
  "@babel/helpers - typeof";
  return nd = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, nd(e);
}
function o$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function a$(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? o$(Object(n), !0).forEach(function(r) {
      wW(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : o$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function wW(e, t, n) {
  return t = rAe(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function rAe(e) {
  var t = iAe(e, "string");
  return nd(t) == "symbol" ? t : t + "";
}
function iAe(e, t) {
  if (nd(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (nd(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var oAe = ["Webkit", "Moz", "O", "ms"], aAe = function(t, n) {
  var r = t.replace(/(\w)/, function(o) {
    return o.toUpperCase();
  }), i = oAe.reduce(function(o, a) {
    return a$(a$({}, o), {}, wW({}, a + r, n));
  }, {});
  return i[t] = n, i;
};
function vc(e) {
  "@babel/helpers - typeof";
  return vc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, vc(e);
}
function Rm() {
  return Rm = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Rm.apply(this, arguments);
}
function s$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function o0(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? s$(Object(n), !0).forEach(function(r) {
      Rr(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : s$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function sAe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function l$(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, SW(r.key), r);
  }
}
function lAe(e, t, n) {
  return t && l$(e.prototype, t), n && l$(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function cAe(e, t, n) {
  return t = jm(t), uAe(e, _W() ? Reflect.construct(t, n || [], jm(e).constructor) : t.apply(e, n));
}
function uAe(e, t) {
  if (t && (vc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return fAe(e);
}
function fAe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function _W() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (_W = function() {
    return !!e;
  })();
}
function jm(e) {
  return jm = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, jm(e);
}
function dAe(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && Ow(e, t);
}
function Ow(e, t) {
  return Ow = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, Ow(e, t);
}
function Rr(e, t, n) {
  return t = SW(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function SW(e) {
  var t = hAe(e, "string");
  return vc(t) == "symbol" ? t : t + "";
}
function hAe(e, t) {
  if (vc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (vc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var pAe = function(t) {
  var n = t.data, r = t.startIndex, i = t.endIndex, o = t.x, a = t.width, s = t.travellerWidth;
  if (!n || !n.length)
    return {};
  var l = n.length, c = nf().domain(Im(0, l)).range([o, o + a - s]), f = c.domain().map(function(d) {
    return c(d);
  });
  return {
    isTextActive: !1,
    isSlideMoving: !1,
    isTravellerMoving: !1,
    isTravellerFocused: !1,
    startX: c(r),
    endX: c(i),
    scale: c,
    scaleValues: f
  };
}, c$ = function(t) {
  return t.changedTouches && !!t.changedTouches.length;
}, bc = /* @__PURE__ */ function(e) {
  function t(n) {
    var r;
    return sAe(this, t), r = cAe(this, t, [n]), Rr(r, "handleDrag", function(i) {
      r.leaveTimer && (clearTimeout(r.leaveTimer), r.leaveTimer = null), r.state.isTravellerMoving ? r.handleTravellerMove(i) : r.state.isSlideMoving && r.handleSlideDrag(i);
    }), Rr(r, "handleTouchMove", function(i) {
      i.changedTouches != null && i.changedTouches.length > 0 && r.handleDrag(i.changedTouches[0]);
    }), Rr(r, "handleDragEnd", function() {
      r.setState({
        isTravellerMoving: !1,
        isSlideMoving: !1
      }, function() {
        var i = r.props, o = i.endIndex, a = i.onDragEnd, s = i.startIndex;
        a == null || a({
          endIndex: o,
          startIndex: s
        });
      }), r.detachDragEndListener();
    }), Rr(r, "handleLeaveWrapper", function() {
      (r.state.isTravellerMoving || r.state.isSlideMoving) && (r.leaveTimer = window.setTimeout(r.handleDragEnd, r.props.leaveTimeOut));
    }), Rr(r, "handleEnterSlideOrTraveller", function() {
      r.setState({
        isTextActive: !0
      });
    }), Rr(r, "handleLeaveSlideOrTraveller", function() {
      r.setState({
        isTextActive: !1
      });
    }), Rr(r, "handleSlideDragStart", function(i) {
      var o = c$(i) ? i.changedTouches[0] : i;
      r.setState({
        isTravellerMoving: !1,
        isSlideMoving: !0,
        slideMoveStartX: o.pageX
      }), r.attachDragEndListener();
    }), r.travellerDragStartHandlers = {
      startX: r.handleTravellerDragStart.bind(r, "startX"),
      endX: r.handleTravellerDragStart.bind(r, "endX")
    }, r.state = {}, r;
  }
  return dAe(t, e), lAe(t, [{
    key: "componentWillUnmount",
    value: function() {
      this.leaveTimer && (clearTimeout(this.leaveTimer), this.leaveTimer = null), this.detachDragEndListener();
    }
  }, {
    key: "getIndex",
    value: function(r) {
      var i = r.startX, o = r.endX, a = this.state.scaleValues, s = this.props, l = s.gap, c = s.data, f = c.length - 1, d = Math.min(i, o), p = Math.max(i, o), m = t.getIndexInRange(a, d), y = t.getIndexInRange(a, p);
      return {
        startIndex: m - m % l,
        endIndex: y === f ? f : y - y % l
      };
    }
  }, {
    key: "getTextOfTick",
    value: function(r) {
      var i = this.props, o = i.data, a = i.tickFormatter, s = i.dataKey, l = cn(o[r], s, r);
      return ze(a) ? a(l, r) : l;
    }
  }, {
    key: "attachDragEndListener",
    value: function() {
      window.addEventListener("mouseup", this.handleDragEnd, !0), window.addEventListener("touchend", this.handleDragEnd, !0), window.addEventListener("mousemove", this.handleDrag, !0);
    }
  }, {
    key: "detachDragEndListener",
    value: function() {
      window.removeEventListener("mouseup", this.handleDragEnd, !0), window.removeEventListener("touchend", this.handleDragEnd, !0), window.removeEventListener("mousemove", this.handleDrag, !0);
    }
  }, {
    key: "handleSlideDrag",
    value: function(r) {
      var i = this.state, o = i.slideMoveStartX, a = i.startX, s = i.endX, l = this.props, c = l.x, f = l.width, d = l.travellerWidth, p = l.startIndex, m = l.endIndex, y = l.onChange, g = r.pageX - o;
      g > 0 ? g = Math.min(g, c + f - d - s, c + f - d - a) : g < 0 && (g = Math.max(g, c - a, c - s));
      var v = this.getIndex({
        startX: a + g,
        endX: s + g
      });
      (v.startIndex !== p || v.endIndex !== m) && y && y(v), this.setState({
        startX: a + g,
        endX: s + g,
        slideMoveStartX: r.pageX
      });
    }
  }, {
    key: "handleTravellerDragStart",
    value: function(r, i) {
      var o = c$(i) ? i.changedTouches[0] : i;
      this.setState({
        isSlideMoving: !1,
        isTravellerMoving: !0,
        movingTravellerId: r,
        brushMoveStartX: o.pageX
      }), this.attachDragEndListener();
    }
  }, {
    key: "handleTravellerMove",
    value: function(r) {
      var i = this.state, o = i.brushMoveStartX, a = i.movingTravellerId, s = i.endX, l = i.startX, c = this.state[a], f = this.props, d = f.x, p = f.width, m = f.travellerWidth, y = f.onChange, g = f.gap, v = f.data, x = {
        startX: this.state.startX,
        endX: this.state.endX
      }, w = r.pageX - o;
      w > 0 ? w = Math.min(w, d + p - m - c) : w < 0 && (w = Math.max(w, d - c)), x[a] = c + w;
      var S = this.getIndex(x), A = S.startIndex, _ = S.endIndex, O = function() {
        var C = v.length - 1;
        return a === "startX" && (s > l ? A % g === 0 : _ % g === 0) || s < l && _ === C || a === "endX" && (s > l ? _ % g === 0 : A % g === 0) || s > l && _ === C;
      };
      this.setState(Rr(Rr({}, a, c + w), "brushMoveStartX", r.pageX), function() {
        y && O() && y(S);
      });
    }
  }, {
    key: "handleTravellerMoveKeyboard",
    value: function(r, i) {
      var o = this, a = this.state, s = a.scaleValues, l = a.startX, c = a.endX, f = this.state[i], d = s.indexOf(f);
      if (d !== -1) {
        var p = d + r;
        if (!(p === -1 || p >= s.length)) {
          var m = s[p];
          i === "startX" && m >= c || i === "endX" && m <= l || this.setState(Rr({}, i, m), function() {
            o.props.onChange(o.getIndex({
              startX: o.state.startX,
              endX: o.state.endX
            }));
          });
        }
      }
    }
  }, {
    key: "renderBackground",
    value: function() {
      var r = this.props, i = r.x, o = r.y, a = r.width, s = r.height, l = r.fill, c = r.stroke;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
        stroke: c,
        fill: l,
        x: i,
        y: o,
        width: a,
        height: s
      });
    }
  }, {
    key: "renderPanorama",
    value: function() {
      var r = this.props, i = r.x, o = r.y, a = r.width, s = r.height, l = r.data, c = r.children, f = r.padding, d = react__WEBPACK_IMPORTED_MODULE_1__.Children.only(c);
      return d ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(d, {
        x: i,
        y: o,
        width: a,
        height: s,
        margin: f,
        compact: !0,
        data: l
      }) : null;
    }
  }, {
    key: "renderTravellerLayer",
    value: function(r, i) {
      var o, a, s = this, l = this.props, c = l.y, f = l.travellerWidth, d = l.height, p = l.traveller, m = l.ariaLabel, y = l.data, g = l.startIndex, v = l.endIndex, x = Math.max(r, this.props.x), w = o0(o0({}, Ee(this.props, !1)), {}, {
        x,
        y: c,
        width: f,
        height: d
      }), S = m || "Min value: ".concat((o = y[g]) === null || o === void 0 ? void 0 : o.name, ", Max value: ").concat((a = y[v]) === null || a === void 0 ? void 0 : a.name);
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        tabIndex: 0,
        role: "slider",
        "aria-label": S,
        "aria-valuenow": r,
        className: "recharts-brush-traveller",
        onMouseEnter: this.handleEnterSlideOrTraveller,
        onMouseLeave: this.handleLeaveSlideOrTraveller,
        onMouseDown: this.travellerDragStartHandlers[i],
        onTouchStart: this.travellerDragStartHandlers[i],
        onKeyDown: function(_) {
          ["ArrowLeft", "ArrowRight"].includes(_.key) && (_.preventDefault(), _.stopPropagation(), s.handleTravellerMoveKeyboard(_.key === "ArrowRight" ? 1 : -1, i));
        },
        onFocus: function() {
          s.setState({
            isTravellerFocused: !0
          });
        },
        onBlur: function() {
          s.setState({
            isTravellerFocused: !1
          });
        },
        style: {
          cursor: "col-resize"
        }
      }, t.renderTraveller(p, w));
    }
  }, {
    key: "renderSlide",
    value: function(r, i) {
      var o = this.props, a = o.y, s = o.height, l = o.stroke, c = o.travellerWidth, f = Math.min(r, i) + c, d = Math.max(Math.abs(i - r) - c, 0);
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
        className: "recharts-brush-slide",
        onMouseEnter: this.handleEnterSlideOrTraveller,
        onMouseLeave: this.handleLeaveSlideOrTraveller,
        onMouseDown: this.handleSlideDragStart,
        onTouchStart: this.handleSlideDragStart,
        style: {
          cursor: "move"
        },
        stroke: "none",
        fill: l,
        fillOpacity: 0.2,
        x: f,
        y: a,
        width: d,
        height: s
      });
    }
  }, {
    key: "renderText",
    value: function() {
      var r = this.props, i = r.startIndex, o = r.endIndex, a = r.y, s = r.height, l = r.travellerWidth, c = r.stroke, f = this.state, d = f.startX, p = f.endX, m = 5, y = {
        pointerEvents: "none",
        fill: c
      };
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: "recharts-brush-texts"
      }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Vs, Rm({
        textAnchor: "end",
        verticalAnchor: "middle",
        x: Math.min(d, p) - m,
        y: a + s / 2
      }, y), this.getTextOfTick(i)), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Vs, Rm({
        textAnchor: "start",
        verticalAnchor: "middle",
        x: Math.max(d, p) + l + m,
        y: a + s / 2
      }, y), this.getTextOfTick(o)));
    }
  }, {
    key: "render",
    value: function() {
      var r = this.props, i = r.data, o = r.className, a = r.children, s = r.x, l = r.y, c = r.width, f = r.height, d = r.alwaysShowText, p = this.state, m = p.startX, y = p.endX, g = p.isTextActive, v = p.isSlideMoving, x = p.isTravellerMoving, w = p.isTravellerFocused;
      if (!i || !i.length || !be(s) || !be(l) || !be(c) || !be(f) || c <= 0 || f <= 0)
        return null;
      var S = Xe("recharts-brush", o), A = react__WEBPACK_IMPORTED_MODULE_1__.Children.count(a) === 1, _ = aAe("userSelect", "none");
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: S,
        onMouseLeave: this.handleLeaveWrapper,
        onTouchMove: this.handleTouchMove,
        style: _
      }, this.renderBackground(), A && this.renderPanorama(), this.renderSlide(m, y), this.renderTravellerLayer(m, "startX"), this.renderTravellerLayer(y, "endX"), (g || v || x || w || d) && this.renderText());
    }
  }], [{
    key: "renderDefaultTraveller",
    value: function(r) {
      var i = r.x, o = r.y, a = r.width, s = r.height, l = r.stroke, c = Math.floor(o + s / 2) - 1;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
        x: i,
        y: o,
        width: a,
        height: s,
        fill: l,
        stroke: "none"
      }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("line", {
        x1: i + 1,
        y1: c,
        x2: i + a - 1,
        y2: c,
        fill: "none",
        stroke: "#fff"
      }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("line", {
        x1: i + 1,
        y1: c + 2,
        x2: i + a - 1,
        y2: c + 2,
        fill: "none",
        stroke: "#fff"
      }));
    }
  }, {
    key: "renderTraveller",
    value: function(r, i) {
      var o;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(r) ? o = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(r, i) : ze(r) ? o = r(i) : o = t.renderDefaultTraveller(i), o;
    }
  }, {
    key: "getDerivedStateFromProps",
    value: function(r, i) {
      var o = r.data, a = r.width, s = r.x, l = r.travellerWidth, c = r.updateId, f = r.startIndex, d = r.endIndex;
      if (o !== i.prevData || c !== i.prevUpdateId)
        return o0({
          prevData: o,
          prevTravellerWidth: l,
          prevUpdateId: c,
          prevX: s,
          prevWidth: a
        }, o && o.length ? pAe({
          data: o,
          width: a,
          x: s,
          travellerWidth: l,
          startIndex: f,
          endIndex: d
        }) : {
          scale: null,
          scaleValues: null
        });
      if (i.scale && (a !== i.prevWidth || s !== i.prevX || l !== i.prevTravellerWidth)) {
        i.scale.range([s, s + a - l]);
        var p = i.scale.domain().map(function(m) {
          return i.scale(m);
        });
        return {
          prevData: o,
          prevTravellerWidth: l,
          prevUpdateId: c,
          prevX: s,
          prevWidth: a,
          startX: i.scale(r.startIndex),
          endX: i.scale(r.endIndex),
          scaleValues: p
        };
      }
      return null;
    }
  }, {
    key: "getIndexInRange",
    value: function(r, i) {
      for (var o = r.length, a = 0, s = o - 1; s - a > 1; ) {
        var l = Math.floor((a + s) / 2);
        r[l] > i ? s = l : a = l;
      }
      return i >= r[s] ? s : a;
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent);
Rr(bc, "displayName", "Brush");
Rr(bc, "defaultProps", {
  height: 40,
  travellerWidth: 5,
  gap: 1,
  fill: "#fff",
  stroke: "#666",
  padding: {
    top: 1,
    right: 1,
    bottom: 1,
    left: 1
  },
  leaveTimeOut: 1e3,
  alwaysShowText: !1
});
var mAe = J_;
function gAe(e, t) {
  var n;
  return mAe(e, function(r, i, o) {
    return n = t(r, i, o), !n;
  }), !!n;
}
var yAe = gAe, vAe = fB, bAe = so, xAe = yAe, wAe = Tr, _Ae = iy;
function SAe(e, t, n) {
  var r = wAe(e) ? vAe : xAe;
  return n && _Ae(e, t, n) && (t = void 0), r(e, bAe(t));
}
var OAe = SAe;
const AAe = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(OAe);
var Qi = function(t, n) {
  var r = t.alwaysShow, i = t.ifOverflow;
  return r && (i = "extendDomain"), i === n;
}, u$ = $B;
function TAe(e, t, n) {
  t == "__proto__" && u$ ? u$(e, t, {
    configurable: !0,
    enumerable: !0,
    value: n,
    writable: !0
  }) : e[t] = n;
}
var PAe = TAe, CAe = PAe, EAe = MB, kAe = so;
function MAe(e, t) {
  var n = {};
  return t = kAe(t), EAe(e, function(r, i, o) {
    CAe(n, i, t(r, i, o));
  }), n;
}
var NAe = MAe;
const $Ae = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(NAe);
function DAe(e, t) {
  for (var n = -1, r = e == null ? 0 : e.length; ++n < r; )
    if (!t(e[n], n, e))
      return !1;
  return !0;
}
var IAe = DAe, RAe = J_;
function jAe(e, t) {
  var n = !0;
  return RAe(e, function(r, i, o) {
    return n = !!t(r, i, o), n;
  }), n;
}
var LAe = jAe, BAe = IAe, FAe = LAe, WAe = so, zAe = Tr, VAe = iy;
function UAe(e, t, n) {
  var r = zAe(e) ? BAe : FAe;
  return n && VAe(e, t, n) && (t = void 0), r(e, WAe(t));
}
var HAe = UAe;
const OW = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(HAe);
var KAe = ["x", "y"];
function xc(e) {
  "@babel/helpers - typeof";
  return xc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, xc(e);
}
function Aw() {
  return Aw = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Aw.apply(this, arguments);
}
function f$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function Ru(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? f$(Object(n), !0).forEach(function(r) {
      GAe(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : f$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function GAe(e, t, n) {
  return t = YAe(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function YAe(e) {
  var t = qAe(e, "string");
  return xc(t) == "symbol" ? t : t + "";
}
function qAe(e, t) {
  if (xc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (xc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function XAe(e, t) {
  if (e == null) return {};
  var n = ZAe(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function ZAe(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function JAe(e, t) {
  var n = e.x, r = e.y, i = XAe(e, KAe), o = "".concat(n), a = parseInt(o, 10), s = "".concat(r), l = parseInt(s, 10), c = "".concat(t.height || i.height), f = parseInt(c, 10), d = "".concat(t.width || i.width), p = parseInt(d, 10);
  return Ru(Ru(Ru(Ru(Ru({}, t), i), a ? {
    x: a
  } : {}), l ? {
    y: l
  } : {}), {}, {
    height: f,
    width: p,
    name: t.name,
    radius: t.radius
  });
}
function d$(e) {
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(yW, Aw({
    shapeType: "rectangle",
    propTransformer: JAe,
    activeClassName: "recharts-active-bar"
  }, e));
}
var QAe = function(t) {
  var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
  return function(r, i) {
    if (typeof t == "number") return t;
    var o = typeof r == "number";
    return o ? t(r, i) : (o || ( true ? Sr(!1, "minPointSize callback function received a value with type of ".concat(xc(r), ". Currently only numbers are supported.")) : 0), n);
  };
}, eTe = ["value", "background"], AW;
function wc(e) {
  "@babel/helpers - typeof";
  return wc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, wc(e);
}
function tTe(e, t) {
  if (e == null) return {};
  var n = nTe(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function nTe(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function Lm() {
  return Lm = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Lm.apply(this, arguments);
}
function h$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function dn(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? h$(Object(n), !0).forEach(function(r) {
      Pa(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : h$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function rTe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function p$(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, PW(r.key), r);
  }
}
function iTe(e, t, n) {
  return t && p$(e.prototype, t), n && p$(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function oTe(e, t, n) {
  return t = Bm(t), aTe(e, TW() ? Reflect.construct(t, n || [], Bm(e).constructor) : t.apply(e, n));
}
function aTe(e, t) {
  if (t && (wc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return sTe(e);
}
function sTe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function TW() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (TW = function() {
    return !!e;
  })();
}
function Bm(e) {
  return Bm = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, Bm(e);
}
function lTe(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && Tw(e, t);
}
function Tw(e, t) {
  return Tw = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, Tw(e, t);
}
function Pa(e, t, n) {
  return t = PW(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function PW(e) {
  var t = cTe(e, "string");
  return wc(t) == "symbol" ? t : t + "";
}
function cTe(e, t) {
  if (wc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (wc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var il = /* @__PURE__ */ function(e) {
  function t() {
    var n;
    rTe(this, t);
    for (var r = arguments.length, i = new Array(r), o = 0; o < r; o++)
      i[o] = arguments[o];
    return n = oTe(this, t, [].concat(i)), Pa(n, "state", {
      isAnimationFinished: !1
    }), Pa(n, "id", tl("recharts-bar-")), Pa(n, "handleAnimationEnd", function() {
      var a = n.props.onAnimationEnd;
      n.setState({
        isAnimationFinished: !0
      }), a && a();
    }), Pa(n, "handleAnimationStart", function() {
      var a = n.props.onAnimationStart;
      n.setState({
        isAnimationFinished: !1
      }), a && a();
    }), n;
  }
  return lTe(t, e), iTe(t, [{
    key: "renderRectanglesStatically",
    value: function(r) {
      var i = this, o = this.props, a = o.shape, s = o.dataKey, l = o.activeIndex, c = o.activeBar, f = Ee(this.props, !1);
      return r && r.map(function(d, p) {
        var m = p === l, y = m ? c : a, g = dn(dn(dn({}, f), d), {}, {
          isActive: m,
          option: y,
          index: p,
          dataKey: s,
          onAnimationStart: i.handleAnimationStart,
          onAnimationEnd: i.handleAnimationEnd
        });
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, Lm({
          className: "recharts-bar-rectangle"
        }, zs(i.props, d, p), {
          key: "rectangle-".concat(d == null ? void 0 : d.x, "-").concat(d == null ? void 0 : d.y, "-").concat(d == null ? void 0 : d.value)
        }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(d$, g));
      });
    }
  }, {
    key: "renderRectanglesWithAnimation",
    value: function() {
      var r = this, i = this.props, o = i.data, a = i.layout, s = i.isAnimationActive, l = i.animationBegin, c = i.animationDuration, f = i.animationEasing, d = i.animationId, p = this.state.prevData;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement($i, {
        begin: l,
        duration: c,
        isActive: s,
        easing: f,
        from: {
          t: 0
        },
        to: {
          t: 1
        },
        key: "bar-".concat(d),
        onAnimationEnd: this.handleAnimationEnd,
        onAnimationStart: this.handleAnimationStart
      }, function(m) {
        var y = m.t, g = o.map(function(v, x) {
          var w = p && p[x];
          if (w) {
            var S = _n(w.x, v.x), A = _n(w.y, v.y), _ = _n(w.width, v.width), O = _n(w.height, v.height);
            return dn(dn({}, v), {}, {
              x: S(y),
              y: A(y),
              width: _(y),
              height: O(y)
            });
          }
          if (a === "horizontal") {
            var P = _n(0, v.height), C = P(y);
            return dn(dn({}, v), {}, {
              y: v.y + v.height - C,
              height: C
            });
          }
          var k = _n(0, v.width), I = k(y);
          return dn(dn({}, v), {}, {
            width: I
          });
        });
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, null, r.renderRectanglesStatically(g));
      });
    }
  }, {
    key: "renderRectangles",
    value: function() {
      var r = this.props, i = r.data, o = r.isAnimationActive, a = this.state.prevData;
      return o && i && i.length && (!a || !Us(a, i)) ? this.renderRectanglesWithAnimation() : this.renderRectanglesStatically(i);
    }
  }, {
    key: "renderBackground",
    value: function() {
      var r = this, i = this.props, o = i.data, a = i.dataKey, s = i.activeIndex, l = Ee(this.props.background, !1);
      return o.map(function(c, f) {
        c.value;
        var d = c.background, p = tTe(c, eTe);
        if (!d)
          return null;
        var m = dn(dn(dn(dn(dn({}, p), {}, {
          fill: "#eee"
        }, d), l), zs(r.props, c, f)), {}, {
          onAnimationStart: r.handleAnimationStart,
          onAnimationEnd: r.handleAnimationEnd,
          dataKey: a,
          index: f,
          className: "recharts-bar-background-rectangle"
        });
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(d$, Lm({
          key: "background-bar-".concat(f),
          option: r.props.background,
          isActive: f === s
        }, m));
      });
    }
  }, {
    key: "renderErrorBar",
    value: function(r, i) {
      if (this.props.isAnimationActive && !this.state.isAnimationFinished)
        return null;
      var o = this.props, a = o.data, s = o.xAxis, l = o.yAxis, c = o.layout, f = o.children, d = Vr(f, $d);
      if (!d)
        return null;
      var p = c === "vertical" ? a[0].height / 2 : a[0].width / 2, m = function(v, x) {
        var w = Array.isArray(v.value) ? v.value[1] : v.value;
        return {
          x: v.x,
          y: v.y,
          value: w,
          errorVal: cn(v, x)
        };
      }, y = {
        clipPath: r ? "url(#clipPath-".concat(i, ")") : null
      };
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, y, d.map(function(g) {
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(g, {
          key: "error-bar-".concat(i, "-").concat(g.props.dataKey),
          data: a,
          xAxis: s,
          yAxis: l,
          layout: c,
          offset: p,
          dataPointFormatter: m
        });
      }));
    }
  }, {
    key: "render",
    value: function() {
      var r = this.props, i = r.hide, o = r.data, a = r.className, s = r.xAxis, l = r.yAxis, c = r.left, f = r.top, d = r.width, p = r.height, m = r.isAnimationActive, y = r.background, g = r.id;
      if (i || !o || !o.length)
        return null;
      var v = this.state.isAnimationFinished, x = Xe("recharts-bar", a), w = s && s.allowDataOverflow, S = l && l.allowDataOverflow, A = w || S, _ = Ue(g) ? this.id : g;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: x
      }, w || S ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("defs", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("clipPath", {
        id: "clipPath-".concat(_)
      }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
        x: w ? c : c - d / 2,
        y: S ? f : f - p / 2,
        width: w ? d : d * 2,
        height: S ? p : p * 2
      }))) : null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: "recharts-bar-rectangles",
        clipPath: A ? "url(#clipPath-".concat(_, ")") : null
      }, y ? this.renderBackground() : null, this.renderRectangles()), this.renderErrorBar(A, _), (!m || v) && Ji.renderCallByParent(this.props, o));
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function(r, i) {
      return r.animationId !== i.prevAnimationId ? {
        prevAnimationId: r.animationId,
        curData: r.data,
        prevData: i.curData
      } : r.data !== i.curData ? {
        curData: r.data
      } : null;
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent);
AW = il;
Pa(il, "displayName", "Bar");
Pa(il, "defaultProps", {
  xAxisId: 0,
  yAxisId: 0,
  legendType: "rect",
  minPointSize: 0,
  hide: !1,
  data: [],
  layout: "vertical",
  activeBar: !1,
  isAnimationActive: !Ni.isSsr,
  animationBegin: 0,
  animationDuration: 400,
  animationEasing: "ease"
});
Pa(il, "getComposedData", function(e) {
  var t = e.props, n = e.item, r = e.barPosition, i = e.bandSize, o = e.xAxis, a = e.yAxis, s = e.xAxisTicks, l = e.yAxisTicks, c = e.stackedData, f = e.dataStartIndex, d = e.displayedData, p = e.offset, m = Yxe(r, n);
  if (!m)
    return null;
  var y = t.layout, g = n.type.defaultProps, v = g !== void 0 ? dn(dn({}, g), n.props) : n.props, x = v.dataKey, w = v.children, S = v.minPointSize, A = y === "horizontal" ? a : o, _ = c ? A.scale.domain() : null, O = twe({
    numericAxis: A
  }), P = Vr(w, nS), C = d.map(function(k, I) {
    var $, N, D, j, F, W;
    c ? $ = qxe(c[f + I], _) : ($ = cn(k, x), Array.isArray($) || ($ = [O, $]));
    var z = QAe(S, AW.defaultProps.minPointSize)($[1], I);
    if (y === "horizontal") {
      var H, U = [a.scale($[0]), a.scale($[1])], V = U[0], Y = U[1];
      N = YM({
        axis: o,
        ticks: s,
        bandSize: i,
        offset: m.offset,
        entry: k,
        index: I
      }), D = (H = Y ?? V) !== null && H !== void 0 ? H : void 0, j = m.size;
      var Q = V - Y;
      if (F = Number.isNaN(Q) ? 0 : Q, W = {
        x: N,
        y: a.y,
        width: j,
        height: a.height
      }, Math.abs(z) > 0 && Math.abs(F) < Math.abs(z)) {
        var ne = fr(F || z) * (Math.abs(z) - Math.abs(F));
        D -= ne, F += ne;
      }
    } else {
      var re = [o.scale($[0]), o.scale($[1])], ce = re[0], oe = re[1];
      if (N = ce, D = YM({
        axis: a,
        ticks: l,
        bandSize: i,
        offset: m.offset,
        entry: k,
        index: I
      }), j = oe - ce, F = m.size, W = {
        x: o.x,
        y: D,
        width: o.width,
        height: F
      }, Math.abs(z) > 0 && Math.abs(j) < Math.abs(z)) {
        var fe = fr(j || z) * (Math.abs(z) - Math.abs(j));
        j += fe;
      }
    }
    return dn(dn(dn({}, k), {}, {
      x: N,
      y: D,
      width: j,
      height: F,
      value: c ? $ : $[1],
      payload: k,
      background: W
    }, P && P[I] && P[I].props), {}, {
      tooltipPayload: [qF(n, k)],
      tooltipPosition: {
        x: N + j / 2,
        y: D + F / 2
      }
    });
  });
  return dn({
    data: C,
    layout: y
  }, p);
});
function rd(e) {
  "@babel/helpers - typeof";
  return rd = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, rd(e);
}
function uTe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function m$(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, CW(r.key), r);
  }
}
function fTe(e, t, n) {
  return t && m$(e.prototype, t), n && m$(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function g$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function Ai(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? g$(Object(n), !0).forEach(function(r) {
      wy(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : g$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function wy(e, t, n) {
  return t = CW(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function CW(e) {
  var t = dTe(e, "string");
  return rd(t) == "symbol" ? t : t + "";
}
function dTe(e, t) {
  if (rd(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (rd(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var kS = function(t, n, r, i, o) {
  var a = t.width, s = t.height, l = t.layout, c = t.children, f = Object.keys(n), d = {
    left: r.left,
    leftMirror: r.left,
    right: a - r.right,
    rightMirror: a - r.right,
    top: r.top,
    topMirror: r.top,
    bottom: s - r.bottom,
    bottomMirror: s - r.bottom
  }, p = !!jr(c, il);
  return f.reduce(function(m, y) {
    var g = n[y], v = g.orientation, x = g.domain, w = g.padding, S = w === void 0 ? {} : w, A = g.mirror, _ = g.reversed, O = "".concat(v).concat(A ? "Mirror" : ""), P, C, k, I, $;
    if (g.type === "number" && (g.padding === "gap" || g.padding === "no-gap")) {
      var N = x[1] - x[0], D = 1 / 0, j = g.categoricalDomain.sort();
      if (j.forEach(function(re, ce) {
        ce > 0 && (D = Math.min((re || 0) - (j[ce - 1] || 0), D));
      }), Number.isFinite(D)) {
        var F = D / N, W = g.layout === "vertical" ? r.height : r.width;
        if (g.padding === "gap" && (P = F * W / 2), g.padding === "no-gap") {
          var z = dr(t.barCategoryGap, F * W), H = F * W / 2;
          P = H - z - (H - z) / W * z;
        }
      }
    }
    i === "xAxis" ? C = [r.left + (S.left || 0) + (P || 0), r.left + r.width - (S.right || 0) - (P || 0)] : i === "yAxis" ? C = l === "horizontal" ? [r.top + r.height - (S.bottom || 0), r.top + (S.top || 0)] : [r.top + (S.top || 0) + (P || 0), r.top + r.height - (S.bottom || 0) - (P || 0)] : C = g.range, _ && (C = [C[1], C[0]]);
    var U = HF(g, o, p), V = U.scale, Y = U.realScaleType;
    V.domain(x).range(C), KF(V);
    var Q = GF(V, Ai(Ai({}, g), {}, {
      realScaleType: Y
    }));
    i === "xAxis" ? ($ = v === "top" && !A || v === "bottom" && A, k = r.left, I = d[O] - $ * g.height) : i === "yAxis" && ($ = v === "left" && !A || v === "right" && A, k = d[O] - $ * g.width, I = r.top);
    var ne = Ai(Ai(Ai({}, g), Q), {}, {
      realScaleType: Y,
      x: k,
      y: I,
      scale: V,
      width: i === "xAxis" ? r.width : g.width,
      height: i === "yAxis" ? r.height : g.height
    });
    return ne.bandSize = _m(ne, Q), !g.hide && i === "xAxis" ? d[O] += ($ ? -1 : 1) * ne.height : g.hide || (d[O] += ($ ? -1 : 1) * ne.width), Ai(Ai({}, m), {}, wy({}, y, ne));
  }, {});
}, EW = function(t, n) {
  var r = t.x, i = t.y, o = n.x, a = n.y;
  return {
    x: Math.min(r, o),
    y: Math.min(i, a),
    width: Math.abs(o - r),
    height: Math.abs(a - i)
  };
}, hTe = function(t) {
  var n = t.x1, r = t.y1, i = t.x2, o = t.y2;
  return EW({
    x: n,
    y: r
  }, {
    x: i,
    y: o
  });
}, kW = /* @__PURE__ */ function() {
  function e(t) {
    uTe(this, e), this.scale = t;
  }
  return fTe(e, [{
    key: "domain",
    get: function() {
      return this.scale.domain;
    }
  }, {
    key: "range",
    get: function() {
      return this.scale.range;
    }
  }, {
    key: "rangeMin",
    get: function() {
      return this.range()[0];
    }
  }, {
    key: "rangeMax",
    get: function() {
      return this.range()[1];
    }
  }, {
    key: "bandwidth",
    get: function() {
      return this.scale.bandwidth;
    }
  }, {
    key: "apply",
    value: function(n) {
      var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = r.bandAware, o = r.position;
      if (n !== void 0) {
        if (o)
          switch (o) {
            case "start":
              return this.scale(n);
            case "middle": {
              var a = this.bandwidth ? this.bandwidth() / 2 : 0;
              return this.scale(n) + a;
            }
            case "end": {
              var s = this.bandwidth ? this.bandwidth() : 0;
              return this.scale(n) + s;
            }
            default:
              return this.scale(n);
          }
        if (i) {
          var l = this.bandwidth ? this.bandwidth() / 2 : 0;
          return this.scale(n) + l;
        }
        return this.scale(n);
      }
    }
  }, {
    key: "isInRange",
    value: function(n) {
      var r = this.range(), i = r[0], o = r[r.length - 1];
      return i <= o ? n >= i && n <= o : n >= o && n <= i;
    }
  }], [{
    key: "create",
    value: function(n) {
      return new e(n);
    }
  }]);
}();
wy(kW, "EPS", 1e-4);
var MS = function(t) {
  var n = Object.keys(t).reduce(function(r, i) {
    return Ai(Ai({}, r), {}, wy({}, i, kW.create(t[i])));
  }, {});
  return Ai(Ai({}, n), {}, {
    apply: function(i) {
      var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = o.bandAware, s = o.position;
      return $Ae(i, function(l, c) {
        return n[c].apply(l, {
          bandAware: a,
          position: s
        });
      });
    },
    isInRange: function(i) {
      return OW(i, function(o, a) {
        return n[a].isInRange(o);
      });
    }
  });
};
function pTe(e) {
  return (e % 180 + 180) % 180;
}
var mTe = function(t) {
  var n = t.width, r = t.height, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, o = pTe(i), a = o * Math.PI / 180, s = Math.atan(r / n), l = a > s && a < Math.PI - s ? r / Math.sin(a) : n / Math.cos(a);
  return Math.abs(l);
}, gTe = so, yTe = Cd, vTe = ny;
function bTe(e) {
  return function(t, n, r) {
    var i = Object(t);
    if (!yTe(t)) {
      var o = gTe(n);
      t = vTe(t), n = function(s) {
        return o(i[s], s, i);
      };
    }
    var a = e(t, n, r);
    return a > -1 ? i[o ? t[a] : a] : void 0;
  };
}
var xTe = bTe, wTe = xW;
function _Te(e) {
  var t = wTe(e), n = t % 1;
  return t === t ? n ? t - n : t : 0;
}
var STe = _Te, OTe = AB, ATe = so, TTe = STe, PTe = Math.max;
function CTe(e, t, n) {
  var r = e == null ? 0 : e.length;
  if (!r)
    return -1;
  var i = n == null ? 0 : TTe(n);
  return i < 0 && (i = PTe(r + i, 0)), OTe(e, ATe(t), i);
}
var ETe = CTe, kTe = xTe, MTe = ETe, NTe = kTe(MTe), $Te = NTe;
const DTe = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)($Te);
var ITe = Ioe(function(e) {
  return {
    x: e.left,
    y: e.top,
    width: e.width,
    height: e.height
  };
}, function(e) {
  return ["l", e.left, "t", e.top, "w", e.width, "h", e.height].join("");
});
function Fm(e) {
  "@babel/helpers - typeof";
  return Fm = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Fm(e);
}
var NS = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(void 0), $S = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(void 0), MW = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(void 0), NW = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({}), $W = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(void 0), DW = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(0), IW = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(0), y$ = function(t) {
  var n = t.state, r = n.xAxisMap, i = n.yAxisMap, o = n.offset, a = t.clipPathId, s = t.children, l = t.width, c = t.height, f = ITe(o);
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(NS.Provider, {
    value: r
  }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement($S.Provider, {
    value: i
  }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(NW.Provider, {
    value: o
  }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(MW.Provider, {
    value: f
  }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement($W.Provider, {
    value: a
  }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(DW.Provider, {
    value: c
  }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(IW.Provider, {
    value: l
  }, s)))))));
}, RTe = function() {
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)($W);
};
function RW(e) {
  var t = Object.keys(e);
  return t.length === 0 ? "There are no available ids." : "Available ids are: ".concat(t, ".");
}
var jW = function(t) {
  var n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(NS);
  n == null && ( true ? Sr(!1, "Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?") : 0);
  var r = n[t];
  return r == null && ( true ? Sr(!1, 'Could not find xAxis by id "'.concat(t, '" [').concat(Fm(t), "]. ").concat(RW(n))) : 0), r;
}, jTe = function() {
  var t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(NS);
  return Sa(t);
}, LTe = function() {
  var t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)($S), n = DTe(t, function(r) {
    return OW(r.domain, Number.isFinite);
  });
  return n || Sa(t);
}, LW = function(t) {
  var n = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)($S);
  n == null && ( true ? Sr(!1, "Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?") : 0);
  var r = n[t];
  return r == null && ( true ? Sr(!1, 'Could not find yAxis by id "'.concat(t, '" [').concat(Fm(t), "]. ").concat(RW(n))) : 0), r;
}, BTe = function() {
  var t = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(MW);
  return t;
}, FTe = function() {
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(NW);
}, DS = function() {
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(IW);
}, IS = function() {
  return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(DW);
};
function _c(e) {
  "@babel/helpers - typeof";
  return _c = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, _c(e);
}
function WTe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function zTe(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, FW(r.key), r);
  }
}
function VTe(e, t, n) {
  return t && zTe(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function UTe(e, t, n) {
  return t = Wm(t), HTe(e, BW() ? Reflect.construct(t, n || [], Wm(e).constructor) : t.apply(e, n));
}
function HTe(e, t) {
  if (t && (_c(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return KTe(e);
}
function KTe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function BW() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (BW = function() {
    return !!e;
  })();
}
function Wm(e) {
  return Wm = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, Wm(e);
}
function GTe(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && Pw(e, t);
}
function Pw(e, t) {
  return Pw = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, Pw(e, t);
}
function v$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function b$(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? v$(Object(n), !0).forEach(function(r) {
      RS(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : v$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function RS(e, t, n) {
  return t = FW(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function FW(e) {
  var t = YTe(e, "string");
  return _c(t) == "symbol" ? t : t + "";
}
function YTe(e, t) {
  if (_c(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (_c(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function qTe(e, t) {
  return QTe(e) || JTe(e, t) || ZTe(e, t) || XTe();
}
function XTe() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function ZTe(e, t) {
  if (e) {
    if (typeof e == "string") return x$(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return x$(e, t);
  }
}
function x$(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function JTe(e, t) {
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (n != null) {
    var r, i, o, a, s = [], l = !0, c = !1;
    try {
      if (o = (n = n.call(e)).next, t !== 0) for (; !(l = (r = o.call(n)).done) && (s.push(r.value), s.length !== t); l = !0) ;
    } catch (f) {
      c = !0, i = f;
    } finally {
      try {
        if (!l && n.return != null && (a = n.return(), Object(a) !== a)) return;
      } finally {
        if (c) throw i;
      }
    }
    return s;
  }
}
function QTe(e) {
  if (Array.isArray(e)) return e;
}
function Cw() {
  return Cw = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Cw.apply(this, arguments);
}
var ePe = function(t, n) {
  var r;
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(t) ? r = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(t, n) : ze(t) ? r = t(n) : r = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("line", Cw({}, n, {
    className: "recharts-reference-line-line"
  })), r;
}, tPe = function(t, n, r, i, o, a, s, l, c) {
  var f = o.x, d = o.y, p = o.width, m = o.height;
  if (r) {
    var y = c.y, g = t.y.apply(y, {
      position: a
    });
    if (Qi(c, "discard") && !t.y.isInRange(g))
      return null;
    var v = [{
      x: f + p,
      y: g
    }, {
      x: f,
      y: g
    }];
    return l === "left" ? v.reverse() : v;
  }
  if (n) {
    var x = c.x, w = t.x.apply(x, {
      position: a
    });
    if (Qi(c, "discard") && !t.x.isInRange(w))
      return null;
    var S = [{
      x: w,
      y: d + m
    }, {
      x: w,
      y: d
    }];
    return s === "top" ? S.reverse() : S;
  }
  if (i) {
    var A = c.segment, _ = A.map(function(O) {
      return t.apply(O, {
        position: a
      });
    });
    return Qi(c, "discard") && AAe(_, function(O) {
      return !t.isInRange(O);
    }) ? null : _;
  }
  return null;
};
function nPe(e) {
  var t = e.x, n = e.y, r = e.segment, i = e.xAxisId, o = e.yAxisId, a = e.shape, s = e.className, l = e.alwaysShow, c = RTe(), f = jW(i), d = LW(o), p = BTe();
  if (!c || !p)
    return null;
  Mi(l === void 0, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
  var m = MS({
    x: f.scale,
    y: d.scale
  }), y = On(t), g = On(n), v = r && r.length === 2, x = tPe(m, y, g, v, p, e.position, f.orientation, d.orientation, e);
  if (!x)
    return null;
  var w = qTe(x, 2), S = w[0], A = S.x, _ = S.y, O = w[1], P = O.x, C = O.y, k = Qi(e, "hidden") ? "url(#".concat(c, ")") : void 0, I = b$(b$({
    clipPath: k
  }, Ee(e, !0)), {}, {
    x1: A,
    y1: _,
    x2: P,
    y2: C
  });
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
    className: Xe("recharts-reference-line", s)
  }, ePe(a, I), Sn.renderCallByParent(e, hTe({
    x1: A,
    y1: _,
    x2: P,
    y2: C
  })));
}
var jS = /* @__PURE__ */ function(e) {
  function t() {
    return WTe(this, t), UTe(this, t, arguments);
  }
  return GTe(t, e), VTe(t, [{
    key: "render",
    value: function() {
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(nPe, this.props);
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.Component);
RS(jS, "displayName", "ReferenceLine");
RS(jS, "defaultProps", {
  isFront: !1,
  ifOverflow: "discard",
  xAxisId: 0,
  yAxisId: 0,
  fill: "none",
  stroke: "#ccc",
  fillOpacity: 1,
  strokeWidth: 1,
  position: "middle"
});
function Ew() {
  return Ew = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Ew.apply(this, arguments);
}
function Sc(e) {
  "@babel/helpers - typeof";
  return Sc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Sc(e);
}
function w$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function _$(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? w$(Object(n), !0).forEach(function(r) {
      _y(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : w$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function rPe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function iPe(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, zW(r.key), r);
  }
}
function oPe(e, t, n) {
  return t && iPe(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function aPe(e, t, n) {
  return t = zm(t), sPe(e, WW() ? Reflect.construct(t, n || [], zm(e).constructor) : t.apply(e, n));
}
function sPe(e, t) {
  if (t && (Sc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return lPe(e);
}
function lPe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function WW() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (WW = function() {
    return !!e;
  })();
}
function zm(e) {
  return zm = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, zm(e);
}
function cPe(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && kw(e, t);
}
function kw(e, t) {
  return kw = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, kw(e, t);
}
function _y(e, t, n) {
  return t = zW(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function zW(e) {
  var t = uPe(e, "string");
  return Sc(t) == "symbol" ? t : t + "";
}
function uPe(e, t) {
  if (Sc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Sc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var fPe = function(t) {
  var n = t.x, r = t.y, i = t.xAxis, o = t.yAxis, a = MS({
    x: i.scale,
    y: o.scale
  }), s = a.apply({
    x: n,
    y: r
  }, {
    bandAware: !0
  });
  return Qi(t, "discard") && !a.isInRange(s) ? null : s;
}, Sy = /* @__PURE__ */ function(e) {
  function t() {
    return rPe(this, t), aPe(this, t, arguments);
  }
  return cPe(t, e), oPe(t, [{
    key: "render",
    value: function() {
      var r = this.props, i = r.x, o = r.y, a = r.r, s = r.alwaysShow, l = r.clipPathId, c = On(i), f = On(o);
      if (Mi(s === void 0, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'), !c || !f)
        return null;
      var d = fPe(this.props);
      if (!d)
        return null;
      var p = d.x, m = d.y, y = this.props, g = y.shape, v = y.className, x = Qi(this.props, "hidden") ? "url(#".concat(l, ")") : void 0, w = _$(_$({
        clipPath: x
      }, Ee(this.props, !0)), {}, {
        cx: p,
        cy: m
      });
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: Xe("recharts-reference-dot", v)
      }, t.renderDot(g, w), Sn.renderCallByParent(this.props, {
        x: p - a,
        y: m - a,
        width: 2 * a,
        height: 2 * a
      }));
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.Component);
_y(Sy, "displayName", "ReferenceDot");
_y(Sy, "defaultProps", {
  isFront: !1,
  ifOverflow: "discard",
  xAxisId: 0,
  yAxisId: 0,
  r: 10,
  fill: "#fff",
  stroke: "#ccc",
  fillOpacity: 1,
  strokeWidth: 1
});
_y(Sy, "renderDot", function(e, t) {
  var n;
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(e) ? n = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(e, t) : ze(e) ? n = e(t) : n = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Dd, Ew({}, t, {
    cx: t.cx,
    cy: t.cy,
    className: "recharts-reference-dot-dot"
  })), n;
});
function Mw() {
  return Mw = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Mw.apply(this, arguments);
}
function Oc(e) {
  "@babel/helpers - typeof";
  return Oc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Oc(e);
}
function S$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function O$(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? S$(Object(n), !0).forEach(function(r) {
      Oy(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : S$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function dPe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function hPe(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, UW(r.key), r);
  }
}
function pPe(e, t, n) {
  return t && hPe(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function mPe(e, t, n) {
  return t = Vm(t), gPe(e, VW() ? Reflect.construct(t, n || [], Vm(e).constructor) : t.apply(e, n));
}
function gPe(e, t) {
  if (t && (Oc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return yPe(e);
}
function yPe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function VW() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (VW = function() {
    return !!e;
  })();
}
function Vm(e) {
  return Vm = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, Vm(e);
}
function vPe(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && Nw(e, t);
}
function Nw(e, t) {
  return Nw = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, Nw(e, t);
}
function Oy(e, t, n) {
  return t = UW(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function UW(e) {
  var t = bPe(e, "string");
  return Oc(t) == "symbol" ? t : t + "";
}
function bPe(e, t) {
  if (Oc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Oc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var xPe = function(t, n, r, i, o) {
  var a = o.x1, s = o.x2, l = o.y1, c = o.y2, f = o.xAxis, d = o.yAxis;
  if (!f || !d) return null;
  var p = MS({
    x: f.scale,
    y: d.scale
  }), m = {
    x: t ? p.x.apply(a, {
      position: "start"
    }) : p.x.rangeMin,
    y: r ? p.y.apply(l, {
      position: "start"
    }) : p.y.rangeMin
  }, y = {
    x: n ? p.x.apply(s, {
      position: "end"
    }) : p.x.rangeMax,
    y: i ? p.y.apply(c, {
      position: "end"
    }) : p.y.rangeMax
  };
  return Qi(o, "discard") && (!p.isInRange(m) || !p.isInRange(y)) ? null : EW(m, y);
}, Ay = /* @__PURE__ */ function(e) {
  function t() {
    return dPe(this, t), mPe(this, t, arguments);
  }
  return vPe(t, e), pPe(t, [{
    key: "render",
    value: function() {
      var r = this.props, i = r.x1, o = r.x2, a = r.y1, s = r.y2, l = r.className, c = r.alwaysShow, f = r.clipPathId;
      Mi(c === void 0, 'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');
      var d = On(i), p = On(o), m = On(a), y = On(s), g = this.props.shape;
      if (!d && !p && !m && !y && !g)
        return null;
      var v = xPe(d, p, m, y, this.props);
      if (!v && !g)
        return null;
      var x = Qi(this.props, "hidden") ? "url(#".concat(f, ")") : void 0;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: Xe("recharts-reference-area", l)
      }, t.renderRect(g, O$(O$({
        clipPath: x
      }, Ee(this.props, !0)), v)), Sn.renderCallByParent(this.props, v));
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.Component);
Oy(Ay, "displayName", "ReferenceArea");
Oy(Ay, "defaultProps", {
  isFront: !1,
  ifOverflow: "discard",
  xAxisId: 0,
  yAxisId: 0,
  r: 10,
  fill: "#ccc",
  fillOpacity: 0.5,
  stroke: "none",
  strokeWidth: 1
});
Oy(Ay, "renderRect", function(e, t) {
  var n;
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(e) ? n = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(e, t) : ze(e) ? n = e(t) : n = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(ES, Mw({}, t, {
    className: "recharts-reference-area-rect"
  })), n;
});
function HW(e, t, n) {
  if (t < 1)
    return [];
  if (t === 1 && n === void 0)
    return e;
  for (var r = [], i = 0; i < e.length; i += t)
    r.push(e[i]);
  return r;
}
function wPe(e, t, n) {
  var r = {
    width: e.width + t.width,
    height: e.height + t.height
  };
  return mTe(r, n);
}
function _Pe(e, t, n) {
  var r = n === "width", i = e.x, o = e.y, a = e.width, s = e.height;
  return t === 1 ? {
    start: r ? i : o,
    end: r ? i + a : o + s
  } : {
    start: r ? i + a : o + s,
    end: r ? i : o
  };
}
function Um(e, t, n, r, i) {
  if (e * t < e * r || e * t > e * i)
    return !1;
  var o = n();
  return e * (t - e * o / 2 - r) >= 0 && e * (t + e * o / 2 - i) <= 0;
}
function SPe(e, t) {
  return HW(e, t + 1);
}
function OPe(e, t, n, r, i) {
  for (var o = (r || []).slice(), a = t.start, s = t.end, l = 0, c = 1, f = a, d = function() {
    var y = r == null ? void 0 : r[l];
    if (y === void 0)
      return {
        v: HW(r, c)
      };
    var g = l, v, x = function() {
      return v === void 0 && (v = n(y, g)), v;
    }, w = y.coordinate, S = l === 0 || Um(e, w, x, f, s);
    S || (l = 0, f = a, c += 1), S && (f = w + e * (x() / 2 + i), l += c);
  }, p; c <= o.length; )
    if (p = d(), p) return p.v;
  return [];
}
function id(e) {
  "@babel/helpers - typeof";
  return id = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, id(e);
}
function A$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function tr(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? A$(Object(n), !0).forEach(function(r) {
      APe(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : A$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function APe(e, t, n) {
  return t = TPe(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function TPe(e) {
  var t = PPe(e, "string");
  return id(t) == "symbol" ? t : t + "";
}
function PPe(e, t) {
  if (id(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (id(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function CPe(e, t, n, r, i) {
  for (var o = (r || []).slice(), a = o.length, s = t.start, l = t.end, c = function(p) {
    var m = o[p], y, g = function() {
      return y === void 0 && (y = n(m, p)), y;
    };
    if (p === a - 1) {
      var v = e * (m.coordinate + e * g() / 2 - l);
      o[p] = m = tr(tr({}, m), {}, {
        tickCoord: v > 0 ? m.coordinate - v * e : m.coordinate
      });
    } else
      o[p] = m = tr(tr({}, m), {}, {
        tickCoord: m.coordinate
      });
    var x = Um(e, m.tickCoord, g, s, l);
    x && (l = m.tickCoord - e * (g() / 2 + i), o[p] = tr(tr({}, m), {}, {
      isShow: !0
    }));
  }, f = a - 1; f >= 0; f--)
    c(f);
  return o;
}
function EPe(e, t, n, r, i, o) {
  var a = (r || []).slice(), s = a.length, l = t.start, c = t.end;
  if (o) {
    var f = r[s - 1], d = n(f, s - 1), p = e * (f.coordinate + e * d / 2 - c);
    a[s - 1] = f = tr(tr({}, f), {}, {
      tickCoord: p > 0 ? f.coordinate - p * e : f.coordinate
    });
    var m = Um(e, f.tickCoord, function() {
      return d;
    }, l, c);
    m && (c = f.tickCoord - e * (d / 2 + i), a[s - 1] = tr(tr({}, f), {}, {
      isShow: !0
    }));
  }
  for (var y = o ? s - 1 : s, g = function(w) {
    var S = a[w], A, _ = function() {
      return A === void 0 && (A = n(S, w)), A;
    };
    if (w === 0) {
      var O = e * (S.coordinate - e * _() / 2 - l);
      a[w] = S = tr(tr({}, S), {}, {
        tickCoord: O < 0 ? S.coordinate - O * e : S.coordinate
      });
    } else
      a[w] = S = tr(tr({}, S), {}, {
        tickCoord: S.coordinate
      });
    var P = Um(e, S.tickCoord, _, l, c);
    P && (l = S.tickCoord + e * (_() / 2 + i), a[w] = tr(tr({}, S), {}, {
      isShow: !0
    }));
  }, v = 0; v < y; v++)
    g(v);
  return a;
}
function LS(e, t, n) {
  var r = e.tick, i = e.ticks, o = e.viewBox, a = e.minTickGap, s = e.orientation, l = e.interval, c = e.tickFormatter, f = e.unit, d = e.angle;
  if (!i || !i.length || !r)
    return [];
  if (be(l) || Ni.isSsr)
    return SPe(i, typeof l == "number" && be(l) ? l : 0);
  var p = [], m = s === "top" || s === "bottom" ? "width" : "height", y = f && m === "width" ? tf(f, {
    fontSize: t,
    letterSpacing: n
  }) : {
    width: 0,
    height: 0
  }, g = function(S, A) {
    var _ = ze(c) ? c(S.value, A) : S.value;
    return m === "width" ? wPe(tf(_, {
      fontSize: t,
      letterSpacing: n
    }), y, d) : tf(_, {
      fontSize: t,
      letterSpacing: n
    })[m];
  }, v = i.length >= 2 ? fr(i[1].coordinate - i[0].coordinate) : 1, x = _Pe(o, v, m);
  return l === "equidistantPreserveStart" ? OPe(v, x, g, i, a) : (l === "preserveStart" || l === "preserveStartEnd" ? p = EPe(v, x, g, i, a, l === "preserveStartEnd") : p = CPe(v, x, g, i, a), p.filter(function(w) {
    return w.isShow;
  }));
}
var kPe = ["viewBox"], MPe = ["viewBox"], NPe = ["ticks"];
function Ac(e) {
  "@babel/helpers - typeof";
  return Ac = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Ac(e);
}
function Wl() {
  return Wl = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Wl.apply(this, arguments);
}
function T$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function lr(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? T$(Object(n), !0).forEach(function(r) {
      BS(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : T$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function a0(e, t) {
  if (e == null) return {};
  var n = $Pe(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function $Pe(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function DPe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function P$(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, GW(r.key), r);
  }
}
function IPe(e, t, n) {
  return t && P$(e.prototype, t), n && P$(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function RPe(e, t, n) {
  return t = Hm(t), jPe(e, KW() ? Reflect.construct(t, n || [], Hm(e).constructor) : t.apply(e, n));
}
function jPe(e, t) {
  if (t && (Ac(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return LPe(e);
}
function LPe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function KW() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (KW = function() {
    return !!e;
  })();
}
function Hm(e) {
  return Hm = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, Hm(e);
}
function BPe(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && $w(e, t);
}
function $w(e, t) {
  return $w = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, $w(e, t);
}
function BS(e, t, n) {
  return t = GW(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function GW(e) {
  var t = FPe(e, "string");
  return Ac(t) == "symbol" ? t : t + "";
}
function FPe(e, t) {
  if (Ac(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Ac(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var tu = /* @__PURE__ */ function(e) {
  function t(n) {
    var r;
    return DPe(this, t), r = RPe(this, t, [n]), r.state = {
      fontSize: "",
      letterSpacing: ""
    }, r;
  }
  return BPe(t, e), IPe(t, [{
    key: "shouldComponentUpdate",
    value: function(r, i) {
      var o = r.viewBox, a = a0(r, kPe), s = this.props, l = s.viewBox, c = a0(s, MPe);
      return !Yl(o, l) || !Yl(a, c) || !Yl(i, this.state);
    }
  }, {
    key: "componentDidMount",
    value: function() {
      var r = this.layerReference;
      if (r) {
        var i = r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];
        i && this.setState({
          fontSize: window.getComputedStyle(i).fontSize,
          letterSpacing: window.getComputedStyle(i).letterSpacing
        });
      }
    }
    /**
     * 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: function(r) {
      var i = this.props, o = i.x, a = i.y, s = i.width, l = i.height, c = i.orientation, f = i.tickSize, d = i.mirror, p = i.tickMargin, m, y, g, v, x, w, S = d ? -1 : 1, A = r.tickSize || f, _ = be(r.tickCoord) ? r.tickCoord : r.coordinate;
      switch (c) {
        case "top":
          m = y = r.coordinate, v = a + +!d * l, g = v - S * A, w = g - S * p, x = _;
          break;
        case "left":
          g = v = r.coordinate, y = o + +!d * s, m = y - S * A, x = m - S * p, w = _;
          break;
        case "right":
          g = v = r.coordinate, y = o + +d * s, m = y + S * A, x = m + S * p, w = _;
          break;
        default:
          m = y = r.coordinate, v = a + +d * l, g = v + S * A, w = g + S * p, x = _;
          break;
      }
      return {
        line: {
          x1: m,
          y1: g,
          x2: y,
          y2: v
        },
        tick: {
          x,
          y: w
        }
      };
    }
  }, {
    key: "getTickTextAnchor",
    value: function() {
      var r = this.props, i = r.orientation, o = r.mirror, a;
      switch (i) {
        case "left":
          a = o ? "start" : "end";
          break;
        case "right":
          a = o ? "end" : "start";
          break;
        default:
          a = "middle";
          break;
      }
      return a;
    }
  }, {
    key: "getTickVerticalAnchor",
    value: function() {
      var r = this.props, i = r.orientation, o = r.mirror, a = "end";
      switch (i) {
        case "left":
        case "right":
          a = "middle";
          break;
        case "top":
          a = o ? "start" : "end";
          break;
        default:
          a = o ? "end" : "start";
          break;
      }
      return a;
    }
  }, {
    key: "renderAxisLine",
    value: function() {
      var r = this.props, i = r.x, o = r.y, a = r.width, s = r.height, l = r.orientation, c = r.mirror, f = r.axisLine, d = lr(lr(lr({}, Ee(this.props, !1)), Ee(f, !1)), {}, {
        fill: "none"
      });
      if (l === "top" || l === "bottom") {
        var p = +(l === "top" && !c || l === "bottom" && c);
        d = lr(lr({}, d), {}, {
          x1: i,
          y1: o + p * s,
          x2: i + a,
          y2: o + p * s
        });
      } else {
        var m = +(l === "left" && !c || l === "right" && c);
        d = lr(lr({}, d), {}, {
          x1: i + m * a,
          y1: o,
          x2: i + m * a,
          y2: o + s
        });
      }
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("line", Wl({}, d, {
        className: Xe("recharts-cartesian-axis-line", zr(f, "className"))
      }));
    }
  }, {
    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
       */
      function(r, i, o) {
        var a = this, s = this.props, l = s.tickLine, c = s.stroke, f = s.tick, d = s.tickFormatter, p = s.unit, m = LS(lr(lr({}, this.props), {}, {
          ticks: r
        }), i, o), y = this.getTickTextAnchor(), g = this.getTickVerticalAnchor(), v = Ee(this.props, !1), x = Ee(f, !1), w = lr(lr({}, v), {}, {
          fill: "none"
        }, Ee(l, !1)), S = m.map(function(A, _) {
          var O = a.getTickLineCoord(A), P = O.line, C = O.tick, k = lr(lr(lr(lr({
            textAnchor: y,
            verticalAnchor: g
          }, v), {}, {
            stroke: "none",
            fill: c
          }, x), C), {}, {
            index: _,
            payload: A,
            visibleTicksCount: m.length,
            tickFormatter: d
          });
          return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, Wl({
            className: "recharts-cartesian-axis-tick",
            key: "tick-".concat(A.value, "-").concat(A.coordinate, "-").concat(A.tickCoord)
          }, zs(a.props, A, _)), l && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("line", Wl({}, w, P, {
            className: Xe("recharts-cartesian-axis-tick-line", zr(l, "className"))
          })), f && t.renderTickItem(f, k, "".concat(ze(d) ? d(A.value, _) : A.value).concat(p || "")));
        });
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("g", {
          className: "recharts-cartesian-axis-ticks"
        }, S);
      }
    )
  }, {
    key: "render",
    value: function() {
      var r = this, i = this.props, o = i.axisLine, a = i.width, s = i.height, l = i.ticksGenerator, c = i.className, f = i.hide;
      if (f)
        return null;
      var d = this.props, p = d.ticks, m = a0(d, NPe), y = p;
      return ze(l) && (y = p && p.length > 0 ? l(this.props) : l(m)), a <= 0 || s <= 0 || !y || !y.length ? null : /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: Xe("recharts-cartesian-axis", c),
        ref: function(v) {
          r.layerReference = v;
        }
      }, o && this.renderAxisLine(), this.renderTicks(y, this.state.fontSize, this.state.letterSpacing), Sn.renderCallByParent(this.props));
    }
  }], [{
    key: "renderTickItem",
    value: function(r, i, o) {
      var a;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(r) ? a = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(r, i) : ze(r) ? a = r(i) : a = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Vs, Wl({}, i, {
        className: "recharts-cartesian-axis-tick-value"
      }), o), a;
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.Component);
BS(tu, "displayName", "CartesianAxis");
BS(tu, "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: !0,
  axisLine: !0,
  tick: !0,
  mirror: !1,
  minTickGap: 5,
  // The width or height of tick
  tickSize: 6,
  tickMargin: 2,
  interval: "preserveEnd"
});
var WPe = ["x1", "y1", "x2", "y2", "key"], zPe = ["offset"];
function Ks(e) {
  "@babel/helpers - typeof";
  return Ks = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Ks(e);
}
function C$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function nr(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? C$(Object(n), !0).forEach(function(r) {
      VPe(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : C$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function VPe(e, t, n) {
  return t = UPe(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function UPe(e) {
  var t = HPe(e, "string");
  return Ks(t) == "symbol" ? t : t + "";
}
function HPe(e, t) {
  if (Ks(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Ks(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function Ts() {
  return Ts = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Ts.apply(this, arguments);
}
function E$(e, t) {
  if (e == null) return {};
  var n = KPe(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function KPe(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
var GPe = function(t) {
  var n = t.fill;
  if (!n || n === "none")
    return null;
  var r = t.fillOpacity, i = t.x, o = t.y, a = t.width, s = t.height, l = t.ry;
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
    x: i,
    y: o,
    ry: l,
    width: a,
    height: s,
    stroke: "none",
    fill: n,
    fillOpacity: r,
    className: "recharts-cartesian-grid-bg"
  });
};
function YW(e, t) {
  var n;
  if (/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(e))
    n = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(e, t);
  else if (ze(e))
    n = e(t);
  else {
    var r = t.x1, i = t.y1, o = t.x2, a = t.y2, s = t.key, l = E$(t, WPe), c = Ee(l, !1);
    c.offset;
    var f = E$(c, zPe);
    n = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("line", Ts({}, f, {
      x1: r,
      y1: i,
      x2: o,
      y2: a,
      fill: "none",
      key: s
    }));
  }
  return n;
}
function YPe(e) {
  var t = e.x, n = e.width, r = e.horizontal, i = r === void 0 ? !0 : r, o = e.horizontalPoints;
  if (!i || !o || !o.length)
    return null;
  var a = o.map(function(s, l) {
    var c = nr(nr({}, e), {}, {
      x1: t,
      y1: s,
      x2: t + n,
      y2: s,
      key: "line-".concat(l),
      index: l
    });
    return YW(i, c);
  });
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("g", {
    className: "recharts-cartesian-grid-horizontal"
  }, a);
}
function qPe(e) {
  var t = e.y, n = e.height, r = e.vertical, i = r === void 0 ? !0 : r, o = e.verticalPoints;
  if (!i || !o || !o.length)
    return null;
  var a = o.map(function(s, l) {
    var c = nr(nr({}, e), {}, {
      x1: s,
      y1: t,
      x2: s,
      y2: t + n,
      key: "line-".concat(l),
      index: l
    });
    return YW(i, c);
  });
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("g", {
    className: "recharts-cartesian-grid-vertical"
  }, a);
}
function XPe(e) {
  var t = e.horizontalFill, n = e.fillOpacity, r = e.x, i = e.y, o = e.width, a = e.height, s = e.horizontalPoints, l = e.horizontal, c = l === void 0 ? !0 : l;
  if (!c || !t || !t.length)
    return null;
  var f = s.map(function(p) {
    return Math.round(p + i - i);
  }).sort(function(p, m) {
    return p - m;
  });
  i !== f[0] && f.unshift(0);
  var d = f.map(function(p, m) {
    var y = !f[m + 1], g = y ? i + a - p : f[m + 1] - p;
    if (g <= 0)
      return null;
    var v = m % t.length;
    return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
      key: "react-".concat(m),
      y: p,
      x: r,
      height: g,
      width: o,
      stroke: "none",
      fill: t[v],
      fillOpacity: n,
      className: "recharts-cartesian-grid-bg"
    });
  });
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("g", {
    className: "recharts-cartesian-gridstripes-horizontal"
  }, d);
}
function ZPe(e) {
  var t = e.vertical, n = t === void 0 ? !0 : t, r = e.verticalFill, i = e.fillOpacity, o = e.x, a = e.y, s = e.width, l = e.height, c = e.verticalPoints;
  if (!n || !r || !r.length)
    return null;
  var f = c.map(function(p) {
    return Math.round(p + o - o);
  }).sort(function(p, m) {
    return p - m;
  });
  o !== f[0] && f.unshift(0);
  var d = f.map(function(p, m) {
    var y = !f[m + 1], g = y ? o + s - p : f[m + 1] - p;
    if (g <= 0)
      return null;
    var v = m % r.length;
    return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
      key: "react-".concat(m),
      x: p,
      y: a,
      width: g,
      height: l,
      stroke: "none",
      fill: r[v],
      fillOpacity: i,
      className: "recharts-cartesian-grid-bg"
    });
  });
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("g", {
    className: "recharts-cartesian-gridstripes-vertical"
  }, d);
}
var JPe = function(t, n) {
  var r = t.xAxis, i = t.width, o = t.height, a = t.offset;
  return UF(LS(nr(nr(nr({}, tu.defaultProps), r), {}, {
    ticks: Mo(r, !0),
    viewBox: {
      x: 0,
      y: 0,
      width: i,
      height: o
    }
  })), a.left, a.left + a.width, n);
}, QPe = function(t, n) {
  var r = t.yAxis, i = t.width, o = t.height, a = t.offset;
  return UF(LS(nr(nr(nr({}, tu.defaultProps), r), {}, {
    ticks: Mo(r, !0),
    viewBox: {
      x: 0,
      y: 0,
      width: i,
      height: o
    }
  })), a.top, a.top + a.height, n);
}, Al = {
  horizontal: !0,
  vertical: !0,
  // The ordinates of horizontal grid lines
  horizontalPoints: [],
  // The abscissas of vertical grid lines
  verticalPoints: [],
  stroke: "#ccc",
  fill: "none",
  // The fill of colors of grid lines
  verticalFill: [],
  horizontalFill: []
};
function Ty(e) {
  var t, n, r, i, o, a, s = DS(), l = IS(), c = FTe(), f = nr(nr({}, e), {}, {
    stroke: (t = e.stroke) !== null && t !== void 0 ? t : Al.stroke,
    fill: (n = e.fill) !== null && n !== void 0 ? n : Al.fill,
    horizontal: (r = e.horizontal) !== null && r !== void 0 ? r : Al.horizontal,
    horizontalFill: (i = e.horizontalFill) !== null && i !== void 0 ? i : Al.horizontalFill,
    vertical: (o = e.vertical) !== null && o !== void 0 ? o : Al.vertical,
    verticalFill: (a = e.verticalFill) !== null && a !== void 0 ? a : Al.verticalFill,
    x: be(e.x) ? e.x : c.left,
    y: be(e.y) ? e.y : c.top,
    width: be(e.width) ? e.width : c.width,
    height: be(e.height) ? e.height : c.height
  }), d = f.x, p = f.y, m = f.width, y = f.height, g = f.syncWithTicks, v = f.horizontalValues, x = f.verticalValues, w = jTe(), S = LTe();
  if (!be(m) || m <= 0 || !be(y) || y <= 0 || !be(d) || d !== +d || !be(p) || p !== +p)
    return null;
  var A = f.verticalCoordinatesGenerator || JPe, _ = f.horizontalCoordinatesGenerator || QPe, O = f.horizontalPoints, P = f.verticalPoints;
  if ((!O || !O.length) && ze(_)) {
    var C = v && v.length, k = _({
      yAxis: S ? nr(nr({}, S), {}, {
        ticks: C ? v : S.ticks
      }) : void 0,
      width: s,
      height: l,
      offset: c
    }, C ? !0 : g);
    Mi(Array.isArray(k), "horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Ks(k), "]")), Array.isArray(k) && (O = k);
  }
  if ((!P || !P.length) && ze(A)) {
    var I = x && x.length, $ = A({
      xAxis: w ? nr(nr({}, w), {}, {
        ticks: I ? x : w.ticks
      }) : void 0,
      width: s,
      height: l,
      offset: c
    }, I ? !0 : g);
    Mi(Array.isArray($), "verticalCoordinatesGenerator should return Array but instead it returned [".concat(Ks($), "]")), Array.isArray($) && (P = $);
  }
  return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("g", {
    className: "recharts-cartesian-grid"
  }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(GPe, {
    fill: f.fill,
    fillOpacity: f.fillOpacity,
    x: f.x,
    y: f.y,
    width: f.width,
    height: f.height,
    ry: f.ry
  }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(YPe, Ts({}, f, {
    offset: c,
    horizontalPoints: O,
    xAxis: w,
    yAxis: S
  })), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(qPe, Ts({}, f, {
    offset: c,
    verticalPoints: P,
    xAxis: w,
    yAxis: S
  })), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(XPe, Ts({}, f, {
    horizontalPoints: O
  })), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(ZPe, Ts({}, f, {
    verticalPoints: P
  })));
}
Ty.displayName = "CartesianGrid";
var eCe = ["type", "layout", "connectNulls", "ref"], tCe = ["key"];
function Tc(e) {
  "@babel/helpers - typeof";
  return Tc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Tc(e);
}
function k$(e, t) {
  if (e == null) return {};
  var n = nCe(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function nCe(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function lf() {
  return lf = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, lf.apply(this, arguments);
}
function M$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function Ir(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? M$(Object(n), !0).forEach(function(r) {
      Ti(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : M$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function Tl(e) {
  return aCe(e) || oCe(e) || iCe(e) || rCe();
}
function rCe() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function iCe(e, t) {
  if (e) {
    if (typeof e == "string") return Dw(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Dw(e, t);
  }
}
function oCe(e) {
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function aCe(e) {
  if (Array.isArray(e)) return Dw(e);
}
function Dw(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function sCe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function N$(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, XW(r.key), r);
  }
}
function lCe(e, t, n) {
  return t && N$(e.prototype, t), n && N$(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function cCe(e, t, n) {
  return t = Km(t), uCe(e, qW() ? Reflect.construct(t, n || [], Km(e).constructor) : t.apply(e, n));
}
function uCe(e, t) {
  if (t && (Tc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return fCe(e);
}
function fCe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function qW() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (qW = function() {
    return !!e;
  })();
}
function Km(e) {
  return Km = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, Km(e);
}
function dCe(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && Iw(e, t);
}
function Iw(e, t) {
  return Iw = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, Iw(e, t);
}
function Ti(e, t, n) {
  return t = XW(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function XW(e) {
  var t = hCe(e, "string");
  return Tc(t) == "symbol" ? t : t + "";
}
function hCe(e, t) {
  if (Tc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Tc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var Id = /* @__PURE__ */ function(e) {
  function t() {
    var n;
    sCe(this, t);
    for (var r = arguments.length, i = new Array(r), o = 0; o < r; o++)
      i[o] = arguments[o];
    return n = cCe(this, t, [].concat(i)), Ti(n, "state", {
      isAnimationFinished: !0,
      totalLength: 0
    }), Ti(n, "generateSimpleStrokeDasharray", function(a, s) {
      return "".concat(s, "px ").concat(a - s, "px");
    }), Ti(n, "getStrokeDasharray", function(a, s, l) {
      var c = l.reduce(function(x, w) {
        return x + w;
      });
      if (!c)
        return n.generateSimpleStrokeDasharray(s, a);
      for (var f = Math.floor(a / c), d = a % c, p = s - a, m = [], y = 0, g = 0; y < l.length; g += l[y], ++y)
        if (g + l[y] > d) {
          m = [].concat(Tl(l.slice(0, y)), [d - g]);
          break;
        }
      var v = m.length % 2 === 0 ? [0, p] : [p];
      return [].concat(Tl(t.repeat(l, f)), Tl(m), v).map(function(x) {
        return "".concat(x, "px");
      }).join(", ");
    }), Ti(n, "id", tl("recharts-line-")), Ti(n, "pathRef", function(a) {
      n.mainCurve = a;
    }), Ti(n, "handleAnimationEnd", function() {
      n.setState({
        isAnimationFinished: !0
      }), n.props.onAnimationEnd && n.props.onAnimationEnd();
    }), Ti(n, "handleAnimationStart", function() {
      n.setState({
        isAnimationFinished: !1
      }), n.props.onAnimationStart && n.props.onAnimationStart();
    }), n;
  }
  return dCe(t, e), lCe(t, [{
    key: "componentDidMount",
    value: function() {
      if (this.props.isAnimationActive) {
        var r = this.getTotalLength();
        this.setState({
          totalLength: r
        });
      }
    }
  }, {
    key: "componentDidUpdate",
    value: function() {
      if (this.props.isAnimationActive) {
        var r = this.getTotalLength();
        r !== this.state.totalLength && this.setState({
          totalLength: r
        });
      }
    }
  }, {
    key: "getTotalLength",
    value: function() {
      var r = this.mainCurve;
      try {
        return r && r.getTotalLength && r.getTotalLength() || 0;
      } catch {
        return 0;
      }
    }
  }, {
    key: "renderErrorBar",
    value: function(r, i) {
      if (this.props.isAnimationActive && !this.state.isAnimationFinished)
        return null;
      var o = this.props, a = o.points, s = o.xAxis, l = o.yAxis, c = o.layout, f = o.children, d = Vr(f, $d);
      if (!d)
        return null;
      var p = function(g, v) {
        return {
          x: g.x,
          y: g.y,
          value: g.value,
          errorVal: cn(g.payload, v)
        };
      }, m = {
        clipPath: r ? "url(#clipPath-".concat(i, ")") : null
      };
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, m, d.map(function(y) {
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(y, {
          key: "bar-".concat(y.props.dataKey),
          data: a,
          xAxis: s,
          yAxis: l,
          layout: c,
          dataPointFormatter: p
        });
      }));
    }
  }, {
    key: "renderDots",
    value: function(r, i, o) {
      var a = this.props.isAnimationActive;
      if (a && !this.state.isAnimationFinished)
        return null;
      var s = this.props, l = s.dot, c = s.points, f = s.dataKey, d = Ee(this.props, !1), p = Ee(l, !0), m = c.map(function(g, v) {
        var x = Ir(Ir(Ir({
          key: "dot-".concat(v),
          r: 3
        }, d), p), {}, {
          value: g.value,
          dataKey: f,
          cx: g.x,
          cy: g.y,
          index: v,
          payload: g.payload
        });
        return t.renderDotItem(l, x);
      }), y = {
        clipPath: r ? "url(#clipPath-".concat(i ? "" : "dots-").concat(o, ")") : null
      };
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, lf({
        className: "recharts-line-dots",
        key: "dots"
      }, y), m);
    }
  }, {
    key: "renderCurveStatically",
    value: function(r, i, o, a) {
      var s = this.props, l = s.type, c = s.layout, f = s.connectNulls;
      s.ref;
      var d = k$(s, eCe), p = Ir(Ir(Ir({}, Ee(d, !0)), {}, {
        fill: "none",
        className: "recharts-line-curve",
        clipPath: i ? "url(#clipPath-".concat(o, ")") : null,
        points: r
      }, a), {}, {
        type: l,
        layout: c,
        connectNulls: f
      });
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Ds, lf({}, p, {
        pathRef: this.pathRef
      }));
    }
  }, {
    key: "renderCurveWithAnimation",
    value: function(r, i) {
      var o = this, a = this.props, s = a.points, l = a.strokeDasharray, c = a.isAnimationActive, f = a.animationBegin, d = a.animationDuration, p = a.animationEasing, m = a.animationId, y = a.animateNewValues, g = a.width, v = a.height, x = this.state, w = x.prevPoints, S = x.totalLength;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement($i, {
        begin: f,
        duration: d,
        isActive: c,
        easing: p,
        from: {
          t: 0
        },
        to: {
          t: 1
        },
        key: "line-".concat(m),
        onAnimationEnd: this.handleAnimationEnd,
        onAnimationStart: this.handleAnimationStart
      }, function(A) {
        var _ = A.t;
        if (w) {
          var O = w.length / s.length, P = s.map(function(N, D) {
            var j = Math.floor(D * O);
            if (w[j]) {
              var F = w[j], W = _n(F.x, N.x), z = _n(F.y, N.y);
              return Ir(Ir({}, N), {}, {
                x: W(_),
                y: z(_)
              });
            }
            if (y) {
              var H = _n(g * 2, N.x), U = _n(v / 2, N.y);
              return Ir(Ir({}, N), {}, {
                x: H(_),
                y: U(_)
              });
            }
            return Ir(Ir({}, N), {}, {
              x: N.x,
              y: N.y
            });
          });
          return o.renderCurveStatically(P, r, i);
        }
        var C = _n(0, S), k = C(_), I;
        if (l) {
          var $ = "".concat(l).split(/[,\s]+/gim).map(function(N) {
            return parseFloat(N);
          });
          I = o.getStrokeDasharray(k, S, $);
        } else
          I = o.generateSimpleStrokeDasharray(S, k);
        return o.renderCurveStatically(s, r, i, {
          strokeDasharray: I
        });
      });
    }
  }, {
    key: "renderCurve",
    value: function(r, i) {
      var o = this.props, a = o.points, s = o.isAnimationActive, l = this.state, c = l.prevPoints, f = l.totalLength;
      return s && a && a.length && (!c && f > 0 || !Us(c, a)) ? this.renderCurveWithAnimation(r, i) : this.renderCurveStatically(a, r, i);
    }
  }, {
    key: "render",
    value: function() {
      var r, i = this.props, o = i.hide, a = i.dot, s = i.points, l = i.className, c = i.xAxis, f = i.yAxis, d = i.top, p = i.left, m = i.width, y = i.height, g = i.isAnimationActive, v = i.id;
      if (o || !s || !s.length)
        return null;
      var x = this.state.isAnimationFinished, w = s.length === 1, S = Xe("recharts-line", l), A = c && c.allowDataOverflow, _ = f && f.allowDataOverflow, O = A || _, P = Ue(v) ? this.id : v, C = (r = Ee(a, !1)) !== null && r !== void 0 ? r : {
        r: 3,
        strokeWidth: 2
      }, k = C.r, I = k === void 0 ? 3 : k, $ = C.strokeWidth, N = $ === void 0 ? 2 : $, D = RL(a) ? a : {}, j = D.clipDot, F = j === void 0 ? !0 : j, W = I * 2 + N;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: S
      }, A || _ ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("defs", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("clipPath", {
        id: "clipPath-".concat(P)
      }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
        x: A ? p : p - m / 2,
        y: _ ? d : d - y / 2,
        width: A ? m : m * 2,
        height: _ ? y : y * 2
      })), !F && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("clipPath", {
        id: "clipPath-dots-".concat(P)
      }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
        x: p - W / 2,
        y: d - W / 2,
        width: m + W,
        height: y + W
      }))) : null, !w && this.renderCurve(O, P), this.renderErrorBar(O, P), (w || a) && this.renderDots(O, F, P), (!g || x) && Ji.renderCallByParent(this.props, s));
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function(r, i) {
      return r.animationId !== i.prevAnimationId ? {
        prevAnimationId: r.animationId,
        curPoints: r.points,
        prevPoints: i.curPoints
      } : r.points !== i.curPoints ? {
        curPoints: r.points
      } : null;
    }
  }, {
    key: "repeat",
    value: function(r, i) {
      for (var o = r.length % 2 !== 0 ? [].concat(Tl(r), [0]) : r, a = [], s = 0; s < i; ++s)
        a = [].concat(Tl(a), Tl(o));
      return a;
    }
  }, {
    key: "renderDotItem",
    value: function(r, i) {
      var o;
      if (/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(r))
        o = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(r, i);
      else if (ze(r))
        o = r(i);
      else {
        var a = i.key, s = k$(i, tCe), l = Xe("recharts-line-dot", typeof r != "boolean" ? r.className : "");
        o = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Dd, lf({
          key: a
        }, s, {
          className: l
        }));
      }
      return o;
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent);
Ti(Id, "displayName", "Line");
Ti(Id, "defaultProps", {
  xAxisId: 0,
  yAxisId: 0,
  connectNulls: !1,
  activeDot: !0,
  dot: !0,
  legendType: "line",
  stroke: "#3182bd",
  strokeWidth: 1,
  fill: "#fff",
  points: [],
  isAnimationActive: !Ni.isSsr,
  animateNewValues: !0,
  animationBegin: 0,
  animationDuration: 1500,
  animationEasing: "ease",
  hide: !1,
  label: !1
});
Ti(Id, "getComposedData", function(e) {
  var t = e.props, n = e.xAxis, r = e.yAxis, i = e.xAxisTicks, o = e.yAxisTicks, a = e.dataKey, s = e.bandSize, l = e.displayedData, c = e.offset, f = t.layout, d = l.map(function(p, m) {
    var y = cn(p, a);
    return f === "horizontal" ? {
      x: wm({
        axis: n,
        ticks: i,
        bandSize: s,
        entry: p,
        index: m
      }),
      y: Ue(y) ? null : r.scale(y),
      value: y,
      payload: p
    } : {
      x: Ue(y) ? null : n.scale(y),
      y: wm({
        axis: r,
        ticks: o,
        bandSize: s,
        entry: p,
        index: m
      }),
      value: y,
      payload: p
    };
  });
  return Ir({
    points: d,
    layout: f
  }, c);
});
var pCe = ["layout", "type", "stroke", "connectNulls", "isRange", "ref"], mCe = ["key"], ZW;
function Pc(e) {
  "@babel/helpers - typeof";
  return Pc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Pc(e);
}
function JW(e, t) {
  if (e == null) return {};
  var n = gCe(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function gCe(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function Ps() {
  return Ps = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Ps.apply(this, arguments);
}
function $$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function ba(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? $$(Object(n), !0).forEach(function(r) {
      Hi(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : $$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function yCe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function D$(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, ez(r.key), r);
  }
}
function vCe(e, t, n) {
  return t && D$(e.prototype, t), n && D$(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function bCe(e, t, n) {
  return t = Gm(t), xCe(e, QW() ? Reflect.construct(t, n || [], Gm(e).constructor) : t.apply(e, n));
}
function xCe(e, t) {
  if (t && (Pc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return wCe(e);
}
function wCe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function QW() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (QW = function() {
    return !!e;
  })();
}
function Gm(e) {
  return Gm = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, Gm(e);
}
function _Ce(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && Rw(e, t);
}
function Rw(e, t) {
  return Rw = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, Rw(e, t);
}
function Hi(e, t, n) {
  return t = ez(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function ez(e) {
  var t = SCe(e, "string");
  return Pc(t) == "symbol" ? t : t + "";
}
function SCe(e, t) {
  if (Pc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Pc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var Xa = /* @__PURE__ */ function(e) {
  function t() {
    var n;
    yCe(this, t);
    for (var r = arguments.length, i = new Array(r), o = 0; o < r; o++)
      i[o] = arguments[o];
    return n = bCe(this, t, [].concat(i)), Hi(n, "state", {
      isAnimationFinished: !0
    }), Hi(n, "id", tl("recharts-area-")), Hi(n, "handleAnimationEnd", function() {
      var a = n.props.onAnimationEnd;
      n.setState({
        isAnimationFinished: !0
      }), ze(a) && a();
    }), Hi(n, "handleAnimationStart", function() {
      var a = n.props.onAnimationStart;
      n.setState({
        isAnimationFinished: !1
      }), ze(a) && a();
    }), n;
  }
  return _Ce(t, e), vCe(t, [{
    key: "renderDots",
    value: function(r, i, o) {
      var a = this.props.isAnimationActive, s = this.state.isAnimationFinished;
      if (a && !s)
        return null;
      var l = this.props, c = l.dot, f = l.points, d = l.dataKey, p = Ee(this.props, !1), m = Ee(c, !0), y = f.map(function(v, x) {
        var w = ba(ba(ba({
          key: "dot-".concat(x),
          r: 3
        }, p), m), {}, {
          index: x,
          cx: v.x,
          cy: v.y,
          dataKey: d,
          value: v.value,
          payload: v.payload,
          points: f
        });
        return t.renderDotItem(c, w);
      }), g = {
        clipPath: r ? "url(#clipPath-".concat(i ? "" : "dots-").concat(o, ")") : null
      };
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, Ps({
        className: "recharts-area-dots"
      }, g), y);
    }
  }, {
    key: "renderHorizontalRect",
    value: function(r) {
      var i = this.props, o = i.baseLine, a = i.points, s = i.strokeWidth, l = a[0].x, c = a[a.length - 1].x, f = r * Math.abs(l - c), d = Ta(a.map(function(p) {
        return p.y || 0;
      }));
      return be(o) && typeof o == "number" ? d = Math.max(o, d) : o && Array.isArray(o) && o.length && (d = Math.max(Ta(o.map(function(p) {
        return p.y || 0;
      })), d)), be(d) ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
        x: l < c ? l : l - f,
        y: 0,
        width: f,
        height: Math.floor(d + (s ? parseInt("".concat(s), 10) : 1))
      }) : null;
    }
  }, {
    key: "renderVerticalRect",
    value: function(r) {
      var i = this.props, o = i.baseLine, a = i.points, s = i.strokeWidth, l = a[0].y, c = a[a.length - 1].y, f = r * Math.abs(l - c), d = Ta(a.map(function(p) {
        return p.x || 0;
      }));
      return be(o) && typeof o == "number" ? d = Math.max(o, d) : o && Array.isArray(o) && o.length && (d = Math.max(Ta(o.map(function(p) {
        return p.x || 0;
      })), d)), be(d) ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
        x: 0,
        y: l < c ? l : l - f,
        width: d + (s ? parseInt("".concat(s), 10) : 1),
        height: Math.floor(f)
      }) : null;
    }
  }, {
    key: "renderClipRect",
    value: function(r) {
      var i = this.props.layout;
      return i === "vertical" ? this.renderVerticalRect(r) : this.renderHorizontalRect(r);
    }
  }, {
    key: "renderAreaStatically",
    value: function(r, i, o, a) {
      var s = this.props, l = s.layout, c = s.type, f = s.stroke, d = s.connectNulls, p = s.isRange;
      s.ref;
      var m = JW(s, pCe);
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        clipPath: o ? "url(#clipPath-".concat(a, ")") : null
      }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Ds, Ps({}, Ee(m, !0), {
        points: r,
        connectNulls: d,
        type: c,
        baseLine: i,
        layout: l,
        stroke: "none",
        className: "recharts-area-area"
      })), f !== "none" && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Ds, Ps({}, Ee(this.props, !1), {
        className: "recharts-area-curve",
        layout: l,
        type: c,
        connectNulls: d,
        fill: "none",
        points: r
      })), f !== "none" && p && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Ds, Ps({}, Ee(this.props, !1), {
        className: "recharts-area-curve",
        layout: l,
        type: c,
        connectNulls: d,
        fill: "none",
        points: i
      })));
    }
  }, {
    key: "renderAreaWithAnimation",
    value: function(r, i) {
      var o = this, a = this.props, s = a.points, l = a.baseLine, c = a.isAnimationActive, f = a.animationBegin, d = a.animationDuration, p = a.animationEasing, m = a.animationId, y = this.state, g = y.prevPoints, v = y.prevBaseLine;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement($i, {
        begin: f,
        duration: d,
        isActive: c,
        easing: p,
        from: {
          t: 0
        },
        to: {
          t: 1
        },
        key: "area-".concat(m),
        onAnimationEnd: this.handleAnimationEnd,
        onAnimationStart: this.handleAnimationStart
      }, function(x) {
        var w = x.t;
        if (g) {
          var S = g.length / s.length, A = s.map(function(C, k) {
            var I = Math.floor(k * S);
            if (g[I]) {
              var $ = g[I], N = _n($.x, C.x), D = _n($.y, C.y);
              return ba(ba({}, C), {}, {
                x: N(w),
                y: D(w)
              });
            }
            return C;
          }), _;
          if (be(l) && typeof l == "number") {
            var O = _n(v, l);
            _ = O(w);
          } else if (Ue(l) || Gc(l)) {
            var P = _n(v, 0);
            _ = P(w);
          } else
            _ = l.map(function(C, k) {
              var I = Math.floor(k * S);
              if (v[I]) {
                var $ = v[I], N = _n($.x, C.x), D = _n($.y, C.y);
                return ba(ba({}, C), {}, {
                  x: N(w),
                  y: D(w)
                });
              }
              return C;
            });
          return o.renderAreaStatically(A, _, r, i);
        }
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("defs", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("clipPath", {
          id: "animationClipPath-".concat(i)
        }, o.renderClipRect(w))), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
          clipPath: "url(#animationClipPath-".concat(i, ")")
        }, o.renderAreaStatically(s, l, r, i)));
      });
    }
  }, {
    key: "renderArea",
    value: function(r, i) {
      var o = this.props, a = o.points, s = o.baseLine, l = o.isAnimationActive, c = this.state, f = c.prevPoints, d = c.prevBaseLine, p = c.totalLength;
      return l && a && a.length && (!f && p > 0 || !Us(f, a) || !Us(d, s)) ? this.renderAreaWithAnimation(r, i) : this.renderAreaStatically(a, s, r, i);
    }
  }, {
    key: "render",
    value: function() {
      var r, i = this.props, o = i.hide, a = i.dot, s = i.points, l = i.className, c = i.top, f = i.left, d = i.xAxis, p = i.yAxis, m = i.width, y = i.height, g = i.isAnimationActive, v = i.id;
      if (o || !s || !s.length)
        return null;
      var x = this.state.isAnimationFinished, w = s.length === 1, S = Xe("recharts-area", l), A = d && d.allowDataOverflow, _ = p && p.allowDataOverflow, O = A || _, P = Ue(v) ? this.id : v, C = (r = Ee(a, !1)) !== null && r !== void 0 ? r : {
        r: 3,
        strokeWidth: 2
      }, k = C.r, I = k === void 0 ? 3 : k, $ = C.strokeWidth, N = $ === void 0 ? 2 : $, D = RL(a) ? a : {}, j = D.clipDot, F = j === void 0 ? !0 : j, W = I * 2 + N;
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
        className: S
      }, A || _ ? /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("defs", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("clipPath", {
        id: "clipPath-".concat(P)
      }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
        x: A ? f : f - m / 2,
        y: _ ? c : c - y / 2,
        width: A ? m : m * 2,
        height: _ ? y : y * 2
      })), !F && /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("clipPath", {
        id: "clipPath-dots-".concat(P)
      }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
        x: f - W / 2,
        y: c - W / 2,
        width: m + W,
        height: y + W
      }))) : null, w ? null : this.renderArea(O, P), (a || w) && this.renderDots(O, F, P), (!g || x) && Ji.renderCallByParent(this.props, s));
    }
  }], [{
    key: "getDerivedStateFromProps",
    value: function(r, i) {
      return r.animationId !== i.prevAnimationId ? {
        prevAnimationId: r.animationId,
        curPoints: r.points,
        curBaseLine: r.baseLine,
        prevPoints: i.curPoints,
        prevBaseLine: i.curBaseLine
      } : r.points !== i.curPoints || r.baseLine !== i.curBaseLine ? {
        curPoints: r.points,
        curBaseLine: r.baseLine
      } : null;
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.PureComponent);
ZW = Xa;
Hi(Xa, "displayName", "Area");
Hi(Xa, "defaultProps", {
  stroke: "#3182bd",
  fill: "#3182bd",
  fillOpacity: 0.6,
  xAxisId: 0,
  yAxisId: 0,
  legendType: "line",
  connectNulls: !1,
  // points of area
  points: [],
  dot: !1,
  activeDot: !0,
  hide: !1,
  isAnimationActive: !Ni.isSsr,
  animationBegin: 0,
  animationDuration: 1500,
  animationEasing: "ease"
});
Hi(Xa, "getBaseValue", function(e, t, n, r) {
  var i = e.layout, o = e.baseValue, a = t.props.baseValue, s = a ?? o;
  if (be(s) && typeof s == "number")
    return s;
  var l = i === "horizontal" ? r : n, c = l.scale.domain();
  if (l.type === "number") {
    var f = Math.max(c[0], c[1]), d = Math.min(c[0], c[1]);
    return s === "dataMin" ? d : s === "dataMax" || f < 0 ? f : Math.max(Math.min(c[0], c[1]), 0);
  }
  return s === "dataMin" ? c[0] : s === "dataMax" ? c[1] : c[0];
});
Hi(Xa, "getComposedData", function(e) {
  var t = e.props, n = e.item, r = e.xAxis, i = e.yAxis, o = e.xAxisTicks, a = e.yAxisTicks, s = e.bandSize, l = e.dataKey, c = e.stackedData, f = e.dataStartIndex, d = e.displayedData, p = e.offset, m = t.layout, y = c && c.length, g = ZW.getBaseValue(t, n, r, i), v = m === "horizontal", x = !1, w = d.map(function(A, _) {
    var O;
    y ? O = c[f + _] : (O = cn(A, l), Array.isArray(O) ? x = !0 : O = [g, O]);
    var P = O[1] == null || y && cn(A, l) == null;
    return v ? {
      x: wm({
        axis: r,
        ticks: o,
        bandSize: s,
        entry: A,
        index: _
      }),
      y: P ? null : i.scale(O[1]),
      value: O,
      payload: A
    } : {
      x: P ? null : r.scale(O[1]),
      y: wm({
        axis: i,
        ticks: a,
        bandSize: s,
        entry: A,
        index: _
      }),
      value: O,
      payload: A
    };
  }), S;
  return y || x ? S = w.map(function(A) {
    var _ = Array.isArray(A.value) ? A.value[0] : null;
    return v ? {
      x: A.x,
      y: _ != null && A.y != null ? i.scale(_) : null
    } : {
      x: _ != null ? r.scale(_) : null,
      y: A.y
    };
  }) : S = v ? i.scale(g) : r.scale(g), ba({
    points: w,
    baseLine: S,
    layout: m,
    isRange: x
  }, p);
});
Hi(Xa, "renderDotItem", function(e, t) {
  var n;
  if (/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(e))
    n = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(e, t);
  else if (ze(e))
    n = e(t);
  else {
    var r = Xe("recharts-area-dot", typeof e != "boolean" ? e.className : ""), i = t.key, o = JW(t, mCe);
    n = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Dd, Ps({}, o, {
      key: i,
      className: r
    }));
  }
  return n;
});
function Cc(e) {
  "@babel/helpers - typeof";
  return Cc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Cc(e);
}
function OCe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function ACe(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, rz(r.key), r);
  }
}
function TCe(e, t, n) {
  return t && ACe(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function PCe(e, t, n) {
  return t = Ym(t), CCe(e, tz() ? Reflect.construct(t, n || [], Ym(e).constructor) : t.apply(e, n));
}
function CCe(e, t) {
  if (t && (Cc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return ECe(e);
}
function ECe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function tz() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (tz = function() {
    return !!e;
  })();
}
function Ym(e) {
  return Ym = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, Ym(e);
}
function kCe(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && jw(e, t);
}
function jw(e, t) {
  return jw = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, jw(e, t);
}
function nz(e, t, n) {
  return t = rz(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function rz(e) {
  var t = MCe(e, "string");
  return Cc(t) == "symbol" ? t : t + "";
}
function MCe(e, t) {
  if (Cc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Cc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function Lw() {
  return Lw = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Lw.apply(this, arguments);
}
function NCe(e) {
  var t = e.xAxisId, n = DS(), r = IS(), i = jW(t);
  return i == null ? null : (
    // @ts-expect-error the axisOptions type is not exactly what CartesianAxis is expecting.
    /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(tu, Lw({}, i, {
      className: Xe("recharts-".concat(i.axisType, " ").concat(i.axisType), i.className),
      viewBox: {
        x: 0,
        y: 0,
        width: n,
        height: r
      },
      ticksGenerator: function(a) {
        return Mo(a, !0);
      }
    }))
  );
}
var Yo = /* @__PURE__ */ function(e) {
  function t() {
    return OCe(this, t), PCe(this, t, arguments);
  }
  return kCe(t, e), TCe(t, [{
    key: "render",
    value: function() {
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(NCe, this.props);
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.Component);
nz(Yo, "displayName", "XAxis");
nz(Yo, "defaultProps", {
  allowDecimals: !0,
  hide: !1,
  orientation: "bottom",
  width: 0,
  height: 30,
  mirror: !1,
  xAxisId: 0,
  tickCount: 5,
  type: "category",
  padding: {
    left: 0,
    right: 0
  },
  allowDataOverflow: !1,
  scale: "auto",
  reversed: !1,
  allowDuplicatedCategory: !0
});
function Ec(e) {
  "@babel/helpers - typeof";
  return Ec = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Ec(e);
}
function $Ce(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function DCe(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, az(r.key), r);
  }
}
function ICe(e, t, n) {
  return t && DCe(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function RCe(e, t, n) {
  return t = qm(t), jCe(e, iz() ? Reflect.construct(t, n || [], qm(e).constructor) : t.apply(e, n));
}
function jCe(e, t) {
  if (t && (Ec(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return LCe(e);
}
function LCe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function iz() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (iz = function() {
    return !!e;
  })();
}
function qm(e) {
  return qm = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, qm(e);
}
function BCe(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && Bw(e, t);
}
function Bw(e, t) {
  return Bw = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, Bw(e, t);
}
function oz(e, t, n) {
  return t = az(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function az(e) {
  var t = FCe(e, "string");
  return Ec(t) == "symbol" ? t : t + "";
}
function FCe(e, t) {
  if (Ec(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (Ec(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function Fw() {
  return Fw = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, Fw.apply(this, arguments);
}
var WCe = function(t) {
  var n = t.yAxisId, r = DS(), i = IS(), o = LW(n);
  return o == null ? null : (
    // @ts-expect-error the axisOptions type is not exactly what CartesianAxis is expecting.
    /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(tu, Fw({}, o, {
      className: Xe("recharts-".concat(o.axisType, " ").concat(o.axisType), o.className),
      viewBox: {
        x: 0,
        y: 0,
        width: r,
        height: i
      },
      ticksGenerator: function(s) {
        return Mo(s, !0);
      }
    }))
  );
}, eo = /* @__PURE__ */ function(e) {
  function t() {
    return $Ce(this, t), RCe(this, t, arguments);
  }
  return BCe(t, e), ICe(t, [{
    key: "render",
    value: function() {
      return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(WCe, this.props);
    }
  }]);
}(react__WEBPACK_IMPORTED_MODULE_1__.Component);
oz(eo, "displayName", "YAxis");
oz(eo, "defaultProps", {
  allowDuplicatedCategory: !0,
  allowDecimals: !0,
  hide: !1,
  orientation: "left",
  width: 60,
  height: 0,
  mirror: !1,
  yAxisId: 0,
  tickCount: 5,
  type: "number",
  padding: {
    top: 0,
    bottom: 0
  },
  allowDataOverflow: !1,
  scale: "auto",
  reversed: !1
});
function I$(e) {
  return HCe(e) || UCe(e) || VCe(e) || zCe();
}
function zCe() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function VCe(e, t) {
  if (e) {
    if (typeof e == "string") return Ww(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ww(e, t);
  }
}
function UCe(e) {
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function HCe(e) {
  if (Array.isArray(e)) return Ww(e);
}
function Ww(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
var zw = function(t, n, r, i, o) {
  var a = Vr(t, jS), s = Vr(t, Sy), l = [].concat(I$(a), I$(s)), c = Vr(t, Ay), f = "".concat(i, "Id"), d = i[0], p = n;
  if (l.length && (p = l.reduce(function(g, v) {
    if (v.props[f] === r && Qi(v.props, "extendDomain") && be(v.props[d])) {
      var x = v.props[d];
      return [Math.min(g[0], x), Math.max(g[1], x)];
    }
    return g;
  }, p)), c.length) {
    var m = "".concat(d, "1"), y = "".concat(d, "2");
    p = c.reduce(function(g, v) {
      if (v.props[f] === r && Qi(v.props, "extendDomain") && be(v.props[m]) && be(v.props[y])) {
        var x = v.props[m], w = v.props[y];
        return [Math.min(g[0], x, w), Math.max(g[1], x, w)];
      }
      return g;
    }, p);
  }
  return o && o.length && (p = o.reduce(function(g, v) {
    return be(v) ? [Math.min(g[0], v), Math.max(g[1], v)] : g;
  }, p)), p;
}, sz = { exports: {} };
(function(e) {
  var t = Object.prototype.hasOwnProperty, n = "~";
  function r() {
  }
  Object.create && (r.prototype = /* @__PURE__ */ Object.create(null), new r().__proto__ || (n = !1));
  function i(l, c, f) {
    this.fn = l, this.context = c, this.once = f || !1;
  }
  function o(l, c, f, d, p) {
    if (typeof f != "function")
      throw new TypeError("The listener must be a function");
    var m = new i(f, d || l, p), y = n ? n + c : c;
    return l._events[y] ? l._events[y].fn ? l._events[y] = [l._events[y], m] : l._events[y].push(m) : (l._events[y] = m, l._eventsCount++), l;
  }
  function a(l, c) {
    --l._eventsCount === 0 ? l._events = new r() : delete l._events[c];
  }
  function s() {
    this._events = new r(), this._eventsCount = 0;
  }
  s.prototype.eventNames = function() {
    var c = [], f, d;
    if (this._eventsCount === 0) return c;
    for (d in f = this._events)
      t.call(f, d) && c.push(n ? d.slice(1) : d);
    return Object.getOwnPropertySymbols ? c.concat(Object.getOwnPropertySymbols(f)) : c;
  }, s.prototype.listeners = function(c) {
    var f = n ? n + c : c, d = this._events[f];
    if (!d) return [];
    if (d.fn) return [d.fn];
    for (var p = 0, m = d.length, y = new Array(m); p < m; p++)
      y[p] = d[p].fn;
    return y;
  }, s.prototype.listenerCount = function(c) {
    var f = n ? n + c : c, d = this._events[f];
    return d ? d.fn ? 1 : d.length : 0;
  }, s.prototype.emit = function(c, f, d, p, m, y) {
    var g = n ? n + c : c;
    if (!this._events[g]) return !1;
    var v = this._events[g], x = arguments.length, w, S;
    if (v.fn) {
      switch (v.once && this.removeListener(c, v.fn, void 0, !0), x) {
        case 1:
          return v.fn.call(v.context), !0;
        case 2:
          return v.fn.call(v.context, f), !0;
        case 3:
          return v.fn.call(v.context, f, d), !0;
        case 4:
          return v.fn.call(v.context, f, d, p), !0;
        case 5:
          return v.fn.call(v.context, f, d, p, m), !0;
        case 6:
          return v.fn.call(v.context, f, d, p, m, y), !0;
      }
      for (S = 1, w = new Array(x - 1); S < x; S++)
        w[S - 1] = arguments[S];
      v.fn.apply(v.context, w);
    } else {
      var A = v.length, _;
      for (S = 0; S < A; S++)
        switch (v[S].once && this.removeListener(c, v[S].fn, void 0, !0), x) {
          case 1:
            v[S].fn.call(v[S].context);
            break;
          case 2:
            v[S].fn.call(v[S].context, f);
            break;
          case 3:
            v[S].fn.call(v[S].context, f, d);
            break;
          case 4:
            v[S].fn.call(v[S].context, f, d, p);
            break;
          default:
            if (!w) for (_ = 1, w = new Array(x - 1); _ < x; _++)
              w[_ - 1] = arguments[_];
            v[S].fn.apply(v[S].context, w);
        }
    }
    return !0;
  }, s.prototype.on = function(c, f, d) {
    return o(this, c, f, d, !1);
  }, s.prototype.once = function(c, f, d) {
    return o(this, c, f, d, !0);
  }, s.prototype.removeListener = function(c, f, d, p) {
    var m = n ? n + c : c;
    if (!this._events[m]) return this;
    if (!f)
      return a(this, m), this;
    var y = this._events[m];
    if (y.fn)
      y.fn === f && (!p || y.once) && (!d || y.context === d) && a(this, m);
    else {
      for (var g = 0, v = [], x = y.length; g < x; g++)
        (y[g].fn !== f || p && !y[g].once || d && y[g].context !== d) && v.push(y[g]);
      v.length ? this._events[m] = v.length === 1 ? v[0] : v : a(this, m);
    }
    return this;
  }, s.prototype.removeAllListeners = function(c) {
    var f;
    return c ? (f = n ? n + c : c, this._events[f] && a(this, f)) : (this._events = new r(), this._eventsCount = 0), this;
  }, s.prototype.off = s.prototype.removeListener, s.prototype.addListener = s.prototype.on, s.prefixed = n, s.EventEmitter = s, e.exports = s;
})(sz);
var KCe = sz.exports;
const GCe = /* @__PURE__ */ (0,_commonjsHelpers_DaMA6jEr_js__WEBPACK_IMPORTED_MODULE_3__.g)(KCe);
var s0 = new GCe(), l0 = "recharts.syncMouseEvents";
function od(e) {
  "@babel/helpers - typeof";
  return od = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, od(e);
}
function YCe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function qCe(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, lz(r.key), r);
  }
}
function XCe(e, t, n) {
  return t && qCe(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function c0(e, t, n) {
  return t = lz(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function lz(e) {
  var t = ZCe(e, "string");
  return od(t) == "symbol" ? t : t + "";
}
function ZCe(e, t) {
  if (od(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t);
    if (od(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return String(e);
}
var JCe = /* @__PURE__ */ function() {
  function e() {
    YCe(this, e), c0(this, "activeIndex", 0), c0(this, "coordinateList", []), c0(this, "layout", "horizontal");
  }
  return XCe(e, [{
    key: "setDetails",
    value: function(n) {
      var r, i = n.coordinateList, o = i === void 0 ? null : i, a = n.container, s = a === void 0 ? null : a, l = n.layout, c = l === void 0 ? null : l, f = n.offset, d = f === void 0 ? null : f, p = n.mouseHandlerCallback, m = p === void 0 ? null : p;
      this.coordinateList = (r = o ?? this.coordinateList) !== null && r !== void 0 ? r : [], this.container = s ?? this.container, this.layout = c ?? this.layout, this.offset = d ?? this.offset, this.mouseHandlerCallback = m ?? this.mouseHandlerCallback, this.activeIndex = Math.min(Math.max(this.activeIndex, 0), this.coordinateList.length - 1);
    }
  }, {
    key: "focus",
    value: function() {
      this.spoofMouse();
    }
  }, {
    key: "keyboardEvent",
    value: function(n) {
      if (this.coordinateList.length !== 0)
        switch (n.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;
          }
        }
    }
  }, {
    key: "setIndex",
    value: function(n) {
      this.activeIndex = n;
    }
  }, {
    key: "spoofMouse",
    value: function() {
      var n, r;
      if (this.layout === "horizontal" && this.coordinateList.length !== 0) {
        var i = this.container.getBoundingClientRect(), o = i.x, a = i.y, s = i.height, l = this.coordinateList[this.activeIndex].coordinate, c = ((n = window) === null || n === void 0 ? void 0 : n.scrollX) || 0, f = ((r = window) === null || r === void 0 ? void 0 : r.scrollY) || 0, d = o + l + c, p = a + this.offset.top + s / 2 + f;
        this.mouseHandlerCallback({
          pageX: d,
          pageY: p
        });
      }
    }
  }]);
}();
function QCe(e, t, n) {
  if (n === "number" && t === !0 && Array.isArray(e)) {
    var r = e == null ? void 0 : e[0], i = e == null ? void 0 : e[1];
    if (r && i && be(r) && be(i))
      return !0;
  }
  return !1;
}
function eEe(e, t, n, r) {
  var i = r / 2;
  return {
    stroke: "none",
    fill: "#ccc",
    x: e === "horizontal" ? t.x - i : n.left + 0.5,
    y: e === "horizontal" ? n.top + 0.5 : t.y - i,
    width: e === "horizontal" ? r : n.width - 1,
    height: e === "horizontal" ? n.height - 1 : r
  };
}
function cz(e) {
  var t = e.cx, n = e.cy, r = e.radius, i = e.startAngle, o = e.endAngle, a = Bt(t, n, r, i), s = Bt(t, n, r, o);
  return {
    points: [a, s],
    cx: t,
    cy: n,
    radius: r,
    startAngle: i,
    endAngle: o
  };
}
function tEe(e, t, n) {
  var r, i, o, a;
  if (e === "horizontal")
    r = t.x, o = r, i = n.top, a = n.top + n.height;
  else if (e === "vertical")
    i = t.y, a = i, r = n.left, o = n.left + n.width;
  else if (t.cx != null && t.cy != null)
    if (e === "centric") {
      var s = t.cx, l = t.cy, c = t.innerRadius, f = t.outerRadius, d = t.angle, p = Bt(s, l, c, d), m = Bt(s, l, f, d);
      r = p.x, i = p.y, o = m.x, a = m.y;
    } else
      return cz(t);
  return [{
    x: r,
    y: i
  }, {
    x: o,
    y: a
  }];
}
function ad(e) {
  "@babel/helpers - typeof";
  return ad = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, ad(e);
}
function R$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function tp(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? R$(Object(n), !0).forEach(function(r) {
      nEe(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : R$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function nEe(e, t, n) {
  return t = rEe(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function rEe(e) {
  var t = iEe(e, "string");
  return ad(t) == "symbol" ? t : t + "";
}
function iEe(e, t) {
  if (ad(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (ad(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function oEe(e) {
  var t, n, r = e.element, i = e.tooltipEventType, o = e.isActive, a = e.activeCoordinate, s = e.activePayload, l = e.offset, c = e.activeTooltipIndex, f = e.tooltipAxisBandSize, d = e.layout, p = e.chartName, m = (t = r.props.cursor) !== null && t !== void 0 ? t : (n = r.type.defaultProps) === null || n === void 0 ? void 0 : n.cursor;
  if (!r || !m || !o || !a || p !== "ScatterChart" && i !== "axis")
    return null;
  var y, g = Ds;
  if (p === "ScatterChart")
    y = a, g = hSe;
  else if (p === "BarChart")
    y = eEe(d, a, l, f), g = ES;
  else if (d === "radial") {
    var v = cz(a), x = v.cx, w = v.cy, S = v.radius, A = v.startAngle, _ = v.endAngle;
    y = {
      cx: x,
      cy: w,
      startAngle: A,
      endAngle: _,
      innerRadius: S,
      outerRadius: S
    }, g = tW;
  } else
    y = {
      points: tEe(d, a, l)
    }, g = Ds;
  var O = tp(tp(tp(tp({
    stroke: "#ccc",
    pointerEvents: "none"
  }, l), y), Ee(m, !1)), {}, {
    payload: s,
    payloadIndex: c,
    className: Xe("recharts-tooltip-cursor", m.className)
  });
  return /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(m) ? /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(m, O) : /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(g, O);
}
var aEe = ["item"], sEe = ["children", "className", "width", "height", "style", "compact", "title", "desc"];
function kc(e) {
  "@babel/helpers - typeof";
  return kc = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
    return typeof t;
  } : function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, kc(e);
}
function zl() {
  return zl = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, zl.apply(this, arguments);
}
function j$(e, t) {
  return uEe(e) || cEe(e, t) || fz(e, t) || lEe();
}
function lEe() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function cEe(e, t) {
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
  if (n != null) {
    var r, i, o, a, s = [], l = !0, c = !1;
    try {
      if (o = (n = n.call(e)).next, t !== 0) for (; !(l = (r = o.call(n)).done) && (s.push(r.value), s.length !== t); l = !0) ;
    } catch (f) {
      c = !0, i = f;
    } finally {
      try {
        if (!l && n.return != null && (a = n.return(), Object(a) !== a)) return;
      } finally {
        if (c) throw i;
      }
    }
    return s;
  }
}
function uEe(e) {
  if (Array.isArray(e)) return e;
}
function L$(e, t) {
  if (e == null) return {};
  var n = fEe(e, t), r, i;
  if (Object.getOwnPropertySymbols) {
    var o = Object.getOwnPropertySymbols(e);
    for (i = 0; i < o.length; i++)
      r = o[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function fEe(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function dEe(e, t) {
  if (!(e instanceof t))
    throw new TypeError("Cannot call a class as a function");
}
function hEe(e, t) {
  for (var n = 0; n < t.length; n++) {
    var r = t[n];
    r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, dz(r.key), r);
  }
}
function pEe(e, t, n) {
  return t && hEe(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
}
function mEe(e, t, n) {
  return t = Xm(t), gEe(e, uz() ? Reflect.construct(t, n || [], Xm(e).constructor) : t.apply(e, n));
}
function gEe(e, t) {
  if (t && (kc(t) === "object" || typeof t == "function"))
    return t;
  if (t !== void 0)
    throw new TypeError("Derived constructors may only return object or undefined");
  return yEe(e);
}
function yEe(e) {
  if (e === void 0)
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e;
}
function uz() {
  try {
    var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch {
  }
  return (uz = function() {
    return !!e;
  })();
}
function Xm(e) {
  return Xm = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
    return n.__proto__ || Object.getPrototypeOf(n);
  }, Xm(e);
}
function vEe(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Super expression must either be null or a function");
  e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && Vw(e, t);
}
function Vw(e, t) {
  return Vw = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
    return r.__proto__ = i, r;
  }, Vw(e, t);
}
function Mc(e) {
  return wEe(e) || xEe(e) || fz(e) || bEe();
}
function bEe() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function fz(e, t) {
  if (e) {
    if (typeof e == "string") return Uw(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Uw(e, t);
  }
}
function xEe(e) {
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function wEe(e) {
  if (Array.isArray(e)) return Uw(e);
}
function Uw(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];
  return r;
}
function B$(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(i) {
      return Object.getOwnPropertyDescriptor(e, i).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function le(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? B$(Object(n), !0).forEach(function(r) {
      We(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : B$(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function We(e, t, n) {
  return t = dz(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function dz(e) {
  var t = _Ee(e, "string");
  return kc(t) == "symbol" ? t : t + "";
}
function _Ee(e, t) {
  if (kc(e) != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t || "default");
    if (kc(r) != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
var SEe = {
  xAxis: ["bottom", "top"],
  yAxis: ["left", "right"]
}, OEe = {
  width: "100%",
  height: "100%"
}, hz = {
  x: 0,
  y: 0
};
function np(e) {
  return e;
}
var AEe = function(t, n) {
  return n === "horizontal" ? t.x : n === "vertical" ? t.y : n === "centric" ? t.angle : t.radius;
}, TEe = function(t, n, r, i) {
  var o = n.find(function(f) {
    return f && f.index === r;
  });
  if (o) {
    if (t === "horizontal")
      return {
        x: o.coordinate,
        y: i.y
      };
    if (t === "vertical")
      return {
        x: i.x,
        y: o.coordinate
      };
    if (t === "centric") {
      var a = o.coordinate, s = i.radius;
      return le(le(le({}, i), Bt(i.cx, i.cy, s, a)), {}, {
        angle: a,
        radius: s
      });
    }
    var l = o.coordinate, c = i.angle;
    return le(le(le({}, i), Bt(i.cx, i.cy, l, c)), {}, {
      angle: c,
      radius: l
    });
  }
  return hz;
}, Py = function(t, n) {
  var r = n.graphicalItems, i = n.dataStartIndex, o = n.dataEndIndex, a = (r ?? []).reduce(function(s, l) {
    var c = l.props.data;
    return c && c.length ? [].concat(Mc(s), Mc(c)) : s;
  }, []);
  return a.length > 0 ? a : t && t.length && be(i) && be(o) ? t.slice(i, o + 1) : [];
};
function pz(e) {
  return e === "number" ? [0, "auto"] : void 0;
}
var Hw = function(t, n, r, i) {
  var o = t.graphicalItems, a = t.tooltipAxis, s = Py(n, t);
  return r < 0 || !o || !o.length || r >= s.length ? null : o.reduce(function(l, c) {
    var f, d = (f = c.props.data) !== null && f !== void 0 ? f : n;
    d && t.dataStartIndex + t.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.
    t.dataEndIndex - t.dataStartIndex >= r && (d = d.slice(t.dataStartIndex, t.dataEndIndex + 1));
    var p;
    if (a.dataKey && !a.allowDuplicatedCategory) {
      var m = d === void 0 ? s : d;
      p = Gp(m, a.dataKey, i);
    } else
      p = d && d[r] || s[r];
    return p ? [].concat(Mc(l), [qF(c, p)]) : l;
  }, []);
}, F$ = function(t, n, r, i) {
  var o = i || {
    x: t.chartX,
    y: t.chartY
  }, a = AEe(o, r), s = t.orderedTooltipTicks, l = t.tooltipAxis, c = t.tooltipTicks, f = zxe(a, s, c, l);
  if (f >= 0 && c) {
    var d = c[f] && c[f].value, p = Hw(t, n, f, d), m = TEe(r, s, f, o);
    return {
      activeTooltipIndex: f,
      activeLabel: d,
      activePayload: p,
      activeCoordinate: m
    };
  }
  return null;
}, PEe = function(t, n) {
  var r = n.axes, i = n.graphicalItems, o = n.axisType, a = n.axisIdKey, s = n.stackGroups, l = n.dataStartIndex, c = n.dataEndIndex, f = t.layout, d = t.children, p = t.stackOffset, m = VF(f, o);
  return r.reduce(function(y, g) {
    var v, x = g.type.defaultProps !== void 0 ? le(le({}, g.type.defaultProps), g.props) : g.props, w = x.type, S = x.dataKey, A = x.allowDataOverflow, _ = x.allowDuplicatedCategory, O = x.scale, P = x.ticks, C = x.includeHidden, k = x[a];
    if (y[k])
      return y;
    var I = Py(t.data, {
      graphicalItems: i.filter(function(Q) {
        var ne, re = a in Q.props ? Q.props[a] : (ne = Q.type.defaultProps) === null || ne === void 0 ? void 0 : ne[a];
        return re === k;
      }),
      dataStartIndex: l,
      dataEndIndex: c
    }), $ = I.length, N, D, j;
    QCe(x.domain, A, w) && (N = rw(x.domain, null, A), m && (w === "number" || O !== "auto") && (j = rf(I, S, "category")));
    var F = pz(w);
    if (!N || N.length === 0) {
      var W, z = (W = x.domain) !== null && W !== void 0 ? W : F;
      if (S) {
        if (N = rf(I, S, w), w === "category" && m) {
          var H = Nae(N);
          _ && H ? (D = N, N = Im(0, $)) : _ || (N = ZM(z, N, g).reduce(function(Q, ne) {
            return Q.indexOf(ne) >= 0 ? Q : [].concat(Mc(Q), [ne]);
          }, []));
        } else if (w === "category")
          _ ? N = N.filter(function(Q) {
            return Q !== "" && !Ue(Q);
          }) : N = ZM(z, N, g).reduce(function(Q, ne) {
            return Q.indexOf(ne) >= 0 || ne === "" || Ue(ne) ? Q : [].concat(Mc(Q), [ne]);
          }, []);
        else if (w === "number") {
          var U = Gxe(I, i.filter(function(Q) {
            var ne, re, ce = a in Q.props ? Q.props[a] : (ne = Q.type.defaultProps) === null || ne === void 0 ? void 0 : ne[a], oe = "hide" in Q.props ? Q.props.hide : (re = Q.type.defaultProps) === null || re === void 0 ? void 0 : re.hide;
            return ce === k && (C || !oe);
          }), S, o, f);
          U && (N = U);
        }
        m && (w === "number" || O !== "auto") && (j = rf(I, S, "category"));
      } else m ? N = Im(0, $) : s && s[k] && s[k].hasStack && w === "number" ? N = p === "expand" ? [0, 1] : YF(s[k].stackGroups, l, c) : N = zF(I, i.filter(function(Q) {
        var ne = a in Q.props ? Q.props[a] : Q.type.defaultProps[a], re = "hide" in Q.props ? Q.props.hide : Q.type.defaultProps.hide;
        return ne === k && (C || !re);
      }), w, f, !0);
      if (w === "number")
        N = zw(d, N, k, o, P), z && (N = rw(z, N, A));
      else if (w === "category" && z) {
        var V = z, Y = N.every(function(Q) {
          return V.indexOf(Q) >= 0;
        });
        Y && (N = V);
      }
    }
    return le(le({}, y), {}, We({}, k, le(le({}, x), {}, {
      axisType: o,
      domain: N,
      categoricalDomain: j,
      duplicateDomain: D,
      originalDomain: (v = x.domain) !== null && v !== void 0 ? v : F,
      isCategorical: m,
      layout: f
    })));
  }, {});
}, CEe = function(t, n) {
  var r = n.graphicalItems, i = n.Axis, o = n.axisType, a = n.axisIdKey, s = n.stackGroups, l = n.dataStartIndex, c = n.dataEndIndex, f = t.layout, d = t.children, p = Py(t.data, {
    graphicalItems: r,
    dataStartIndex: l,
    dataEndIndex: c
  }), m = p.length, y = VF(f, o), g = -1;
  return r.reduce(function(v, x) {
    var w = x.type.defaultProps !== void 0 ? le(le({}, x.type.defaultProps), x.props) : x.props, S = w[a], A = pz("number");
    if (!v[S]) {
      g++;
      var _;
      return y ? _ = Im(0, m) : s && s[S] && s[S].hasStack ? (_ = YF(s[S].stackGroups, l, c), _ = zw(d, _, S, o)) : (_ = rw(A, zF(p, r.filter(function(O) {
        var P, C, k = a in O.props ? O.props[a] : (P = O.type.defaultProps) === null || P === void 0 ? void 0 : P[a], I = "hide" in O.props ? O.props.hide : (C = O.type.defaultProps) === null || C === void 0 ? void 0 : C.hide;
        return k === S && !I;
      }), "number", f), i.defaultProps.allowDataOverflow), _ = zw(d, _, S, o)), le(le({}, v), {}, We({}, S, le(le({
        axisType: o
      }, i.defaultProps), {}, {
        hide: !0,
        orientation: zr(SEe, "".concat(o, ".").concat(g % 2), null),
        domain: _,
        originalDomain: A,
        isCategorical: y,
        layout: f
        // specify scale when no Axis
        // scale: isCategorical ? 'band' : 'linear',
      })));
    }
    return v;
  }, {});
}, EEe = function(t, n) {
  var r = n.axisType, i = r === void 0 ? "xAxis" : r, o = n.AxisComp, a = n.graphicalItems, s = n.stackGroups, l = n.dataStartIndex, c = n.dataEndIndex, f = t.children, d = "".concat(i, "Id"), p = Vr(f, o), m = {};
  return p && p.length ? m = PEe(t, {
    axes: p,
    graphicalItems: a,
    axisType: i,
    axisIdKey: d,
    stackGroups: s,
    dataStartIndex: l,
    dataEndIndex: c
  }) : a && a.length && (m = CEe(t, {
    Axis: o,
    graphicalItems: a,
    axisType: i,
    axisIdKey: d,
    stackGroups: s,
    dataStartIndex: l,
    dataEndIndex: c
  })), m;
}, kEe = function(t) {
  var n = Sa(t), r = Mo(n, !1, !0);
  return {
    tooltipTicks: r,
    orderedTooltipTicks: Q_(r, function(i) {
      return i.coordinate;
    }),
    tooltipAxis: n,
    tooltipAxisBandSize: _m(n, r)
  };
}, W$ = function(t) {
  var n = t.children, r = t.defaultShowTooltip, i = jr(n, bc), o = 0, a = 0;
  return t.data && t.data.length !== 0 && (a = t.data.length - 1), i && i.props && (i.props.startIndex >= 0 && (o = i.props.startIndex), i.props.endIndex >= 0 && (a = i.props.endIndex)), {
    chartX: 0,
    chartY: 0,
    dataStartIndex: o,
    dataEndIndex: a,
    activeTooltipIndex: -1,
    isTooltipActive: !!r
  };
}, MEe = function(t) {
  return !t || !t.length ? !1 : t.some(function(n) {
    var r = jo(n && n.type);
    return r && r.indexOf("Bar") >= 0;
  });
}, z$ = function(t) {
  return t === "horizontal" ? {
    numericAxisName: "yAxis",
    cateAxisName: "xAxis"
  } : t === "vertical" ? {
    numericAxisName: "xAxis",
    cateAxisName: "yAxis"
  } : t === "centric" ? {
    numericAxisName: "radiusAxis",
    cateAxisName: "angleAxis"
  } : {
    numericAxisName: "angleAxis",
    cateAxisName: "radiusAxis"
  };
}, NEe = function(t, n) {
  var r = t.props, i = t.graphicalItems, o = t.xAxisMap, a = o === void 0 ? {} : o, s = t.yAxisMap, l = s === void 0 ? {} : s, c = r.width, f = r.height, d = r.children, p = r.margin || {}, m = jr(d, bc), y = jr(d, Lo), g = Object.keys(l).reduce(function(_, O) {
    var P = l[O], C = P.orientation;
    return !P.mirror && !P.hide ? le(le({}, _), {}, We({}, C, _[C] + P.width)) : _;
  }, {
    left: p.left || 0,
    right: p.right || 0
  }), v = Object.keys(a).reduce(function(_, O) {
    var P = a[O], C = P.orientation;
    return !P.mirror && !P.hide ? le(le({}, _), {}, We({}, C, zr(_, "".concat(C)) + P.height)) : _;
  }, {
    top: p.top || 0,
    bottom: p.bottom || 0
  }), x = le(le({}, v), g), w = x.bottom;
  m && (x.bottom += m.props.height || bc.defaultProps.height), y && n && (x = Hxe(x, i, r, n));
  var S = c - x.left - x.right, A = f - x.top - x.bottom;
  return le(le({
    brushBottom: w
  }, x), {}, {
    // never return negative values for height and width
    width: Math.max(S, 0),
    height: Math.max(A, 0)
  });
}, $Ee = function(t, n) {
  if (n === "xAxis")
    return t[n].width;
  if (n === "yAxis")
    return t[n].height;
}, Cy = function(t) {
  var n = t.chartName, r = t.GraphicalChild, i = t.defaultTooltipEventType, o = i === void 0 ? "axis" : i, a = t.validateTooltipEventTypes, s = a === void 0 ? ["axis"] : a, l = t.axisComponents, c = t.legendContent, f = t.formatAxisMap, d = t.defaultProps, p = function(x, w) {
    var S = w.graphicalItems, A = w.stackGroups, _ = w.offset, O = w.updateId, P = w.dataStartIndex, C = w.dataEndIndex, k = x.barSize, I = x.layout, $ = x.barGap, N = x.barCategoryGap, D = x.maxBarSize, j = z$(I), F = j.numericAxisName, W = j.cateAxisName, z = MEe(S), H = [];
    return S.forEach(function(U, V) {
      var Y = Py(x.data, {
        graphicalItems: [U],
        dataStartIndex: P,
        dataEndIndex: C
      }), Q = U.type.defaultProps !== void 0 ? le(le({}, U.type.defaultProps), U.props) : U.props, ne = Q.dataKey, re = Q.maxBarSize, ce = Q["".concat(F, "Id")], oe = Q["".concat(W, "Id")], fe = {}, ae = l.reduce(function(Oe, Ge) {
        var Zt, mt, en = w["".concat(Ge.axisType, "Map")], Yr = Q["".concat(Ge.axisType, "Id")];
        en && en[Yr] || Ge.axisType === "zAxis" || ( true ? Sr(!1, "Specifying a(n) ".concat(Ge.axisType, "Id requires a corresponding ").concat(
          Ge.axisType,
          "Id on the targeted graphical component "
        ).concat((Zt = U == null || (mt = U.type) === null || mt === void 0 ? void 0 : mt.displayName) !== null && Zt !== void 0 ? Zt : "")) : 0);
        var Cn = en[Yr];
        return le(le({}, Oe), {}, We(We({}, Ge.axisType, Cn), "".concat(Ge.axisType, "Ticks"), Mo(Cn)));
      }, fe), ee = ae[W], se = ae["".concat(W, "Ticks")], ge = A && A[ce] && A[ce].hasStack && nwe(U, A[ce].stackGroups), X = jo(U.type).indexOf("Bar") >= 0, $e = _m(ee, se), de = [], ke = z && Vxe({
        barSize: k,
        stackGroups: A,
        totalSize: $Ee(ae, W)
      });
      if (X) {
        var it, lt, Xn = Ue(re) ? D : re, Ie = (it = (lt = _m(ee, se, !0)) !== null && lt !== void 0 ? lt : Xn) !== null && it !== void 0 ? it : 0;
        de = Uxe({
          barGap: $,
          barCategoryGap: N,
          bandSize: Ie !== $e ? Ie : $e,
          sizeList: ke[oe],
          maxBarSize: Xn
        }), Ie !== $e && (de = de.map(function(Oe) {
          return le(le({}, Oe), {}, {
            position: le(le({}, Oe.position), {}, {
              offset: Oe.position.offset - Ie / 2
            })
          });
        }));
      }
      var ct = U && U.type && U.type.getComposedData;
      ct && H.push({
        props: le(le({}, ct(le(le({}, ae), {}, {
          displayedData: Y,
          props: x,
          dataKey: ne,
          item: U,
          bandSize: $e,
          barPosition: de,
          offset: _,
          stackedData: ge,
          layout: I,
          dataStartIndex: P,
          dataEndIndex: C
        }))), {}, We(We(We({
          key: U.key || "item-".concat(V)
        }, F, ae[F]), W, ae[W]), "animationId", O)),
        childIndex: Vae(U, x.children),
        item: U
      });
    }), H;
  }, m = function(x, w) {
    var S = x.props, A = x.dataStartIndex, _ = x.dataEndIndex, O = x.updateId;
    if (!HE({
      props: S
    }))
      return null;
    var P = S.children, C = S.layout, k = S.stackOffset, I = S.data, $ = S.reverseStackOrder, N = z$(C), D = N.numericAxisName, j = N.cateAxisName, F = Vr(P, r), W = ewe(I, F, "".concat(D, "Id"), "".concat(j, "Id"), k, $), z = l.reduce(function(Q, ne) {
      var re = "".concat(ne.axisType, "Map");
      return le(le({}, Q), {}, We({}, re, EEe(S, le(le({}, ne), {}, {
        graphicalItems: F,
        stackGroups: ne.axisType === D && W,
        dataStartIndex: A,
        dataEndIndex: _
      }))));
    }, {}), H = NEe(le(le({}, z), {}, {
      props: S,
      graphicalItems: F
    }), w == null ? void 0 : w.legendBBox);
    Object.keys(z).forEach(function(Q) {
      z[Q] = f(S, z[Q], H, Q.replace("Map", ""), n);
    });
    var U = z["".concat(j, "Map")], V = kEe(U), Y = p(S, le(le({}, z), {}, {
      dataStartIndex: A,
      dataEndIndex: _,
      updateId: O,
      graphicalItems: F,
      stackGroups: W,
      offset: H
    }));
    return le(le({
      formattedGraphicalItems: Y,
      graphicalItems: F,
      offset: H,
      stackGroups: W
    }, V), z);
  }, y = /* @__PURE__ */ function(v) {
    function x(w) {
      var S, A, _;
      return dEe(this, x), _ = mEe(this, x, [w]), We(_, "eventEmitterSymbol", Symbol("rechartsEventEmitter")), We(_, "accessibilityManager", new JCe()), We(_, "handleLegendBBoxUpdate", function(O) {
        if (O) {
          var P = _.state, C = P.dataStartIndex, k = P.dataEndIndex, I = P.updateId;
          _.setState(le({
            legendBBox: O
          }, m({
            props: _.props,
            dataStartIndex: C,
            dataEndIndex: k,
            updateId: I
          }, le(le({}, _.state), {}, {
            legendBBox: O
          }))));
        }
      }), We(_, "handleReceiveSyncEvent", function(O, P, C) {
        if (_.props.syncId === O) {
          if (C === _.eventEmitterSymbol && typeof _.props.syncMethod != "function")
            return;
          _.applySyncEvent(P);
        }
      }), We(_, "handleBrushChange", function(O) {
        var P = O.startIndex, C = O.endIndex;
        if (P !== _.state.dataStartIndex || C !== _.state.dataEndIndex) {
          var k = _.state.updateId;
          _.setState(function() {
            return le({
              dataStartIndex: P,
              dataEndIndex: C
            }, m({
              props: _.props,
              dataStartIndex: P,
              dataEndIndex: C,
              updateId: k
            }, _.state));
          }), _.triggerSyncEvent({
            dataStartIndex: P,
            dataEndIndex: C
          });
        }
      }), We(_, "handleMouseEnter", function(O) {
        var P = _.getMouseInfo(O);
        if (P) {
          var C = le(le({}, P), {}, {
            isTooltipActive: !0
          });
          _.setState(C), _.triggerSyncEvent(C);
          var k = _.props.onMouseEnter;
          ze(k) && k(C, O);
        }
      }), We(_, "triggeredAfterMouseMove", function(O) {
        var P = _.getMouseInfo(O), C = P ? le(le({}, P), {}, {
          isTooltipActive: !0
        }) : {
          isTooltipActive: !1
        };
        _.setState(C), _.triggerSyncEvent(C);
        var k = _.props.onMouseMove;
        ze(k) && k(C, O);
      }), We(_, "handleItemMouseEnter", function(O) {
        _.setState(function() {
          return {
            isTooltipActive: !0,
            activeItem: O,
            activePayload: O.tooltipPayload,
            activeCoordinate: O.tooltipPosition || {
              x: O.cx,
              y: O.cy
            }
          };
        });
      }), We(_, "handleItemMouseLeave", function() {
        _.setState(function() {
          return {
            isTooltipActive: !1
          };
        });
      }), We(_, "handleMouseMove", function(O) {
        O.persist(), _.throttleTriggeredAfterMouseMove(O);
      }), We(_, "handleMouseLeave", function(O) {
        _.throttleTriggeredAfterMouseMove.cancel();
        var P = {
          isTooltipActive: !1
        };
        _.setState(P), _.triggerSyncEvent(P);
        var C = _.props.onMouseLeave;
        ze(C) && C(P, O);
      }), We(_, "handleOuterEvent", function(O) {
        var P = zae(O), C = zr(_.props, "".concat(P));
        if (P && ze(C)) {
          var k, I;
          /.*touch.*/i.test(P) ? I = _.getMouseInfo(O.changedTouches[0]) : I = _.getMouseInfo(O), C((k = I) !== null && k !== void 0 ? k : {}, O);
        }
      }), We(_, "handleClick", function(O) {
        var P = _.getMouseInfo(O);
        if (P) {
          var C = le(le({}, P), {}, {
            isTooltipActive: !0
          });
          _.setState(C), _.triggerSyncEvent(C);
          var k = _.props.onClick;
          ze(k) && k(C, O);
        }
      }), We(_, "handleMouseDown", function(O) {
        var P = _.props.onMouseDown;
        if (ze(P)) {
          var C = _.getMouseInfo(O);
          P(C, O);
        }
      }), We(_, "handleMouseUp", function(O) {
        var P = _.props.onMouseUp;
        if (ze(P)) {
          var C = _.getMouseInfo(O);
          P(C, O);
        }
      }), We(_, "handleTouchMove", function(O) {
        O.changedTouches != null && O.changedTouches.length > 0 && _.throttleTriggeredAfterMouseMove(O.changedTouches[0]);
      }), We(_, "handleTouchStart", function(O) {
        O.changedTouches != null && O.changedTouches.length > 0 && _.handleMouseDown(O.changedTouches[0]);
      }), We(_, "handleTouchEnd", function(O) {
        O.changedTouches != null && O.changedTouches.length > 0 && _.handleMouseUp(O.changedTouches[0]);
      }), We(_, "triggerSyncEvent", function(O) {
        _.props.syncId !== void 0 && s0.emit(l0, _.props.syncId, O, _.eventEmitterSymbol);
      }), We(_, "applySyncEvent", function(O) {
        var P = _.props, C = P.layout, k = P.syncMethod, I = _.state.updateId, $ = O.dataStartIndex, N = O.dataEndIndex;
        if (O.dataStartIndex !== void 0 || O.dataEndIndex !== void 0)
          _.setState(le({
            dataStartIndex: $,
            dataEndIndex: N
          }, m({
            props: _.props,
            dataStartIndex: $,
            dataEndIndex: N,
            updateId: I
          }, _.state)));
        else if (O.activeTooltipIndex !== void 0) {
          var D = O.chartX, j = O.chartY, F = O.activeTooltipIndex, W = _.state, z = W.offset, H = W.tooltipTicks;
          if (!z)
            return;
          if (typeof k == "function")
            F = k(H, O);
          else if (k === "value") {
            F = -1;
            for (var U = 0; U < H.length; U++)
              if (H[U].value === O.activeLabel) {
                F = U;
                break;
              }
          }
          var V = le(le({}, z), {}, {
            x: z.left,
            y: z.top
          }), Y = Math.min(D, V.x + V.width), Q = Math.min(j, V.y + V.height), ne = H[F] && H[F].value, re = Hw(_.state, _.props.data, F), ce = H[F] ? {
            x: C === "horizontal" ? H[F].coordinate : Y,
            y: C === "horizontal" ? Q : H[F].coordinate
          } : hz;
          _.setState(le(le({}, O), {}, {
            activeLabel: ne,
            activeCoordinate: ce,
            activePayload: re,
            activeTooltipIndex: F
          }));
        } else
          _.setState(O);
      }), We(_, "renderCursor", function(O) {
        var P, C = _.state, k = C.isTooltipActive, I = C.activeCoordinate, $ = C.activePayload, N = C.offset, D = C.activeTooltipIndex, j = C.tooltipAxisBandSize, F = _.getTooltipEventType(), W = (P = O.props.active) !== null && P !== void 0 ? P : k, z = _.props.layout, H = O.key || "_recharts-cursor";
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(oEe, {
          key: H,
          activeCoordinate: I,
          activePayload: $,
          activeTooltipIndex: D,
          chartName: n,
          element: O,
          isActive: W,
          layout: z,
          offset: N,
          tooltipAxisBandSize: j,
          tooltipEventType: F
        });
      }), We(_, "renderPolarAxis", function(O, P, C) {
        var k = zr(O, "type.axisType"), I = zr(_.state, "".concat(k, "Map")), $ = O.type.defaultProps, N = $ !== void 0 ? le(le({}, $), O.props) : O.props, D = I && I[N["".concat(k, "Id")]];
        return /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(O, le(le({}, D), {}, {
          className: Xe(k, D.className),
          key: O.key || "".concat(P, "-").concat(C),
          ticks: Mo(D, !0)
        }));
      }), We(_, "renderPolarGrid", function(O) {
        var P = O.props, C = P.radialLines, k = P.polarAngles, I = P.polarRadius, $ = _.state, N = $.radiusAxisMap, D = $.angleAxisMap, j = Sa(N), F = Sa(D), W = F.cx, z = F.cy, H = F.innerRadius, U = F.outerRadius;
        return /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(O, {
          polarAngles: Array.isArray(k) ? k : Mo(F, !0).map(function(V) {
            return V.coordinate;
          }),
          polarRadius: Array.isArray(I) ? I : Mo(j, !0).map(function(V) {
            return V.coordinate;
          }),
          cx: W,
          cy: z,
          innerRadius: H,
          outerRadius: U,
          key: O.key || "polar-grid",
          radialLines: C
        });
      }), We(_, "renderLegend", function() {
        var O = _.state.formattedGraphicalItems, P = _.props, C = P.children, k = P.width, I = P.height, $ = _.props.margin || {}, N = k - ($.left || 0) - ($.right || 0), D = FF({
          children: C,
          formattedGraphicalItems: O,
          legendWidth: N,
          legendContent: c
        });
        if (!D)
          return null;
        var j = D.item, F = L$(D, aEe);
        return /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(j, le(le({}, F), {}, {
          chartWidth: k,
          chartHeight: I,
          margin: $,
          onBBoxUpdate: _.handleLegendBBoxUpdate
        }));
      }), We(_, "renderTooltip", function() {
        var O, P = _.props, C = P.children, k = P.accessibilityLayer, I = jr(C, Lr);
        if (!I)
          return null;
        var $ = _.state, N = $.isTooltipActive, D = $.activeCoordinate, j = $.activePayload, F = $.activeLabel, W = $.offset, z = (O = I.props.active) !== null && O !== void 0 ? O : N;
        return /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(I, {
          viewBox: le(le({}, W), {}, {
            x: W.left,
            y: W.top
          }),
          active: z,
          label: F,
          payload: z ? j : [],
          coordinate: D,
          accessibilityLayer: k
        });
      }), We(_, "renderBrush", function(O) {
        var P = _.props, C = P.margin, k = P.data, I = _.state, $ = I.offset, N = I.dataStartIndex, D = I.dataEndIndex, j = I.updateId;
        return /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(O, {
          key: O.key || "_recharts-brush",
          onChange: Xh(_.handleBrushChange, O.props.onChange),
          data: k,
          x: be(O.props.x) ? O.props.x : $.left,
          y: be(O.props.y) ? O.props.y : $.top + $.height + $.brushBottom - (C.bottom || 0),
          width: be(O.props.width) ? O.props.width : $.width,
          startIndex: N,
          endIndex: D,
          updateId: "brush-".concat(j)
        });
      }), We(_, "renderReferenceElement", function(O, P, C) {
        if (!O)
          return null;
        var k = _, I = k.clipPathId, $ = _.state, N = $.xAxisMap, D = $.yAxisMap, j = $.offset, F = O.type.defaultProps || {}, W = O.props, z = W.xAxisId, H = z === void 0 ? F.xAxisId : z, U = W.yAxisId, V = U === void 0 ? F.yAxisId : U;
        return /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(O, {
          key: O.key || "".concat(P, "-").concat(C),
          xAxis: N[H],
          yAxis: D[V],
          viewBox: {
            x: j.left,
            y: j.top,
            width: j.width,
            height: j.height
          },
          clipPathId: I
        });
      }), We(_, "renderActivePoints", function(O) {
        var P = O.item, C = O.activePoint, k = O.basePoint, I = O.childIndex, $ = O.isRange, N = [], D = P.props.key, j = P.item.type.defaultProps !== void 0 ? le(le({}, P.item.type.defaultProps), P.item.props) : P.item.props, F = j.activeDot, W = j.dataKey, z = le(le({
          index: I,
          dataKey: W,
          cx: C.x,
          cy: C.y,
          r: 4,
          fill: PS(P.item),
          strokeWidth: 2,
          stroke: "#fff",
          payload: C.payload,
          value: C.value
        }, Ee(F, !1)), Yp(F));
        return N.push(x.renderActiveDot(F, z, "".concat(D, "-activePoint-").concat(I))), k ? N.push(x.renderActiveDot(F, le(le({}, z), {}, {
          cx: k.x,
          cy: k.y
        }), "".concat(D, "-basePoint-").concat(I))) : $ && N.push(null), N;
      }), We(_, "renderGraphicChild", function(O, P, C) {
        var k = _.filterFormatItem(O, P, C);
        if (!k)
          return null;
        var I = _.getTooltipEventType(), $ = _.state, N = $.isTooltipActive, D = $.tooltipAxis, j = $.activeTooltipIndex, F = $.activeLabel, W = _.props.children, z = jr(W, Lr), H = k.props, U = H.points, V = H.isRange, Y = H.baseLine, Q = k.item.type.defaultProps !== void 0 ? le(le({}, k.item.type.defaultProps), k.item.props) : k.item.props, ne = Q.activeDot, re = Q.hide, ce = Q.activeBar, oe = Q.activeShape, fe = !!(!re && N && z && (ne || ce || oe)), ae = {};
        I !== "axis" && z && z.props.trigger === "click" ? ae = {
          onClick: Xh(_.handleItemMouseEnter, O.props.onClick)
        } : I !== "axis" && (ae = {
          onMouseLeave: Xh(_.handleItemMouseLeave, O.props.onMouseLeave),
          onMouseEnter: Xh(_.handleItemMouseEnter, O.props.onMouseEnter)
        });
        var ee = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(O, le(le({}, k.props), ae));
        function se(Ge) {
          return typeof D.dataKey == "function" ? D.dataKey(Ge.payload) : null;
        }
        if (fe)
          if (j >= 0) {
            var ge, X;
            if (D.dataKey && !D.allowDuplicatedCategory) {
              var $e = typeof D.dataKey == "function" ? se : "payload.".concat(D.dataKey.toString());
              ge = Gp(U, $e, F), X = V && Y && Gp(Y, $e, F);
            } else
              ge = U == null ? void 0 : U[j], X = V && Y && Y[j];
            if (oe || ce) {
              var de = O.props.activeIndex !== void 0 ? O.props.activeIndex : j;
              return [/* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(O, le(le(le({}, k.props), ae), {}, {
                activeIndex: de
              })), null, null];
            }
            if (!Ue(ge))
              return [ee].concat(Mc(_.renderActivePoints({
                item: k,
                activePoint: ge,
                basePoint: X,
                childIndex: j,
                isRange: V
              })));
          } else {
            var ke, it = (ke = _.getItemByXY(_.state.activeCoordinate)) !== null && ke !== void 0 ? ke : {
              graphicalItem: ee
            }, lt = it.graphicalItem, Xn = lt.item, Ie = Xn === void 0 ? O : Xn, ct = lt.childIndex, Oe = le(le(le({}, k.props), ae), {}, {
              activeIndex: ct
            });
            return [/* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(Ie, Oe), null, null];
          }
        return V ? [ee, null, null] : [ee, null];
      }), We(_, "renderCustomized", function(O, P, C) {
        return /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(O, le(le({
          key: "recharts-customized-".concat(C)
        }, _.props), _.state));
      }), We(_, "renderMap", {
        CartesianGrid: {
          handler: np,
          once: !0
        },
        ReferenceArea: {
          handler: _.renderReferenceElement
        },
        ReferenceLine: {
          handler: np
        },
        ReferenceDot: {
          handler: _.renderReferenceElement
        },
        XAxis: {
          handler: np
        },
        YAxis: {
          handler: np
        },
        Brush: {
          handler: _.renderBrush,
          once: !0
        },
        Bar: {
          handler: _.renderGraphicChild
        },
        Line: {
          handler: _.renderGraphicChild
        },
        Area: {
          handler: _.renderGraphicChild
        },
        Radar: {
          handler: _.renderGraphicChild
        },
        RadialBar: {
          handler: _.renderGraphicChild
        },
        Scatter: {
          handler: _.renderGraphicChild
        },
        Pie: {
          handler: _.renderGraphicChild
        },
        Funnel: {
          handler: _.renderGraphicChild
        },
        Tooltip: {
          handler: _.renderCursor,
          once: !0
        },
        PolarGrid: {
          handler: _.renderPolarGrid,
          once: !0
        },
        PolarAngleAxis: {
          handler: _.renderPolarAxis
        },
        PolarRadiusAxis: {
          handler: _.renderPolarAxis
        },
        Customized: {
          handler: _.renderCustomized
        }
      }), _.clipPathId = "".concat((S = w.id) !== null && S !== void 0 ? S : tl("recharts"), "-clip"), _.throttleTriggeredAfterMouseMove = BB(_.triggeredAfterMouseMove, (A = w.throttleDelay) !== null && A !== void 0 ? A : 1e3 / 60), _.state = {}, _;
    }
    return vEe(x, v), pEe(x, [{
      key: "componentDidMount",
      value: function() {
        var S, A;
        this.addListener(), this.accessibilityManager.setDetails({
          container: this.container,
          offset: {
            left: (S = this.props.margin.left) !== null && S !== void 0 ? S : 0,
            top: (A = this.props.margin.top) !== null && A !== void 0 ? A : 0
          },
          coordinateList: this.state.tooltipTicks,
          mouseHandlerCallback: this.triggeredAfterMouseMove,
          layout: this.props.layout
        }), this.displayDefaultTooltip();
      }
    }, {
      key: "displayDefaultTooltip",
      value: function() {
        var S = this.props, A = S.children, _ = S.data, O = S.height, P = S.layout, C = jr(A, Lr);
        if (C) {
          var k = C.props.defaultIndex;
          if (!(typeof k != "number" || k < 0 || k > this.state.tooltipTicks.length - 1)) {
            var I = this.state.tooltipTicks[k] && this.state.tooltipTicks[k].value, $ = Hw(this.state, _, k, I), N = this.state.tooltipTicks[k].coordinate, D = (this.state.offset.top + O) / 2, j = P === "horizontal", F = j ? {
              x: N,
              y: D
            } : {
              y: N,
              x: D
            }, W = this.state.formattedGraphicalItems.find(function(H) {
              var U = H.item;
              return U.type.name === "Scatter";
            });
            W && (F = le(le({}, F), W.props.points[k].tooltipPosition), $ = W.props.points[k].tooltipPayload);
            var z = {
              activeTooltipIndex: k,
              isTooltipActive: !0,
              activeLabel: I,
              activePayload: $,
              activeCoordinate: F
            };
            this.setState(z), this.renderCursor(C), this.accessibilityManager.setIndex(k);
          }
        }
      }
    }, {
      key: "getSnapshotBeforeUpdate",
      value: function(S, A) {
        if (!this.props.accessibilityLayer)
          return null;
        if (this.state.tooltipTicks !== A.tooltipTicks && this.accessibilityManager.setDetails({
          coordinateList: this.state.tooltipTicks
        }), this.props.layout !== S.layout && this.accessibilityManager.setDetails({
          layout: this.props.layout
        }), this.props.margin !== S.margin) {
          var _, O;
          this.accessibilityManager.setDetails({
            offset: {
              left: (_ = this.props.margin.left) !== null && _ !== void 0 ? _ : 0,
              top: (O = this.props.margin.top) !== null && O !== void 0 ? O : 0
            }
          });
        }
        return null;
      }
    }, {
      key: "componentDidUpdate",
      value: function(S) {
        vx([jr(S.children, Lr)], [jr(this.props.children, Lr)]) || this.displayDefaultTooltip();
      }
    }, {
      key: "componentWillUnmount",
      value: function() {
        this.removeListener(), this.throttleTriggeredAfterMouseMove.cancel();
      }
    }, {
      key: "getTooltipEventType",
      value: function() {
        var S = jr(this.props.children, Lr);
        if (S && typeof S.props.shared == "boolean") {
          var A = S.props.shared ? "axis" : "item";
          return s.indexOf(A) >= 0 ? A : o;
        }
        return o;
      }
      /**
       * 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: function(S) {
        if (!this.container)
          return null;
        var A = this.container, _ = A.getBoundingClientRect(), O = gye(_), P = {
          chartX: Math.round(S.pageX - O.left),
          chartY: Math.round(S.pageY - O.top)
        }, C = _.width / A.offsetWidth || 1, k = this.inRange(P.chartX, P.chartY, C);
        if (!k)
          return null;
        var I = this.state, $ = I.xAxisMap, N = I.yAxisMap, D = this.getTooltipEventType();
        if (D !== "axis" && $ && N) {
          var j = Sa($).scale, F = Sa(N).scale, W = j && j.invert ? j.invert(P.chartX) : null, z = F && F.invert ? F.invert(P.chartY) : null;
          return le(le({}, P), {}, {
            xValue: W,
            yValue: z
          });
        }
        var H = F$(this.state, this.props.data, this.props.layout, k);
        return H ? le(le({}, P), H) : null;
      }
    }, {
      key: "inRange",
      value: function(S, A) {
        var _ = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, O = this.props.layout, P = S / _, C = A / _;
        if (O === "horizontal" || O === "vertical") {
          var k = this.state.offset, I = P >= k.left && P <= k.left + k.width && C >= k.top && C <= k.top + k.height;
          return I ? {
            x: P,
            y: C
          } : null;
        }
        var $ = this.state, N = $.angleAxisMap, D = $.radiusAxisMap;
        if (N && D) {
          var j = Sa(N);
          return eN({
            x: P,
            y: C
          }, j);
        }
        return null;
      }
    }, {
      key: "parseEventsOfWrapper",
      value: function() {
        var S = this.props.children, A = this.getTooltipEventType(), _ = jr(S, Lr), O = {};
        _ && A === "axis" && (_.props.trigger === "click" ? O = {
          onClick: this.handleClick
        } : O = {
          onMouseEnter: this.handleMouseEnter,
          onMouseMove: this.handleMouseMove,
          onMouseLeave: this.handleMouseLeave,
          onTouchMove: this.handleTouchMove,
          onTouchStart: this.handleTouchStart,
          onTouchEnd: this.handleTouchEnd
        });
        var P = Yp(this.props, this.handleOuterEvent);
        return le(le({}, P), O);
      }
    }, {
      key: "addListener",
      value: function() {
        s0.on(l0, this.handleReceiveSyncEvent);
      }
    }, {
      key: "removeListener",
      value: function() {
        s0.removeListener(l0, this.handleReceiveSyncEvent);
      }
    }, {
      key: "filterFormatItem",
      value: function(S, A, _) {
        for (var O = this.state.formattedGraphicalItems, P = 0, C = O.length; P < C; P++) {
          var k = O[P];
          if (k.item === S || k.props.key === S.key || A === jo(k.item.type) && _ === k.childIndex)
            return k;
        }
        return null;
      }
    }, {
      key: "renderClipPath",
      value: function() {
        var S = this.clipPathId, A = this.state.offset, _ = A.left, O = A.top, P = A.height, C = A.width;
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("defs", null, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("clipPath", {
          id: S
        }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("rect", {
          x: _,
          y: O,
          height: P,
          width: C
        })));
      }
    }, {
      key: "getXScales",
      value: function() {
        var S = this.state.xAxisMap;
        return S ? Object.entries(S).reduce(function(A, _) {
          var O = j$(_, 2), P = O[0], C = O[1];
          return le(le({}, A), {}, We({}, P, C.scale));
        }, {}) : null;
      }
    }, {
      key: "getYScales",
      value: function() {
        var S = this.state.yAxisMap;
        return S ? Object.entries(S).reduce(function(A, _) {
          var O = j$(_, 2), P = O[0], C = O[1];
          return le(le({}, A), {}, We({}, P, C.scale));
        }, {}) : null;
      }
    }, {
      key: "getXScaleByAxisId",
      value: function(S) {
        var A;
        return (A = this.state.xAxisMap) === null || A === void 0 || (A = A[S]) === null || A === void 0 ? void 0 : A.scale;
      }
    }, {
      key: "getYScaleByAxisId",
      value: function(S) {
        var A;
        return (A = this.state.yAxisMap) === null || A === void 0 || (A = A[S]) === null || A === void 0 ? void 0 : A.scale;
      }
    }, {
      key: "getItemByXY",
      value: function(S) {
        var A = this.state, _ = A.formattedGraphicalItems, O = A.activeItem;
        if (_ && _.length)
          for (var P = 0, C = _.length; P < C; P++) {
            var k = _[P], I = k.props, $ = k.item, N = $.type.defaultProps !== void 0 ? le(le({}, $.type.defaultProps), $.props) : $.props, D = jo($.type);
            if (D === "Bar") {
              var j = (I.data || []).find(function(H) {
                return G_e(S, H);
              });
              if (j)
                return {
                  graphicalItem: k,
                  payload: j
                };
            } else if (D === "RadialBar") {
              var F = (I.data || []).find(function(H) {
                return eN(S, H);
              });
              if (F)
                return {
                  graphicalItem: k,
                  payload: F
                };
            } else if (by(k, O) || xy(k, O) || td(k, O)) {
              var W = IOe({
                graphicalItem: k,
                activeTooltipItem: O,
                itemData: N.data
              }), z = N.activeIndex === void 0 ? W : N.activeIndex;
              return {
                graphicalItem: le(le({}, k), {}, {
                  childIndex: z
                }),
                payload: td(k, O) ? N.data[W] : k.props.data[W]
              };
            }
          }
        return null;
      }
    }, {
      key: "render",
      value: function() {
        var S = this;
        if (!HE(this))
          return null;
        var A = this.props, _ = A.children, O = A.className, P = A.width, C = A.height, k = A.style, I = A.compact, $ = A.title, N = A.desc, D = L$(A, sEe), j = Ee(D, !1);
        if (I)
          return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(y$, {
            state: this.state,
            width: this.props.width,
            height: this.props.height,
            clipPathId: this.clipPathId
          }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(xx, zl({}, j, {
            width: P,
            height: C,
            title: $,
            desc: N
          }), this.renderClipPath(), GE(_, this.renderMap)));
        if (this.props.accessibilityLayer) {
          var F, W;
          j.tabIndex = (F = this.props.tabIndex) !== null && F !== void 0 ? F : 0, j.role = (W = this.props.role) !== null && W !== void 0 ? W : "application", j.onKeyDown = function(H) {
            S.accessibilityManager.keyboardEvent(H);
          }, j.onFocus = function() {
            S.accessibilityManager.focus();
          };
        }
        var z = this.parseEventsOfWrapper();
        return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(y$, {
          state: this.state,
          width: this.props.width,
          height: this.props.height,
          clipPathId: this.clipPathId
        }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement("div", zl({
          className: Xe("recharts-wrapper", O),
          style: le({
            position: "relative",
            cursor: "default",
            width: P,
            height: C
          }, k)
        }, z, {
          ref: function(U) {
            S.container = U;
          }
        }), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(xx, zl({}, j, {
          width: P,
          height: C,
          title: $,
          desc: N,
          style: OEe
        }), this.renderClipPath(), GE(_, this.renderMap)), this.renderLegend(), this.renderTooltip()));
      }
    }]);
  }(react__WEBPACK_IMPORTED_MODULE_1__.Component);
  We(y, "displayName", n), We(y, "defaultProps", le({
    layout: "horizontal",
    stackOffset: "none",
    barCategoryGap: "10%",
    barGap: 4,
    margin: {
      top: 5,
      right: 5,
      bottom: 5,
      left: 5
    },
    reverseStackOrder: !1,
    syncMethod: "index"
  }, d)), We(y, "getDerivedStateFromProps", function(v, x) {
    var w = v.dataKey, S = v.data, A = v.children, _ = v.width, O = v.height, P = v.layout, C = v.stackOffset, k = v.margin, I = x.dataStartIndex, $ = x.dataEndIndex;
    if (x.updateId === void 0) {
      var N = W$(v);
      return le(le(le({}, N), {}, {
        updateId: 0
      }, m(le(le({
        props: v
      }, N), {}, {
        updateId: 0
      }), x)), {}, {
        prevDataKey: w,
        prevData: S,
        prevWidth: _,
        prevHeight: O,
        prevLayout: P,
        prevStackOffset: C,
        prevMargin: k,
        prevChildren: A
      });
    }
    if (w !== x.prevDataKey || S !== x.prevData || _ !== x.prevWidth || O !== x.prevHeight || P !== x.prevLayout || C !== x.prevStackOffset || !Yl(k, x.prevMargin)) {
      var D = W$(v), j = {
        // (chartX, chartY) are (0,0) in default state, but we want to keep the last mouse position to avoid
        // any flickering
        chartX: x.chartX,
        chartY: x.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: x.isTooltipActive
      }, F = le(le({}, F$(x, S, P)), {}, {
        updateId: x.updateId + 1
      }), W = le(le(le({}, D), j), F);
      return le(le(le({}, W), m(le({
        props: v
      }, W), x)), {}, {
        prevDataKey: w,
        prevData: S,
        prevWidth: _,
        prevHeight: O,
        prevLayout: P,
        prevStackOffset: C,
        prevMargin: k,
        prevChildren: A
      });
    }
    if (!vx(A, x.prevChildren)) {
      var z, H, U, V, Y = jr(A, bc), Q = Y && (z = (H = Y.props) === null || H === void 0 ? void 0 : H.startIndex) !== null && z !== void 0 ? z : I, ne = Y && (U = (V = Y.props) === null || V === void 0 ? void 0 : V.endIndex) !== null && U !== void 0 ? U : $, re = Q !== I || ne !== $, ce = !Ue(S), oe = ce && !re ? x.updateId : x.updateId + 1;
      return le(le({
        updateId: oe
      }, m(le(le({
        props: v
      }, x), {}, {
        updateId: oe,
        dataStartIndex: Q,
        dataEndIndex: ne
      }), x)), {}, {
        prevChildren: A,
        dataStartIndex: Q,
        dataEndIndex: ne
      });
    }
    return null;
  }), We(y, "renderActiveDot", function(v, x, w) {
    var S;
    return /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.isValidElement)(v) ? S = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(v, x) : ze(v) ? S = v(x) : S = /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(Dd, x), /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(at, {
      className: "recharts-active-dot",
      key: w
    }, S);
  });
  var g = /* @__PURE__ */ (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function(x, w) {
    return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_1__.createElement(y, zl({}, x, {
      ref: w
    }));
  });
  return g.displayName = y.displayName, g;
}, DEe = Cy({
  chartName: "LineChart",
  GraphicalChild: Id,
  axisComponents: [{
    axisType: "xAxis",
    AxisComp: Yo
  }, {
    axisType: "yAxis",
    AxisComp: eo
  }],
  formatAxisMap: kS
}), IEe = Cy({
  chartName: "BarChart",
  GraphicalChild: il,
  defaultTooltipEventType: "axis",
  validateTooltipEventTypes: ["axis", "item"],
  axisComponents: [{
    axisType: "xAxis",
    AxisComp: Yo
  }, {
    axisType: "yAxis",
    AxisComp: eo
  }],
  formatAxisMap: kS
}), REe = Cy({
  chartName: "PieChart",
  GraphicalChild: ra,
  validateTooltipEventTypes: ["item"],
  defaultTooltipEventType: "item",
  legendContent: "children",
  axisComponents: [{
    axisType: "angleAxis",
    AxisComp: vy
  }, {
    axisType: "radiusAxis",
    AxisComp: gy
  }],
  formatAxisMap: dwe,
  defaultProps: {
    layout: "centric",
    startAngle: 0,
    endAngle: 360,
    cx: "50%",
    cy: "50%",
    innerRadius: 0,
    outerRadius: "80%"
  }
}), jEe = Cy({
  chartName: "AreaChart",
  GraphicalChild: Xa,
  axisComponents: [{
    axisType: "xAxis",
    AxisComp: Yo
  }, {
    axisType: "yAxis",
    AxisComp: eo
  }],
  formatAxisMap: kS
});
const mz = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(
  ({
    className: e,
    hideIcon: t = !1,
    payload: n = [],
    // array of objects that represents the data for each legend item
    verticalAlign: r = "bottom",
    // top | bottom
    nameKey: i = "value",
    fontSizeVariant: o
  }, a) => n.length ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      ref: a,
      className: K(
        "flex items-center justify-center gap-4",
        r === "top" ? "pb-3" : "pt-3",
        e
      ),
      children: n.map((s) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5", children: [
        !t && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "div",
          {
            className: "size-2 shrink-0 rounded-sm",
            style: {
              backgroundColor: s.color
            }
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "span",
          {
            className: "capitalize",
            style: { fontSize: o },
            children: s[i]
          }
        )
      ] }, s.value))
    }
  ) : null
);
mz.displayName = "ChartLegendContent";
const gz = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(
  ({
    active: e,
    payload: t,
    className: n,
    indicator: r = "dot",
    //dot, line, dashed
    hideLabel: i = !1,
    hideIndicator: o = !1,
    label: a,
    labelFormatter: s,
    labelClassName: l,
    formatter: c,
    color: f,
    nameKey: d = "name",
    labelKey: p
  }, m) => {
    const y = () => {
      if (i || !(t != null && t.length))
        return null;
      const [v] = t, x = s ? s(a || "") : v[p] || a;
      return x ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K("font-medium", l), children: x }) : null;
    };
    if (!e || !(t != null && t.length))
      return null;
    const g = t.length === 1 && r !== "dot";
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "div",
      {
        ref: m,
        className: K(
          "grid min-w-[8rem] items-start gap-1.5 rounded-lg border bg-tooltip-background-light px-3 py-2 text-xs shadow-xl",
          n
        ),
        children: [
          g ? null : y(),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid gap-1.5", children: t.map((v, x) => {
            const w = f || v.color || "#000";
            return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
              "div",
              {
                className: K(
                  "flex w-full items-stretch gap-2",
                  r === "dot" && "items-center"
                ),
                children: [
                  !o && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                    "div",
                    {
                      className: K({
                        "size-2.5": r === "dot",
                        "w-1 h-full": r === "line",
                        "w-0 border-[0.5px] border-dashed": r === "dashed"
                      }),
                      style: {
                        backgroundColor: r === "dot" || r === "line" ? w : "",
                        borderColor: r === "dashed" ? w : ""
                      }
                    }
                  ),
                  /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 flex justify-between items-center", children: [
                    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: v[d] || v.dataKey }),
                    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-mono font-medium", children: c ? c(v.value ?? "") : v.value ?? "" })
                  ] })
                ]
              },
              v.dataKey || x
            );
          }) })
        ]
      }
    );
  }
);
gz.displayName = "ChartTooltipContent";
const ske = ({
  data: e,
  dataKeys: t = [],
  colors: n = [],
  layout: r = "horizontal",
  // horizontal, vertical
  stacked: i = !1,
  showXAxis: o = !0,
  showYAxis: a = !0,
  showTooltip: s = !0,
  tooltipIndicator: l = "dot",
  // dot, line, dashed
  tooltipLabelKey: c,
  showLegend: f = !1,
  showCartesianGrid: d = !0,
  xTickFormatter: p,
  yTickFormatter: m,
  xAxisDataKey: y,
  yAxisDataKey: g,
  xAxisFontSize: v = "sm",
  // sm, md, lg
  xAxisFontColor: x = "#6B7280",
  yAxisFontColor: w = "#6B7280",
  chartWidth: S = 350,
  chartHeight: A = 200,
  borderRadius: _ = 8,
  xAxisProps: O,
  yAxisProps: P,
  tooltipProps: C,
  activeBar: k
}) => {
  const I = [{ fill: "#7DD3FC" }, { fill: "#2563EB" }], $ = n.length > 0 ? n : I, N = {
    sm: "12px",
    md: "14px",
    lg: "16px"
  }, D = N[v] || N.sm;
  return !e || e.length === 0 ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(to, { size: "sm", variant: "help", children: "No data available" }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(tS, { width: S, height: A, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    IEe,
    {
      data: e,
      margin: { left: 14, right: 14 },
      layout: r,
      children: [
        d && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ty, { vertical: !1 }),
        r === "horizontal" && o && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Yo,
          {
            ...O,
            dataKey: y,
            tickLine: !1,
            axisLine: !1,
            tickMargin: 8,
            tickFormatter: p,
            tick: {
              fontSize: D,
              fill: x
            }
          }
        ),
        r === "horizontal" && a && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          eo,
          {
            ...P,
            dataKey: g,
            tickLine: !1,
            tickMargin: 10,
            axisLine: !1,
            tickFormatter: m,
            tick: {
              fontSize: D,
              fill: w
            }
          }
        ),
        r === "vertical" && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            Yo,
            {
              ...O,
              type: "number",
              dataKey: y,
              hide: !0
            }
          ),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            eo,
            {
              ...P,
              dataKey: g,
              type: "category",
              tickLine: !1,
              tickMargin: 10,
              axisLine: !1,
              tickFormatter: p,
              tick: {
                fontSize: D,
                fill: w
              }
            }
          )
        ] }),
        a && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(eo, { dataKey: g }),
        s && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Lr,
          {
            ...C,
            content: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              gz,
              {
                indicator: l,
                labelKey: c
              }
            )
          }
        ),
        f && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Lo,
          {
            content: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              mz,
              {
                fontSizeVariant: D
              }
            )
          }
        ),
        t.map((j, F) => {
          var z;
          let W;
          return i ? F === 0 ? W = [0, 0, 4, 4] : F === t.length - 1 ? W = [4, 4, 0, 0] : W = 0 : W = _, /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            il,
            {
              dataKey: j,
              fill: (z = $[F]) == null ? void 0 : z.fill,
              radius: W,
              stackId: i ? "a" : void 0,
              activeBar: k
            },
            j
          );
        })
      ]
    }
  ) });
}, yz = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(
  ({
    active: e,
    payload: t,
    className: n,
    indicator: r = "dot",
    //dot, line, dashed
    hideLabel: i = !1,
    hideIndicator: o = !1,
    label: a,
    labelFormatter: s,
    labelClassName: l,
    formatter: c,
    color: f,
    nameKey: d = "name",
    labelKey: p
  }, m) => {
    const y = () => {
      if (i || !(t != null && t.length))
        return null;
      const [v] = t, x = s ? s(a || "") : v[p] || a;
      return x ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K("font-medium", l), children: x }) : null;
    };
    if (!e || !(t != null && t.length))
      return null;
    const g = t.length === 1 && r !== "dot";
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "div",
      {
        ref: m,
        className: K(
          "grid min-w-[8rem] items-start gap-1.5 rounded-lg border bg-tooltip-background-light px-3 py-2 text-xs shadow-xl",
          n
        ),
        children: [
          g ? null : y(),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid gap-1.5", children: t.map((v, x) => {
            const w = f || v.color || "#000";
            return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
              "div",
              {
                className: K(
                  "flex w-full items-stretch gap-2",
                  r === "dot" && "items-center"
                ),
                children: [
                  !o && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                    "div",
                    {
                      className: K({
                        "size-2.5 ": r === "dot",
                        "w-1 h-full": r === "line",
                        "w-0 border-[0.5px] border-dashed": r === "dashed"
                      }),
                      style: {
                        backgroundColor: r === "dot" || r === "line" ? w : "",
                        borderColor: r === "dashed" ? w : ""
                      }
                    }
                  ),
                  /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 flex justify-between items-center", children: [
                    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: v[d] || v.dataKey }),
                    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-mono font-medium", children: c ? c(v.value ?? "") : v.value ?? "" })
                  ] })
                ]
              },
              v.dataKey || x
            );
          }) })
        ]
      }
    );
  }
);
yz.displayName = "ChartTooltipContent";
const lke = ({
  data: e,
  dataKeys: t = [],
  colors: n = [],
  showXAxis: r = !1,
  showYAxis: i = !1,
  showTooltip: o = !0,
  tooltipIndicator: a = "dot",
  // dot, line, dashed
  tooltipLabelKey: s,
  showCartesianGrid: l = !0,
  tickFormatter: c,
  xAxisDataKey: f,
  yAxisDataKey: d,
  xAxisFontSize: p = "sm",
  // sm, md, lg
  xAxisFontColor: m = "#6B7280",
  yAxisFontColor: y = "#6B7280",
  chartWidth: g = 350,
  chartHeight: v = 200,
  withDots: x = !1,
  lineChartWrapperProps: w,
  strokeDasharray: S = "3 3",
  gridColor: A = "#E5E7EB"
}) => {
  const _ = [{ stroke: "#2563EB" }, { stroke: "#38BDF8" }], O = n.length > 0 ? n : _, P = {
    sm: "12px",
    md: "14px",
    lg: "16px"
  }, C = P[p] || P.sm;
  return !e || e.length === 0 ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(to, { size: "sm", variant: "help", children: "No data available" }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(tS, { width: g, height: v, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(DEe, { ...w, data: e, children: [
    l && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Ty,
      {
        strokeDasharray: S,
        horizontal: !1,
        stroke: A
      }
    ),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Yo,
      {
        dataKey: f,
        tickLine: !1,
        axisLine: !1,
        tickMargin: 8,
        tickFormatter: c,
        tick: {
          fontSize: C,
          fill: m
        },
        hide: !r
      }
    ),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      eo,
      {
        dataKey: d,
        tickLine: !1,
        axisLine: !1,
        tickMargin: 8,
        tick: {
          fontSize: C,
          fill: y
        },
        hide: !i
      }
    ),
    o && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Lr,
      {
        content: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          yz,
          {
            indicator: a,
            labelKey: s
          }
        )
      }
    ),
    t.map((k, I) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Id,
      {
        type: "natural",
        dataKey: k,
        stroke: O[I].stroke,
        fill: O[I].stroke,
        strokeWidth: 2,
        dot: x
      },
      k
    ))
  ] }) });
}, vz = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(
  ({
    active: e,
    payload: t,
    className: n,
    indicator: r = "dot",
    hideLabel: i = !1,
    hideIndicator: o = !1,
    label: a,
    labelFormatter: s,
    labelClassName: l,
    formatter: c,
    color: f,
    nameKey: d = "name",
    labelKey: p
  }, m) => {
    const y = () => {
      if (i || !(t != null && t.length))
        return null;
      const [v] = t, x = s ? s(a || "") : v[p] || a;
      return x ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K("font-medium", l), children: x }) : null;
    };
    if (!e || !(t != null && t.length))
      return null;
    const g = t.length === 1 && r !== "dot";
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "div",
      {
        ref: m,
        className: K(
          "grid min-w-[8rem] items-start gap-1.5 rounded-lg border bg-tooltip-background-light px-3 py-2 text-xs shadow-xl",
          n
        ),
        children: [
          g ? null : y(),
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid gap-1.5", children: t.map((v, x) => {
            var S;
            const w = v.color || ((S = v.payload) == null ? void 0 : S.fill) || f || "#000";
            return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
              "div",
              {
                className: K(
                  "flex w-full items-stretch gap-2",
                  r === "dot" && "items-center"
                ),
                children: [
                  !o && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                    "div",
                    {
                      className: K({
                        "h-2.5 w-2.5 ": r === "dot",
                        "w-1 h-full": r === "line",
                        "w-0 border-[0.5px] border-dashed": r === "dashed"
                      }),
                      style: {
                        backgroundColor: r === "dot" || r === "line" ? w : "",
                        borderColor: r === "dashed" ? w : ""
                      }
                    }
                  ),
                  /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 flex justify-between items-center", children: [
                    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: v[d] || v.dataKey }),
                    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-mono font-medium", children: c ? c(v.value ?? "") : v.value ?? "" })
                  ] })
                ]
              },
              v.dataKey || x
            );
          }) })
        ]
      }
    );
  }
);
vz.displayName = "ChartTooltipContent";
const bz = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(
  ({
    className: e,
    hideIcon: t = !1,
    payload: n = [],
    // array of objects that represents the data for each legend item
    verticalAlign: r = "bottom",
    // top | bottom
    nameKey: i = "value"
  }, o) => n.length ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      ref: o,
      className: K(
        "flex items-center justify-center gap-4",
        r === "top" ? "pb-3" : "pt-3",
        e
      ),
      children: n.map((a) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5", children: [
        !t && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "div",
          {
            className: "h-2 w-2 shrink-0 rounded-sm",
            style: {
              backgroundColor: a.color
            }
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "capitalize", children: a[i] })
      ] }, a.value))
    }
  ) : null
);
bz.displayName = "ChartLegendContent";
const cke = ({
  data: e,
  dataKey: t,
  type: n = "simple",
  // simple, donut
  showTooltip: r = !0,
  tooltipIndicator: i = "dot",
  // dot, line, dashed
  tooltipLabelKey: o,
  label: a = !1,
  labelName: s = "",
  labelNameColor: l = "#6B7280",
  labelValue: c,
  showLegend: f = !1,
  chartWidth: d = 300,
  pieOuterRadius: p = 90,
  pieInnerRadius: m = 60
}) => {
  const y = n === "donut", g = p, v = y ? m : 0;
  return !e || e.length === 0 ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(to, { size: "sm", variant: "help", children: "No data available" }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(REe, { width: d, height: d, children: [
    r && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Lr,
      {
        content: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          vz,
          {
            indicator: i,
            labelKey: o
          }
        )
      }
    ),
    f && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Lo, { content: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(bz, {}) }),
    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      ra,
      {
        data: e,
        cx: "50%",
        cy: "50%",
        innerRadius: v,
        outerRadius: g,
        dataKey: t,
        children: y && a && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Sn,
          {
            content: ({ viewBox: x }) => {
              if (x && "cx" in x && "cy" in x)
                return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
                  "text",
                  {
                    x: x.cx,
                    y: x.cy,
                    textAnchor: "middle",
                    dominantBaseline: "middle",
                    className: "space-y-3",
                    children: [
                      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                        "tspan",
                        {
                          x: x.cx,
                          dy: "-4",
                          className: "fill-foreground text-xl font-bold",
                          children: c
                        }
                      ),
                      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                        "tspan",
                        {
                          x: x.cx,
                          dy: "24",
                          className: "text-sm",
                          style: { fill: l },
                          children: s
                        }
                      )
                    ]
                  }
                );
            }
          }
        )
      }
    )
  ] });
}, xz = react__WEBPACK_IMPORTED_MODULE_1__.forwardRef(
  ({
    className: e,
    hideIcon: t = !1,
    payload: n = [],
    // array of objects that represents the data for each legend item
    verticalAlign: r = "bottom",
    // top | bottom
    nameKey: i = "value",
    fontSizeVariant: o
  }, a) => n.length ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      ref: a,
      className: K(
        "flex items-center justify-center gap-4",
        r === "top" ? "pb-3" : "pt-3",
        e
      ),
      children: n.map((s) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5", children: [
        !t && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "div",
          {
            className: "size-2 shrink-0 rounded-sm",
            style: {
              backgroundColor: s.color
            }
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "span",
          {
            className: "capitalize",
            style: { fontSize: o },
            children: s[i]
          }
        )
      ] }, s.value))
    }
  ) : null
);
xz.displayName = "ChartLegendContent";
const wz = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(
  ({
    active: e,
    payload: t,
    className: n,
    indicator: r,
    // dot, line, dashed
    hideLabel: i = !1,
    hideIndicator: o = !1,
    label: a,
    labelFormatter: s,
    labelClassName: l,
    formatter: c,
    color: f,
    nameKey: d = "name",
    labelKey: p
  }, m) => {
    const y = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
      if (i || !(t != null && t.length))
        return null;
      const [v] = t, x = s ? s(a || "") : v[p] || a;
      return x ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: K("font-medium", l), children: x }) : null;
    }, [
      a,
      s,
      t,
      i,
      l,
      p
    ]);
    if (!e || !(t != null && t.length))
      return null;
    const g = t.length === 1 && r !== "dot";
    return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
      "div",
      {
        ref: m,
        className: K(
          "grid min-w-[8rem] items-start gap-1.5 rounded-lg border bg-tooltip-background-light px-3 py-2 text-xs shadow-xl",
          n
        ),
        children: [
          g ? null : y,
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid gap-1.5", children: t.map((v, x) => {
            const w = f || v.color || "#000";
            return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
              "div",
              {
                className: K(
                  "flex w-full items-stretch gap-2",
                  r === "dot" && "items-center"
                ),
                children: [
                  !o && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                    "div",
                    {
                      className: K({
                        "size-2.5": r === "dot",
                        "w-1 h-full": r === "line",
                        "w-0 border-[0.5px] border-dashed": r === "dashed"
                      }),
                      style: {
                        backgroundColor: r === "dot" || r === "line" ? w : "",
                        borderColor: r === "dashed" ? w : ""
                      }
                    }
                  ),
                  /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 flex justify-between items-center", children: [
                    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: v[d] || v.dataKey }),
                    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-mono font-medium", children: c ? c(v.value ?? "") : v.value ?? "" })
                  ] })
                ]
              },
              v.dataKey || x
            );
          }) })
        ]
      }
    );
  }
);
wz.displayName = "ChartTooltipContent";
const uke = ({
  data: e,
  dataKeys: t,
  colors: n = [],
  variant: r = "solid",
  showXAxis: i = !0,
  showYAxis: o = !0,
  showTooltip: a = !0,
  tooltipIndicator: s = "dot",
  // dot, line, dashed
  tooltipLabelKey: l,
  showLegend: c = !0,
  showCartesianGrid: f = !0,
  tickFormatter: d,
  xAxisDataKey: p,
  yAxisDataKey: m,
  xAxisFontSize: y = "sm",
  // sm, md, lg
  xAxisFontColor: g = "#6B7280",
  chartWidth: v = 350,
  chartHeight: x = 200
}) => {
  const [w, S] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(v), [A, _] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(x), O = [
    { stroke: "#2563EB", fill: "#BFDBFE" },
    { stroke: "#38BDF8", fill: "#BAE6FD" }
  ], P = n.length > 0 ? n : O;
  (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    S(v), _(x);
  }, [v, x]);
  const C = {
    sm: "12px",
    md: "14px",
    lg: "16px"
  }, k = C[y] || C.sm, I = () => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("defs", { children: P.map(($, N) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    "linearGradient",
    {
      id: `fill${N}`,
      x1: "0",
      y1: "0",
      x2: "0",
      y2: "1",
      children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "stop",
          {
            offset: "5%",
            stopColor: $.fill,
            stopOpacity: 0.8
          }
        ),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "stop",
          {
            offset: "95%",
            stopColor: $.fill,
            stopOpacity: 0.1
          }
        )
      ]
    },
    `gradient${N}`
  )) });
  return !e || e.length === 0 ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(to, { size: "sm", variant: "help", children: "No data available" }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(tS, { width: w, height: A, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(jEe, { data: e, margin: { left: 14, right: 14 }, children: [
    f && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Ty, { vertical: !1 }),
    i && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Yo,
      {
        dataKey: p,
        tickLine: !1,
        axisLine: !1,
        tickMargin: 8,
        tickFormatter: d,
        tick: {
          fontSize: k,
          fill: g
        }
      }
    ),
    o && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      eo,
      {
        dataKey: m,
        tickLine: !1,
        axisLine: !1,
        tickMargin: 8,
        tick: {
          fontSize: k,
          fill: g
        }
      }
    ),
    a && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Lr,
      {
        content: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          wz,
          {
            indicator: s,
            labelKey: l
          }
        )
      }
    ),
    c && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Lo,
      {
        content: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          xz,
          {
            fontSizeVariant: k
          }
        )
      }
    ),
    r === "gradient" && I(),
    t.map(($, N) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
      Xa,
      {
        type: "monotone",
        dataKey: $,
        stroke: P[N % P.length].stroke,
        fill: r === "gradient" ? `url(#fill${N})` : P[N % P.length].fill,
        stackId: "1"
      },
      $
    ))
  ] }) });
}, _z = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(null), LEe = () => (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(_z), BEe = () => {
  const { file: e, removeFile: t, isLoading: n, error: r, errorText: i } = LEe(), o = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex self-start p-0.5", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ZH, { className: "size-5 text-icon-primary" }) }), [e]);
  return e ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K(
        "border border-solid border-transparent flex items-start justify-between rounded mt-2 bg-field-primary-background p-3 gap-3",
        r && "border-alert-border-danger bg-alert-background-danger"
      ),
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 w-full", children: [
        n && o,
        !n && (e.type.startsWith("image/") ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "div",
          {
            className: K(
              "size-10 rounded-sm flex items-center justify-center shrink-0",
              r && "bg-gray-200 "
            ),
            children: r ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(JH, { className: "size-6 text-field-helper" }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              "img",
              {
                src: URL.createObjectURL(e),
                alt: "Preview",
                className: "w-full h-10 object-contain"
              }
            )
          }
        ) : o),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-left flex flex-col gap-1 w-[calc(100%_-_5.5rem)]", children: [
          /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-field-label truncate", children: n ? "Loading..." : e.name }),
          !n && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
            "span",
            {
              className: K(
                "text-xs text-field-helper",
                r && "text-support-error"
              ),
              children: r ? i : WH(e.size)
            }
          )
        ] }),
        n ? /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex ml-auto p-0.5", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(d1, { className: "inline-flex" }) }) : /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "button",
          {
            onClick: t,
            className: "inline-flex cursor-pointer bg-transparent border-0 p-1 my-0 ml-auto mr-0 ring-0 focus:outline-none self-start",
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(rK, { className: "size-4 text-support-error" })
          }
        )
      ] })
    }
  ) : null;
}, FEe = ({
  onFileUpload: e,
  inlineIcon: t = !1,
  label: n = "Drag and drop or browse files",
  helpText: r = "Help Text",
  size: i = "sm",
  disabled: o = !1,
  error: a = !1,
  errorText: s = "Upload failed, please try again."
}) => {
  const [l, c] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), [f, d] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null), [p, m] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1), y = (_) => {
    if (o)
      return;
    c(!0), _.preventDefault(), _.stopPropagation(), m(!1);
    const O = _.dataTransfer.files[0];
    O && (d(O), e && e(O)), c(!1);
  }, g = (_) => {
    o || (_.preventDefault(), m(!0));
  }, v = () => {
    o || m(!1);
  }, x = (_) => {
    if (o)
      return;
    c(!0);
    const O = _.target.files;
    if (!O)
      return;
    const P = O[0];
    P && (d(P), e && e(P)), c(!1);
  }, w = () => {
    d(null);
  }, S = {
    sm: {
      label: "text-sm",
      helpText: "text-xs",
      icon: "size-5",
      padding: t ? "p-3" : "p-5",
      gap: "gap-2.5"
    },
    md: {
      label: "text-sm",
      helpText: "text-xs",
      icon: "size-5",
      padding: t ? "p-4" : "p-6",
      gap: "gap-3"
    },
    lg: {
      label: "text-base",
      helpText: "text-sm",
      icon: "size-6",
      padding: t ? "p-4" : "p-6",
      gap: "gap-3"
    }
  }, A = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(`fui-file-upload-${io()}`);
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    _z.Provider,
    {
      value: { file: f, removeFile: w, isLoading: l, error: a, errorText: s },
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { htmlFor: A.current, children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
          "div",
          {
            className: K(
              "min-w-80 cursor-pointer mx-auto border-dashed border rounded-md text-center hover:border-field-dropzone-color hover:bg-field-dropzone-background-hover focus:outline-none focus:ring focus:ring-toggle-on focus:ring-offset-2 transition duration-200 ease-in-out",
              p ? "border-field-dropzone-color bg-field-dropzone-background-hover" : "border-field-border",
              o && "border-field-border bg-field-background-disabled cursor-not-allowed hover:border-field-border",
              S[i].padding
            ),
            onDragOver: g,
            onDragLeave: v,
            onDrop: y,
            children: [
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
                "div",
                {
                  className: K(
                    "flex flex-col items-center justify-center",
                    t && `flex-row items-start ${S[i].gap}`
                  ),
                  children: [
                    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                      qH,
                      {
                        className: K(
                          "text-field-dropzone-color size-6",
                          S[i].icon,
                          o && "text-field-color-disabled"
                        )
                      }
                    ) }),
                    /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col", children: [
                      /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                        "span",
                        {
                          className: K(
                            "mt-1 text-center font-medium text-field-label",
                            t && "text-left mt-0",
                            S[i].label,
                            o && "text-field-color-disabled"
                          ),
                          children: n
                        }
                      ),
                      r && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                        "span",
                        {
                          className: K(
                            "mt-1 text-center font-medium text-field-helper",
                            t && "text-left",
                            S[i].helpText,
                            o && "text-field-color-disabled"
                          ),
                          children: r
                        }
                      )
                    ] })
                  ]
                }
              ),
              /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
                "input",
                {
                  id: A.current,
                  type: "file",
                  className: "sr-only",
                  onChange: x,
                  disabled: o
                }
              )
            ]
          }
        ) }),
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(BEe, {})
      ] })
    }
  );
};
FEe.displayName = "Dropzone";
const Sz = (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)(
  void 0
), FS = () => {
  const e = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(Sz);
  if (!e)
    throw new Error("Table components must be used within Table component");
  return e;
}, ol = ({
  children: e,
  className: t,
  checkboxSelection: n = !1,
  ...r
}) => {
  const i = {
    checkboxSelection: n
  }, o = react__WEBPACK_IMPORTED_MODULE_1__.Children.toArray(e).find(
    (s) => react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(s) && s.type === Zm
  ), a = react__WEBPACK_IMPORTED_MODULE_1__.Children.toArray(e).filter(
    (s) => react__WEBPACK_IMPORTED_MODULE_1__.isValidElement(s) && s.type !== Zm
  );
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    Sz.Provider,
    {
      value: i,
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flow-root border-0.5 border-solid border-border-subtle rounded-md divide-y-0.5 divide-x-0 divide-solid divide-border-subtle overflow-hidden", children: [
        /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto w-full", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "table",
          {
            className: K(
              "table-fixed min-w-full border-collapse border-spacing-0",
              t
            ),
            ...r,
            children: a
          }
        ) }) }),
        o
      ] })
    }
  );
}, Oz = ({
  children: e,
  className: t,
  selected: n,
  onChangeSelection: r,
  indeterminate: i,
  disabled: o,
  ...a
}) => {
  const { checkboxSelection: s } = FS(), l = (c) => {
    typeof r == "function" && r(c);
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "thead",
    {
      className: K(
        "bg-background-secondary border-x-0 border-t-0 border-b-0.5 border-solid border-border-subtle",
        t
      ),
      ...a,
      children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [
        s && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          "th",
          {
            scope: "col",
            className: "relative px-5.5 w-11 overflow-hidden",
            children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 grid grid-cols-1 place-content-center", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
              Jw,
              {
                size: "sm",
                checked: n,
                indeterminate: i,
                disabled: o,
                onChange: l,
                "aria-label": n ? "Deselect all" : "Select all"
              }
            ) })
          }
        ),
        e
      ] })
    }
  );
}, Az = ({
  children: e,
  className: t,
  ...n
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "th",
  {
    scope: "col",
    className: K(
      "p-3 text-left text-sm font-medium leading-5 text-text-primary",
      t
    ),
    ...n,
    children: e
  }
), Tz = ({
  children: e,
  className: t,
  ...n
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "tbody",
  {
    className: K(
      "bg-background-primary divide-y-0.5 divide-x-0 divide-solid divide-border-subtle",
      t
    ),
    ...n,
    children: e
  }
), Pz = ({
  children: e,
  selected: t,
  value: n,
  className: r,
  onChangeSelection: i,
  ...o
}) => {
  const { checkboxSelection: a } = FS(), s = (l) => {
    typeof i == "function" && i(l, n);
  };
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(
    "tr",
    {
      className: K(
        "hover:bg-background-secondary",
        t && "bg-background-secondary",
        r
      ),
      ...o,
      children: [
        a && /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "relative px-5.5 w-11 overflow-hidden", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 grid grid-cols-1 place-content-center", children: /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
          Jw,
          {
            size: "sm",
            checked: t,
            onChange: s,
            "aria-label": "Select row"
          }
        ) }) }),
        e
      ]
    }
  );
}, Cz = ({
  children: e,
  className: t,
  ...n
}) => /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
  "td",
  {
    className: K(
      "px-3 py-3.5 text-sm font-normal leading-5 text-text-secondary",
      t
    ),
    ...n,
    children: e
  }
), Zm = ({
  children: e,
  className: t,
  ...n
}) => {
  const { checkboxSelection: r } = FS();
  return /* @__PURE__ */ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(
    "div",
    {
      className: K("px-3 py-3", r && "px-4", t),
      ...n,
      children: e
    }
  );
};
ol.displayName = "Table";
Oz.displayName = "Table.Head";
Az.displayName = "Table.HeadCell";
Tz.displayName = "Table.Body";
Pz.displayName = "Table.Row";
Cz.displayName = "Table.Cell";
Zm.displayName = "Table.Footer";
ol.Head = Oz;
ol.HeadCell = Az;
ol.Body = Tz;
ol.Row = Pz;
ol.Cell = Cz;
ol.Footer = Zm;



/***/ }),

/***/ "./node_modules/@remix-run/router/dist/router.js":
/*!*******************************************************!*\
  !*** ./node_modules/@remix-run/router/dist/router.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AbortedDeferredError: () => (/* binding */ AbortedDeferredError),
/* harmony export */   Action: () => (/* binding */ Action),
/* harmony export */   IDLE_BLOCKER: () => (/* binding */ IDLE_BLOCKER),
/* harmony export */   IDLE_FETCHER: () => (/* binding */ IDLE_FETCHER),
/* harmony export */   IDLE_NAVIGATION: () => (/* binding */ IDLE_NAVIGATION),
/* harmony export */   UNSAFE_DEFERRED_SYMBOL: () => (/* binding */ UNSAFE_DEFERRED_SYMBOL),
/* harmony export */   UNSAFE_DeferredData: () => (/* binding */ DeferredData),
/* harmony export */   UNSAFE_ErrorResponseImpl: () => (/* binding */ ErrorResponseImpl),
/* harmony export */   UNSAFE_convertRouteMatchToUiMatch: () => (/* binding */ convertRouteMatchToUiMatch),
/* harmony export */   UNSAFE_convertRoutesToDataRoutes: () => (/* binding */ convertRoutesToDataRoutes),
/* harmony export */   UNSAFE_decodePath: () => (/* binding */ decodePath),
/* harmony export */   UNSAFE_getResolveToMatches: () => (/* binding */ getResolveToMatches),
/* harmony export */   UNSAFE_invariant: () => (/* binding */ invariant),
/* harmony export */   UNSAFE_warning: () => (/* binding */ warning),
/* harmony export */   createBrowserHistory: () => (/* binding */ createBrowserHistory),
/* harmony export */   createHashHistory: () => (/* binding */ createHashHistory),
/* harmony export */   createMemoryHistory: () => (/* binding */ createMemoryHistory),
/* harmony export */   createPath: () => (/* binding */ createPath),
/* harmony export */   createRouter: () => (/* binding */ createRouter),
/* harmony export */   createStaticHandler: () => (/* binding */ createStaticHandler),
/* harmony export */   data: () => (/* binding */ data),
/* harmony export */   defer: () => (/* binding */ defer),
/* harmony export */   generatePath: () => (/* binding */ generatePath),
/* harmony export */   getStaticContextFromError: () => (/* binding */ getStaticContextFromError),
/* harmony export */   getToPathname: () => (/* binding */ getToPathname),
/* harmony export */   isDataWithResponseInit: () => (/* binding */ isDataWithResponseInit),
/* harmony export */   isDeferredData: () => (/* binding */ isDeferredData),
/* harmony export */   isRouteErrorResponse: () => (/* binding */ isRouteErrorResponse),
/* harmony export */   joinPaths: () => (/* binding */ joinPaths),
/* harmony export */   json: () => (/* binding */ json),
/* harmony export */   matchPath: () => (/* binding */ matchPath),
/* harmony export */   matchRoutes: () => (/* binding */ matchRoutes),
/* harmony export */   normalizePathname: () => (/* binding */ normalizePathname),
/* harmony export */   parsePath: () => (/* binding */ parsePath),
/* harmony export */   redirect: () => (/* binding */ redirect),
/* harmony export */   redirectDocument: () => (/* binding */ redirectDocument),
/* harmony export */   replace: () => (/* binding */ replace),
/* harmony export */   resolvePath: () => (/* binding */ resolvePath),
/* harmony export */   resolveTo: () => (/* binding */ resolveTo),
/* harmony export */   stripBasename: () => (/* binding */ stripBasename)
/* harmony export */ });
/**
 * @remix-run/router v1.23.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */
function _extends() {
  _extends = Object.assign ? Object.assign.bind() : function (target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends.apply(this, arguments);
}

////////////////////////////////////////////////////////////////////////////////
//#region Types and Constants
////////////////////////////////////////////////////////////////////////////////
/**
 * Actions represent the type of change to a location value.
 */
var Action;
(function (Action) {
  /**
   * A POP indicates a change to an arbitrary index in the history stack, such
   * as a back or forward navigation. It does not describe the direction of the
   * navigation, only that the current index changed.
   *
   * Note: This is the default action for newly created history objects.
   */
  Action["Pop"] = "POP";
  /**
   * A PUSH indicates a new entry being added to the history stack, such as when
   * a link is clicked and a new page loads. When this happens, all subsequent
   * entries in the stack are lost.
   */
  Action["Push"] = "PUSH";
  /**
   * A REPLACE indicates the entry at the current index in the history stack
   * being replaced by a new one.
   */
  Action["Replace"] = "REPLACE";
})(Action || (Action = {}));
const PopStateEventType = "popstate";
/**
 * Memory history stores the current location in memory. It is designed for use
 * in stateful non-browser environments like tests and React Native.
 */
function createMemoryHistory(options) {
  if (options === void 0) {
    options = {};
  }
  let {
    initialEntries = ["/"],
    initialIndex,
    v5Compat = false
  } = options;
  let entries; // Declare so we can access from createMemoryLocation
  entries = initialEntries.map((entry, index) => createMemoryLocation(entry, typeof entry === "string" ? null : entry.state, index === 0 ? "default" : undefined));
  let index = clampIndex(initialIndex == null ? entries.length - 1 : initialIndex);
  let action = Action.Pop;
  let listener = null;
  function clampIndex(n) {
    return Math.min(Math.max(n, 0), entries.length - 1);
  }
  function getCurrentLocation() {
    return entries[index];
  }
  function createMemoryLocation(to, state, key) {
    if (state === void 0) {
      state = null;
    }
    let location = createLocation(entries ? getCurrentLocation().pathname : "/", to, state, key);
    warning(location.pathname.charAt(0) === "/", "relative pathnames are not supported in memory history: " + JSON.stringify(to));
    return location;
  }
  function createHref(to) {
    return typeof to === "string" ? to : createPath(to);
  }
  let history = {
    get index() {
      return index;
    },
    get action() {
      return action;
    },
    get location() {
      return getCurrentLocation();
    },
    createHref,
    createURL(to) {
      return new URL(createHref(to), "http://localhost");
    },
    encodeLocation(to) {
      let path = typeof to === "string" ? parsePath(to) : to;
      return {
        pathname: path.pathname || "",
        search: path.search || "",
        hash: path.hash || ""
      };
    },
    push(to, state) {
      action = Action.Push;
      let nextLocation = createMemoryLocation(to, state);
      index += 1;
      entries.splice(index, entries.length, nextLocation);
      if (v5Compat && listener) {
        listener({
          action,
          location: nextLocation,
          delta: 1
        });
      }
    },
    replace(to, state) {
      action = Action.Replace;
      let nextLocation = createMemoryLocation(to, state);
      entries[index] = nextLocation;
      if (v5Compat && listener) {
        listener({
          action,
          location: nextLocation,
          delta: 0
        });
      }
    },
    go(delta) {
      action = Action.Pop;
      let nextIndex = clampIndex(index + delta);
      let nextLocation = entries[nextIndex];
      index = nextIndex;
      if (listener) {
        listener({
          action,
          location: nextLocation,
          delta
        });
      }
    },
    listen(fn) {
      listener = fn;
      return () => {
        listener = null;
      };
    }
  };
  return history;
}
/**
 * Browser history stores the location in regular URLs. This is the standard for
 * most web apps, but it requires some configuration on the server to ensure you
 * serve the same app at multiple URLs.
 *
 * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createbrowserhistory
 */
function createBrowserHistory(options) {
  if (options === void 0) {
    options = {};
  }
  function createBrowserLocation(window, globalHistory) {
    let {
      pathname,
      search,
      hash
    } = window.location;
    return createLocation("", {
      pathname,
      search,
      hash
    },
    // state defaults to `null` because `window.history.state` does
    globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || "default");
  }
  function createBrowserHref(window, to) {
    return typeof to === "string" ? to : createPath(to);
  }
  return getUrlBasedHistory(createBrowserLocation, createBrowserHref, null, options);
}
/**
 * Hash history stores the location in window.location.hash. This makes it ideal
 * for situations where you don't want to send the location to the server for
 * some reason, either because you do cannot configure it or the URL space is
 * reserved for something else.
 *
 * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#createhashhistory
 */
function createHashHistory(options) {
  if (options === void 0) {
    options = {};
  }
  function createHashLocation(window, globalHistory) {
    let {
      pathname = "/",
      search = "",
      hash = ""
    } = parsePath(window.location.hash.substr(1));
    // Hash URL should always have a leading / just like window.location.pathname
    // does, so if an app ends up at a route like /#something then we add a
    // leading slash so all of our path-matching behaves the same as if it would
    // in a browser router.  This is particularly important when there exists a
    // root splat route (<Route path="*">) since that matches internally against
    // "/*" and we'd expect /#something to 404 in a hash router app.
    if (!pathname.startsWith("/") && !pathname.startsWith(".")) {
      pathname = "/" + pathname;
    }
    return createLocation("", {
      pathname,
      search,
      hash
    },
    // state defaults to `null` because `window.history.state` does
    globalHistory.state && globalHistory.state.usr || null, globalHistory.state && globalHistory.state.key || "default");
  }
  function createHashHref(window, to) {
    let base = window.document.querySelector("base");
    let href = "";
    if (base && base.getAttribute("href")) {
      let url = window.location.href;
      let hashIndex = url.indexOf("#");
      href = hashIndex === -1 ? url : url.slice(0, hashIndex);
    }
    return href + "#" + (typeof to === "string" ? to : createPath(to));
  }
  function validateHashLocation(location, to) {
    warning(location.pathname.charAt(0) === "/", "relative pathnames are not supported in hash history.push(" + JSON.stringify(to) + ")");
  }
  return getUrlBasedHistory(createHashLocation, createHashHref, validateHashLocation, options);
}
function invariant(value, message) {
  if (value === false || value === null || typeof value === "undefined") {
    throw new Error(message);
  }
}
function warning(cond, message) {
  if (!cond) {
    // eslint-disable-next-line no-console
    if (typeof console !== "undefined") console.warn(message);
    try {
      // Welcome to debugging history!
      //
      // This error is thrown as a convenience, so you can more easily
      // find the source for a warning that appears in the console by
      // enabling "pause on exceptions" in your JavaScript debugger.
      throw new Error(message);
      // eslint-disable-next-line no-empty
    } catch (e) {}
  }
}
function createKey() {
  return Math.random().toString(36).substr(2, 8);
}
/**
 * For browser-based histories, we combine the state and key into an object
 */
function getHistoryState(location, index) {
  return {
    usr: location.state,
    key: location.key,
    idx: index
  };
}
/**
 * Creates a Location object with a unique key from the given Path
 */
function createLocation(current, to, state, key) {
  if (state === void 0) {
    state = null;
  }
  let location = _extends({
    pathname: typeof current === "string" ? current : current.pathname,
    search: "",
    hash: ""
  }, typeof to === "string" ? parsePath(to) : to, {
    state,
    // TODO: This could be cleaned up.  push/replace should probably just take
    // full Locations now and avoid the need to run through this flow at all
    // But that's a pretty big refactor to the current test suite so going to
    // keep as is for the time being and just let any incoming keys take precedence
    key: to && to.key || key || createKey()
  });
  return location;
}
/**
 * Creates a string URL path from the given pathname, search, and hash components.
 */
function createPath(_ref) {
  let {
    pathname = "/",
    search = "",
    hash = ""
  } = _ref;
  if (search && search !== "?") pathname += search.charAt(0) === "?" ? search : "?" + search;
  if (hash && hash !== "#") pathname += hash.charAt(0) === "#" ? hash : "#" + hash;
  return pathname;
}
/**
 * Parses a string URL path into its separate pathname, search, and hash components.
 */
function parsePath(path) {
  let parsedPath = {};
  if (path) {
    let hashIndex = path.indexOf("#");
    if (hashIndex >= 0) {
      parsedPath.hash = path.substr(hashIndex);
      path = path.substr(0, hashIndex);
    }
    let searchIndex = path.indexOf("?");
    if (searchIndex >= 0) {
      parsedPath.search = path.substr(searchIndex);
      path = path.substr(0, searchIndex);
    }
    if (path) {
      parsedPath.pathname = path;
    }
  }
  return parsedPath;
}
function getUrlBasedHistory(getLocation, createHref, validateLocation, options) {
  if (options === void 0) {
    options = {};
  }
  let {
    window = document.defaultView,
    v5Compat = false
  } = options;
  let globalHistory = window.history;
  let action = Action.Pop;
  let listener = null;
  let index = getIndex();
  // Index should only be null when we initialize. If not, it's because the
  // user called history.pushState or history.replaceState directly, in which
  // case we should log a warning as it will result in bugs.
  if (index == null) {
    index = 0;
    globalHistory.replaceState(_extends({}, globalHistory.state, {
      idx: index
    }), "");
  }
  function getIndex() {
    let state = globalHistory.state || {
      idx: null
    };
    return state.idx;
  }
  function handlePop() {
    action = Action.Pop;
    let nextIndex = getIndex();
    let delta = nextIndex == null ? null : nextIndex - index;
    index = nextIndex;
    if (listener) {
      listener({
        action,
        location: history.location,
        delta
      });
    }
  }
  function push(to, state) {
    action = Action.Push;
    let location = createLocation(history.location, to, state);
    if (validateLocation) validateLocation(location, to);
    index = getIndex() + 1;
    let historyState = getHistoryState(location, index);
    let url = history.createHref(location);
    // try...catch because iOS limits us to 100 pushState calls :/
    try {
      globalHistory.pushState(historyState, "", url);
    } catch (error) {
      // If the exception is because `state` can't be serialized, let that throw
      // outwards just like a replace call would so the dev knows the cause
      // https://html.spec.whatwg.org/multipage/nav-history-apis.html#shared-history-push/replace-state-steps
      // https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal
      if (error instanceof DOMException && error.name === "DataCloneError") {
        throw error;
      }
      // They are going to lose state here, but there is no real
      // way to warn them about it since the page will refresh...
      window.location.assign(url);
    }
    if (v5Compat && listener) {
      listener({
        action,
        location: history.location,
        delta: 1
      });
    }
  }
  function replace(to, state) {
    action = Action.Replace;
    let location = createLocation(history.location, to, state);
    if (validateLocation) validateLocation(location, to);
    index = getIndex();
    let historyState = getHistoryState(location, index);
    let url = history.createHref(location);
    globalHistory.replaceState(historyState, "", url);
    if (v5Compat && listener) {
      listener({
        action,
        location: history.location,
        delta: 0
      });
    }
  }
  function createURL(to) {
    // window.location.origin is "null" (the literal string value) in Firefox
    // under certain conditions, notably when serving from a local HTML file
    // See https://bugzilla.mozilla.org/show_bug.cgi?id=878297
    let base = window.location.origin !== "null" ? window.location.origin : window.location.href;
    let href = typeof to === "string" ? to : createPath(to);
    // Treating this as a full URL will strip any trailing spaces so we need to
    // pre-encode them since they might be part of a matching splat param from
    // an ancestor route
    href = href.replace(/ $/, "%20");
    invariant(base, "No window.location.(origin|href) available to create URL for href: " + href);
    return new URL(href, base);
  }
  let history = {
    get action() {
      return action;
    },
    get location() {
      return getLocation(window, globalHistory);
    },
    listen(fn) {
      if (listener) {
        throw new Error("A history only accepts one active listener");
      }
      window.addEventListener(PopStateEventType, handlePop);
      listener = fn;
      return () => {
        window.removeEventListener(PopStateEventType, handlePop);
        listener = null;
      };
    },
    createHref(to) {
      return createHref(window, to);
    },
    createURL,
    encodeLocation(to) {
      // Encode a Location the same way window.location would
      let url = createURL(to);
      return {
        pathname: url.pathname,
        search: url.search,
        hash: url.hash
      };
    },
    push,
    replace,
    go(n) {
      return globalHistory.go(n);
    }
  };
  return history;
}
//#endregion

var ResultType;
(function (ResultType) {
  ResultType["data"] = "data";
  ResultType["deferred"] = "deferred";
  ResultType["redirect"] = "redirect";
  ResultType["error"] = "error";
})(ResultType || (ResultType = {}));
const immutableRouteKeys = new Set(["lazy", "caseSensitive", "path", "id", "index", "children"]);
function isIndexRoute(route) {
  return route.index === true;
}
// Walk the route tree generating unique IDs where necessary, so we are working
// solely with AgnosticDataRouteObject's within the Router
function convertRoutesToDataRoutes(routes, mapRouteProperties, parentPath, manifest) {
  if (parentPath === void 0) {
    parentPath = [];
  }
  if (manifest === void 0) {
    manifest = {};
  }
  return routes.map((route, index) => {
    let treePath = [...parentPath, String(index)];
    let id = typeof route.id === "string" ? route.id : treePath.join("-");
    invariant(route.index !== true || !route.children, "Cannot specify children on an index route");
    invariant(!manifest[id], "Found a route id collision on id \"" + id + "\".  Route " + "id's must be globally unique within Data Router usages");
    if (isIndexRoute(route)) {
      let indexRoute = _extends({}, route, mapRouteProperties(route), {
        id
      });
      manifest[id] = indexRoute;
      return indexRoute;
    } else {
      let pathOrLayoutRoute = _extends({}, route, mapRouteProperties(route), {
        id,
        children: undefined
      });
      manifest[id] = pathOrLayoutRoute;
      if (route.children) {
        pathOrLayoutRoute.children = convertRoutesToDataRoutes(route.children, mapRouteProperties, treePath, manifest);
      }
      return pathOrLayoutRoute;
    }
  });
}
/**
 * Matches the given routes to a location and returns the match data.
 *
 * @see https://reactrouter.com/v6/utils/match-routes
 */
function matchRoutes(routes, locationArg, basename) {
  if (basename === void 0) {
    basename = "/";
  }
  return matchRoutesImpl(routes, locationArg, basename, false);
}
function matchRoutesImpl(routes, locationArg, basename, allowPartial) {
  let location = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
  let pathname = stripBasename(location.pathname || "/", basename);
  if (pathname == null) {
    return null;
  }
  let branches = flattenRoutes(routes);
  rankRouteBranches(branches);
  let matches = null;
  for (let i = 0; matches == null && i < branches.length; ++i) {
    // Incoming pathnames are generally encoded from either window.location
    // or from router.navigate, but we want to match against the unencoded
    // paths in the route definitions.  Memory router locations won't be
    // encoded here but there also shouldn't be anything to decode so this
    // should be a safe operation.  This avoids needing matchRoutes to be
    // history-aware.
    let decoded = decodePath(pathname);
    matches = matchRouteBranch(branches[i], decoded, allowPartial);
  }
  return matches;
}
function convertRouteMatchToUiMatch(match, loaderData) {
  let {
    route,
    pathname,
    params
  } = match;
  return {
    id: route.id,
    pathname,
    params,
    data: loaderData[route.id],
    handle: route.handle
  };
}
function flattenRoutes(routes, branches, parentsMeta, parentPath) {
  if (branches === void 0) {
    branches = [];
  }
  if (parentsMeta === void 0) {
    parentsMeta = [];
  }
  if (parentPath === void 0) {
    parentPath = "";
  }
  let flattenRoute = (route, index, relativePath) => {
    let meta = {
      relativePath: relativePath === undefined ? route.path || "" : relativePath,
      caseSensitive: route.caseSensitive === true,
      childrenIndex: index,
      route
    };
    if (meta.relativePath.startsWith("/")) {
      invariant(meta.relativePath.startsWith(parentPath), "Absolute route path \"" + meta.relativePath + "\" nested under path " + ("\"" + parentPath + "\" is not valid. An absolute child route path ") + "must start with the combined path of all its parent routes.");
      meta.relativePath = meta.relativePath.slice(parentPath.length);
    }
    let path = joinPaths([parentPath, meta.relativePath]);
    let routesMeta = parentsMeta.concat(meta);
    // Add the children before adding this route to the array, so we traverse the
    // route tree depth-first and child routes appear before their parents in
    // the "flattened" version.
    if (route.children && route.children.length > 0) {
      invariant(
      // Our types know better, but runtime JS may not!
      // @ts-expect-error
      route.index !== true, "Index routes must not have child routes. Please remove " + ("all child routes from route path \"" + path + "\"."));
      flattenRoutes(route.children, branches, routesMeta, path);
    }
    // Routes without a path shouldn't ever match by themselves unless they are
    // index routes, so don't add them to the list of possible branches.
    if (route.path == null && !route.index) {
      return;
    }
    branches.push({
      path,
      score: computeScore(path, route.index),
      routesMeta
    });
  };
  routes.forEach((route, index) => {
    var _route$path;
    // coarse-grain check for optional params
    if (route.path === "" || !((_route$path = route.path) != null && _route$path.includes("?"))) {
      flattenRoute(route, index);
    } else {
      for (let exploded of explodeOptionalSegments(route.path)) {
        flattenRoute(route, index, exploded);
      }
    }
  });
  return branches;
}
/**
 * Computes all combinations of optional path segments for a given path,
 * excluding combinations that are ambiguous and of lower priority.
 *
 * For example, `/one/:two?/three/:four?/:five?` explodes to:
 * - `/one/three`
 * - `/one/:two/three`
 * - `/one/three/:four`
 * - `/one/three/:five`
 * - `/one/:two/three/:four`
 * - `/one/:two/three/:five`
 * - `/one/three/:four/:five`
 * - `/one/:two/three/:four/:five`
 */
function explodeOptionalSegments(path) {
  let segments = path.split("/");
  if (segments.length === 0) return [];
  let [first, ...rest] = segments;
  // Optional path segments are denoted by a trailing `?`
  let isOptional = first.endsWith("?");
  // Compute the corresponding required segment: `foo?` -> `foo`
  let required = first.replace(/\?$/, "");
  if (rest.length === 0) {
    // Intepret empty string as omitting an optional segment
    // `["one", "", "three"]` corresponds to omitting `:two` from `/one/:two?/three` -> `/one/three`
    return isOptional ? [required, ""] : [required];
  }
  let restExploded = explodeOptionalSegments(rest.join("/"));
  let result = [];
  // All child paths with the prefix.  Do this for all children before the
  // optional version for all children, so we get consistent ordering where the
  // parent optional aspect is preferred as required.  Otherwise, we can get
  // child sections interspersed where deeper optional segments are higher than
  // parent optional segments, where for example, /:two would explode _earlier_
  // then /:one.  By always including the parent as required _for all children_
  // first, we avoid this issue
  result.push(...restExploded.map(subpath => subpath === "" ? required : [required, subpath].join("/")));
  // Then, if this is an optional value, add all child versions without
  if (isOptional) {
    result.push(...restExploded);
  }
  // for absolute paths, ensure `/` instead of empty segment
  return result.map(exploded => path.startsWith("/") && exploded === "" ? "/" : exploded);
}
function rankRouteBranches(branches) {
  branches.sort((a, b) => a.score !== b.score ? b.score - a.score // Higher score first
  : compareIndexes(a.routesMeta.map(meta => meta.childrenIndex), b.routesMeta.map(meta => meta.childrenIndex)));
}
const paramRe = /^:[\w-]+$/;
const dynamicSegmentValue = 3;
const indexRouteValue = 2;
const emptySegmentValue = 1;
const staticSegmentValue = 10;
const splatPenalty = -2;
const isSplat = s => s === "*";
function computeScore(path, index) {
  let segments = path.split("/");
  let initialScore = segments.length;
  if (segments.some(isSplat)) {
    initialScore += splatPenalty;
  }
  if (index) {
    initialScore += indexRouteValue;
  }
  return segments.filter(s => !isSplat(s)).reduce((score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), initialScore);
}
function compareIndexes(a, b) {
  let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);
  return siblings ?
  // If two routes are siblings, we should try to match the earlier sibling
  // first. This allows people to have fine-grained control over the matching
  // behavior by simply putting routes with identical paths in the order they
  // want them tried.
  a[a.length - 1] - b[b.length - 1] :
  // Otherwise, it doesn't really make sense to rank non-siblings by index,
  // so they sort equally.
  0;
}
function matchRouteBranch(branch, pathname, allowPartial) {
  if (allowPartial === void 0) {
    allowPartial = false;
  }
  let {
    routesMeta
  } = branch;
  let matchedParams = {};
  let matchedPathname = "/";
  let matches = [];
  for (let i = 0; i < routesMeta.length; ++i) {
    let meta = routesMeta[i];
    let end = i === routesMeta.length - 1;
    let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/";
    let match = matchPath({
      path: meta.relativePath,
      caseSensitive: meta.caseSensitive,
      end
    }, remainingPathname);
    let route = meta.route;
    if (!match && end && allowPartial && !routesMeta[routesMeta.length - 1].route.index) {
      match = matchPath({
        path: meta.relativePath,
        caseSensitive: meta.caseSensitive,
        end: false
      }, remainingPathname);
    }
    if (!match) {
      return null;
    }
    Object.assign(matchedParams, match.params);
    matches.push({
      // TODO: Can this as be avoided?
      params: matchedParams,
      pathname: joinPaths([matchedPathname, match.pathname]),
      pathnameBase: normalizePathname(joinPaths([matchedPathname, match.pathnameBase])),
      route
    });
    if (match.pathnameBase !== "/") {
      matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);
    }
  }
  return matches;
}
/**
 * Returns a path with params interpolated.
 *
 * @see https://reactrouter.com/v6/utils/generate-path
 */
function generatePath(originalPath, params) {
  if (params === void 0) {
    params = {};
  }
  let path = originalPath;
  if (path.endsWith("*") && path !== "*" && !path.endsWith("/*")) {
    warning(false, "Route path \"" + path + "\" will be treated as if it were " + ("\"" + path.replace(/\*$/, "/*") + "\" because the `*` character must ") + "always follow a `/` in the pattern. To get rid of this warning, " + ("please change the route path to \"" + path.replace(/\*$/, "/*") + "\"."));
    path = path.replace(/\*$/, "/*");
  }
  // ensure `/` is added at the beginning if the path is absolute
  const prefix = path.startsWith("/") ? "/" : "";
  const stringify = p => p == null ? "" : typeof p === "string" ? p : String(p);
  const segments = path.split(/\/+/).map((segment, index, array) => {
    const isLastSegment = index === array.length - 1;
    // only apply the splat if it's the last segment
    if (isLastSegment && segment === "*") {
      const star = "*";
      // Apply the splat
      return stringify(params[star]);
    }
    const keyMatch = segment.match(/^:([\w-]+)(\??)$/);
    if (keyMatch) {
      const [, key, optional] = keyMatch;
      let param = params[key];
      invariant(optional === "?" || param != null, "Missing \":" + key + "\" param");
      return stringify(param);
    }
    // Remove any optional markers from optional static segments
    return segment.replace(/\?$/g, "");
  })
  // Remove empty segments
  .filter(segment => !!segment);
  return prefix + segments.join("/");
}
/**
 * Performs pattern matching on a URL pathname and returns information about
 * the match.
 *
 * @see https://reactrouter.com/v6/utils/match-path
 */
function matchPath(pattern, pathname) {
  if (typeof pattern === "string") {
    pattern = {
      path: pattern,
      caseSensitive: false,
      end: true
    };
  }
  let [matcher, compiledParams] = compilePath(pattern.path, pattern.caseSensitive, pattern.end);
  let match = pathname.match(matcher);
  if (!match) return null;
  let matchedPathname = match[0];
  let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1");
  let captureGroups = match.slice(1);
  let params = compiledParams.reduce((memo, _ref, index) => {
    let {
      paramName,
      isOptional
    } = _ref;
    // We need to compute the pathnameBase here using the raw splat value
    // instead of using params["*"] later because it will be decoded then
    if (paramName === "*") {
      let splatValue = captureGroups[index] || "";
      pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1");
    }
    const value = captureGroups[index];
    if (isOptional && !value) {
      memo[paramName] = undefined;
    } else {
      memo[paramName] = (value || "").replace(/%2F/g, "/");
    }
    return memo;
  }, {});
  return {
    params,
    pathname: matchedPathname,
    pathnameBase,
    pattern
  };
}
function compilePath(path, caseSensitive, end) {
  if (caseSensitive === void 0) {
    caseSensitive = false;
  }
  if (end === void 0) {
    end = true;
  }
  warning(path === "*" || !path.endsWith("*") || path.endsWith("/*"), "Route path \"" + path + "\" will be treated as if it were " + ("\"" + path.replace(/\*$/, "/*") + "\" because the `*` character must ") + "always follow a `/` in the pattern. To get rid of this warning, " + ("please change the route path to \"" + path.replace(/\*$/, "/*") + "\"."));
  let params = [];
  let regexpSource = "^" + path.replace(/\/*\*?$/, "") // Ignore trailing / and /*, we'll handle it below
  .replace(/^\/*/, "/") // Make sure it has a leading /
  .replace(/[\\.*+^${}|()[\]]/g, "\\$&") // Escape special regex chars
  .replace(/\/:([\w-]+)(\?)?/g, (_, paramName, isOptional) => {
    params.push({
      paramName,
      isOptional: isOptional != null
    });
    return isOptional ? "/?([^\\/]+)?" : "/([^\\/]+)";
  });
  if (path.endsWith("*")) {
    params.push({
      paramName: "*"
    });
    regexpSource += path === "*" || path === "/*" ? "(.*)$" // Already matched the initial /, just match the rest
    : "(?:\\/(.+)|\\/*)$"; // Don't include the / in params["*"]
  } else if (end) {
    // When matching to the end, ignore trailing slashes
    regexpSource += "\\/*$";
  } else if (path !== "" && path !== "/") {
    // If our path is non-empty and contains anything beyond an initial slash,
    // then we have _some_ form of path in our regex, so we should expect to
    // match only if we find the end of this path segment.  Look for an optional
    // non-captured trailing slash (to match a portion of the URL) or the end
    // of the path (if we've matched to the end).  We used to do this with a
    // word boundary but that gives false positives on routes like
    // /user-preferences since `-` counts as a word boundary.
    regexpSource += "(?:(?=\\/|$))";
  } else ;
  let matcher = new RegExp(regexpSource, caseSensitive ? undefined : "i");
  return [matcher, params];
}
function decodePath(value) {
  try {
    return value.split("/").map(v => decodeURIComponent(v).replace(/\//g, "%2F")).join("/");
  } catch (error) {
    warning(false, "The URL path \"" + value + "\" could not be decoded because it is is a " + "malformed URL segment. This is probably due to a bad percent " + ("encoding (" + error + ")."));
    return value;
  }
}
/**
 * @private
 */
function stripBasename(pathname, basename) {
  if (basename === "/") return pathname;
  if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {
    return null;
  }
  // We want to leave trailing slash behavior in the user's control, so if they
  // specify a basename with a trailing slash, we should support it
  let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length;
  let nextChar = pathname.charAt(startIndex);
  if (nextChar && nextChar !== "/") {
    // pathname does not start with basename/
    return null;
  }
  return pathname.slice(startIndex) || "/";
}
/**
 * Returns a resolved path object relative to the given pathname.
 *
 * @see https://reactrouter.com/v6/utils/resolve-path
 */
function resolvePath(to, fromPathname) {
  if (fromPathname === void 0) {
    fromPathname = "/";
  }
  let {
    pathname: toPathname,
    search = "",
    hash = ""
  } = typeof to === "string" ? parsePath(to) : to;
  let pathname = toPathname ? toPathname.startsWith("/") ? toPathname : resolvePathname(toPathname, fromPathname) : fromPathname;
  return {
    pathname,
    search: normalizeSearch(search),
    hash: normalizeHash(hash)
  };
}
function resolvePathname(relativePath, fromPathname) {
  let segments = fromPathname.replace(/\/+$/, "").split("/");
  let relativeSegments = relativePath.split("/");
  relativeSegments.forEach(segment => {
    if (segment === "..") {
      // Keep the root "" segment so the pathname starts at /
      if (segments.length > 1) segments.pop();
    } else if (segment !== ".") {
      segments.push(segment);
    }
  });
  return segments.length > 1 ? segments.join("/") : "/";
}
function getInvalidPathError(char, field, dest, path) {
  return "Cannot include a '" + char + "' character in a manually specified " + ("`to." + field + "` field [" + JSON.stringify(path) + "].  Please separate it out to the ") + ("`to." + dest + "` field. Alternatively you may provide the full path as ") + "a string in <Link to=\"...\"> and the router will parse it for you.";
}
/**
 * @private
 *
 * When processing relative navigation we want to ignore ancestor routes that
 * do not contribute to the path, such that index/pathless layout routes don't
 * interfere.
 *
 * For example, when moving a route element into an index route and/or a
 * pathless layout route, relative link behavior contained within should stay
 * the same.  Both of the following examples should link back to the root:
 *
 *   <Route path="/">
 *     <Route path="accounts" element={<Link to=".."}>
 *   </Route>
 *
 *   <Route path="/">
 *     <Route path="accounts">
 *       <Route element={<AccountsLayout />}>       // <-- Does not contribute
 *         <Route index element={<Link to=".."} />  // <-- Does not contribute
 *       </Route
 *     </Route>
 *   </Route>
 */
function getPathContributingMatches(matches) {
  return matches.filter((match, index) => index === 0 || match.route.path && match.route.path.length > 0);
}
// Return the array of pathnames for the current route matches - used to
// generate the routePathnames input for resolveTo()
function getResolveToMatches(matches, v7_relativeSplatPath) {
  let pathMatches = getPathContributingMatches(matches);
  // When v7_relativeSplatPath is enabled, use the full pathname for the leaf
  // match so we include splat values for "." links.  See:
  // https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329
  if (v7_relativeSplatPath) {
    return pathMatches.map((match, idx) => idx === pathMatches.length - 1 ? match.pathname : match.pathnameBase);
  }
  return pathMatches.map(match => match.pathnameBase);
}
/**
 * @private
 */
function resolveTo(toArg, routePathnames, locationPathname, isPathRelative) {
  if (isPathRelative === void 0) {
    isPathRelative = false;
  }
  let to;
  if (typeof toArg === "string") {
    to = parsePath(toArg);
  } else {
    to = _extends({}, toArg);
    invariant(!to.pathname || !to.pathname.includes("?"), getInvalidPathError("?", "pathname", "search", to));
    invariant(!to.pathname || !to.pathname.includes("#"), getInvalidPathError("#", "pathname", "hash", to));
    invariant(!to.search || !to.search.includes("#"), getInvalidPathError("#", "search", "hash", to));
  }
  let isEmptyPath = toArg === "" || to.pathname === "";
  let toPathname = isEmptyPath ? "/" : to.pathname;
  let from;
  // Routing is relative to the current pathname if explicitly requested.
  //
  // If a pathname is explicitly provided in `to`, it should be relative to the
  // route context. This is explained in `Note on `<Link to>` values` in our
  // migration guide from v5 as a means of disambiguation between `to` values
  // that begin with `/` and those that do not. However, this is problematic for
  // `to` values that do not provide a pathname. `to` can simply be a search or
  // hash string, in which case we should assume that the navigation is relative
  // to the current location's pathname and *not* the route pathname.
  if (toPathname == null) {
    from = locationPathname;
  } else {
    let routePathnameIndex = routePathnames.length - 1;
    // With relative="route" (the default), each leading .. segment means
    // "go up one route" instead of "go up one URL segment".  This is a key
    // difference from how <a href> works and a major reason we call this a
    // "to" value instead of a "href".
    if (!isPathRelative && toPathname.startsWith("..")) {
      let toSegments = toPathname.split("/");
      while (toSegments[0] === "..") {
        toSegments.shift();
        routePathnameIndex -= 1;
      }
      to.pathname = toSegments.join("/");
    }
    from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/";
  }
  let path = resolvePath(to, from);
  // Ensure the pathname has a trailing slash if the original "to" had one
  let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/");
  // Or if this was a link to the current path which has a trailing slash
  let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/");
  if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) {
    path.pathname += "/";
  }
  return path;
}
/**
 * @private
 */
function getToPathname(to) {
  // Empty strings should be treated the same as / paths
  return to === "" || to.pathname === "" ? "/" : typeof to === "string" ? parsePath(to).pathname : to.pathname;
}
/**
 * @private
 */
const joinPaths = paths => paths.join("/").replace(/\/\/+/g, "/");
/**
 * @private
 */
const normalizePathname = pathname => pathname.replace(/\/+$/, "").replace(/^\/*/, "/");
/**
 * @private
 */
const normalizeSearch = search => !search || search === "?" ? "" : search.startsWith("?") ? search : "?" + search;
/**
 * @private
 */
const normalizeHash = hash => !hash || hash === "#" ? "" : hash.startsWith("#") ? hash : "#" + hash;
/**
 * This is a shortcut for creating `application/json` responses. Converts `data`
 * to JSON and sets the `Content-Type` header.
 *
 * @deprecated The `json` method is deprecated in favor of returning raw objects.
 * This method will be removed in v7.
 */
const json = function json(data, init) {
  if (init === void 0) {
    init = {};
  }
  let responseInit = typeof init === "number" ? {
    status: init
  } : init;
  let headers = new Headers(responseInit.headers);
  if (!headers.has("Content-Type")) {
    headers.set("Content-Type", "application/json; charset=utf-8");
  }
  return new Response(JSON.stringify(data), _extends({}, responseInit, {
    headers
  }));
};
class DataWithResponseInit {
  constructor(data, init) {
    this.type = "DataWithResponseInit";
    this.data = data;
    this.init = init || null;
  }
}
/**
 * Create "responses" that contain `status`/`headers` without forcing
 * serialization into an actual `Response` - used by Remix single fetch
 */
function data(data, init) {
  return new DataWithResponseInit(data, typeof init === "number" ? {
    status: init
  } : init);
}
class AbortedDeferredError extends Error {}
class DeferredData {
  constructor(data, responseInit) {
    this.pendingKeysSet = new Set();
    this.subscribers = new Set();
    this.deferredKeys = [];
    invariant(data && typeof data === "object" && !Array.isArray(data), "defer() only accepts plain objects");
    // Set up an AbortController + Promise we can race against to exit early
    // cancellation
    let reject;
    this.abortPromise = new Promise((_, r) => reject = r);
    this.controller = new AbortController();
    let onAbort = () => reject(new AbortedDeferredError("Deferred data aborted"));
    this.unlistenAbortSignal = () => this.controller.signal.removeEventListener("abort", onAbort);
    this.controller.signal.addEventListener("abort", onAbort);
    this.data = Object.entries(data).reduce((acc, _ref2) => {
      let [key, value] = _ref2;
      return Object.assign(acc, {
        [key]: this.trackPromise(key, value)
      });
    }, {});
    if (this.done) {
      // All incoming values were resolved
      this.unlistenAbortSignal();
    }
    this.init = responseInit;
  }
  trackPromise(key, value) {
    if (!(value instanceof Promise)) {
      return value;
    }
    this.deferredKeys.push(key);
    this.pendingKeysSet.add(key);
    // We store a little wrapper promise that will be extended with
    // _data/_error props upon resolve/reject
    let promise = Promise.race([value, this.abortPromise]).then(data => this.onSettle(promise, key, undefined, data), error => this.onSettle(promise, key, error));
    // Register rejection listeners to avoid uncaught promise rejections on
    // errors or aborted deferred values
    promise.catch(() => {});
    Object.defineProperty(promise, "_tracked", {
      get: () => true
    });
    return promise;
  }
  onSettle(promise, key, error, data) {
    if (this.controller.signal.aborted && error instanceof AbortedDeferredError) {
      this.unlistenAbortSignal();
      Object.defineProperty(promise, "_error", {
        get: () => error
      });
      return Promise.reject(error);
    }
    this.pendingKeysSet.delete(key);
    if (this.done) {
      // Nothing left to abort!
      this.unlistenAbortSignal();
    }
    // If the promise was resolved/rejected with undefined, we'll throw an error as you
    // should always resolve with a value or null
    if (error === undefined && data === undefined) {
      let undefinedError = new Error("Deferred data for key \"" + key + "\" resolved/rejected with `undefined`, " + "you must resolve/reject with a value or `null`.");
      Object.defineProperty(promise, "_error", {
        get: () => undefinedError
      });
      this.emit(false, key);
      return Promise.reject(undefinedError);
    }
    if (data === undefined) {
      Object.defineProperty(promise, "_error", {
        get: () => error
      });
      this.emit(false, key);
      return Promise.reject(error);
    }
    Object.defineProperty(promise, "_data", {
      get: () => data
    });
    this.emit(false, key);
    return data;
  }
  emit(aborted, settledKey) {
    this.subscribers.forEach(subscriber => subscriber(aborted, settledKey));
  }
  subscribe(fn) {
    this.subscribers.add(fn);
    return () => this.subscribers.delete(fn);
  }
  cancel() {
    this.controller.abort();
    this.pendingKeysSet.forEach((v, k) => this.pendingKeysSet.delete(k));
    this.emit(true);
  }
  async resolveData(signal) {
    let aborted = false;
    if (!this.done) {
      let onAbort = () => this.cancel();
      signal.addEventListener("abort", onAbort);
      aborted = await new Promise(resolve => {
        this.subscribe(aborted => {
          signal.removeEventListener("abort", onAbort);
          if (aborted || this.done) {
            resolve(aborted);
          }
        });
      });
    }
    return aborted;
  }
  get done() {
    return this.pendingKeysSet.size === 0;
  }
  get unwrappedData() {
    invariant(this.data !== null && this.done, "Can only unwrap data on initialized and settled deferreds");
    return Object.entries(this.data).reduce((acc, _ref3) => {
      let [key, value] = _ref3;
      return Object.assign(acc, {
        [key]: unwrapTrackedPromise(value)
      });
    }, {});
  }
  get pendingKeys() {
    return Array.from(this.pendingKeysSet);
  }
}
function isTrackedPromise(value) {
  return value instanceof Promise && value._tracked === true;
}
function unwrapTrackedPromise(value) {
  if (!isTrackedPromise(value)) {
    return value;
  }
  if (value._error) {
    throw value._error;
  }
  return value._data;
}
/**
 * @deprecated The `defer` method is deprecated in favor of returning raw
 * objects. This method will be removed in v7.
 */
const defer = function defer(data, init) {
  if (init === void 0) {
    init = {};
  }
  let responseInit = typeof init === "number" ? {
    status: init
  } : init;
  return new DeferredData(data, responseInit);
};
/**
 * A redirect response. Sets the status code and the `Location` header.
 * Defaults to "302 Found".
 */
const redirect = function redirect(url, init) {
  if (init === void 0) {
    init = 302;
  }
  let responseInit = init;
  if (typeof responseInit === "number") {
    responseInit = {
      status: responseInit
    };
  } else if (typeof responseInit.status === "undefined") {
    responseInit.status = 302;
  }
  let headers = new Headers(responseInit.headers);
  headers.set("Location", url);
  return new Response(null, _extends({}, responseInit, {
    headers
  }));
};
/**
 * A redirect response that will force a document reload to the new location.
 * Sets the status code and the `Location` header.
 * Defaults to "302 Found".
 */
const redirectDocument = (url, init) => {
  let response = redirect(url, init);
  response.headers.set("X-Remix-Reload-Document", "true");
  return response;
};
/**
 * A redirect response that will perform a `history.replaceState` instead of a
 * `history.pushState` for client-side navigation redirects.
 * Sets the status code and the `Location` header.
 * Defaults to "302 Found".
 */
const replace = (url, init) => {
  let response = redirect(url, init);
  response.headers.set("X-Remix-Replace", "true");
  return response;
};
/**
 * @private
 * Utility class we use to hold auto-unwrapped 4xx/5xx Response bodies
 *
 * We don't export the class for public use since it's an implementation
 * detail, but we export the interface above so folks can build their own
 * abstractions around instances via isRouteErrorResponse()
 */
class ErrorResponseImpl {
  constructor(status, statusText, data, internal) {
    if (internal === void 0) {
      internal = false;
    }
    this.status = status;
    this.statusText = statusText || "";
    this.internal = internal;
    if (data instanceof Error) {
      this.data = data.toString();
      this.error = data;
    } else {
      this.data = data;
    }
  }
}
/**
 * Check if the given error is an ErrorResponse generated from a 4xx/5xx
 * Response thrown from an action/loader
 */
function isRouteErrorResponse(error) {
  return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error;
}

const validMutationMethodsArr = ["post", "put", "patch", "delete"];
const validMutationMethods = new Set(validMutationMethodsArr);
const validRequestMethodsArr = ["get", ...validMutationMethodsArr];
const validRequestMethods = new Set(validRequestMethodsArr);
const redirectStatusCodes = new Set([301, 302, 303, 307, 308]);
const redirectPreserveMethodStatusCodes = new Set([307, 308]);
const IDLE_NAVIGATION = {
  state: "idle",
  location: undefined,
  formMethod: undefined,
  formAction: undefined,
  formEncType: undefined,
  formData: undefined,
  json: undefined,
  text: undefined
};
const IDLE_FETCHER = {
  state: "idle",
  data: undefined,
  formMethod: undefined,
  formAction: undefined,
  formEncType: undefined,
  formData: undefined,
  json: undefined,
  text: undefined
};
const IDLE_BLOCKER = {
  state: "unblocked",
  proceed: undefined,
  reset: undefined,
  location: undefined
};
const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
const defaultMapRouteProperties = route => ({
  hasErrorBoundary: Boolean(route.hasErrorBoundary)
});
const TRANSITIONS_STORAGE_KEY = "remix-router-transitions";
//#endregion
////////////////////////////////////////////////////////////////////////////////
//#region createRouter
////////////////////////////////////////////////////////////////////////////////
/**
 * Create a router and listen to history POP navigations
 */
function createRouter(init) {
  const routerWindow = init.window ? init.window : typeof window !== "undefined" ? window : undefined;
  const isBrowser = typeof routerWindow !== "undefined" && typeof routerWindow.document !== "undefined" && typeof routerWindow.document.createElement !== "undefined";
  const isServer = !isBrowser;
  invariant(init.routes.length > 0, "You must provide a non-empty routes array to createRouter");
  let mapRouteProperties;
  if (init.mapRouteProperties) {
    mapRouteProperties = init.mapRouteProperties;
  } else if (init.detectErrorBoundary) {
    // If they are still using the deprecated version, wrap it with the new API
    let detectErrorBoundary = init.detectErrorBoundary;
    mapRouteProperties = route => ({
      hasErrorBoundary: detectErrorBoundary(route)
    });
  } else {
    mapRouteProperties = defaultMapRouteProperties;
  }
  // Routes keyed by ID
  let manifest = {};
  // Routes in tree format for matching
  let dataRoutes = convertRoutesToDataRoutes(init.routes, mapRouteProperties, undefined, manifest);
  let inFlightDataRoutes;
  let basename = init.basename || "/";
  let dataStrategyImpl = init.dataStrategy || defaultDataStrategy;
  let patchRoutesOnNavigationImpl = init.patchRoutesOnNavigation;
  // Config driven behavior flags
  let future = _extends({
    v7_fetcherPersist: false,
    v7_normalizeFormMethod: false,
    v7_partialHydration: false,
    v7_prependBasename: false,
    v7_relativeSplatPath: false,
    v7_skipActionErrorRevalidation: false
  }, init.future);
  // Cleanup function for history
  let unlistenHistory = null;
  // Externally-provided functions to call on all state changes
  let subscribers = new Set();
  // Externally-provided object to hold scroll restoration locations during routing
  let savedScrollPositions = null;
  // Externally-provided function to get scroll restoration keys
  let getScrollRestorationKey = null;
  // Externally-provided function to get current scroll position
  let getScrollPosition = null;
  // One-time flag to control the initial hydration scroll restoration.  Because
  // we don't get the saved positions from <ScrollRestoration /> until _after_
  // the initial render, we need to manually trigger a separate updateState to
  // send along the restoreScrollPosition
  // Set to true if we have `hydrationData` since we assume we were SSR'd and that
  // SSR did the initial scroll restoration.
  let initialScrollRestored = init.hydrationData != null;
  let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);
  let initialMatchesIsFOW = false;
  let initialErrors = null;
  if (initialMatches == null && !patchRoutesOnNavigationImpl) {
    // If we do not match a user-provided-route, fall back to the root
    // to allow the error boundary to take over
    let error = getInternalRouterError(404, {
      pathname: init.history.location.pathname
    });
    let {
      matches,
      route
    } = getShortCircuitMatches(dataRoutes);
    initialMatches = matches;
    initialErrors = {
      [route.id]: error
    };
  }
  // In SPA apps, if the user provided a patchRoutesOnNavigation implementation and
  // our initial match is a splat route, clear them out so we run through lazy
  // discovery on hydration in case there's a more accurate lazy route match.
  // In SSR apps (with `hydrationData`), we expect that the server will send
  // up the proper matched routes so we don't want to run lazy discovery on
  // initial hydration and want to hydrate into the splat route.
  if (initialMatches && !init.hydrationData) {
    let fogOfWar = checkFogOfWar(initialMatches, dataRoutes, init.history.location.pathname);
    if (fogOfWar.active) {
      initialMatches = null;
    }
  }
  let initialized;
  if (!initialMatches) {
    initialized = false;
    initialMatches = [];
    // If partial hydration and fog of war is enabled, we will be running
    // `patchRoutesOnNavigation` during hydration so include any partial matches as
    // the initial matches so we can properly render `HydrateFallback`'s
    if (future.v7_partialHydration) {
      let fogOfWar = checkFogOfWar(null, dataRoutes, init.history.location.pathname);
      if (fogOfWar.active && fogOfWar.matches) {
        initialMatchesIsFOW = true;
        initialMatches = fogOfWar.matches;
      }
    }
  } else if (initialMatches.some(m => m.route.lazy)) {
    // All initialMatches need to be loaded before we're ready.  If we have lazy
    // functions around still then we'll need to run them in initialize()
    initialized = false;
  } else if (!initialMatches.some(m => m.route.loader)) {
    // If we've got no loaders to run, then we're good to go
    initialized = true;
  } else if (future.v7_partialHydration) {
    // If partial hydration is enabled, we're initialized so long as we were
    // provided with hydrationData for every route with a loader, and no loaders
    // were marked for explicit hydration
    let loaderData = init.hydrationData ? init.hydrationData.loaderData : null;
    let errors = init.hydrationData ? init.hydrationData.errors : null;
    // If errors exist, don't consider routes below the boundary
    if (errors) {
      let idx = initialMatches.findIndex(m => errors[m.route.id] !== undefined);
      initialized = initialMatches.slice(0, idx + 1).every(m => !shouldLoadRouteOnHydration(m.route, loaderData, errors));
    } else {
      initialized = initialMatches.every(m => !shouldLoadRouteOnHydration(m.route, loaderData, errors));
    }
  } else {
    // Without partial hydration - we're initialized if we were provided any
    // hydrationData - which is expected to be complete
    initialized = init.hydrationData != null;
  }
  let router;
  let state = {
    historyAction: init.history.action,
    location: init.history.location,
    matches: initialMatches,
    initialized,
    navigation: IDLE_NAVIGATION,
    // Don't restore on initial updateState() if we were SSR'd
    restoreScrollPosition: init.hydrationData != null ? false : null,
    preventScrollReset: false,
    revalidation: "idle",
    loaderData: init.hydrationData && init.hydrationData.loaderData || {},
    actionData: init.hydrationData && init.hydrationData.actionData || null,
    errors: init.hydrationData && init.hydrationData.errors || initialErrors,
    fetchers: new Map(),
    blockers: new Map()
  };
  // -- Stateful internal variables to manage navigations --
  // Current navigation in progress (to be committed in completeNavigation)
  let pendingAction = Action.Pop;
  // Should the current navigation prevent the scroll reset if scroll cannot
  // be restored?
  let pendingPreventScrollReset = false;
  // AbortController for the active navigation
  let pendingNavigationController;
  // Should the current navigation enable document.startViewTransition?
  let pendingViewTransitionEnabled = false;
  // Store applied view transitions so we can apply them on POP
  let appliedViewTransitions = new Map();
  // Cleanup function for persisting applied transitions to sessionStorage
  let removePageHideEventListener = null;
  // We use this to avoid touching history in completeNavigation if a
  // revalidation is entirely uninterrupted
  let isUninterruptedRevalidation = false;
  // Use this internal flag to force revalidation of all loaders:
  //  - submissions (completed or interrupted)
  //  - useRevalidator()
  //  - X-Remix-Revalidate (from redirect)
  let isRevalidationRequired = false;
  // Use this internal array to capture routes that require revalidation due
  // to a cancelled deferred on action submission
  let cancelledDeferredRoutes = [];
  // Use this internal array to capture fetcher loads that were cancelled by an
  // action navigation and require revalidation
  let cancelledFetcherLoads = new Set();
  // AbortControllers for any in-flight fetchers
  let fetchControllers = new Map();
  // Track loads based on the order in which they started
  let incrementingLoadId = 0;
  // Track the outstanding pending navigation data load to be compared against
  // the globally incrementing load when a fetcher load lands after a completed
  // navigation
  let pendingNavigationLoadId = -1;
  // Fetchers that triggered data reloads as a result of their actions
  let fetchReloadIds = new Map();
  // Fetchers that triggered redirect navigations
  let fetchRedirectIds = new Set();
  // Most recent href/match for fetcher.load calls for fetchers
  let fetchLoadMatches = new Map();
  // Ref-count mounted fetchers so we know when it's ok to clean them up
  let activeFetchers = new Map();
  // Fetchers that have requested a delete when using v7_fetcherPersist,
  // they'll be officially removed after they return to idle
  let deletedFetchers = new Set();
  // Store DeferredData instances for active route matches.  When a
  // route loader returns defer() we stick one in here.  Then, when a nested
  // promise resolves we update loaderData.  If a new navigation starts we
  // cancel active deferreds for eliminated routes.
  let activeDeferreds = new Map();
  // Store blocker functions in a separate Map outside of router state since
  // we don't need to update UI state if they change
  let blockerFunctions = new Map();
  // Flag to ignore the next history update, so we can revert the URL change on
  // a POP navigation that was blocked by the user without touching router state
  let unblockBlockerHistoryUpdate = undefined;
  // Initialize the router, all side effects should be kicked off from here.
  // Implemented as a Fluent API for ease of:
  //   let router = createRouter(init).initialize();
  function initialize() {
    // If history informs us of a POP navigation, start the navigation but do not update
    // state.  We'll update our own state once the navigation completes
    unlistenHistory = init.history.listen(_ref => {
      let {
        action: historyAction,
        location,
        delta
      } = _ref;
      // Ignore this event if it was just us resetting the URL from a
      // blocked POP navigation
      if (unblockBlockerHistoryUpdate) {
        unblockBlockerHistoryUpdate();
        unblockBlockerHistoryUpdate = undefined;
        return;
      }
      warning(blockerFunctions.size === 0 || delta != null, "You are trying to use a blocker on a POP navigation to a location " + "that was not created by @remix-run/router. This will fail silently in " + "production. This can happen if you are navigating outside the router " + "via `window.history.pushState`/`window.location.hash` instead of using " + "router navigation APIs.  This can also happen if you are using " + "createHashRouter and the user manually changes the URL.");
      let blockerKey = shouldBlockNavigation({
        currentLocation: state.location,
        nextLocation: location,
        historyAction
      });
      if (blockerKey && delta != null) {
        // Restore the URL to match the current UI, but don't update router state
        let nextHistoryUpdatePromise = new Promise(resolve => {
          unblockBlockerHistoryUpdate = resolve;
        });
        init.history.go(delta * -1);
        // Put the blocker into a blocked state
        updateBlocker(blockerKey, {
          state: "blocked",
          location,
          proceed() {
            updateBlocker(blockerKey, {
              state: "proceeding",
              proceed: undefined,
              reset: undefined,
              location
            });
            // Re-do the same POP navigation we just blocked, after the url
            // restoration is also complete.  See:
            // https://github.com/remix-run/react-router/issues/11613
            nextHistoryUpdatePromise.then(() => init.history.go(delta));
          },
          reset() {
            let blockers = new Map(state.blockers);
            blockers.set(blockerKey, IDLE_BLOCKER);
            updateState({
              blockers
            });
          }
        });
        return;
      }
      return startNavigation(historyAction, location);
    });
    if (isBrowser) {
      // FIXME: This feels gross.  How can we cleanup the lines between
      // scrollRestoration/appliedTransitions persistance?
      restoreAppliedTransitions(routerWindow, appliedViewTransitions);
      let _saveAppliedTransitions = () => persistAppliedTransitions(routerWindow, appliedViewTransitions);
      routerWindow.addEventListener("pagehide", _saveAppliedTransitions);
      removePageHideEventListener = () => routerWindow.removeEventListener("pagehide", _saveAppliedTransitions);
    }
    // Kick off initial data load if needed.  Use Pop to avoid modifying history
    // Note we don't do any handling of lazy here.  For SPA's it'll get handled
    // in the normal navigation flow.  For SSR it's expected that lazy modules are
    // resolved prior to router creation since we can't go into a fallbackElement
    // UI for SSR'd apps
    if (!state.initialized) {
      startNavigation(Action.Pop, state.location, {
        initialHydration: true
      });
    }
    return router;
  }
  // Clean up a router and it's side effects
  function dispose() {
    if (unlistenHistory) {
      unlistenHistory();
    }
    if (removePageHideEventListener) {
      removePageHideEventListener();
    }
    subscribers.clear();
    pendingNavigationController && pendingNavigationController.abort();
    state.fetchers.forEach((_, key) => deleteFetcher(key));
    state.blockers.forEach((_, key) => deleteBlocker(key));
  }
  // Subscribe to state updates for the router
  function subscribe(fn) {
    subscribers.add(fn);
    return () => subscribers.delete(fn);
  }
  // Update our state and notify the calling context of the change
  function updateState(newState, opts) {
    if (opts === void 0) {
      opts = {};
    }
    state = _extends({}, state, newState);
    // Prep fetcher cleanup so we can tell the UI which fetcher data entries
    // can be removed
    let completedFetchers = [];
    let deletedFetchersKeys = [];
    if (future.v7_fetcherPersist) {
      state.fetchers.forEach((fetcher, key) => {
        if (fetcher.state === "idle") {
          if (deletedFetchers.has(key)) {
            // Unmounted from the UI and can be totally removed
            deletedFetchersKeys.push(key);
          } else {
            // Returned to idle but still mounted in the UI, so semi-remains for
            // revalidations and such
            completedFetchers.push(key);
          }
        }
      });
    }
    // Remove any lingering deleted fetchers that have already been removed
    // from state.fetchers
    deletedFetchers.forEach(key => {
      if (!state.fetchers.has(key) && !fetchControllers.has(key)) {
        deletedFetchersKeys.push(key);
      }
    });
    // Iterate over a local copy so that if flushSync is used and we end up
    // removing and adding a new subscriber due to the useCallback dependencies,
    // we don't get ourselves into a loop calling the new subscriber immediately
    [...subscribers].forEach(subscriber => subscriber(state, {
      deletedFetchers: deletedFetchersKeys,
      viewTransitionOpts: opts.viewTransitionOpts,
      flushSync: opts.flushSync === true
    }));
    // Remove idle fetchers from state since we only care about in-flight fetchers.
    if (future.v7_fetcherPersist) {
      completedFetchers.forEach(key => state.fetchers.delete(key));
      deletedFetchersKeys.forEach(key => deleteFetcher(key));
    } else {
      // We already called deleteFetcher() on these, can remove them from this
      // Set now that we've handed the keys off to the data layer
      deletedFetchersKeys.forEach(key => deletedFetchers.delete(key));
    }
  }
  // Complete a navigation returning the state.navigation back to the IDLE_NAVIGATION
  // and setting state.[historyAction/location/matches] to the new route.
  // - Location is a required param
  // - Navigation will always be set to IDLE_NAVIGATION
  // - Can pass any other state in newState
  function completeNavigation(location, newState, _temp) {
    var _location$state, _location$state2;
    let {
      flushSync
    } = _temp === void 0 ? {} : _temp;
    // Deduce if we're in a loading/actionReload state:
    // - We have committed actionData in the store
    // - The current navigation was a mutation submission
    // - We're past the submitting state and into the loading state
    // - The location being loaded is not the result of a redirect
    let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === "loading" && ((_location$state = location.state) == null ? void 0 : _location$state._isRedirect) !== true;
    let actionData;
    if (newState.actionData) {
      if (Object.keys(newState.actionData).length > 0) {
        actionData = newState.actionData;
      } else {
        // Empty actionData -> clear prior actionData due to an action error
        actionData = null;
      }
    } else if (isActionReload) {
      // Keep the current data if we're wrapping up the action reload
      actionData = state.actionData;
    } else {
      // Clear actionData on any other completed navigations
      actionData = null;
    }
    // Always preserve any existing loaderData from re-used routes
    let loaderData = newState.loaderData ? mergeLoaderData(state.loaderData, newState.loaderData, newState.matches || [], newState.errors) : state.loaderData;
    // On a successful navigation we can assume we got through all blockers
    // so we can start fresh
    let blockers = state.blockers;
    if (blockers.size > 0) {
      blockers = new Map(blockers);
      blockers.forEach((_, k) => blockers.set(k, IDLE_BLOCKER));
    }
    // Always respect the user flag.  Otherwise don't reset on mutation
    // submission navigations unless they redirect
    let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && ((_location$state2 = location.state) == null ? void 0 : _location$state2._isRedirect) !== true;
    // Commit any in-flight routes at the end of the HMR revalidation "navigation"
    if (inFlightDataRoutes) {
      dataRoutes = inFlightDataRoutes;
      inFlightDataRoutes = undefined;
    }
    if (isUninterruptedRevalidation) ; else if (pendingAction === Action.Pop) ; else if (pendingAction === Action.Push) {
      init.history.push(location, location.state);
    } else if (pendingAction === Action.Replace) {
      init.history.replace(location, location.state);
    }
    let viewTransitionOpts;
    // On POP, enable transitions if they were enabled on the original navigation
    if (pendingAction === Action.Pop) {
      // Forward takes precedence so they behave like the original navigation
      let priorPaths = appliedViewTransitions.get(state.location.pathname);
      if (priorPaths && priorPaths.has(location.pathname)) {
        viewTransitionOpts = {
          currentLocation: state.location,
          nextLocation: location
        };
      } else if (appliedViewTransitions.has(location.pathname)) {
        // If we don't have a previous forward nav, assume we're popping back to
        // the new location and enable if that location previously enabled
        viewTransitionOpts = {
          currentLocation: location,
          nextLocation: state.location
        };
      }
    } else if (pendingViewTransitionEnabled) {
      // Store the applied transition on PUSH/REPLACE
      let toPaths = appliedViewTransitions.get(state.location.pathname);
      if (toPaths) {
        toPaths.add(location.pathname);
      } else {
        toPaths = new Set([location.pathname]);
        appliedViewTransitions.set(state.location.pathname, toPaths);
      }
      viewTransitionOpts = {
        currentLocation: state.location,
        nextLocation: location
      };
    }
    updateState(_extends({}, newState, {
      actionData,
      loaderData,
      historyAction: pendingAction,
      location,
      initialized: true,
      navigation: IDLE_NAVIGATION,
      revalidation: "idle",
      restoreScrollPosition: getSavedScrollPosition(location, newState.matches || state.matches),
      preventScrollReset,
      blockers
    }), {
      viewTransitionOpts,
      flushSync: flushSync === true
    });
    // Reset stateful navigation vars
    pendingAction = Action.Pop;
    pendingPreventScrollReset = false;
    pendingViewTransitionEnabled = false;
    isUninterruptedRevalidation = false;
    isRevalidationRequired = false;
    cancelledDeferredRoutes = [];
  }
  // Trigger a navigation event, which can either be a numerical POP or a PUSH
  // replace with an optional submission
  async function navigate(to, opts) {
    if (typeof to === "number") {
      init.history.go(to);
      return;
    }
    let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, to, future.v7_relativeSplatPath, opts == null ? void 0 : opts.fromRouteId, opts == null ? void 0 : opts.relative);
    let {
      path,
      submission,
      error
    } = normalizeNavigateOptions(future.v7_normalizeFormMethod, false, normalizedPath, opts);
    let currentLocation = state.location;
    let nextLocation = createLocation(state.location, path, opts && opts.state);
    // When using navigate as a PUSH/REPLACE we aren't reading an already-encoded
    // URL from window.location, so we need to encode it here so the behavior
    // remains the same as POP and non-data-router usages.  new URL() does all
    // the same encoding we'd get from a history.pushState/window.location read
    // without having to touch history
    nextLocation = _extends({}, nextLocation, init.history.encodeLocation(nextLocation));
    let userReplace = opts && opts.replace != null ? opts.replace : undefined;
    let historyAction = Action.Push;
    if (userReplace === true) {
      historyAction = Action.Replace;
    } else if (userReplace === false) ; else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) {
      // By default on submissions to the current location we REPLACE so that
      // users don't have to double-click the back button to get to the prior
      // location.  If the user redirects to a different location from the
      // action/loader this will be ignored and the redirect will be a PUSH
      historyAction = Action.Replace;
    }
    let preventScrollReset = opts && "preventScrollReset" in opts ? opts.preventScrollReset === true : undefined;
    let flushSync = (opts && opts.flushSync) === true;
    let blockerKey = shouldBlockNavigation({
      currentLocation,
      nextLocation,
      historyAction
    });
    if (blockerKey) {
      // Put the blocker into a blocked state
      updateBlocker(blockerKey, {
        state: "blocked",
        location: nextLocation,
        proceed() {
          updateBlocker(blockerKey, {
            state: "proceeding",
            proceed: undefined,
            reset: undefined,
            location: nextLocation
          });
          // Send the same navigation through
          navigate(to, opts);
        },
        reset() {
          let blockers = new Map(state.blockers);
          blockers.set(blockerKey, IDLE_BLOCKER);
          updateState({
            blockers
          });
        }
      });
      return;
    }
    return await startNavigation(historyAction, nextLocation, {
      submission,
      // Send through the formData serialization error if we have one so we can
      // render at the right error boundary after we match routes
      pendingError: error,
      preventScrollReset,
      replace: opts && opts.replace,
      enableViewTransition: opts && opts.viewTransition,
      flushSync
    });
  }
  // Revalidate all current loaders.  If a navigation is in progress or if this
  // is interrupted by a navigation, allow this to "succeed" by calling all
  // loaders during the next loader round
  function revalidate() {
    interruptActiveLoads();
    updateState({
      revalidation: "loading"
    });
    // If we're currently submitting an action, we don't need to start a new
    // navigation, we'll just let the follow up loader execution call all loaders
    if (state.navigation.state === "submitting") {
      return;
    }
    // If we're currently in an idle state, start a new navigation for the current
    // action/location and mark it as uninterrupted, which will skip the history
    // update in completeNavigation
    if (state.navigation.state === "idle") {
      startNavigation(state.historyAction, state.location, {
        startUninterruptedRevalidation: true
      });
      return;
    }
    // Otherwise, if we're currently in a loading state, just start a new
    // navigation to the navigation.location but do not trigger an uninterrupted
    // revalidation so that history correctly updates once the navigation completes
    startNavigation(pendingAction || state.historyAction, state.navigation.location, {
      overrideNavigation: state.navigation,
      // Proxy through any rending view transition
      enableViewTransition: pendingViewTransitionEnabled === true
    });
  }
  // Start a navigation to the given action/location.  Can optionally provide a
  // overrideNavigation which will override the normalLoad in the case of a redirect
  // navigation
  async function startNavigation(historyAction, location, opts) {
    // Abort any in-progress navigations and start a new one. Unset any ongoing
    // uninterrupted revalidations unless told otherwise, since we want this
    // new navigation to update history normally
    pendingNavigationController && pendingNavigationController.abort();
    pendingNavigationController = null;
    pendingAction = historyAction;
    isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true;
    // Save the current scroll position every time we start a new navigation,
    // and track whether we should reset scroll on completion
    saveScrollPosition(state.location, state.matches);
    pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;
    pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true;
    let routesToUse = inFlightDataRoutes || dataRoutes;
    let loadingNavigation = opts && opts.overrideNavigation;
    let matches = opts != null && opts.initialHydration && state.matches && state.matches.length > 0 && !initialMatchesIsFOW ?
    // `matchRoutes()` has already been called if we're in here via `router.initialize()`
    state.matches : matchRoutes(routesToUse, location, basename);
    let flushSync = (opts && opts.flushSync) === true;
    // Short circuit if it's only a hash change and not a revalidation or
    // mutation submission.
    //
    // Ignore on initial page loads because since the initial hydration will always
    // be "same hash".  For example, on /page#hash and submit a <Form method="post">
    // which will default to a navigation to /page
    if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) {
      completeNavigation(location, {
        matches
      }, {
        flushSync
      });
      return;
    }
    let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname);
    if (fogOfWar.active && fogOfWar.matches) {
      matches = fogOfWar.matches;
    }
    // Short circuit with a 404 on the root error boundary if we match nothing
    if (!matches) {
      let {
        error,
        notFoundMatches,
        route
      } = handleNavigational404(location.pathname);
      completeNavigation(location, {
        matches: notFoundMatches,
        loaderData: {},
        errors: {
          [route.id]: error
        }
      }, {
        flushSync
      });
      return;
    }
    // Create a controller/Request for this navigation
    pendingNavigationController = new AbortController();
    let request = createClientSideRequest(init.history, location, pendingNavigationController.signal, opts && opts.submission);
    let pendingActionResult;
    if (opts && opts.pendingError) {
      // If we have a pendingError, it means the user attempted a GET submission
      // with binary FormData so assign here and skip to handleLoaders.  That
      // way we handle calling loaders above the boundary etc.  It's not really
      // different from an actionError in that sense.
      pendingActionResult = [findNearestBoundary(matches).route.id, {
        type: ResultType.error,
        error: opts.pendingError
      }];
    } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) {
      // Call action if we received an action submission
      let actionResult = await handleAction(request, location, opts.submission, matches, fogOfWar.active, {
        replace: opts.replace,
        flushSync
      });
      if (actionResult.shortCircuited) {
        return;
      }
      // If we received a 404 from handleAction, it's because we couldn't lazily
      // discover the destination route so we don't want to call loaders
      if (actionResult.pendingActionResult) {
        let [routeId, result] = actionResult.pendingActionResult;
        if (isErrorResult(result) && isRouteErrorResponse(result.error) && result.error.status === 404) {
          pendingNavigationController = null;
          completeNavigation(location, {
            matches: actionResult.matches,
            loaderData: {},
            errors: {
              [routeId]: result.error
            }
          });
          return;
        }
      }
      matches = actionResult.matches || matches;
      pendingActionResult = actionResult.pendingActionResult;
      loadingNavigation = getLoadingNavigation(location, opts.submission);
      flushSync = false;
      // No need to do fog of war matching again on loader execution
      fogOfWar.active = false;
      // Create a GET request for the loaders
      request = createClientSideRequest(init.history, request.url, request.signal);
    }
    // Call loaders
    let {
      shortCircuited,
      matches: updatedMatches,
      loaderData,
      errors
    } = await handleLoaders(request, location, matches, fogOfWar.active, loadingNavigation, opts && opts.submission, opts && opts.fetcherSubmission, opts && opts.replace, opts && opts.initialHydration === true, flushSync, pendingActionResult);
    if (shortCircuited) {
      return;
    }
    // Clean up now that the action/loaders have completed.  Don't clean up if
    // we short circuited because pendingNavigationController will have already
    // been assigned to a new controller for the next navigation
    pendingNavigationController = null;
    completeNavigation(location, _extends({
      matches: updatedMatches || matches
    }, getActionDataForCommit(pendingActionResult), {
      loaderData,
      errors
    }));
  }
  // Call the action matched by the leaf route for this navigation and handle
  // redirects/errors
  async function handleAction(request, location, submission, matches, isFogOfWar, opts) {
    if (opts === void 0) {
      opts = {};
    }
    interruptActiveLoads();
    // Put us in a submitting state
    let navigation = getSubmittingNavigation(location, submission);
    updateState({
      navigation
    }, {
      flushSync: opts.flushSync === true
    });
    if (isFogOfWar) {
      let discoverResult = await discoverRoutes(matches, location.pathname, request.signal);
      if (discoverResult.type === "aborted") {
        return {
          shortCircuited: true
        };
      } else if (discoverResult.type === "error") {
        let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id;
        return {
          matches: discoverResult.partialMatches,
          pendingActionResult: [boundaryId, {
            type: ResultType.error,
            error: discoverResult.error
          }]
        };
      } else if (!discoverResult.matches) {
        let {
          notFoundMatches,
          error,
          route
        } = handleNavigational404(location.pathname);
        return {
          matches: notFoundMatches,
          pendingActionResult: [route.id, {
            type: ResultType.error,
            error
          }]
        };
      } else {
        matches = discoverResult.matches;
      }
    }
    // Call our action and get the result
    let result;
    let actionMatch = getTargetMatch(matches, location);
    if (!actionMatch.route.action && !actionMatch.route.lazy) {
      result = {
        type: ResultType.error,
        error: getInternalRouterError(405, {
          method: request.method,
          pathname: location.pathname,
          routeId: actionMatch.route.id
        })
      };
    } else {
      let results = await callDataStrategy("action", state, request, [actionMatch], matches, null);
      result = results[actionMatch.route.id];
      if (request.signal.aborted) {
        return {
          shortCircuited: true
        };
      }
    }
    if (isRedirectResult(result)) {
      let replace;
      if (opts && opts.replace != null) {
        replace = opts.replace;
      } else {
        // If the user didn't explicity indicate replace behavior, replace if
        // we redirected to the exact same location we're currently at to avoid
        // double back-buttons
        let location = normalizeRedirectLocation(result.response.headers.get("Location"), new URL(request.url), basename);
        replace = location === state.location.pathname + state.location.search;
      }
      await startRedirectNavigation(request, result, true, {
        submission,
        replace
      });
      return {
        shortCircuited: true
      };
    }
    if (isDeferredResult(result)) {
      throw getInternalRouterError(400, {
        type: "defer-action"
      });
    }
    if (isErrorResult(result)) {
      // Store off the pending error - we use it to determine which loaders
      // to call and will commit it when we complete the navigation
      let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id);
      // By default, all submissions to the current location are REPLACE
      // navigations, but if the action threw an error that'll be rendered in
      // an errorElement, we fall back to PUSH so that the user can use the
      // back button to get back to the pre-submission form location to try
      // again
      if ((opts && opts.replace) !== true) {
        pendingAction = Action.Push;
      }
      return {
        matches,
        pendingActionResult: [boundaryMatch.route.id, result]
      };
    }
    return {
      matches,
      pendingActionResult: [actionMatch.route.id, result]
    };
  }
  // Call all applicable loaders for the given matches, handling redirects,
  // errors, etc.
  async function handleLoaders(request, location, matches, isFogOfWar, overrideNavigation, submission, fetcherSubmission, replace, initialHydration, flushSync, pendingActionResult) {
    // Figure out the right navigation we want to use for data loading
    let loadingNavigation = overrideNavigation || getLoadingNavigation(location, submission);
    // If this was a redirect from an action we don't have a "submission" but
    // we have it on the loading navigation so use that if available
    let activeSubmission = submission || fetcherSubmission || getSubmissionFromNavigation(loadingNavigation);
    // If this is an uninterrupted revalidation, we remain in our current idle
    // state.  If not, we need to switch to our loading state and load data,
    // preserving any new action data or existing action data (in the case of
    // a revalidation interrupting an actionReload)
    // If we have partialHydration enabled, then don't update the state for the
    // initial data load since it's not a "navigation"
    let shouldUpdateNavigationState = !isUninterruptedRevalidation && (!future.v7_partialHydration || !initialHydration);
    // When fog of war is enabled, we enter our `loading` state earlier so we
    // can discover new routes during the `loading` state.  We skip this if
    // we've already run actions since we would have done our matching already.
    // If the children() function threw then, we want to proceed with the
    // partial matches it discovered.
    if (isFogOfWar) {
      if (shouldUpdateNavigationState) {
        let actionData = getUpdatedActionData(pendingActionResult);
        updateState(_extends({
          navigation: loadingNavigation
        }, actionData !== undefined ? {
          actionData
        } : {}), {
          flushSync
        });
      }
      let discoverResult = await discoverRoutes(matches, location.pathname, request.signal);
      if (discoverResult.type === "aborted") {
        return {
          shortCircuited: true
        };
      } else if (discoverResult.type === "error") {
        let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id;
        return {
          matches: discoverResult.partialMatches,
          loaderData: {},
          errors: {
            [boundaryId]: discoverResult.error
          }
        };
      } else if (!discoverResult.matches) {
        let {
          error,
          notFoundMatches,
          route
        } = handleNavigational404(location.pathname);
        return {
          matches: notFoundMatches,
          loaderData: {},
          errors: {
            [route.id]: error
          }
        };
      } else {
        matches = discoverResult.matches;
      }
    }
    let routesToUse = inFlightDataRoutes || dataRoutes;
    let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, activeSubmission, location, future.v7_partialHydration && initialHydration === true, future.v7_skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionResult);
    // Cancel pending deferreds for no-longer-matched routes or routes we're
    // about to reload.  Note that if this is an action reload we would have
    // already cancelled all pending deferreds so this would be a no-op
    cancelActiveDeferreds(routeId => !(matches && matches.some(m => m.route.id === routeId)) || matchesToLoad && matchesToLoad.some(m => m.route.id === routeId));
    pendingNavigationLoadId = ++incrementingLoadId;
    // Short circuit if we have no loaders to run
    if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {
      let updatedFetchers = markFetchRedirectsDone();
      completeNavigation(location, _extends({
        matches,
        loaderData: {},
        // Commit pending error if we're short circuiting
        errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? {
          [pendingActionResult[0]]: pendingActionResult[1].error
        } : null
      }, getActionDataForCommit(pendingActionResult), updatedFetchers ? {
        fetchers: new Map(state.fetchers)
      } : {}), {
        flushSync
      });
      return {
        shortCircuited: true
      };
    }
    if (shouldUpdateNavigationState) {
      let updates = {};
      if (!isFogOfWar) {
        // Only update navigation/actionNData if we didn't already do it above
        updates.navigation = loadingNavigation;
        let actionData = getUpdatedActionData(pendingActionResult);
        if (actionData !== undefined) {
          updates.actionData = actionData;
        }
      }
      if (revalidatingFetchers.length > 0) {
        updates.fetchers = getUpdatedRevalidatingFetchers(revalidatingFetchers);
      }
      updateState(updates, {
        flushSync
      });
    }
    revalidatingFetchers.forEach(rf => {
      abortFetcher(rf.key);
      if (rf.controller) {
        // Fetchers use an independent AbortController so that aborting a fetcher
        // (via deleteFetcher) does not abort the triggering navigation that
        // triggered the revalidation
        fetchControllers.set(rf.key, rf.controller);
      }
    });
    // Proxy navigation abort through to revalidation fetchers
    let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach(f => abortFetcher(f.key));
    if (pendingNavigationController) {
      pendingNavigationController.signal.addEventListener("abort", abortPendingFetchRevalidations);
    }
    let {
      loaderResults,
      fetcherResults
    } = await callLoadersAndMaybeResolveData(state, matches, matchesToLoad, revalidatingFetchers, request);
    if (request.signal.aborted) {
      return {
        shortCircuited: true
      };
    }
    // Clean up _after_ loaders have completed.  Don't clean up if we short
    // circuited because fetchControllers would have been aborted and
    // reassigned to new controllers for the next navigation
    if (pendingNavigationController) {
      pendingNavigationController.signal.removeEventListener("abort", abortPendingFetchRevalidations);
    }
    revalidatingFetchers.forEach(rf => fetchControllers.delete(rf.key));
    // If any loaders returned a redirect Response, start a new REPLACE navigation
    let redirect = findRedirect(loaderResults);
    if (redirect) {
      await startRedirectNavigation(request, redirect.result, true, {
        replace
      });
      return {
        shortCircuited: true
      };
    }
    redirect = findRedirect(fetcherResults);
    if (redirect) {
      // If this redirect came from a fetcher make sure we mark it in
      // fetchRedirectIds so it doesn't get revalidated on the next set of
      // loader executions
      fetchRedirectIds.add(redirect.key);
      await startRedirectNavigation(request, redirect.result, true, {
        replace
      });
      return {
        shortCircuited: true
      };
    }
    // Process and commit output from loaders
    let {
      loaderData,
      errors
    } = processLoaderData(state, matches, loaderResults, pendingActionResult, revalidatingFetchers, fetcherResults, activeDeferreds);
    // Wire up subscribers to update loaderData as promises settle
    activeDeferreds.forEach((deferredData, routeId) => {
      deferredData.subscribe(aborted => {
        // Note: No need to updateState here since the TrackedPromise on
        // loaderData is stable across resolve/reject
        // Remove this instance if we were aborted or if promises have settled
        if (aborted || deferredData.done) {
          activeDeferreds.delete(routeId);
        }
      });
    });
    // Preserve SSR errors during partial hydration
    if (future.v7_partialHydration && initialHydration && state.errors) {
      errors = _extends({}, state.errors, errors);
    }
    let updatedFetchers = markFetchRedirectsDone();
    let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);
    let shouldUpdateFetchers = updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0;
    return _extends({
      matches,
      loaderData,
      errors
    }, shouldUpdateFetchers ? {
      fetchers: new Map(state.fetchers)
    } : {});
  }
  function getUpdatedActionData(pendingActionResult) {
    if (pendingActionResult && !isErrorResult(pendingActionResult[1])) {
      // This is cast to `any` currently because `RouteData`uses any and it
      // would be a breaking change to use any.
      // TODO: v7 - change `RouteData` to use `unknown` instead of `any`
      return {
        [pendingActionResult[0]]: pendingActionResult[1].data
      };
    } else if (state.actionData) {
      if (Object.keys(state.actionData).length === 0) {
        return null;
      } else {
        return state.actionData;
      }
    }
  }
  function getUpdatedRevalidatingFetchers(revalidatingFetchers) {
    revalidatingFetchers.forEach(rf => {
      let fetcher = state.fetchers.get(rf.key);
      let revalidatingFetcher = getLoadingFetcher(undefined, fetcher ? fetcher.data : undefined);
      state.fetchers.set(rf.key, revalidatingFetcher);
    });
    return new Map(state.fetchers);
  }
  // Trigger a fetcher load/submit for the given fetcher key
  function fetch(key, routeId, href, opts) {
    if (isServer) {
      throw new Error("router.fetch() was called during the server render, but it shouldn't be. " + "You are likely calling a useFetcher() method in the body of your component. " + "Try moving it to a useEffect or a callback.");
    }
    abortFetcher(key);
    let flushSync = (opts && opts.flushSync) === true;
    let routesToUse = inFlightDataRoutes || dataRoutes;
    let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, href, future.v7_relativeSplatPath, routeId, opts == null ? void 0 : opts.relative);
    let matches = matchRoutes(routesToUse, normalizedPath, basename);
    let fogOfWar = checkFogOfWar(matches, routesToUse, normalizedPath);
    if (fogOfWar.active && fogOfWar.matches) {
      matches = fogOfWar.matches;
    }
    if (!matches) {
      setFetcherError(key, routeId, getInternalRouterError(404, {
        pathname: normalizedPath
      }), {
        flushSync
      });
      return;
    }
    let {
      path,
      submission,
      error
    } = normalizeNavigateOptions(future.v7_normalizeFormMethod, true, normalizedPath, opts);
    if (error) {
      setFetcherError(key, routeId, error, {
        flushSync
      });
      return;
    }
    let match = getTargetMatch(matches, path);
    let preventScrollReset = (opts && opts.preventScrollReset) === true;
    if (submission && isMutationMethod(submission.formMethod)) {
      handleFetcherAction(key, routeId, path, match, matches, fogOfWar.active, flushSync, preventScrollReset, submission);
      return;
    }
    // Store off the match so we can call it's shouldRevalidate on subsequent
    // revalidations
    fetchLoadMatches.set(key, {
      routeId,
      path
    });
    handleFetcherLoader(key, routeId, path, match, matches, fogOfWar.active, flushSync, preventScrollReset, submission);
  }
  // Call the action for the matched fetcher.submit(), and then handle redirects,
  // errors, and revalidation
  async function handleFetcherAction(key, routeId, path, match, requestMatches, isFogOfWar, flushSync, preventScrollReset, submission) {
    interruptActiveLoads();
    fetchLoadMatches.delete(key);
    function detectAndHandle405Error(m) {
      if (!m.route.action && !m.route.lazy) {
        let error = getInternalRouterError(405, {
          method: submission.formMethod,
          pathname: path,
          routeId: routeId
        });
        setFetcherError(key, routeId, error, {
          flushSync
        });
        return true;
      }
      return false;
    }
    if (!isFogOfWar && detectAndHandle405Error(match)) {
      return;
    }
    // Put this fetcher into it's submitting state
    let existingFetcher = state.fetchers.get(key);
    updateFetcherState(key, getSubmittingFetcher(submission, existingFetcher), {
      flushSync
    });
    let abortController = new AbortController();
    let fetchRequest = createClientSideRequest(init.history, path, abortController.signal, submission);
    if (isFogOfWar) {
      let discoverResult = await discoverRoutes(requestMatches, new URL(fetchRequest.url).pathname, fetchRequest.signal, key);
      if (discoverResult.type === "aborted") {
        return;
      } else if (discoverResult.type === "error") {
        setFetcherError(key, routeId, discoverResult.error, {
          flushSync
        });
        return;
      } else if (!discoverResult.matches) {
        setFetcherError(key, routeId, getInternalRouterError(404, {
          pathname: path
        }), {
          flushSync
        });
        return;
      } else {
        requestMatches = discoverResult.matches;
        match = getTargetMatch(requestMatches, path);
        if (detectAndHandle405Error(match)) {
          return;
        }
      }
    }
    // Call the action for the fetcher
    fetchControllers.set(key, abortController);
    let originatingLoadId = incrementingLoadId;
    let actionResults = await callDataStrategy("action", state, fetchRequest, [match], requestMatches, key);
    let actionResult = actionResults[match.route.id];
    if (fetchRequest.signal.aborted) {
      // We can delete this so long as we weren't aborted by our own fetcher
      // re-submit which would have put _new_ controller is in fetchControllers
      if (fetchControllers.get(key) === abortController) {
        fetchControllers.delete(key);
      }
      return;
    }
    // When using v7_fetcherPersist, we don't want errors bubbling up to the UI
    // or redirects processed for unmounted fetchers so we just revert them to
    // idle
    if (future.v7_fetcherPersist && deletedFetchers.has(key)) {
      if (isRedirectResult(actionResult) || isErrorResult(actionResult)) {
        updateFetcherState(key, getDoneFetcher(undefined));
        return;
      }
      // Let SuccessResult's fall through for revalidation
    } else {
      if (isRedirectResult(actionResult)) {
        fetchControllers.delete(key);
        if (pendingNavigationLoadId > originatingLoadId) {
          // A new navigation was kicked off after our action started, so that
          // should take precedence over this redirect navigation.  We already
          // set isRevalidationRequired so all loaders for the new route should
          // fire unless opted out via shouldRevalidate
          updateFetcherState(key, getDoneFetcher(undefined));
          return;
        } else {
          fetchRedirectIds.add(key);
          updateFetcherState(key, getLoadingFetcher(submission));
          return startRedirectNavigation(fetchRequest, actionResult, false, {
            fetcherSubmission: submission,
            preventScrollReset
          });
        }
      }
      // Process any non-redirect errors thrown
      if (isErrorResult(actionResult)) {
        setFetcherError(key, routeId, actionResult.error);
        return;
      }
    }
    if (isDeferredResult(actionResult)) {
      throw getInternalRouterError(400, {
        type: "defer-action"
      });
    }
    // Start the data load for current matches, or the next location if we're
    // in the middle of a navigation
    let nextLocation = state.navigation.location || state.location;
    let revalidationRequest = createClientSideRequest(init.history, nextLocation, abortController.signal);
    let routesToUse = inFlightDataRoutes || dataRoutes;
    let matches = state.navigation.state !== "idle" ? matchRoutes(routesToUse, state.navigation.location, basename) : state.matches;
    invariant(matches, "Didn't find any matches after fetcher action");
    let loadId = ++incrementingLoadId;
    fetchReloadIds.set(key, loadId);
    let loadFetcher = getLoadingFetcher(submission, actionResult.data);
    state.fetchers.set(key, loadFetcher);
    let [matchesToLoad, revalidatingFetchers] = getMatchesToLoad(init.history, state, matches, submission, nextLocation, false, future.v7_skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, [match.route.id, actionResult]);
    // Put all revalidating fetchers into the loading state, except for the
    // current fetcher which we want to keep in it's current loading state which
    // contains it's action submission info + action data
    revalidatingFetchers.filter(rf => rf.key !== key).forEach(rf => {
      let staleKey = rf.key;
      let existingFetcher = state.fetchers.get(staleKey);
      let revalidatingFetcher = getLoadingFetcher(undefined, existingFetcher ? existingFetcher.data : undefined);
      state.fetchers.set(staleKey, revalidatingFetcher);
      abortFetcher(staleKey);
      if (rf.controller) {
        fetchControllers.set(staleKey, rf.controller);
      }
    });
    updateState({
      fetchers: new Map(state.fetchers)
    });
    let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach(rf => abortFetcher(rf.key));
    abortController.signal.addEventListener("abort", abortPendingFetchRevalidations);
    let {
      loaderResults,
      fetcherResults
    } = await callLoadersAndMaybeResolveData(state, matches, matchesToLoad, revalidatingFetchers, revalidationRequest);
    if (abortController.signal.aborted) {
      return;
    }
    abortController.signal.removeEventListener("abort", abortPendingFetchRevalidations);
    fetchReloadIds.delete(key);
    fetchControllers.delete(key);
    revalidatingFetchers.forEach(r => fetchControllers.delete(r.key));
    let redirect = findRedirect(loaderResults);
    if (redirect) {
      return startRedirectNavigation(revalidationRequest, redirect.result, false, {
        preventScrollReset
      });
    }
    redirect = findRedirect(fetcherResults);
    if (redirect) {
      // If this redirect came from a fetcher make sure we mark it in
      // fetchRedirectIds so it doesn't get revalidated on the next set of
      // loader executions
      fetchRedirectIds.add(redirect.key);
      return startRedirectNavigation(revalidationRequest, redirect.result, false, {
        preventScrollReset
      });
    }
    // Process and commit output from loaders
    let {
      loaderData,
      errors
    } = processLoaderData(state, matches, loaderResults, undefined, revalidatingFetchers, fetcherResults, activeDeferreds);
    // Since we let revalidations complete even if the submitting fetcher was
    // deleted, only put it back to idle if it hasn't been deleted
    if (state.fetchers.has(key)) {
      let doneFetcher = getDoneFetcher(actionResult.data);
      state.fetchers.set(key, doneFetcher);
    }
    abortStaleFetchLoads(loadId);
    // If we are currently in a navigation loading state and this fetcher is
    // more recent than the navigation, we want the newer data so abort the
    // navigation and complete it with the fetcher data
    if (state.navigation.state === "loading" && loadId > pendingNavigationLoadId) {
      invariant(pendingAction, "Expected pending action");
      pendingNavigationController && pendingNavigationController.abort();
      completeNavigation(state.navigation.location, {
        matches,
        loaderData,
        errors,
        fetchers: new Map(state.fetchers)
      });
    } else {
      // otherwise just update with the fetcher data, preserving any existing
      // loaderData for loaders that did not need to reload.  We have to
      // manually merge here since we aren't going through completeNavigation
      updateState({
        errors,
        loaderData: mergeLoaderData(state.loaderData, loaderData, matches, errors),
        fetchers: new Map(state.fetchers)
      });
      isRevalidationRequired = false;
    }
  }
  // Call the matched loader for fetcher.load(), handling redirects, errors, etc.
  async function handleFetcherLoader(key, routeId, path, match, matches, isFogOfWar, flushSync, preventScrollReset, submission) {
    let existingFetcher = state.fetchers.get(key);
    updateFetcherState(key, getLoadingFetcher(submission, existingFetcher ? existingFetcher.data : undefined), {
      flushSync
    });
    let abortController = new AbortController();
    let fetchRequest = createClientSideRequest(init.history, path, abortController.signal);
    if (isFogOfWar) {
      let discoverResult = await discoverRoutes(matches, new URL(fetchRequest.url).pathname, fetchRequest.signal, key);
      if (discoverResult.type === "aborted") {
        return;
      } else if (discoverResult.type === "error") {
        setFetcherError(key, routeId, discoverResult.error, {
          flushSync
        });
        return;
      } else if (!discoverResult.matches) {
        setFetcherError(key, routeId, getInternalRouterError(404, {
          pathname: path
        }), {
          flushSync
        });
        return;
      } else {
        matches = discoverResult.matches;
        match = getTargetMatch(matches, path);
      }
    }
    // Call the loader for this fetcher route match
    fetchControllers.set(key, abortController);
    let originatingLoadId = incrementingLoadId;
    let results = await callDataStrategy("loader", state, fetchRequest, [match], matches, key);
    let result = results[match.route.id];
    // Deferred isn't supported for fetcher loads, await everything and treat it
    // as a normal load.  resolveDeferredData will return undefined if this
    // fetcher gets aborted, so we just leave result untouched and short circuit
    // below if that happens
    if (isDeferredResult(result)) {
      result = (await resolveDeferredData(result, fetchRequest.signal, true)) || result;
    }
    // We can delete this so long as we weren't aborted by our our own fetcher
    // re-load which would have put _new_ controller is in fetchControllers
    if (fetchControllers.get(key) === abortController) {
      fetchControllers.delete(key);
    }
    if (fetchRequest.signal.aborted) {
      return;
    }
    // We don't want errors bubbling up or redirects followed for unmounted
    // fetchers, so short circuit here if it was removed from the UI
    if (deletedFetchers.has(key)) {
      updateFetcherState(key, getDoneFetcher(undefined));
      return;
    }
    // If the loader threw a redirect Response, start a new REPLACE navigation
    if (isRedirectResult(result)) {
      if (pendingNavigationLoadId > originatingLoadId) {
        // A new navigation was kicked off after our loader started, so that
        // should take precedence over this redirect navigation
        updateFetcherState(key, getDoneFetcher(undefined));
        return;
      } else {
        fetchRedirectIds.add(key);
        await startRedirectNavigation(fetchRequest, result, false, {
          preventScrollReset
        });
        return;
      }
    }
    // Process any non-redirect errors thrown
    if (isErrorResult(result)) {
      setFetcherError(key, routeId, result.error);
      return;
    }
    invariant(!isDeferredResult(result), "Unhandled fetcher deferred data");
    // Put the fetcher back into an idle state
    updateFetcherState(key, getDoneFetcher(result.data));
  }
  /**
   * Utility function to handle redirects returned from an action or loader.
   * Normally, a redirect "replaces" the navigation that triggered it.  So, for
   * example:
   *
   *  - user is on /a
   *  - user clicks a link to /b
   *  - loader for /b redirects to /c
   *
   * In a non-JS app the browser would track the in-flight navigation to /b and
   * then replace it with /c when it encountered the redirect response.  In
   * the end it would only ever update the URL bar with /c.
   *
   * In client-side routing using pushState/replaceState, we aim to emulate
   * this behavior and we also do not update history until the end of the
   * navigation (including processed redirects).  This means that we never
   * actually touch history until we've processed redirects, so we just use
   * the history action from the original navigation (PUSH or REPLACE).
   */
  async function startRedirectNavigation(request, redirect, isNavigation, _temp2) {
    let {
      submission,
      fetcherSubmission,
      preventScrollReset,
      replace
    } = _temp2 === void 0 ? {} : _temp2;
    if (redirect.response.headers.has("X-Remix-Revalidate")) {
      isRevalidationRequired = true;
    }
    let location = redirect.response.headers.get("Location");
    invariant(location, "Expected a Location header on the redirect Response");
    location = normalizeRedirectLocation(location, new URL(request.url), basename);
    let redirectLocation = createLocation(state.location, location, {
      _isRedirect: true
    });
    if (isBrowser) {
      let isDocumentReload = false;
      if (redirect.response.headers.has("X-Remix-Reload-Document")) {
        // Hard reload if the response contained X-Remix-Reload-Document
        isDocumentReload = true;
      } else if (ABSOLUTE_URL_REGEX.test(location)) {
        const url = init.history.createURL(location);
        isDocumentReload =
        // Hard reload if it's an absolute URL to a new origin
        url.origin !== routerWindow.location.origin ||
        // Hard reload if it's an absolute URL that does not match our basename
        stripBasename(url.pathname, basename) == null;
      }
      if (isDocumentReload) {
        if (replace) {
          routerWindow.location.replace(location);
        } else {
          routerWindow.location.assign(location);
        }
        return;
      }
    }
    // There's no need to abort on redirects, since we don't detect the
    // redirect until the action/loaders have settled
    pendingNavigationController = null;
    let redirectHistoryAction = replace === true || redirect.response.headers.has("X-Remix-Replace") ? Action.Replace : Action.Push;
    // Use the incoming submission if provided, fallback on the active one in
    // state.navigation
    let {
      formMethod,
      formAction,
      formEncType
    } = state.navigation;
    if (!submission && !fetcherSubmission && formMethod && formAction && formEncType) {
      submission = getSubmissionFromNavigation(state.navigation);
    }
    // If this was a 307/308 submission we want to preserve the HTTP method and
    // re-submit the GET/POST/PUT/PATCH/DELETE as a submission navigation to the
    // redirected location
    let activeSubmission = submission || fetcherSubmission;
    if (redirectPreserveMethodStatusCodes.has(redirect.response.status) && activeSubmission && isMutationMethod(activeSubmission.formMethod)) {
      await startNavigation(redirectHistoryAction, redirectLocation, {
        submission: _extends({}, activeSubmission, {
          formAction: location
        }),
        // Preserve these flags across redirects
        preventScrollReset: preventScrollReset || pendingPreventScrollReset,
        enableViewTransition: isNavigation ? pendingViewTransitionEnabled : undefined
      });
    } else {
      // If we have a navigation submission, we will preserve it through the
      // redirect navigation
      let overrideNavigation = getLoadingNavigation(redirectLocation, submission);
      await startNavigation(redirectHistoryAction, redirectLocation, {
        overrideNavigation,
        // Send fetcher submissions through for shouldRevalidate
        fetcherSubmission,
        // Preserve these flags across redirects
        preventScrollReset: preventScrollReset || pendingPreventScrollReset,
        enableViewTransition: isNavigation ? pendingViewTransitionEnabled : undefined
      });
    }
  }
  // Utility wrapper for calling dataStrategy client-side without having to
  // pass around the manifest, mapRouteProperties, etc.
  async function callDataStrategy(type, state, request, matchesToLoad, matches, fetcherKey) {
    let results;
    let dataResults = {};
    try {
      results = await callDataStrategyImpl(dataStrategyImpl, type, state, request, matchesToLoad, matches, fetcherKey, manifest, mapRouteProperties);
    } catch (e) {
      // If the outer dataStrategy method throws, just return the error for all
      // matches - and it'll naturally bubble to the root
      matchesToLoad.forEach(m => {
        dataResults[m.route.id] = {
          type: ResultType.error,
          error: e
        };
      });
      return dataResults;
    }
    for (let [routeId, result] of Object.entries(results)) {
      if (isRedirectDataStrategyResultResult(result)) {
        let response = result.result;
        dataResults[routeId] = {
          type: ResultType.redirect,
          response: normalizeRelativeRoutingRedirectResponse(response, request, routeId, matches, basename, future.v7_relativeSplatPath)
        };
      } else {
        dataResults[routeId] = await convertDataStrategyResultToDataResult(result);
      }
    }
    return dataResults;
  }
  async function callLoadersAndMaybeResolveData(state, matches, matchesToLoad, fetchersToLoad, request) {
    let currentMatches = state.matches;
    // Kick off loaders and fetchers in parallel
    let loaderResultsPromise = callDataStrategy("loader", state, request, matchesToLoad, matches, null);
    let fetcherResultsPromise = Promise.all(fetchersToLoad.map(async f => {
      if (f.matches && f.match && f.controller) {
        let results = await callDataStrategy("loader", state, createClientSideRequest(init.history, f.path, f.controller.signal), [f.match], f.matches, f.key);
        let result = results[f.match.route.id];
        // Fetcher results are keyed by fetcher key from here on out, not routeId
        return {
          [f.key]: result
        };
      } else {
        return Promise.resolve({
          [f.key]: {
            type: ResultType.error,
            error: getInternalRouterError(404, {
              pathname: f.path
            })
          }
        });
      }
    }));
    let loaderResults = await loaderResultsPromise;
    let fetcherResults = (await fetcherResultsPromise).reduce((acc, r) => Object.assign(acc, r), {});
    await Promise.all([resolveNavigationDeferredResults(matches, loaderResults, request.signal, currentMatches, state.loaderData), resolveFetcherDeferredResults(matches, fetcherResults, fetchersToLoad)]);
    return {
      loaderResults,
      fetcherResults
    };
  }
  function interruptActiveLoads() {
    // Every interruption triggers a revalidation
    isRevalidationRequired = true;
    // Cancel pending route-level deferreds and mark cancelled routes for
    // revalidation
    cancelledDeferredRoutes.push(...cancelActiveDeferreds());
    // Abort in-flight fetcher loads
    fetchLoadMatches.forEach((_, key) => {
      if (fetchControllers.has(key)) {
        cancelledFetcherLoads.add(key);
      }
      abortFetcher(key);
    });
  }
  function updateFetcherState(key, fetcher, opts) {
    if (opts === void 0) {
      opts = {};
    }
    state.fetchers.set(key, fetcher);
    updateState({
      fetchers: new Map(state.fetchers)
    }, {
      flushSync: (opts && opts.flushSync) === true
    });
  }
  function setFetcherError(key, routeId, error, opts) {
    if (opts === void 0) {
      opts = {};
    }
    let boundaryMatch = findNearestBoundary(state.matches, routeId);
    deleteFetcher(key);
    updateState({
      errors: {
        [boundaryMatch.route.id]: error
      },
      fetchers: new Map(state.fetchers)
    }, {
      flushSync: (opts && opts.flushSync) === true
    });
  }
  function getFetcher(key) {
    activeFetchers.set(key, (activeFetchers.get(key) || 0) + 1);
    // If this fetcher was previously marked for deletion, unmark it since we
    // have a new instance
    if (deletedFetchers.has(key)) {
      deletedFetchers.delete(key);
    }
    return state.fetchers.get(key) || IDLE_FETCHER;
  }
  function deleteFetcher(key) {
    let fetcher = state.fetchers.get(key);
    // Don't abort the controller if this is a deletion of a fetcher.submit()
    // in it's loading phase since - we don't want to abort the corresponding
    // revalidation and want them to complete and land
    if (fetchControllers.has(key) && !(fetcher && fetcher.state === "loading" && fetchReloadIds.has(key))) {
      abortFetcher(key);
    }
    fetchLoadMatches.delete(key);
    fetchReloadIds.delete(key);
    fetchRedirectIds.delete(key);
    // If we opted into the flag we can clear this now since we're calling
    // deleteFetcher() at the end of updateState() and we've already handed the
    // deleted fetcher keys off to the data layer.
    // If not, we're eagerly calling deleteFetcher() and we need to keep this
    // Set populated until the next updateState call, and we'll clear
    // `deletedFetchers` then
    if (future.v7_fetcherPersist) {
      deletedFetchers.delete(key);
    }
    cancelledFetcherLoads.delete(key);
    state.fetchers.delete(key);
  }
  function deleteFetcherAndUpdateState(key) {
    let count = (activeFetchers.get(key) || 0) - 1;
    if (count <= 0) {
      activeFetchers.delete(key);
      deletedFetchers.add(key);
      if (!future.v7_fetcherPersist) {
        deleteFetcher(key);
      }
    } else {
      activeFetchers.set(key, count);
    }
    updateState({
      fetchers: new Map(state.fetchers)
    });
  }
  function abortFetcher(key) {
    let controller = fetchControllers.get(key);
    if (controller) {
      controller.abort();
      fetchControllers.delete(key);
    }
  }
  function markFetchersDone(keys) {
    for (let key of keys) {
      let fetcher = getFetcher(key);
      let doneFetcher = getDoneFetcher(fetcher.data);
      state.fetchers.set(key, doneFetcher);
    }
  }
  function markFetchRedirectsDone() {
    let doneKeys = [];
    let updatedFetchers = false;
    for (let key of fetchRedirectIds) {
      let fetcher = state.fetchers.get(key);
      invariant(fetcher, "Expected fetcher: " + key);
      if (fetcher.state === "loading") {
        fetchRedirectIds.delete(key);
        doneKeys.push(key);
        updatedFetchers = true;
      }
    }
    markFetchersDone(doneKeys);
    return updatedFetchers;
  }
  function abortStaleFetchLoads(landedId) {
    let yeetedKeys = [];
    for (let [key, id] of fetchReloadIds) {
      if (id < landedId) {
        let fetcher = state.fetchers.get(key);
        invariant(fetcher, "Expected fetcher: " + key);
        if (fetcher.state === "loading") {
          abortFetcher(key);
          fetchReloadIds.delete(key);
          yeetedKeys.push(key);
        }
      }
    }
    markFetchersDone(yeetedKeys);
    return yeetedKeys.length > 0;
  }
  function getBlocker(key, fn) {
    let blocker = state.blockers.get(key) || IDLE_BLOCKER;
    if (blockerFunctions.get(key) !== fn) {
      blockerFunctions.set(key, fn);
    }
    return blocker;
  }
  function deleteBlocker(key) {
    state.blockers.delete(key);
    blockerFunctions.delete(key);
  }
  // Utility function to update blockers, ensuring valid state transitions
  function updateBlocker(key, newBlocker) {
    let blocker = state.blockers.get(key) || IDLE_BLOCKER;
    // Poor mans state machine :)
    // https://mermaid.live/edit#pako:eNqVkc9OwzAMxl8l8nnjAYrEtDIOHEBIgwvKJTReGy3_lDpIqO27k6awMG0XcrLlnz87nwdonESogKXXBuE79rq75XZO3-yHds0RJVuv70YrPlUrCEe2HfrORS3rubqZfuhtpg5C9wk5tZ4VKcRUq88q9Z8RS0-48cE1iHJkL0ugbHuFLus9L6spZy8nX9MP2CNdomVaposqu3fGayT8T8-jJQwhepo_UtpgBQaDEUom04dZhAN1aJBDlUKJBxE1ceB2Smj0Mln-IBW5AFU2dwUiktt_2Qaq2dBfaKdEup85UV7Yd-dKjlnkabl2Pvr0DTkTreM
    invariant(blocker.state === "unblocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "proceeding" || blocker.state === "blocked" && newBlocker.state === "unblocked" || blocker.state === "proceeding" && newBlocker.state === "unblocked", "Invalid blocker state transition: " + blocker.state + " -> " + newBlocker.state);
    let blockers = new Map(state.blockers);
    blockers.set(key, newBlocker);
    updateState({
      blockers
    });
  }
  function shouldBlockNavigation(_ref2) {
    let {
      currentLocation,
      nextLocation,
      historyAction
    } = _ref2;
    if (blockerFunctions.size === 0) {
      return;
    }
    // We ony support a single active blocker at the moment since we don't have
    // any compelling use cases for multi-blocker yet
    if (blockerFunctions.size > 1) {
      warning(false, "A router only supports one blocker at a time");
    }
    let entries = Array.from(blockerFunctions.entries());
    let [blockerKey, blockerFunction] = entries[entries.length - 1];
    let blocker = state.blockers.get(blockerKey);
    if (blocker && blocker.state === "proceeding") {
      // If the blocker is currently proceeding, we don't need to re-check
      // it and can let this navigation continue
      return;
    }
    // At this point, we know we're unblocked/blocked so we need to check the
    // user-provided blocker function
    if (blockerFunction({
      currentLocation,
      nextLocation,
      historyAction
    })) {
      return blockerKey;
    }
  }
  function handleNavigational404(pathname) {
    let error = getInternalRouterError(404, {
      pathname
    });
    let routesToUse = inFlightDataRoutes || dataRoutes;
    let {
      matches,
      route
    } = getShortCircuitMatches(routesToUse);
    // Cancel all pending deferred on 404s since we don't keep any routes
    cancelActiveDeferreds();
    return {
      notFoundMatches: matches,
      route,
      error
    };
  }
  function cancelActiveDeferreds(predicate) {
    let cancelledRouteIds = [];
    activeDeferreds.forEach((dfd, routeId) => {
      if (!predicate || predicate(routeId)) {
        // Cancel the deferred - but do not remove from activeDeferreds here -
        // we rely on the subscribers to do that so our tests can assert proper
        // cleanup via _internalActiveDeferreds
        dfd.cancel();
        cancelledRouteIds.push(routeId);
        activeDeferreds.delete(routeId);
      }
    });
    return cancelledRouteIds;
  }
  // Opt in to capturing and reporting scroll positions during navigations,
  // used by the <ScrollRestoration> component
  function enableScrollRestoration(positions, getPosition, getKey) {
    savedScrollPositions = positions;
    getScrollPosition = getPosition;
    getScrollRestorationKey = getKey || null;
    // Perform initial hydration scroll restoration, since we miss the boat on
    // the initial updateState() because we've not yet rendered <ScrollRestoration/>
    // and therefore have no savedScrollPositions available
    if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) {
      initialScrollRestored = true;
      let y = getSavedScrollPosition(state.location, state.matches);
      if (y != null) {
        updateState({
          restoreScrollPosition: y
        });
      }
    }
    return () => {
      savedScrollPositions = null;
      getScrollPosition = null;
      getScrollRestorationKey = null;
    };
  }
  function getScrollKey(location, matches) {
    if (getScrollRestorationKey) {
      let key = getScrollRestorationKey(location, matches.map(m => convertRouteMatchToUiMatch(m, state.loaderData)));
      return key || location.key;
    }
    return location.key;
  }
  function saveScrollPosition(location, matches) {
    if (savedScrollPositions && getScrollPosition) {
      let key = getScrollKey(location, matches);
      savedScrollPositions[key] = getScrollPosition();
    }
  }
  function getSavedScrollPosition(location, matches) {
    if (savedScrollPositions) {
      let key = getScrollKey(location, matches);
      let y = savedScrollPositions[key];
      if (typeof y === "number") {
        return y;
      }
    }
    return null;
  }
  function checkFogOfWar(matches, routesToUse, pathname) {
    if (patchRoutesOnNavigationImpl) {
      if (!matches) {
        let fogMatches = matchRoutesImpl(routesToUse, pathname, basename, true);
        return {
          active: true,
          matches: fogMatches || []
        };
      } else {
        if (Object.keys(matches[0].params).length > 0) {
          // If we matched a dynamic param or a splat, it might only be because
          // we haven't yet discovered other routes that would match with a
          // higher score.  Call patchRoutesOnNavigation just to be sure
          let partialMatches = matchRoutesImpl(routesToUse, pathname, basename, true);
          return {
            active: true,
            matches: partialMatches
          };
        }
      }
    }
    return {
      active: false,
      matches: null
    };
  }
  async function discoverRoutes(matches, pathname, signal, fetcherKey) {
    if (!patchRoutesOnNavigationImpl) {
      return {
        type: "success",
        matches
      };
    }
    let partialMatches = matches;
    while (true) {
      let isNonHMR = inFlightDataRoutes == null;
      let routesToUse = inFlightDataRoutes || dataRoutes;
      let localManifest = manifest;
      try {
        await patchRoutesOnNavigationImpl({
          signal,
          path: pathname,
          matches: partialMatches,
          fetcherKey,
          patch: (routeId, children) => {
            if (signal.aborted) return;
            patchRoutesImpl(routeId, children, routesToUse, localManifest, mapRouteProperties);
          }
        });
      } catch (e) {
        return {
          type: "error",
          error: e,
          partialMatches
        };
      } finally {
        // If we are not in the middle of an HMR revalidation and we changed the
        // routes, provide a new identity so when we `updateState` at the end of
        // this navigation/fetch `router.routes` will be a new identity and
        // trigger a re-run of memoized `router.routes` dependencies.
        // HMR will already update the identity and reflow when it lands
        // `inFlightDataRoutes` in `completeNavigation`
        if (isNonHMR && !signal.aborted) {
          dataRoutes = [...dataRoutes];
        }
      }
      if (signal.aborted) {
        return {
          type: "aborted"
        };
      }
      let newMatches = matchRoutes(routesToUse, pathname, basename);
      if (newMatches) {
        return {
          type: "success",
          matches: newMatches
        };
      }
      let newPartialMatches = matchRoutesImpl(routesToUse, pathname, basename, true);
      // Avoid loops if the second pass results in the same partial matches
      if (!newPartialMatches || partialMatches.length === newPartialMatches.length && partialMatches.every((m, i) => m.route.id === newPartialMatches[i].route.id)) {
        return {
          type: "success",
          matches: null
        };
      }
      partialMatches = newPartialMatches;
    }
  }
  function _internalSetRoutes(newRoutes) {
    manifest = {};
    inFlightDataRoutes = convertRoutesToDataRoutes(newRoutes, mapRouteProperties, undefined, manifest);
  }
  function patchRoutes(routeId, children) {
    let isNonHMR = inFlightDataRoutes == null;
    let routesToUse = inFlightDataRoutes || dataRoutes;
    patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties);
    // If we are not in the middle of an HMR revalidation and we changed the
    // routes, provide a new identity and trigger a reflow via `updateState`
    // to re-run memoized `router.routes` dependencies.
    // HMR will already update the identity and reflow when it lands
    // `inFlightDataRoutes` in `completeNavigation`
    if (isNonHMR) {
      dataRoutes = [...dataRoutes];
      updateState({});
    }
  }
  router = {
    get basename() {
      return basename;
    },
    get future() {
      return future;
    },
    get state() {
      return state;
    },
    get routes() {
      return dataRoutes;
    },
    get window() {
      return routerWindow;
    },
    initialize,
    subscribe,
    enableScrollRestoration,
    navigate,
    fetch,
    revalidate,
    // Passthrough to history-aware createHref used by useHref so we get proper
    // hash-aware URLs in DOM paths
    createHref: to => init.history.createHref(to),
    encodeLocation: to => init.history.encodeLocation(to),
    getFetcher,
    deleteFetcher: deleteFetcherAndUpdateState,
    dispose,
    getBlocker,
    deleteBlocker,
    patchRoutes,
    _internalFetchControllers: fetchControllers,
    _internalActiveDeferreds: activeDeferreds,
    // TODO: Remove setRoutes, it's temporary to avoid dealing with
    // updating the tree while validating the update algorithm.
    _internalSetRoutes
  };
  return router;
}
//#endregion
////////////////////////////////////////////////////////////////////////////////
//#region createStaticHandler
////////////////////////////////////////////////////////////////////////////////
const UNSAFE_DEFERRED_SYMBOL = Symbol("deferred");
function createStaticHandler(routes, opts) {
  invariant(routes.length > 0, "You must provide a non-empty routes array to createStaticHandler");
  let manifest = {};
  let basename = (opts ? opts.basename : null) || "/";
  let mapRouteProperties;
  if (opts != null && opts.mapRouteProperties) {
    mapRouteProperties = opts.mapRouteProperties;
  } else if (opts != null && opts.detectErrorBoundary) {
    // If they are still using the deprecated version, wrap it with the new API
    let detectErrorBoundary = opts.detectErrorBoundary;
    mapRouteProperties = route => ({
      hasErrorBoundary: detectErrorBoundary(route)
    });
  } else {
    mapRouteProperties = defaultMapRouteProperties;
  }
  // Config driven behavior flags
  let future = _extends({
    v7_relativeSplatPath: false,
    v7_throwAbortReason: false
  }, opts ? opts.future : null);
  let dataRoutes = convertRoutesToDataRoutes(routes, mapRouteProperties, undefined, manifest);
  /**
   * The query() method is intended for document requests, in which we want to
   * call an optional action and potentially multiple loaders for all nested
   * routes.  It returns a StaticHandlerContext object, which is very similar
   * to the router state (location, loaderData, actionData, errors, etc.) and
   * also adds SSR-specific information such as the statusCode and headers
   * from action/loaders Responses.
   *
   * It _should_ never throw and should report all errors through the
   * returned context.errors object, properly associating errors to their error
   * boundary.  Additionally, it tracks _deepestRenderedBoundaryId which can be
   * used to emulate React error boundaries during SSr by performing a second
   * pass only down to the boundaryId.
   *
   * The one exception where we do not return a StaticHandlerContext is when a
   * redirect response is returned or thrown from any action/loader.  We
   * propagate that out and return the raw Response so the HTTP server can
   * return it directly.
   *
   * - `opts.requestContext` is an optional server context that will be passed
   *   to actions/loaders in the `context` parameter
   * - `opts.skipLoaderErrorBubbling` is an optional parameter that will prevent
   *   the bubbling of errors which allows single-fetch-type implementations
   *   where the client will handle the bubbling and we may need to return data
   *   for the handling route
   */
  async function query(request, _temp3) {
    let {
      requestContext,
      skipLoaderErrorBubbling,
      dataStrategy
    } = _temp3 === void 0 ? {} : _temp3;
    let url = new URL(request.url);
    let method = request.method;
    let location = createLocation("", createPath(url), null, "default");
    let matches = matchRoutes(dataRoutes, location, basename);
    // SSR supports HEAD requests while SPA doesn't
    if (!isValidMethod(method) && method !== "HEAD") {
      let error = getInternalRouterError(405, {
        method
      });
      let {
        matches: methodNotAllowedMatches,
        route
      } = getShortCircuitMatches(dataRoutes);
      return {
        basename,
        location,
        matches: methodNotAllowedMatches,
        loaderData: {},
        actionData: null,
        errors: {
          [route.id]: error
        },
        statusCode: error.status,
        loaderHeaders: {},
        actionHeaders: {},
        activeDeferreds: null
      };
    } else if (!matches) {
      let error = getInternalRouterError(404, {
        pathname: location.pathname
      });
      let {
        matches: notFoundMatches,
        route
      } = getShortCircuitMatches(dataRoutes);
      return {
        basename,
        location,
        matches: notFoundMatches,
        loaderData: {},
        actionData: null,
        errors: {
          [route.id]: error
        },
        statusCode: error.status,
        loaderHeaders: {},
        actionHeaders: {},
        activeDeferreds: null
      };
    }
    let result = await queryImpl(request, location, matches, requestContext, dataStrategy || null, skipLoaderErrorBubbling === true, null);
    if (isResponse(result)) {
      return result;
    }
    // When returning StaticHandlerContext, we patch back in the location here
    // since we need it for React Context.  But this helps keep our submit and
    // loadRouteData operating on a Request instead of a Location
    return _extends({
      location,
      basename
    }, result);
  }
  /**
   * The queryRoute() method is intended for targeted route requests, either
   * for fetch ?_data requests or resource route requests.  In this case, we
   * are only ever calling a single action or loader, and we are returning the
   * returned value directly.  In most cases, this will be a Response returned
   * from the action/loader, but it may be a primitive or other value as well -
   * and in such cases the calling context should handle that accordingly.
   *
   * We do respect the throw/return differentiation, so if an action/loader
   * throws, then this method will throw the value.  This is important so we
   * can do proper boundary identification in Remix where a thrown Response
   * must go to the Catch Boundary but a returned Response is happy-path.
   *
   * One thing to note is that any Router-initiated Errors that make sense
   * to associate with a status code will be thrown as an ErrorResponse
   * instance which include the raw Error, such that the calling context can
   * serialize the error as they see fit while including the proper response
   * code.  Examples here are 404 and 405 errors that occur prior to reaching
   * any user-defined loaders.
   *
   * - `opts.routeId` allows you to specify the specific route handler to call.
   *   If not provided the handler will determine the proper route by matching
   *   against `request.url`
   * - `opts.requestContext` is an optional server context that will be passed
   *    to actions/loaders in the `context` parameter
   */
  async function queryRoute(request, _temp4) {
    let {
      routeId,
      requestContext,
      dataStrategy
    } = _temp4 === void 0 ? {} : _temp4;
    let url = new URL(request.url);
    let method = request.method;
    let location = createLocation("", createPath(url), null, "default");
    let matches = matchRoutes(dataRoutes, location, basename);
    // SSR supports HEAD requests while SPA doesn't
    if (!isValidMethod(method) && method !== "HEAD" && method !== "OPTIONS") {
      throw getInternalRouterError(405, {
        method
      });
    } else if (!matches) {
      throw getInternalRouterError(404, {
        pathname: location.pathname
      });
    }
    let match = routeId ? matches.find(m => m.route.id === routeId) : getTargetMatch(matches, location);
    if (routeId && !match) {
      throw getInternalRouterError(403, {
        pathname: location.pathname,
        routeId
      });
    } else if (!match) {
      // This should never hit I don't think?
      throw getInternalRouterError(404, {
        pathname: location.pathname
      });
    }
    let result = await queryImpl(request, location, matches, requestContext, dataStrategy || null, false, match);
    if (isResponse(result)) {
      return result;
    }
    let error = result.errors ? Object.values(result.errors)[0] : undefined;
    if (error !== undefined) {
      // If we got back result.errors, that means the loader/action threw
      // _something_ that wasn't a Response, but it's not guaranteed/required
      // to be an `instanceof Error` either, so we have to use throw here to
      // preserve the "error" state outside of queryImpl.
      throw error;
    }
    // Pick off the right state value to return
    if (result.actionData) {
      return Object.values(result.actionData)[0];
    }
    if (result.loaderData) {
      var _result$activeDeferre;
      let data = Object.values(result.loaderData)[0];
      if ((_result$activeDeferre = result.activeDeferreds) != null && _result$activeDeferre[match.route.id]) {
        data[UNSAFE_DEFERRED_SYMBOL] = result.activeDeferreds[match.route.id];
      }
      return data;
    }
    return undefined;
  }
  async function queryImpl(request, location, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch) {
    invariant(request.signal, "query()/queryRoute() requests must contain an AbortController signal");
    try {
      if (isMutationMethod(request.method.toLowerCase())) {
        let result = await submit(request, matches, routeMatch || getTargetMatch(matches, location), requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch != null);
        return result;
      }
      let result = await loadRouteData(request, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch);
      return isResponse(result) ? result : _extends({}, result, {
        actionData: null,
        actionHeaders: {}
      });
    } catch (e) {
      // If the user threw/returned a Response in callLoaderOrAction for a
      // `queryRoute` call, we throw the `DataStrategyResult` to bail out early
      // and then return or throw the raw Response here accordingly
      if (isDataStrategyResult(e) && isResponse(e.result)) {
        if (e.type === ResultType.error) {
          throw e.result;
        }
        return e.result;
      }
      // Redirects are always returned since they don't propagate to catch
      // boundaries
      if (isRedirectResponse(e)) {
        return e;
      }
      throw e;
    }
  }
  async function submit(request, matches, actionMatch, requestContext, dataStrategy, skipLoaderErrorBubbling, isRouteRequest) {
    let result;
    if (!actionMatch.route.action && !actionMatch.route.lazy) {
      let error = getInternalRouterError(405, {
        method: request.method,
        pathname: new URL(request.url).pathname,
        routeId: actionMatch.route.id
      });
      if (isRouteRequest) {
        throw error;
      }
      result = {
        type: ResultType.error,
        error
      };
    } else {
      let results = await callDataStrategy("action", request, [actionMatch], matches, isRouteRequest, requestContext, dataStrategy);
      result = results[actionMatch.route.id];
      if (request.signal.aborted) {
        throwStaticHandlerAbortedError(request, isRouteRequest, future);
      }
    }
    if (isRedirectResult(result)) {
      // Uhhhh - this should never happen, we should always throw these from
      // callLoaderOrAction, but the type narrowing here keeps TS happy and we
      // can get back on the "throw all redirect responses" train here should
      // this ever happen :/
      throw new Response(null, {
        status: result.response.status,
        headers: {
          Location: result.response.headers.get("Location")
        }
      });
    }
    if (isDeferredResult(result)) {
      let error = getInternalRouterError(400, {
        type: "defer-action"
      });
      if (isRouteRequest) {
        throw error;
      }
      result = {
        type: ResultType.error,
        error
      };
    }
    if (isRouteRequest) {
      // Note: This should only be non-Response values if we get here, since
      // isRouteRequest should throw any Response received in callLoaderOrAction
      if (isErrorResult(result)) {
        throw result.error;
      }
      return {
        matches: [actionMatch],
        loaderData: {},
        actionData: {
          [actionMatch.route.id]: result.data
        },
        errors: null,
        // Note: statusCode + headers are unused here since queryRoute will
        // return the raw Response or value
        statusCode: 200,
        loaderHeaders: {},
        actionHeaders: {},
        activeDeferreds: null
      };
    }
    // Create a GET request for the loaders
    let loaderRequest = new Request(request.url, {
      headers: request.headers,
      redirect: request.redirect,
      signal: request.signal
    });
    if (isErrorResult(result)) {
      // Store off the pending error - we use it to determine which loaders
      // to call and will commit it when we complete the navigation
      let boundaryMatch = skipLoaderErrorBubbling ? actionMatch : findNearestBoundary(matches, actionMatch.route.id);
      let context = await loadRouteData(loaderRequest, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, null, [boundaryMatch.route.id, result]);
      // action status codes take precedence over loader status codes
      return _extends({}, context, {
        statusCode: isRouteErrorResponse(result.error) ? result.error.status : result.statusCode != null ? result.statusCode : 500,
        actionData: null,
        actionHeaders: _extends({}, result.headers ? {
          [actionMatch.route.id]: result.headers
        } : {})
      });
    }
    let context = await loadRouteData(loaderRequest, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, null);
    return _extends({}, context, {
      actionData: {
        [actionMatch.route.id]: result.data
      }
    }, result.statusCode ? {
      statusCode: result.statusCode
    } : {}, {
      actionHeaders: result.headers ? {
        [actionMatch.route.id]: result.headers
      } : {}
    });
  }
  async function loadRouteData(request, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch, pendingActionResult) {
    let isRouteRequest = routeMatch != null;
    // Short circuit if we have no loaders to run (queryRoute())
    if (isRouteRequest && !(routeMatch != null && routeMatch.route.loader) && !(routeMatch != null && routeMatch.route.lazy)) {
      throw getInternalRouterError(400, {
        method: request.method,
        pathname: new URL(request.url).pathname,
        routeId: routeMatch == null ? void 0 : routeMatch.route.id
      });
    }
    let requestMatches = routeMatch ? [routeMatch] : pendingActionResult && isErrorResult(pendingActionResult[1]) ? getLoaderMatchesUntilBoundary(matches, pendingActionResult[0]) : matches;
    let matchesToLoad = requestMatches.filter(m => m.route.loader || m.route.lazy);
    // Short circuit if we have no loaders to run (query())
    if (matchesToLoad.length === 0) {
      return {
        matches,
        // Add a null for all matched routes for proper revalidation on the client
        loaderData: matches.reduce((acc, m) => Object.assign(acc, {
          [m.route.id]: null
        }), {}),
        errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? {
          [pendingActionResult[0]]: pendingActionResult[1].error
        } : null,
        statusCode: 200,
        loaderHeaders: {},
        activeDeferreds: null
      };
    }
    let results = await callDataStrategy("loader", request, matchesToLoad, matches, isRouteRequest, requestContext, dataStrategy);
    if (request.signal.aborted) {
      throwStaticHandlerAbortedError(request, isRouteRequest, future);
    }
    // Process and commit output from loaders
    let activeDeferreds = new Map();
    let context = processRouteLoaderData(matches, results, pendingActionResult, activeDeferreds, skipLoaderErrorBubbling);
    // Add a null for any non-loader matches for proper revalidation on the client
    let executedLoaders = new Set(matchesToLoad.map(match => match.route.id));
    matches.forEach(match => {
      if (!executedLoaders.has(match.route.id)) {
        context.loaderData[match.route.id] = null;
      }
    });
    return _extends({}, context, {
      matches,
      activeDeferreds: activeDeferreds.size > 0 ? Object.fromEntries(activeDeferreds.entries()) : null
    });
  }
  // Utility wrapper for calling dataStrategy server-side without having to
  // pass around the manifest, mapRouteProperties, etc.
  async function callDataStrategy(type, request, matchesToLoad, matches, isRouteRequest, requestContext, dataStrategy) {
    let results = await callDataStrategyImpl(dataStrategy || defaultDataStrategy, type, null, request, matchesToLoad, matches, null, manifest, mapRouteProperties, requestContext);
    let dataResults = {};
    await Promise.all(matches.map(async match => {
      if (!(match.route.id in results)) {
        return;
      }
      let result = results[match.route.id];
      if (isRedirectDataStrategyResultResult(result)) {
        let response = result.result;
        // Throw redirects and let the server handle them with an HTTP redirect
        throw normalizeRelativeRoutingRedirectResponse(response, request, match.route.id, matches, basename, future.v7_relativeSplatPath);
      }
      if (isResponse(result.result) && isRouteRequest) {
        // For SSR single-route requests, we want to hand Responses back
        // directly without unwrapping
        throw result;
      }
      dataResults[match.route.id] = await convertDataStrategyResultToDataResult(result);
    }));
    return dataResults;
  }
  return {
    dataRoutes,
    query,
    queryRoute
  };
}
//#endregion
////////////////////////////////////////////////////////////////////////////////
//#region Helpers
////////////////////////////////////////////////////////////////////////////////
/**
 * Given an existing StaticHandlerContext and an error thrown at render time,
 * provide an updated StaticHandlerContext suitable for a second SSR render
 */
function getStaticContextFromError(routes, context, error) {
  let newContext = _extends({}, context, {
    statusCode: isRouteErrorResponse(error) ? error.status : 500,
    errors: {
      [context._deepestRenderedBoundaryId || routes[0].id]: error
    }
  });
  return newContext;
}
function throwStaticHandlerAbortedError(request, isRouteRequest, future) {
  if (future.v7_throwAbortReason && request.signal.reason !== undefined) {
    throw request.signal.reason;
  }
  let method = isRouteRequest ? "queryRoute" : "query";
  throw new Error(method + "() call aborted: " + request.method + " " + request.url);
}
function isSubmissionNavigation(opts) {
  return opts != null && ("formData" in opts && opts.formData != null || "body" in opts && opts.body !== undefined);
}
function normalizeTo(location, matches, basename, prependBasename, to, v7_relativeSplatPath, fromRouteId, relative) {
  let contextualMatches;
  let activeRouteMatch;
  if (fromRouteId) {
    // Grab matches up to the calling route so our route-relative logic is
    // relative to the correct source route
    contextualMatches = [];
    for (let match of matches) {
      contextualMatches.push(match);
      if (match.route.id === fromRouteId) {
        activeRouteMatch = match;
        break;
      }
    }
  } else {
    contextualMatches = matches;
    activeRouteMatch = matches[matches.length - 1];
  }
  // Resolve the relative path
  let path = resolveTo(to ? to : ".", getResolveToMatches(contextualMatches, v7_relativeSplatPath), stripBasename(location.pathname, basename) || location.pathname, relative === "path");
  // When `to` is not specified we inherit search/hash from the current
  // location, unlike when to="." and we just inherit the path.
  // See https://github.com/remix-run/remix/issues/927
  if (to == null) {
    path.search = location.search;
    path.hash = location.hash;
  }
  // Account for `?index` params when routing to the current location
  if ((to == null || to === "" || to === ".") && activeRouteMatch) {
    let nakedIndex = hasNakedIndexQuery(path.search);
    if (activeRouteMatch.route.index && !nakedIndex) {
      // Add one when we're targeting an index route
      path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
    } else if (!activeRouteMatch.route.index && nakedIndex) {
      // Remove existing ones when we're not
      let params = new URLSearchParams(path.search);
      let indexValues = params.getAll("index");
      params.delete("index");
      indexValues.filter(v => v).forEach(v => params.append("index", v));
      let qs = params.toString();
      path.search = qs ? "?" + qs : "";
    }
  }
  // If we're operating within a basename, prepend it to the pathname.  If
  // this is a root navigation, then just use the raw basename which allows
  // the basename to have full control over the presence of a trailing slash
  // on root actions
  if (prependBasename && basename !== "/") {
    path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
  }
  return createPath(path);
}
// Normalize navigation options by converting formMethod=GET formData objects to
// URLSearchParams so they behave identically to links with query params
function normalizeNavigateOptions(normalizeFormMethod, isFetcher, path, opts) {
  // Return location verbatim on non-submission navigations
  if (!opts || !isSubmissionNavigation(opts)) {
    return {
      path
    };
  }
  if (opts.formMethod && !isValidMethod(opts.formMethod)) {
    return {
      path,
      error: getInternalRouterError(405, {
        method: opts.formMethod
      })
    };
  }
  let getInvalidBodyError = () => ({
    path,
    error: getInternalRouterError(400, {
      type: "invalid-body"
    })
  });
  // Create a Submission on non-GET navigations
  let rawFormMethod = opts.formMethod || "get";
  let formMethod = normalizeFormMethod ? rawFormMethod.toUpperCase() : rawFormMethod.toLowerCase();
  let formAction = stripHashFromPath(path);
  if (opts.body !== undefined) {
    if (opts.formEncType === "text/plain") {
      // text only support POST/PUT/PATCH/DELETE submissions
      if (!isMutationMethod(formMethod)) {
        return getInvalidBodyError();
      }
      let text = typeof opts.body === "string" ? opts.body : opts.body instanceof FormData || opts.body instanceof URLSearchParams ?
      // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data
      Array.from(opts.body.entries()).reduce((acc, _ref3) => {
        let [name, value] = _ref3;
        return "" + acc + name + "=" + value + "\n";
      }, "") : String(opts.body);
      return {
        path,
        submission: {
          formMethod,
          formAction,
          formEncType: opts.formEncType,
          formData: undefined,
          json: undefined,
          text
        }
      };
    } else if (opts.formEncType === "application/json") {
      // json only supports POST/PUT/PATCH/DELETE submissions
      if (!isMutationMethod(formMethod)) {
        return getInvalidBodyError();
      }
      try {
        let json = typeof opts.body === "string" ? JSON.parse(opts.body) : opts.body;
        return {
          path,
          submission: {
            formMethod,
            formAction,
            formEncType: opts.formEncType,
            formData: undefined,
            json,
            text: undefined
          }
        };
      } catch (e) {
        return getInvalidBodyError();
      }
    }
  }
  invariant(typeof FormData === "function", "FormData is not available in this environment");
  let searchParams;
  let formData;
  if (opts.formData) {
    searchParams = convertFormDataToSearchParams(opts.formData);
    formData = opts.formData;
  } else if (opts.body instanceof FormData) {
    searchParams = convertFormDataToSearchParams(opts.body);
    formData = opts.body;
  } else if (opts.body instanceof URLSearchParams) {
    searchParams = opts.body;
    formData = convertSearchParamsToFormData(searchParams);
  } else if (opts.body == null) {
    searchParams = new URLSearchParams();
    formData = new FormData();
  } else {
    try {
      searchParams = new URLSearchParams(opts.body);
      formData = convertSearchParamsToFormData(searchParams);
    } catch (e) {
      return getInvalidBodyError();
    }
  }
  let submission = {
    formMethod,
    formAction,
    formEncType: opts && opts.formEncType || "application/x-www-form-urlencoded",
    formData,
    json: undefined,
    text: undefined
  };
  if (isMutationMethod(submission.formMethod)) {
    return {
      path,
      submission
    };
  }
  // Flatten submission onto URLSearchParams for GET submissions
  let parsedPath = parsePath(path);
  // On GET navigation submissions we can drop the ?index param from the
  // resulting location since all loaders will run.  But fetcher GET submissions
  // only run a single loader so we need to preserve any incoming ?index params
  if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) {
    searchParams.append("index", "");
  }
  parsedPath.search = "?" + searchParams;
  return {
    path: createPath(parsedPath),
    submission
  };
}
// Filter out all routes at/below any caught error as they aren't going to
// render so we don't need to load them
function getLoaderMatchesUntilBoundary(matches, boundaryId, includeBoundary) {
  if (includeBoundary === void 0) {
    includeBoundary = false;
  }
  let index = matches.findIndex(m => m.route.id === boundaryId);
  if (index >= 0) {
    return matches.slice(0, includeBoundary ? index + 1 : index);
  }
  return matches;
}
function getMatchesToLoad(history, state, matches, submission, location, initialHydration, skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionResult) {
  let actionResult = pendingActionResult ? isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : pendingActionResult[1].data : undefined;
  let currentUrl = history.createURL(state.location);
  let nextUrl = history.createURL(location);
  // Pick navigation matches that are net-new or qualify for revalidation
  let boundaryMatches = matches;
  if (initialHydration && state.errors) {
    // On initial hydration, only consider matches up to _and including_ the boundary.
    // This is inclusive to handle cases where a server loader ran successfully,
    // a child server loader bubbled up to this route, but this route has
    // `clientLoader.hydrate` so we want to still run the `clientLoader` so that
    // we have a complete version of `loaderData`
    boundaryMatches = getLoaderMatchesUntilBoundary(matches, Object.keys(state.errors)[0], true);
  } else if (pendingActionResult && isErrorResult(pendingActionResult[1])) {
    // If an action threw an error, we call loaders up to, but not including the
    // boundary
    boundaryMatches = getLoaderMatchesUntilBoundary(matches, pendingActionResult[0]);
  }
  // Don't revalidate loaders by default after action 4xx/5xx responses
  // when the flag is enabled.  They can still opt-into revalidation via
  // `shouldRevalidate` via `actionResult`
  let actionStatus = pendingActionResult ? pendingActionResult[1].statusCode : undefined;
  let shouldSkipRevalidation = skipActionErrorRevalidation && actionStatus && actionStatus >= 400;
  let navigationMatches = boundaryMatches.filter((match, index) => {
    let {
      route
    } = match;
    if (route.lazy) {
      // We haven't loaded this route yet so we don't know if it's got a loader!
      return true;
    }
    if (route.loader == null) {
      return false;
    }
    if (initialHydration) {
      return shouldLoadRouteOnHydration(route, state.loaderData, state.errors);
    }
    // Always call the loader on new route instances and pending defer cancellations
    if (isNewLoader(state.loaderData, state.matches[index], match) || cancelledDeferredRoutes.some(id => id === match.route.id)) {
      return true;
    }
    // This is the default implementation for when we revalidate.  If the route
    // provides it's own implementation, then we give them full control but
    // provide this value so they can leverage it if needed after they check
    // their own specific use cases
    let currentRouteMatch = state.matches[index];
    let nextRouteMatch = match;
    return shouldRevalidateLoader(match, _extends({
      currentUrl,
      currentParams: currentRouteMatch.params,
      nextUrl,
      nextParams: nextRouteMatch.params
    }, submission, {
      actionResult,
      actionStatus,
      defaultShouldRevalidate: shouldSkipRevalidation ? false :
      // Forced revalidation due to submission, useRevalidator, or X-Remix-Revalidate
      isRevalidationRequired || currentUrl.pathname + currentUrl.search === nextUrl.pathname + nextUrl.search ||
      // Search params affect all loaders
      currentUrl.search !== nextUrl.search || isNewRouteInstance(currentRouteMatch, nextRouteMatch)
    }));
  });
  // Pick fetcher.loads that need to be revalidated
  let revalidatingFetchers = [];
  fetchLoadMatches.forEach((f, key) => {
    // Don't revalidate:
    //  - on initial hydration (shouldn't be any fetchers then anyway)
    //  - if fetcher won't be present in the subsequent render
    //    - no longer matches the URL (v7_fetcherPersist=false)
    //    - was unmounted but persisted due to v7_fetcherPersist=true
    if (initialHydration || !matches.some(m => m.route.id === f.routeId) || deletedFetchers.has(key)) {
      return;
    }
    let fetcherMatches = matchRoutes(routesToUse, f.path, basename);
    // If the fetcher path no longer matches, push it in with null matches so
    // we can trigger a 404 in callLoadersAndMaybeResolveData.  Note this is
    // currently only a use-case for Remix HMR where the route tree can change
    // at runtime and remove a route previously loaded via a fetcher
    if (!fetcherMatches) {
      revalidatingFetchers.push({
        key,
        routeId: f.routeId,
        path: f.path,
        matches: null,
        match: null,
        controller: null
      });
      return;
    }
    // Revalidating fetchers are decoupled from the route matches since they
    // load from a static href.  They revalidate based on explicit revalidation
    // (submission, useRevalidator, or X-Remix-Revalidate)
    let fetcher = state.fetchers.get(key);
    let fetcherMatch = getTargetMatch(fetcherMatches, f.path);
    let shouldRevalidate = false;
    if (fetchRedirectIds.has(key)) {
      // Never trigger a revalidation of an actively redirecting fetcher
      shouldRevalidate = false;
    } else if (cancelledFetcherLoads.has(key)) {
      // Always mark for revalidation if the fetcher was cancelled
      cancelledFetcherLoads.delete(key);
      shouldRevalidate = true;
    } else if (fetcher && fetcher.state !== "idle" && fetcher.data === undefined) {
      // If the fetcher hasn't ever completed loading yet, then this isn't a
      // revalidation, it would just be a brand new load if an explicit
      // revalidation is required
      shouldRevalidate = isRevalidationRequired;
    } else {
      // Otherwise fall back on any user-defined shouldRevalidate, defaulting
      // to explicit revalidations only
      shouldRevalidate = shouldRevalidateLoader(fetcherMatch, _extends({
        currentUrl,
        currentParams: state.matches[state.matches.length - 1].params,
        nextUrl,
        nextParams: matches[matches.length - 1].params
      }, submission, {
        actionResult,
        actionStatus,
        defaultShouldRevalidate: shouldSkipRevalidation ? false : isRevalidationRequired
      }));
    }
    if (shouldRevalidate) {
      revalidatingFetchers.push({
        key,
        routeId: f.routeId,
        path: f.path,
        matches: fetcherMatches,
        match: fetcherMatch,
        controller: new AbortController()
      });
    }
  });
  return [navigationMatches, revalidatingFetchers];
}
function shouldLoadRouteOnHydration(route, loaderData, errors) {
  // We dunno if we have a loader - gotta find out!
  if (route.lazy) {
    return true;
  }
  // No loader, nothing to initialize
  if (!route.loader) {
    return false;
  }
  let hasData = loaderData != null && loaderData[route.id] !== undefined;
  let hasError = errors != null && errors[route.id] !== undefined;
  // Don't run if we error'd during SSR
  if (!hasData && hasError) {
    return false;
  }
  // Explicitly opting-in to running on hydration
  if (typeof route.loader === "function" && route.loader.hydrate === true) {
    return true;
  }
  // Otherwise, run if we're not yet initialized with anything
  return !hasData && !hasError;
}
function isNewLoader(currentLoaderData, currentMatch, match) {
  let isNew =
  // [a] -> [a, b]
  !currentMatch ||
  // [a, b] -> [a, c]
  match.route.id !== currentMatch.route.id;
  // Handle the case that we don't have data for a re-used route, potentially
  // from a prior error or from a cancelled pending deferred
  let isMissingData = currentLoaderData[match.route.id] === undefined;
  // Always load if this is a net-new route or we don't yet have data
  return isNew || isMissingData;
}
function isNewRouteInstance(currentMatch, match) {
  let currentPath = currentMatch.route.path;
  return (
    // param change for this match, /users/123 -> /users/456
    currentMatch.pathname !== match.pathname ||
    // splat param changed, which is not present in match.path
    // e.g. /files/images/avatar.jpg -> files/finances.xls
    currentPath != null && currentPath.endsWith("*") && currentMatch.params["*"] !== match.params["*"]
  );
}
function shouldRevalidateLoader(loaderMatch, arg) {
  if (loaderMatch.route.shouldRevalidate) {
    let routeChoice = loaderMatch.route.shouldRevalidate(arg);
    if (typeof routeChoice === "boolean") {
      return routeChoice;
    }
  }
  return arg.defaultShouldRevalidate;
}
function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties) {
  var _childrenToPatch;
  let childrenToPatch;
  if (routeId) {
    let route = manifest[routeId];
    invariant(route, "No route found to patch children into: routeId = " + routeId);
    if (!route.children) {
      route.children = [];
    }
    childrenToPatch = route.children;
  } else {
    childrenToPatch = routesToUse;
  }
  // Don't patch in routes we already know about so that `patch` is idempotent
  // to simplify user-land code. This is useful because we re-call the
  // `patchRoutesOnNavigation` function for matched routes with params.
  let uniqueChildren = children.filter(newRoute => !childrenToPatch.some(existingRoute => isSameRoute(newRoute, existingRoute)));
  let newRoutes = convertRoutesToDataRoutes(uniqueChildren, mapRouteProperties, [routeId || "_", "patch", String(((_childrenToPatch = childrenToPatch) == null ? void 0 : _childrenToPatch.length) || "0")], manifest);
  childrenToPatch.push(...newRoutes);
}
function isSameRoute(newRoute, existingRoute) {
  // Most optimal check is by id
  if ("id" in newRoute && "id" in existingRoute && newRoute.id === existingRoute.id) {
    return true;
  }
  // Second is by pathing differences
  if (!(newRoute.index === existingRoute.index && newRoute.path === existingRoute.path && newRoute.caseSensitive === existingRoute.caseSensitive)) {
    return false;
  }
  // Pathless layout routes are trickier since we need to check children.
  // If they have no children then they're the same as far as we can tell
  if ((!newRoute.children || newRoute.children.length === 0) && (!existingRoute.children || existingRoute.children.length === 0)) {
    return true;
  }
  // Otherwise, we look to see if every child in the new route is already
  // represented in the existing route's children
  return newRoute.children.every((aChild, i) => {
    var _existingRoute$childr;
    return (_existingRoute$childr = existingRoute.children) == null ? void 0 : _existingRoute$childr.some(bChild => isSameRoute(aChild, bChild));
  });
}
/**
 * Execute route.lazy() methods to lazily load route modules (loader, action,
 * shouldRevalidate) and update the routeManifest in place which shares objects
 * with dataRoutes so those get updated as well.
 */
async function loadLazyRouteModule(route, mapRouteProperties, manifest) {
  if (!route.lazy) {
    return;
  }
  let lazyRoute = await route.lazy();
  // If the lazy route function was executed and removed by another parallel
  // call then we can return - first lazy() to finish wins because the return
  // value of lazy is expected to be static
  if (!route.lazy) {
    return;
  }
  let routeToUpdate = manifest[route.id];
  invariant(routeToUpdate, "No route found in manifest");
  // Update the route in place.  This should be safe because there's no way
  // we could yet be sitting on this route as we can't get there without
  // resolving lazy() first.
  //
  // This is different than the HMR "update" use-case where we may actively be
  // on the route being updated.  The main concern boils down to "does this
  // mutation affect any ongoing navigations or any current state.matches
  // values?".  If not, it should be safe to update in place.
  let routeUpdates = {};
  for (let lazyRouteProperty in lazyRoute) {
    let staticRouteValue = routeToUpdate[lazyRouteProperty];
    let isPropertyStaticallyDefined = staticRouteValue !== undefined &&
    // This property isn't static since it should always be updated based
    // on the route updates
    lazyRouteProperty !== "hasErrorBoundary";
    warning(!isPropertyStaticallyDefined, "Route \"" + routeToUpdate.id + "\" has a static property \"" + lazyRouteProperty + "\" " + "defined but its lazy function is also returning a value for this property. " + ("The lazy route property \"" + lazyRouteProperty + "\" will be ignored."));
    if (!isPropertyStaticallyDefined && !immutableRouteKeys.has(lazyRouteProperty)) {
      routeUpdates[lazyRouteProperty] = lazyRoute[lazyRouteProperty];
    }
  }
  // Mutate the route with the provided updates.  Do this first so we pass
  // the updated version to mapRouteProperties
  Object.assign(routeToUpdate, routeUpdates);
  // Mutate the `hasErrorBoundary` property on the route based on the route
  // updates and remove the `lazy` function so we don't resolve the lazy
  // route again.
  Object.assign(routeToUpdate, _extends({}, mapRouteProperties(routeToUpdate), {
    lazy: undefined
  }));
}
// Default implementation of `dataStrategy` which fetches all loaders in parallel
async function defaultDataStrategy(_ref4) {
  let {
    matches
  } = _ref4;
  let matchesToLoad = matches.filter(m => m.shouldLoad);
  let results = await Promise.all(matchesToLoad.map(m => m.resolve()));
  return results.reduce((acc, result, i) => Object.assign(acc, {
    [matchesToLoad[i].route.id]: result
  }), {});
}
async function callDataStrategyImpl(dataStrategyImpl, type, state, request, matchesToLoad, matches, fetcherKey, manifest, mapRouteProperties, requestContext) {
  let loadRouteDefinitionsPromises = matches.map(m => m.route.lazy ? loadLazyRouteModule(m.route, mapRouteProperties, manifest) : undefined);
  let dsMatches = matches.map((match, i) => {
    let loadRoutePromise = loadRouteDefinitionsPromises[i];
    let shouldLoad = matchesToLoad.some(m => m.route.id === match.route.id);
    // `resolve` encapsulates route.lazy(), executing the loader/action,
    // and mapping return values/thrown errors to a `DataStrategyResult`.  Users
    // can pass a callback to take fine-grained control over the execution
    // of the loader/action
    let resolve = async handlerOverride => {
      if (handlerOverride && request.method === "GET" && (match.route.lazy || match.route.loader)) {
        shouldLoad = true;
      }
      return shouldLoad ? callLoaderOrAction(type, request, match, loadRoutePromise, handlerOverride, requestContext) : Promise.resolve({
        type: ResultType.data,
        result: undefined
      });
    };
    return _extends({}, match, {
      shouldLoad,
      resolve
    });
  });
  // Send all matches here to allow for a middleware-type implementation.
  // handler will be a no-op for unneeded routes and we filter those results
  // back out below.
  let results = await dataStrategyImpl({
    matches: dsMatches,
    request,
    params: matches[0].params,
    fetcherKey,
    context: requestContext
  });
  // Wait for all routes to load here but 'swallow the error since we want
  // it to bubble up from the `await loadRoutePromise` in `callLoaderOrAction` -
  // called from `match.resolve()`
  try {
    await Promise.all(loadRouteDefinitionsPromises);
  } catch (e) {
    // No-op
  }
  return results;
}
// Default logic for calling a loader/action is the user has no specified a dataStrategy
async function callLoaderOrAction(type, request, match, loadRoutePromise, handlerOverride, staticContext) {
  let result;
  let onReject;
  let runHandler = handler => {
    // Setup a promise we can race against so that abort signals short circuit
    let reject;
    // This will never resolve so safe to type it as Promise<DataStrategyResult> to
    // satisfy the function return value
    let abortPromise = new Promise((_, r) => reject = r);
    onReject = () => reject();
    request.signal.addEventListener("abort", onReject);
    let actualHandler = ctx => {
      if (typeof handler !== "function") {
        return Promise.reject(new Error("You cannot call the handler for a route which defines a boolean " + ("\"" + type + "\" [routeId: " + match.route.id + "]")));
      }
      return handler({
        request,
        params: match.params,
        context: staticContext
      }, ...(ctx !== undefined ? [ctx] : []));
    };
    let handlerPromise = (async () => {
      try {
        let val = await (handlerOverride ? handlerOverride(ctx => actualHandler(ctx)) : actualHandler());
        return {
          type: "data",
          result: val
        };
      } catch (e) {
        return {
          type: "error",
          result: e
        };
      }
    })();
    return Promise.race([handlerPromise, abortPromise]);
  };
  try {
    let handler = match.route[type];
    // If we have a route.lazy promise, await that first
    if (loadRoutePromise) {
      if (handler) {
        // Run statically defined handler in parallel with lazy()
        let handlerError;
        let [value] = await Promise.all([
        // If the handler throws, don't let it immediately bubble out,
        // since we need to let the lazy() execution finish so we know if this
        // route has a boundary that can handle the error
        runHandler(handler).catch(e => {
          handlerError = e;
        }), loadRoutePromise]);
        if (handlerError !== undefined) {
          throw handlerError;
        }
        result = value;
      } else {
        // Load lazy route module, then run any returned handler
        await loadRoutePromise;
        handler = match.route[type];
        if (handler) {
          // Handler still runs even if we got interrupted to maintain consistency
          // with un-abortable behavior of handler execution on non-lazy or
          // previously-lazy-loaded routes
          result = await runHandler(handler);
        } else if (type === "action") {
          let url = new URL(request.url);
          let pathname = url.pathname + url.search;
          throw getInternalRouterError(405, {
            method: request.method,
            pathname,
            routeId: match.route.id
          });
        } else {
          // lazy() route has no loader to run.  Short circuit here so we don't
          // hit the invariant below that errors on returning undefined.
          return {
            type: ResultType.data,
            result: undefined
          };
        }
      }
    } else if (!handler) {
      let url = new URL(request.url);
      let pathname = url.pathname + url.search;
      throw getInternalRouterError(404, {
        pathname
      });
    } else {
      result = await runHandler(handler);
    }
    invariant(result.result !== undefined, "You defined " + (type === "action" ? "an action" : "a loader") + " for route " + ("\"" + match.route.id + "\" but didn't return anything from your `" + type + "` ") + "function. Please return a value or `null`.");
  } catch (e) {
    // We should already be catching and converting normal handler executions to
    // DataStrategyResults and returning them, so anything that throws here is an
    // unexpected error we still need to wrap
    return {
      type: ResultType.error,
      result: e
    };
  } finally {
    if (onReject) {
      request.signal.removeEventListener("abort", onReject);
    }
  }
  return result;
}
async function convertDataStrategyResultToDataResult(dataStrategyResult) {
  let {
    result,
    type
  } = dataStrategyResult;
  if (isResponse(result)) {
    let data;
    try {
      let contentType = result.headers.get("Content-Type");
      // Check between word boundaries instead of startsWith() due to the last
      // paragraph of https://httpwg.org/specs/rfc9110.html#field.content-type
      if (contentType && /\bapplication\/json\b/.test(contentType)) {
        if (result.body == null) {
          data = null;
        } else {
          data = await result.json();
        }
      } else {
        data = await result.text();
      }
    } catch (e) {
      return {
        type: ResultType.error,
        error: e
      };
    }
    if (type === ResultType.error) {
      return {
        type: ResultType.error,
        error: new ErrorResponseImpl(result.status, result.statusText, data),
        statusCode: result.status,
        headers: result.headers
      };
    }
    return {
      type: ResultType.data,
      data,
      statusCode: result.status,
      headers: result.headers
    };
  }
  if (type === ResultType.error) {
    if (isDataWithResponseInit(result)) {
      var _result$init3, _result$init4;
      if (result.data instanceof Error) {
        var _result$init, _result$init2;
        return {
          type: ResultType.error,
          error: result.data,
          statusCode: (_result$init = result.init) == null ? void 0 : _result$init.status,
          headers: (_result$init2 = result.init) != null && _result$init2.headers ? new Headers(result.init.headers) : undefined
        };
      }
      // Convert thrown data() to ErrorResponse instances
      return {
        type: ResultType.error,
        error: new ErrorResponseImpl(((_result$init3 = result.init) == null ? void 0 : _result$init3.status) || 500, undefined, result.data),
        statusCode: isRouteErrorResponse(result) ? result.status : undefined,
        headers: (_result$init4 = result.init) != null && _result$init4.headers ? new Headers(result.init.headers) : undefined
      };
    }
    return {
      type: ResultType.error,
      error: result,
      statusCode: isRouteErrorResponse(result) ? result.status : undefined
    };
  }
  if (isDeferredData(result)) {
    var _result$init5, _result$init6;
    return {
      type: ResultType.deferred,
      deferredData: result,
      statusCode: (_result$init5 = result.init) == null ? void 0 : _result$init5.status,
      headers: ((_result$init6 = result.init) == null ? void 0 : _result$init6.headers) && new Headers(result.init.headers)
    };
  }
  if (isDataWithResponseInit(result)) {
    var _result$init7, _result$init8;
    return {
      type: ResultType.data,
      data: result.data,
      statusCode: (_result$init7 = result.init) == null ? void 0 : _result$init7.status,
      headers: (_result$init8 = result.init) != null && _result$init8.headers ? new Headers(result.init.headers) : undefined
    };
  }
  return {
    type: ResultType.data,
    data: result
  };
}
// Support relative routing in internal redirects
function normalizeRelativeRoutingRedirectResponse(response, request, routeId, matches, basename, v7_relativeSplatPath) {
  let location = response.headers.get("Location");
  invariant(location, "Redirects returned/thrown from loaders/actions must have a Location header");
  if (!ABSOLUTE_URL_REGEX.test(location)) {
    let trimmedMatches = matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1);
    location = normalizeTo(new URL(request.url), trimmedMatches, basename, true, location, v7_relativeSplatPath);
    response.headers.set("Location", location);
  }
  return response;
}
function normalizeRedirectLocation(location, currentUrl, basename) {
  if (ABSOLUTE_URL_REGEX.test(location)) {
    // Strip off the protocol+origin for same-origin + same-basename absolute redirects
    let normalizedLocation = location;
    let url = normalizedLocation.startsWith("//") ? new URL(currentUrl.protocol + normalizedLocation) : new URL(normalizedLocation);
    let isSameBasename = stripBasename(url.pathname, basename) != null;
    if (url.origin === currentUrl.origin && isSameBasename) {
      return url.pathname + url.search + url.hash;
    }
  }
  return location;
}
// Utility method for creating the Request instances for loaders/actions during
// client-side navigations and fetches.  During SSR we will always have a
// Request instance from the static handler (query/queryRoute)
function createClientSideRequest(history, location, signal, submission) {
  let url = history.createURL(stripHashFromPath(location)).toString();
  let init = {
    signal
  };
  if (submission && isMutationMethod(submission.formMethod)) {
    let {
      formMethod,
      formEncType
    } = submission;
    // Didn't think we needed this but it turns out unlike other methods, patch
    // won't be properly normalized to uppercase and results in a 405 error.
    // See: https://fetch.spec.whatwg.org/#concept-method
    init.method = formMethod.toUpperCase();
    if (formEncType === "application/json") {
      init.headers = new Headers({
        "Content-Type": formEncType
      });
      init.body = JSON.stringify(submission.json);
    } else if (formEncType === "text/plain") {
      // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)
      init.body = submission.text;
    } else if (formEncType === "application/x-www-form-urlencoded" && submission.formData) {
      // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)
      init.body = convertFormDataToSearchParams(submission.formData);
    } else {
      // Content-Type is inferred (https://fetch.spec.whatwg.org/#dom-request)
      init.body = submission.formData;
    }
  }
  return new Request(url, init);
}
function convertFormDataToSearchParams(formData) {
  let searchParams = new URLSearchParams();
  for (let [key, value] of formData.entries()) {
    // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#converting-an-entry-list-to-a-list-of-name-value-pairs
    searchParams.append(key, typeof value === "string" ? value : value.name);
  }
  return searchParams;
}
function convertSearchParamsToFormData(searchParams) {
  let formData = new FormData();
  for (let [key, value] of searchParams.entries()) {
    formData.append(key, value);
  }
  return formData;
}
function processRouteLoaderData(matches, results, pendingActionResult, activeDeferreds, skipLoaderErrorBubbling) {
  // Fill in loaderData/errors from our loaders
  let loaderData = {};
  let errors = null;
  let statusCode;
  let foundError = false;
  let loaderHeaders = {};
  let pendingError = pendingActionResult && isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : undefined;
  // Process loader results into state.loaderData/state.errors
  matches.forEach(match => {
    if (!(match.route.id in results)) {
      return;
    }
    let id = match.route.id;
    let result = results[id];
    invariant(!isRedirectResult(result), "Cannot handle redirect results in processLoaderData");
    if (isErrorResult(result)) {
      let error = result.error;
      // If we have a pending action error, we report it at the highest-route
      // that throws a loader error, and then clear it out to indicate that
      // it was consumed
      if (pendingError !== undefined) {
        error = pendingError;
        pendingError = undefined;
      }
      errors = errors || {};
      if (skipLoaderErrorBubbling) {
        errors[id] = error;
      } else {
        // Look upwards from the matched route for the closest ancestor error
        // boundary, defaulting to the root match.  Prefer higher error values
        // if lower errors bubble to the same boundary
        let boundaryMatch = findNearestBoundary(matches, id);
        if (errors[boundaryMatch.route.id] == null) {
          errors[boundaryMatch.route.id] = error;
        }
      }
      // Clear our any prior loaderData for the throwing route
      loaderData[id] = undefined;
      // Once we find our first (highest) error, we set the status code and
      // prevent deeper status codes from overriding
      if (!foundError) {
        foundError = true;
        statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500;
      }
      if (result.headers) {
        loaderHeaders[id] = result.headers;
      }
    } else {
      if (isDeferredResult(result)) {
        activeDeferreds.set(id, result.deferredData);
        loaderData[id] = result.deferredData.data;
        // Error status codes always override success status codes, but if all
        // loaders are successful we take the deepest status code.
        if (result.statusCode != null && result.statusCode !== 200 && !foundError) {
          statusCode = result.statusCode;
        }
        if (result.headers) {
          loaderHeaders[id] = result.headers;
        }
      } else {
        loaderData[id] = result.data;
        // Error status codes always override success status codes, but if all
        // loaders are successful we take the deepest status code.
        if (result.statusCode && result.statusCode !== 200 && !foundError) {
          statusCode = result.statusCode;
        }
        if (result.headers) {
          loaderHeaders[id] = result.headers;
        }
      }
    }
  });
  // If we didn't consume the pending action error (i.e., all loaders
  // resolved), then consume it here.  Also clear out any loaderData for the
  // throwing route
  if (pendingError !== undefined && pendingActionResult) {
    errors = {
      [pendingActionResult[0]]: pendingError
    };
    loaderData[pendingActionResult[0]] = undefined;
  }
  return {
    loaderData,
    errors,
    statusCode: statusCode || 200,
    loaderHeaders
  };
}
function processLoaderData(state, matches, results, pendingActionResult, revalidatingFetchers, fetcherResults, activeDeferreds) {
  let {
    loaderData,
    errors
  } = processRouteLoaderData(matches, results, pendingActionResult, activeDeferreds, false // This method is only called client side so we always want to bubble
  );
  // Process results from our revalidating fetchers
  revalidatingFetchers.forEach(rf => {
    let {
      key,
      match,
      controller
    } = rf;
    let result = fetcherResults[key];
    invariant(result, "Did not find corresponding fetcher result");
    // Process fetcher non-redirect errors
    if (controller && controller.signal.aborted) {
      // Nothing to do for aborted fetchers
      return;
    } else if (isErrorResult(result)) {
      let boundaryMatch = findNearestBoundary(state.matches, match == null ? void 0 : match.route.id);
      if (!(errors && errors[boundaryMatch.route.id])) {
        errors = _extends({}, errors, {
          [boundaryMatch.route.id]: result.error
        });
      }
      state.fetchers.delete(key);
    } else if (isRedirectResult(result)) {
      // Should never get here, redirects should get processed above, but we
      // keep this to type narrow to a success result in the else
      invariant(false, "Unhandled fetcher revalidation redirect");
    } else if (isDeferredResult(result)) {
      // Should never get here, deferred data should be awaited for fetchers
      // in resolveDeferredResults
      invariant(false, "Unhandled fetcher deferred data");
    } else {
      let doneFetcher = getDoneFetcher(result.data);
      state.fetchers.set(key, doneFetcher);
    }
  });
  return {
    loaderData,
    errors
  };
}
function mergeLoaderData(loaderData, newLoaderData, matches, errors) {
  let mergedLoaderData = _extends({}, newLoaderData);
  for (let match of matches) {
    let id = match.route.id;
    if (newLoaderData.hasOwnProperty(id)) {
      if (newLoaderData[id] !== undefined) {
        mergedLoaderData[id] = newLoaderData[id];
      }
    } else if (loaderData[id] !== undefined && match.route.loader) {
      // Preserve existing keys not included in newLoaderData and where a loader
      // wasn't removed by HMR
      mergedLoaderData[id] = loaderData[id];
    }
    if (errors && errors.hasOwnProperty(id)) {
      // Don't keep any loader data below the boundary
      break;
    }
  }
  return mergedLoaderData;
}
function getActionDataForCommit(pendingActionResult) {
  if (!pendingActionResult) {
    return {};
  }
  return isErrorResult(pendingActionResult[1]) ? {
    // Clear out prior actionData on errors
    actionData: {}
  } : {
    actionData: {
      [pendingActionResult[0]]: pendingActionResult[1].data
    }
  };
}
// Find the nearest error boundary, looking upwards from the leaf route (or the
// route specified by routeId) for the closest ancestor error boundary,
// defaulting to the root match
function findNearestBoundary(matches, routeId) {
  let eligibleMatches = routeId ? matches.slice(0, matches.findIndex(m => m.route.id === routeId) + 1) : [...matches];
  return eligibleMatches.reverse().find(m => m.route.hasErrorBoundary === true) || matches[0];
}
function getShortCircuitMatches(routes) {
  // Prefer a root layout route if present, otherwise shim in a route object
  let route = routes.length === 1 ? routes[0] : routes.find(r => r.index || !r.path || r.path === "/") || {
    id: "__shim-error-route__"
  };
  return {
    matches: [{
      params: {},
      pathname: "",
      pathnameBase: "",
      route
    }],
    route
  };
}
function getInternalRouterError(status, _temp5) {
  let {
    pathname,
    routeId,
    method,
    type,
    message
  } = _temp5 === void 0 ? {} : _temp5;
  let statusText = "Unknown Server Error";
  let errorMessage = "Unknown @remix-run/router error";
  if (status === 400) {
    statusText = "Bad Request";
    if (method && pathname && routeId) {
      errorMessage = "You made a " + method + " request to \"" + pathname + "\" but " + ("did not provide a `loader` for route \"" + routeId + "\", ") + "so there is no way to handle the request.";
    } else if (type === "defer-action") {
      errorMessage = "defer() is not supported in actions";
    } else if (type === "invalid-body") {
      errorMessage = "Unable to encode submission body";
    }
  } else if (status === 403) {
    statusText = "Forbidden";
    errorMessage = "Route \"" + routeId + "\" does not match URL \"" + pathname + "\"";
  } else if (status === 404) {
    statusText = "Not Found";
    errorMessage = "No route matches URL \"" + pathname + "\"";
  } else if (status === 405) {
    statusText = "Method Not Allowed";
    if (method && pathname && routeId) {
      errorMessage = "You made a " + method.toUpperCase() + " request to \"" + pathname + "\" but " + ("did not provide an `action` for route \"" + routeId + "\", ") + "so there is no way to handle the request.";
    } else if (method) {
      errorMessage = "Invalid request method \"" + method.toUpperCase() + "\"";
    }
  }
  return new ErrorResponseImpl(status || 500, statusText, new Error(errorMessage), true);
}
// Find any returned redirect errors, starting from the lowest match
function findRedirect(results) {
  let entries = Object.entries(results);
  for (let i = entries.length - 1; i >= 0; i--) {
    let [key, result] = entries[i];
    if (isRedirectResult(result)) {
      return {
        key,
        result
      };
    }
  }
}
function stripHashFromPath(path) {
  let parsedPath = typeof path === "string" ? parsePath(path) : path;
  return createPath(_extends({}, parsedPath, {
    hash: ""
  }));
}
function isHashChangeOnly(a, b) {
  if (a.pathname !== b.pathname || a.search !== b.search) {
    return false;
  }
  if (a.hash === "") {
    // /page -> /page#hash
    return b.hash !== "";
  } else if (a.hash === b.hash) {
    // /page#hash -> /page#hash
    return true;
  } else if (b.hash !== "") {
    // /page#hash -> /page#other
    return true;
  }
  // If the hash is removed the browser will re-perform a request to the server
  // /page#hash -> /page
  return false;
}
function isDataStrategyResult(result) {
  return result != null && typeof result === "object" && "type" in result && "result" in result && (result.type === ResultType.data || result.type === ResultType.error);
}
function isRedirectDataStrategyResultResult(result) {
  return isResponse(result.result) && redirectStatusCodes.has(result.result.status);
}
function isDeferredResult(result) {
  return result.type === ResultType.deferred;
}
function isErrorResult(result) {
  return result.type === ResultType.error;
}
function isRedirectResult(result) {
  return (result && result.type) === ResultType.redirect;
}
function isDataWithResponseInit(value) {
  return typeof value === "object" && value != null && "type" in value && "data" in value && "init" in value && value.type === "DataWithResponseInit";
}
function isDeferredData(value) {
  let deferred = value;
  return deferred && typeof deferred === "object" && typeof deferred.data === "object" && typeof deferred.subscribe === "function" && typeof deferred.cancel === "function" && typeof deferred.resolveData === "function";
}
function isResponse(value) {
  return value != null && typeof value.status === "number" && typeof value.statusText === "string" && typeof value.headers === "object" && typeof value.body !== "undefined";
}
function isRedirectResponse(result) {
  if (!isResponse(result)) {
    return false;
  }
  let status = result.status;
  let location = result.headers.get("Location");
  return status >= 300 && status <= 399 && location != null;
}
function isValidMethod(method) {
  return validRequestMethods.has(method.toLowerCase());
}
function isMutationMethod(method) {
  return validMutationMethods.has(method.toLowerCase());
}
async function resolveNavigationDeferredResults(matches, results, signal, currentMatches, currentLoaderData) {
  let entries = Object.entries(results);
  for (let index = 0; index < entries.length; index++) {
    let [routeId, result] = entries[index];
    let match = matches.find(m => (m == null ? void 0 : m.route.id) === routeId);
    // If we don't have a match, then we can have a deferred result to do
    // anything with.  This is for revalidating fetchers where the route was
    // removed during HMR
    if (!match) {
      continue;
    }
    let currentMatch = currentMatches.find(m => m.route.id === match.route.id);
    let isRevalidatingLoader = currentMatch != null && !isNewRouteInstance(currentMatch, match) && (currentLoaderData && currentLoaderData[match.route.id]) !== undefined;
    if (isDeferredResult(result) && isRevalidatingLoader) {
      // Note: we do not have to touch activeDeferreds here since we race them
      // against the signal in resolveDeferredData and they'll get aborted
      // there if needed
      await resolveDeferredData(result, signal, false).then(result => {
        if (result) {
          results[routeId] = result;
        }
      });
    }
  }
}
async function resolveFetcherDeferredResults(matches, results, revalidatingFetchers) {
  for (let index = 0; index < revalidatingFetchers.length; index++) {
    let {
      key,
      routeId,
      controller
    } = revalidatingFetchers[index];
    let result = results[key];
    let match = matches.find(m => (m == null ? void 0 : m.route.id) === routeId);
    // If we don't have a match, then we can have a deferred result to do
    // anything with.  This is for revalidating fetchers where the route was
    // removed during HMR
    if (!match) {
      continue;
    }
    if (isDeferredResult(result)) {
      // Note: we do not have to touch activeDeferreds here since we race them
      // against the signal in resolveDeferredData and they'll get aborted
      // there if needed
      invariant(controller, "Expected an AbortController for revalidating fetcher deferred result");
      await resolveDeferredData(result, controller.signal, true).then(result => {
        if (result) {
          results[key] = result;
        }
      });
    }
  }
}
async function resolveDeferredData(result, signal, unwrap) {
  if (unwrap === void 0) {
    unwrap = false;
  }
  let aborted = await result.deferredData.resolveData(signal);
  if (aborted) {
    return;
  }
  if (unwrap) {
    try {
      return {
        type: ResultType.data,
        data: result.deferredData.unwrappedData
      };
    } catch (e) {
      // Handle any TrackedPromise._error values encountered while unwrapping
      return {
        type: ResultType.error,
        error: e
      };
    }
  }
  return {
    type: ResultType.data,
    data: result.deferredData.data
  };
}
function hasNakedIndexQuery(search) {
  return new URLSearchParams(search).getAll("index").some(v => v === "");
}
function getTargetMatch(matches, location) {
  let search = typeof location === "string" ? parsePath(location).search : location.search;
  if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || "")) {
    // Return the leaf index route when index is present
    return matches[matches.length - 1];
  }
  // Otherwise grab the deepest "path contributing" match (ignoring index and
  // pathless layout routes)
  let pathMatches = getPathContributingMatches(matches);
  return pathMatches[pathMatches.length - 1];
}
function getSubmissionFromNavigation(navigation) {
  let {
    formMethod,
    formAction,
    formEncType,
    text,
    formData,
    json
  } = navigation;
  if (!formMethod || !formAction || !formEncType) {
    return;
  }
  if (text != null) {
    return {
      formMethod,
      formAction,
      formEncType,
      formData: undefined,
      json: undefined,
      text
    };
  } else if (formData != null) {
    return {
      formMethod,
      formAction,
      formEncType,
      formData,
      json: undefined,
      text: undefined
    };
  } else if (json !== undefined) {
    return {
      formMethod,
      formAction,
      formEncType,
      formData: undefined,
      json,
      text: undefined
    };
  }
}
function getLoadingNavigation(location, submission) {
  if (submission) {
    let navigation = {
      state: "loading",
      location,
      formMethod: submission.formMethod,
      formAction: submission.formAction,
      formEncType: submission.formEncType,
      formData: submission.formData,
      json: submission.json,
      text: submission.text
    };
    return navigation;
  } else {
    let navigation = {
      state: "loading",
      location,
      formMethod: undefined,
      formAction: undefined,
      formEncType: undefined,
      formData: undefined,
      json: undefined,
      text: undefined
    };
    return navigation;
  }
}
function getSubmittingNavigation(location, submission) {
  let navigation = {
    state: "submitting",
    location,
    formMethod: submission.formMethod,
    formAction: submission.formAction,
    formEncType: submission.formEncType,
    formData: submission.formData,
    json: submission.json,
    text: submission.text
  };
  return navigation;
}
function getLoadingFetcher(submission, data) {
  if (submission) {
    let fetcher = {
      state: "loading",
      formMethod: submission.formMethod,
      formAction: submission.formAction,
      formEncType: submission.formEncType,
      formData: submission.formData,
      json: submission.json,
      text: submission.text,
      data
    };
    return fetcher;
  } else {
    let fetcher = {
      state: "loading",
      formMethod: undefined,
      formAction: undefined,
      formEncType: undefined,
      formData: undefined,
      json: undefined,
      text: undefined,
      data
    };
    return fetcher;
  }
}
function getSubmittingFetcher(submission, existingFetcher) {
  let fetcher = {
    state: "submitting",
    formMethod: submission.formMethod,
    formAction: submission.formAction,
    formEncType: submission.formEncType,
    formData: submission.formData,
    json: submission.json,
    text: submission.text,
    data: existingFetcher ? existingFetcher.data : undefined
  };
  return fetcher;
}
function getDoneFetcher(data) {
  let fetcher = {
    state: "idle",
    formMethod: undefined,
    formAction: undefined,
    formEncType: undefined,
    formData: undefined,
    json: undefined,
    text: undefined,
    data
  };
  return fetcher;
}
function restoreAppliedTransitions(_window, transitions) {
  try {
    let sessionPositions = _window.sessionStorage.getItem(TRANSITIONS_STORAGE_KEY);
    if (sessionPositions) {
      let json = JSON.parse(sessionPositions);
      for (let [k, v] of Object.entries(json || {})) {
        if (v && Array.isArray(v)) {
          transitions.set(k, new Set(v || []));
        }
      }
    }
  } catch (e) {
    // no-op, use default empty object
  }
}
function persistAppliedTransitions(_window, transitions) {
  if (transitions.size > 0) {
    let json = {};
    for (let [k, v] of transitions) {
      json[k] = [...v];
    }
    try {
      _window.sessionStorage.setItem(TRANSITIONS_STORAGE_KEY, JSON.stringify(json));
    } catch (error) {
      warning(false, "Failed to save applied view transitions in sessionStorage (" + error + ").");
    }
  }
}
//#endregion


//# sourceMappingURL=router.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/Icon.js":
/*!****************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/Icon.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Icon)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _defaultAttributes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./defaultAttributes.js */ "./node_modules/lucide-react/dist/esm/defaultAttributes.js");
/* harmony import */ var _shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shared/src/utils.js */ "./node_modules/lucide-react/dist/esm/shared/src/utils.js");
/**
 * @license lucide-react v0.417.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 = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
  ({
    color = "currentColor",
    size = 24,
    strokeWidth = 2,
    absoluteStrokeWidth,
    className = "",
    children,
    iconNode,
    ...rest
  }, ref) => {
    return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(
      "svg",
      {
        ref,
        ..._defaultAttributes_js__WEBPACK_IMPORTED_MODULE_1__["default"],
        width: size,
        height: size,
        stroke: color,
        strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
        className: (0,_shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__.mergeClasses)("lucide", className),
        ...rest
      },
      [
        ...iconNode.map(([tag, attrs]) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(tag, attrs)),
        ...Array.isArray(children) ? children : [children]
      ]
    );
  }
);


//# sourceMappingURL=Icon.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/createLucideIcon.js":
/*!****************************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/createLucideIcon.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ createLucideIcon)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shared/src/utils.js */ "./node_modules/lucide-react/dist/esm/shared/src/utils.js");
/* harmony import */ var _Icon_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Icon.js */ "./node_modules/lucide-react/dist/esm/Icon.js");
/**
 * @license lucide-react v0.417.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 = (iconName, iconNode) => {
  const Component = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(
    ({ className, ...props }, ref) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Icon_js__WEBPACK_IMPORTED_MODULE_1__["default"], {
      ref,
      iconNode,
      className: (0,_shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__.mergeClasses)(`lucide-${(0,_shared_src_utils_js__WEBPACK_IMPORTED_MODULE_2__.toKebabCase)(iconName)}`, className),
      ...props
    })
  );
  Component.displayName = `${iconName}`;
  return Component;
};


//# sourceMappingURL=createLucideIcon.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/defaultAttributes.js":
/*!*****************************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/defaultAttributes.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ defaultAttributes)
/* harmony export */ });
/**
 * @license lucide-react v0.417.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"
};


//# sourceMappingURL=defaultAttributes.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/icons/archive.js":
/*!*************************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/icons/archive.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Archive)
/* harmony export */ });
/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ "./node_modules/lucide-react/dist/esm/createLucideIcon.js");
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */



const Archive = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__["default"])("Archive", [
  ["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
  ["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "1s80jp" }],
  ["path", { d: "M10 12h4", key: "a56b0p" }]
]);


//# sourceMappingURL=archive.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/icons/arrow-up-right.js":
/*!********************************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/icons/arrow-up-right.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ArrowUpRight)
/* harmony export */ });
/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ "./node_modules/lucide-react/dist/esm/createLucideIcon.js");
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */



const ArrowUpRight = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__["default"])("ArrowUpRight", [
  ["path", { d: "M7 7h10v10", key: "1tivn9" }],
  ["path", { d: "M7 17 17 7", key: "1vkiza" }]
]);


//# sourceMappingURL=arrow-up-right.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/icons/circle-help.js":
/*!*****************************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/icons/circle-help.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ CircleHelp)
/* harmony export */ });
/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ "./node_modules/lucide-react/dist/esm/createLucideIcon.js");
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */



const CircleHelp = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__["default"])("CircleHelp", [
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
  ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
  ["path", { d: "M12 17h.01", key: "p32p05" }]
]);


//# sourceMappingURL=circle-help.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/icons/code-xml.js":
/*!**************************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/icons/code-xml.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ CodeXml)
/* harmony export */ });
/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ "./node_modules/lucide-react/dist/esm/createLucideIcon.js");
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */



const CodeXml = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__["default"])("CodeXml", [
  ["path", { d: "m18 16 4-4-4-4", key: "1inbqp" }],
  ["path", { d: "m6 8-4 4 4 4", key: "15zrgr" }],
  ["path", { d: "m14.5 4-5 16", key: "e7oirm" }]
]);


//# sourceMappingURL=code-xml.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/icons/crown.js":
/*!***********************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/icons/crown.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Crown)
/* harmony export */ });
/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ "./node_modules/lucide-react/dist/esm/createLucideIcon.js");
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */



const Crown = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__["default"])("Crown", [
  [
    "path",
    {
      d: "M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",
      key: "1vdc57"
    }
  ],
  ["path", { d: "M5 21h14", key: "11awu3" }]
]);


//# sourceMappingURL=crown.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/icons/layout-grid.js":
/*!*****************************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/icons/layout-grid.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ LayoutGrid)
/* harmony export */ });
/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ "./node_modules/lucide-react/dist/esm/createLucideIcon.js");
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */



const LayoutGrid = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__["default"])("LayoutGrid", [
  ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
  ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
  ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
  ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
]);


//# sourceMappingURL=layout-grid.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/icons/layout-list.js":
/*!*****************************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/icons/layout-list.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ LayoutList)
/* harmony export */ });
/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ "./node_modules/lucide-react/dist/esm/createLucideIcon.js");
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */



const LayoutList = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__["default"])("LayoutList", [
  ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
  ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }],
  ["path", { d: "M14 4h7", key: "3xa0d5" }],
  ["path", { d: "M14 9h7", key: "1icrd9" }],
  ["path", { d: "M14 15h7", key: "1mj8o2" }],
  ["path", { d: "M14 20h7", key: "11slyb" }]
]);


//# sourceMappingURL=layout-list.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/icons/list.js":
/*!**********************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/icons/list.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ List)
/* harmony export */ });
/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ "./node_modules/lucide-react/dist/esm/createLucideIcon.js");
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */



const List = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__["default"])("List", [
  ["line", { x1: "8", x2: "21", y1: "6", y2: "6", key: "7ey8pc" }],
  ["line", { x1: "8", x2: "21", y1: "12", y2: "12", key: "rjfblc" }],
  ["line", { x1: "8", x2: "21", y1: "18", y2: "18", key: "c3b1m8" }],
  ["line", { x1: "3", x2: "3.01", y1: "6", y2: "6", key: "1g7gq3" }],
  ["line", { x1: "3", x2: "3.01", y1: "12", y2: "12", key: "1pjlvk" }],
  ["line", { x1: "3", x2: "3.01", y1: "18", y2: "18", key: "28t2mc" }]
]);


//# sourceMappingURL=list.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/icons/lock.js":
/*!**********************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/icons/lock.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Lock)
/* harmony export */ });
/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ "./node_modules/lucide-react/dist/esm/createLucideIcon.js");
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */



const Lock = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__["default"])("Lock", [
  ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
  ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
]);


//# sourceMappingURL=lock.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/icons/panel-bottom.js":
/*!******************************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/icons/panel-bottom.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ PanelBottom)
/* harmony export */ });
/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ "./node_modules/lucide-react/dist/esm/createLucideIcon.js");
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */



const PanelBottom = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__["default"])("PanelBottom", [
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
  ["path", { d: "M3 15h18", key: "5xshup" }]
]);


//# sourceMappingURL=panel-bottom.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/icons/panel-top.js":
/*!***************************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/icons/panel-top.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ PanelTop)
/* harmony export */ });
/* harmony import */ var _createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLucideIcon.js */ "./node_modules/lucide-react/dist/esm/createLucideIcon.js");
/**
 * @license lucide-react v0.417.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */



const PanelTop = (0,_createLucideIcon_js__WEBPACK_IMPORTED_MODULE_0__["default"])("PanelTop", [
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
  ["path", { d: "M3 9h18", key: "1pudct" }]
]);


//# sourceMappingURL=panel-top.js.map


/***/ }),

/***/ "./node_modules/lucide-react/dist/esm/shared/src/utils.js":
/*!****************************************************************!*\
  !*** ./node_modules/lucide-react/dist/esm/shared/src/utils.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   mergeClasses: () => (/* binding */ mergeClasses),
/* harmony export */   toKebabCase: () => (/* binding */ toKebabCase)
/* harmony export */ });
/**
 * @license lucide-react v0.417.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 = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
const mergeClasses = (...classes) => classes.filter((className, index, array) => {
  return Boolean(className) && array.indexOf(className) === index;
}).join(" ");


//# sourceMappingURL=utils.js.map


/***/ }),

/***/ "./node_modules/react-router-dom/dist/index.js":
/*!*****************************************************!*\
  !*** ./node_modules/react-router-dom/dist/index.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AbortedDeferredError: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.AbortedDeferredError),
/* harmony export */   Await: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.Await),
/* harmony export */   BrowserRouter: () => (/* binding */ BrowserRouter),
/* harmony export */   Form: () => (/* binding */ Form),
/* harmony export */   HashRouter: () => (/* binding */ HashRouter),
/* harmony export */   Link: () => (/* binding */ Link),
/* harmony export */   MemoryRouter: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.MemoryRouter),
/* harmony export */   NavLink: () => (/* binding */ NavLink),
/* harmony export */   Navigate: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.Navigate),
/* harmony export */   NavigationType: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.Action),
/* harmony export */   Outlet: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.Outlet),
/* harmony export */   Route: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.Route),
/* harmony export */   Router: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.Router),
/* harmony export */   RouterProvider: () => (/* binding */ RouterProvider),
/* harmony export */   Routes: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.Routes),
/* harmony export */   ScrollRestoration: () => (/* binding */ ScrollRestoration),
/* harmony export */   UNSAFE_DataRouterContext: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_DataRouterContext),
/* harmony export */   UNSAFE_DataRouterStateContext: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_DataRouterStateContext),
/* harmony export */   UNSAFE_ErrorResponseImpl: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_ErrorResponseImpl),
/* harmony export */   UNSAFE_FetchersContext: () => (/* binding */ FetchersContext),
/* harmony export */   UNSAFE_LocationContext: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_LocationContext),
/* harmony export */   UNSAFE_NavigationContext: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_NavigationContext),
/* harmony export */   UNSAFE_RouteContext: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_RouteContext),
/* harmony export */   UNSAFE_ViewTransitionContext: () => (/* binding */ ViewTransitionContext),
/* harmony export */   UNSAFE_useRouteId: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_useRouteId),
/* harmony export */   UNSAFE_useScrollRestoration: () => (/* binding */ useScrollRestoration),
/* harmony export */   createBrowserRouter: () => (/* binding */ createBrowserRouter),
/* harmony export */   createHashRouter: () => (/* binding */ createHashRouter),
/* harmony export */   createMemoryRouter: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.createMemoryRouter),
/* harmony export */   createPath: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.createPath),
/* harmony export */   createRoutesFromChildren: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.createRoutesFromChildren),
/* harmony export */   createRoutesFromElements: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.createRoutesFromElements),
/* harmony export */   createSearchParams: () => (/* binding */ createSearchParams),
/* harmony export */   defer: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.defer),
/* harmony export */   generatePath: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.generatePath),
/* harmony export */   isRouteErrorResponse: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.isRouteErrorResponse),
/* harmony export */   json: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.json),
/* harmony export */   matchPath: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.matchPath),
/* harmony export */   matchRoutes: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.matchRoutes),
/* harmony export */   parsePath: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.parsePath),
/* harmony export */   redirect: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.redirect),
/* harmony export */   redirectDocument: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.redirectDocument),
/* harmony export */   renderMatches: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.renderMatches),
/* harmony export */   replace: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.replace),
/* harmony export */   resolvePath: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_2__.resolvePath),
/* harmony export */   unstable_HistoryRouter: () => (/* binding */ HistoryRouter),
/* harmony export */   unstable_usePrompt: () => (/* binding */ usePrompt),
/* harmony export */   useActionData: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useActionData),
/* harmony export */   useAsyncError: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useAsyncError),
/* harmony export */   useAsyncValue: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useAsyncValue),
/* harmony export */   useBeforeUnload: () => (/* binding */ useBeforeUnload),
/* harmony export */   useBlocker: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useBlocker),
/* harmony export */   useFetcher: () => (/* binding */ useFetcher),
/* harmony export */   useFetchers: () => (/* binding */ useFetchers),
/* harmony export */   useFormAction: () => (/* binding */ useFormAction),
/* harmony export */   useHref: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useHref),
/* harmony export */   useInRouterContext: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useInRouterContext),
/* harmony export */   useLinkClickHandler: () => (/* binding */ useLinkClickHandler),
/* harmony export */   useLoaderData: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useLoaderData),
/* harmony export */   useLocation: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useLocation),
/* harmony export */   useMatch: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useMatch),
/* harmony export */   useMatches: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useMatches),
/* harmony export */   useNavigate: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useNavigate),
/* harmony export */   useNavigation: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useNavigation),
/* harmony export */   useNavigationType: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useNavigationType),
/* harmony export */   useOutlet: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useOutlet),
/* harmony export */   useOutletContext: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useOutletContext),
/* harmony export */   useParams: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useParams),
/* harmony export */   useResolvedPath: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useResolvedPath),
/* harmony export */   useRevalidator: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useRevalidator),
/* harmony export */   useRouteError: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useRouteError),
/* harmony export */   useRouteLoaderData: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useRouteLoaderData),
/* harmony export */   useRoutes: () => (/* reexport safe */ react_router__WEBPACK_IMPORTED_MODULE_3__.useRoutes),
/* harmony export */   useSearchParams: () => (/* binding */ useSearchParams),
/* harmony export */   useSubmit: () => (/* binding */ useSubmit),
/* harmony export */   useViewTransitionState: () => (/* binding */ useViewTransitionState)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "react-dom");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router */ "./node_modules/react-router/dist/index.js");
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @remix-run/router */ "./node_modules/@remix-run/router/dist/router.js");
/**
 * React Router DOM v6.30.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */







function _extends() {
  _extends = Object.assign ? Object.assign.bind() : function (target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends.apply(this, arguments);
}
function _objectWithoutPropertiesLoose(source, excluded) {
  if (source == null) return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i;
  for (i = 0; i < sourceKeys.length; i++) {
    key = sourceKeys[i];
    if (excluded.indexOf(key) >= 0) continue;
    target[key] = source[key];
  }
  return target;
}

const defaultMethod = "get";
const defaultEncType = "application/x-www-form-urlencoded";
function isHtmlElement(object) {
  return object != null && typeof object.tagName === "string";
}
function isButtonElement(object) {
  return isHtmlElement(object) && object.tagName.toLowerCase() === "button";
}
function isFormElement(object) {
  return isHtmlElement(object) && object.tagName.toLowerCase() === "form";
}
function isInputElement(object) {
  return isHtmlElement(object) && object.tagName.toLowerCase() === "input";
}
function isModifiedEvent(event) {
  return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
}
function shouldProcessLinkClick(event, target) {
  return event.button === 0 && (
  // Ignore everything but left clicks
  !target || target === "_self") &&
  // Let browser handle "target=_blank" etc.
  !isModifiedEvent(event) // Ignore clicks with modifier keys
  ;
}
/**
 * Creates a URLSearchParams object using the given initializer.
 *
 * This is identical to `new URLSearchParams(init)` except it also
 * supports arrays as values in the object form of the initializer
 * instead of just strings. This is convenient when you need multiple
 * values for a given key, but don't want to use an array initializer.
 *
 * For example, instead of:
 *
 *   let searchParams = new URLSearchParams([
 *     ['sort', 'name'],
 *     ['sort', 'price']
 *   ]);
 *
 * you can do:
 *
 *   let searchParams = createSearchParams({
 *     sort: ['name', 'price']
 *   });
 */
function createSearchParams(init) {
  if (init === void 0) {
    init = "";
  }
  return new URLSearchParams(typeof init === "string" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo, key) => {
    let value = init[key];
    return memo.concat(Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]);
  }, []));
}
function getSearchParamsForLocation(locationSearch, defaultSearchParams) {
  let searchParams = createSearchParams(locationSearch);
  if (defaultSearchParams) {
    // Use `defaultSearchParams.forEach(...)` here instead of iterating of
    // `defaultSearchParams.keys()` to work-around a bug in Firefox related to
    // web extensions. Relevant Bugzilla tickets:
    // https://bugzilla.mozilla.org/show_bug.cgi?id=1414602
    // https://bugzilla.mozilla.org/show_bug.cgi?id=1023984
    defaultSearchParams.forEach((_, key) => {
      if (!searchParams.has(key)) {
        defaultSearchParams.getAll(key).forEach(value => {
          searchParams.append(key, value);
        });
      }
    });
  }
  return searchParams;
}
// One-time check for submitter support
let _formDataSupportsSubmitter = null;
function isFormDataSubmitterSupported() {
  if (_formDataSupportsSubmitter === null) {
    try {
      new FormData(document.createElement("form"),
      // @ts-expect-error if FormData supports the submitter parameter, this will throw
      0);
      _formDataSupportsSubmitter = false;
    } catch (e) {
      _formDataSupportsSubmitter = true;
    }
  }
  return _formDataSupportsSubmitter;
}
const supportedFormEncTypes = new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
function getFormEncType(encType) {
  if (encType != null && !supportedFormEncTypes.has(encType)) {
     true ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_warning)(false, "\"" + encType + "\" is not a valid `encType` for `<Form>`/`<fetcher.Form>` " + ("and will default to \"" + defaultEncType + "\"")) : 0;
    return null;
  }
  return encType;
}
function getFormSubmissionInfo(target, basename) {
  let method;
  let action;
  let encType;
  let formData;
  let body;
  if (isFormElement(target)) {
    // When grabbing the action from the element, it will have had the basename
    // prefixed to ensure non-JS scenarios work, so strip it since we'll
    // re-prefix in the router
    let attr = target.getAttribute("action");
    action = attr ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.stripBasename)(attr, basename) : null;
    method = target.getAttribute("method") || defaultMethod;
    encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
    formData = new FormData(target);
  } else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) {
    let form = target.form;
    if (form == null) {
      throw new Error("Cannot submit a <button> or <input type=\"submit\"> without a <form>");
    }
    // <button>/<input type="submit"> may override attributes of <form>
    // When grabbing the action from the element, it will have had the basename
    // prefixed to ensure non-JS scenarios work, so strip it since we'll
    // re-prefix in the router
    let attr = target.getAttribute("formaction") || form.getAttribute("action");
    action = attr ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.stripBasename)(attr, basename) : null;
    method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
    encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
    // Build a FormData object populated from a form and submitter
    formData = new FormData(form, target);
    // If this browser doesn't support the `FormData(el, submitter)` format,
    // then tack on the submitter value at the end.  This is a lightweight
    // solution that is not 100% spec compliant.  For complete support in older
    // browsers, consider using the `formdata-submitter-polyfill` package
    if (!isFormDataSubmitterSupported()) {
      let {
        name,
        type,
        value
      } = target;
      if (type === "image") {
        let prefix = name ? name + "." : "";
        formData.append(prefix + "x", "0");
        formData.append(prefix + "y", "0");
      } else if (name) {
        formData.append(name, value);
      }
    }
  } else if (isHtmlElement(target)) {
    throw new Error("Cannot submit element that is not <form>, <button>, or " + "<input type=\"submit|image\">");
  } else {
    method = defaultMethod;
    action = null;
    encType = defaultEncType;
    body = target;
  }
  // Send body for <Form encType="text/plain" so we encode it into text
  if (formData && encType === "text/plain") {
    body = formData;
    formData = undefined;
  }
  return {
    action,
    method: method.toLowerCase(),
    encType,
    formData,
    body
  };
}

const _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "viewTransition"],
  _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "viewTransition", "children"],
  _excluded3 = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "viewTransition"];
// HEY YOU! DON'T TOUCH THIS VARIABLE!
//
// It is replaced with the proper version at build time via a babel plugin in
// the rollup config.
//
// Export a global property onto the window for React Router detection by the
// Core Web Vitals Technology Report.  This way they can configure the `wappalyzer`
// to detect and properly classify live websites as being built with React Router:
// https://github.com/HTTPArchive/wappalyzer/blob/main/src/technologies/r.json
const REACT_ROUTER_VERSION = "6";
try {
  window.__reactRouterVersion = REACT_ROUTER_VERSION;
} catch (e) {
  // no-op
}
function createBrowserRouter(routes, opts) {
  return (0,react_router__WEBPACK_IMPORTED_MODULE_2__.createRouter)({
    basename: opts == null ? void 0 : opts.basename,
    future: _extends({}, opts == null ? void 0 : opts.future, {
      v7_prependBasename: true
    }),
    history: (0,react_router__WEBPACK_IMPORTED_MODULE_2__.createBrowserHistory)({
      window: opts == null ? void 0 : opts.window
    }),
    hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(),
    routes,
    mapRouteProperties: react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_mapRouteProperties,
    dataStrategy: opts == null ? void 0 : opts.dataStrategy,
    patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation,
    window: opts == null ? void 0 : opts.window
  }).initialize();
}
function createHashRouter(routes, opts) {
  return (0,react_router__WEBPACK_IMPORTED_MODULE_2__.createRouter)({
    basename: opts == null ? void 0 : opts.basename,
    future: _extends({}, opts == null ? void 0 : opts.future, {
      v7_prependBasename: true
    }),
    history: (0,react_router__WEBPACK_IMPORTED_MODULE_2__.createHashHistory)({
      window: opts == null ? void 0 : opts.window
    }),
    hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(),
    routes,
    mapRouteProperties: react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_mapRouteProperties,
    dataStrategy: opts == null ? void 0 : opts.dataStrategy,
    patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation,
    window: opts == null ? void 0 : opts.window
  }).initialize();
}
function parseHydrationData() {
  var _window;
  let state = (_window = window) == null ? void 0 : _window.__staticRouterHydrationData;
  if (state && state.errors) {
    state = _extends({}, state, {
      errors: deserializeErrors(state.errors)
    });
  }
  return state;
}
function deserializeErrors(errors) {
  if (!errors) return null;
  let entries = Object.entries(errors);
  let serialized = {};
  for (let [key, val] of entries) {
    // Hey you!  If you change this, please change the corresponding logic in
    // serializeErrors in react-router-dom/server.tsx :)
    if (val && val.__type === "RouteErrorResponse") {
      serialized[key] = new react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_ErrorResponseImpl(val.status, val.statusText, val.data, val.internal === true);
    } else if (val && val.__type === "Error") {
      // Attempt to reconstruct the right type of Error (i.e., ReferenceError)
      if (val.__subType) {
        let ErrorConstructor = window[val.__subType];
        if (typeof ErrorConstructor === "function") {
          try {
            // @ts-expect-error
            let error = new ErrorConstructor(val.message);
            // Wipe away the client-side stack trace.  Nothing to fill it in with
            // because we don't serialize SSR stack traces for security reasons
            error.stack = "";
            serialized[key] = error;
          } catch (e) {
            // no-op - fall through and create a normal Error
          }
        }
      }
      if (serialized[key] == null) {
        let error = new Error(val.message);
        // Wipe away the client-side stack trace.  Nothing to fill it in with
        // because we don't serialize SSR stack traces for security reasons
        error.stack = "";
        serialized[key] = error;
      }
    } else {
      serialized[key] = val;
    }
  }
  return serialized;
}
const ViewTransitionContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext({
  isTransitioning: false
});
if (true) {
  ViewTransitionContext.displayName = "ViewTransition";
}
const FetchersContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(new Map());
if (true) {
  FetchersContext.displayName = "Fetchers";
}
//#endregion
////////////////////////////////////////////////////////////////////////////////
//#region Components
////////////////////////////////////////////////////////////////////////////////
/**
  Webpack + React 17 fails to compile on any of the following because webpack
  complains that `startTransition` doesn't exist in `React`:
  * import { startTransition } from "react"
  * import * as React from from "react";
    "startTransition" in React ? React.startTransition(() => setState()) : setState()
  * import * as React from from "react";
    "startTransition" in React ? React["startTransition"](() => setState()) : setState()

  Moving it to a constant such as the following solves the Webpack/React 17 issue:
  * import * as React from from "react";
    const START_TRANSITION = "startTransition";
    START_TRANSITION in React ? React[START_TRANSITION](() => setState()) : setState()

  However, that introduces webpack/terser minification issues in production builds
  in React 18 where minification/obfuscation ends up removing the call of
  React.startTransition entirely from the first half of the ternary.  Grabbing
  this exported reference once up front resolves that issue.

  See https://github.com/remix-run/react-router/issues/10579
*/
const START_TRANSITION = "startTransition";
const startTransitionImpl = react__WEBPACK_IMPORTED_MODULE_0__[START_TRANSITION];
const FLUSH_SYNC = "flushSync";
const flushSyncImpl = react_dom__WEBPACK_IMPORTED_MODULE_1__[FLUSH_SYNC];
const USE_ID = "useId";
const useIdImpl = react__WEBPACK_IMPORTED_MODULE_0__[USE_ID];
function startTransitionSafe(cb) {
  if (startTransitionImpl) {
    startTransitionImpl(cb);
  } else {
    cb();
  }
}
function flushSyncSafe(cb) {
  if (flushSyncImpl) {
    flushSyncImpl(cb);
  } else {
    cb();
  }
}
class Deferred {
  constructor() {
    this.status = "pending";
    this.promise = new Promise((resolve, reject) => {
      this.resolve = value => {
        if (this.status === "pending") {
          this.status = "resolved";
          resolve(value);
        }
      };
      this.reject = reason => {
        if (this.status === "pending") {
          this.status = "rejected";
          reject(reason);
        }
      };
    });
  }
}
/**
 * Given a Remix Router instance, render the appropriate UI
 */
function RouterProvider(_ref) {
  let {
    fallbackElement,
    router,
    future
  } = _ref;
  let [state, setStateImpl] = react__WEBPACK_IMPORTED_MODULE_0__.useState(router.state);
  let [pendingState, setPendingState] = react__WEBPACK_IMPORTED_MODULE_0__.useState();
  let [vtContext, setVtContext] = react__WEBPACK_IMPORTED_MODULE_0__.useState({
    isTransitioning: false
  });
  let [renderDfd, setRenderDfd] = react__WEBPACK_IMPORTED_MODULE_0__.useState();
  let [transition, setTransition] = react__WEBPACK_IMPORTED_MODULE_0__.useState();
  let [interruption, setInterruption] = react__WEBPACK_IMPORTED_MODULE_0__.useState();
  let fetcherData = react__WEBPACK_IMPORTED_MODULE_0__.useRef(new Map());
  let {
    v7_startTransition
  } = future || {};
  let optInStartTransition = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(cb => {
    if (v7_startTransition) {
      startTransitionSafe(cb);
    } else {
      cb();
    }
  }, [v7_startTransition]);
  let setState = react__WEBPACK_IMPORTED_MODULE_0__.useCallback((newState, _ref2) => {
    let {
      deletedFetchers,
      flushSync: flushSync,
      viewTransitionOpts: viewTransitionOpts
    } = _ref2;
    newState.fetchers.forEach((fetcher, key) => {
      if (fetcher.data !== undefined) {
        fetcherData.current.set(key, fetcher.data);
      }
    });
    deletedFetchers.forEach(key => fetcherData.current.delete(key));
    let isViewTransitionUnavailable = router.window == null || router.window.document == null || typeof router.window.document.startViewTransition !== "function";
    // If this isn't a view transition or it's not available in this browser,
    // just update and be done with it
    if (!viewTransitionOpts || isViewTransitionUnavailable) {
      if (flushSync) {
        flushSyncSafe(() => setStateImpl(newState));
      } else {
        optInStartTransition(() => setStateImpl(newState));
      }
      return;
    }
    // flushSync + startViewTransition
    if (flushSync) {
      // Flush through the context to mark DOM elements as transition=ing
      flushSyncSafe(() => {
        // Cancel any pending transitions
        if (transition) {
          renderDfd && renderDfd.resolve();
          transition.skipTransition();
        }
        setVtContext({
          isTransitioning: true,
          flushSync: true,
          currentLocation: viewTransitionOpts.currentLocation,
          nextLocation: viewTransitionOpts.nextLocation
        });
      });
      // Update the DOM
      let t = router.window.document.startViewTransition(() => {
        flushSyncSafe(() => setStateImpl(newState));
      });
      // Clean up after the animation completes
      t.finished.finally(() => {
        flushSyncSafe(() => {
          setRenderDfd(undefined);
          setTransition(undefined);
          setPendingState(undefined);
          setVtContext({
            isTransitioning: false
          });
        });
      });
      flushSyncSafe(() => setTransition(t));
      return;
    }
    // startTransition + startViewTransition
    if (transition) {
      // Interrupting an in-progress transition, cancel and let everything flush
      // out, and then kick off a new transition from the interruption state
      renderDfd && renderDfd.resolve();
      transition.skipTransition();
      setInterruption({
        state: newState,
        currentLocation: viewTransitionOpts.currentLocation,
        nextLocation: viewTransitionOpts.nextLocation
      });
    } else {
      // Completed navigation update with opted-in view transitions, let 'er rip
      setPendingState(newState);
      setVtContext({
        isTransitioning: true,
        flushSync: false,
        currentLocation: viewTransitionOpts.currentLocation,
        nextLocation: viewTransitionOpts.nextLocation
      });
    }
  }, [router.window, transition, renderDfd, fetcherData, optInStartTransition]);
  // Need to use a layout effect here so we are subscribed early enough to
  // pick up on any render-driven redirects/navigations (useEffect/<Navigate>)
  react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => router.subscribe(setState), [router, setState]);
  // When we start a view transition, create a Deferred we can use for the
  // eventual "completed" render
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
    if (vtContext.isTransitioning && !vtContext.flushSync) {
      setRenderDfd(new Deferred());
    }
  }, [vtContext]);
  // Once the deferred is created, kick off startViewTransition() to update the
  // DOM and then wait on the Deferred to resolve (indicating the DOM update has
  // happened)
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
    if (renderDfd && pendingState && router.window) {
      let newState = pendingState;
      let renderPromise = renderDfd.promise;
      let transition = router.window.document.startViewTransition(async () => {
        optInStartTransition(() => setStateImpl(newState));
        await renderPromise;
      });
      transition.finished.finally(() => {
        setRenderDfd(undefined);
        setTransition(undefined);
        setPendingState(undefined);
        setVtContext({
          isTransitioning: false
        });
      });
      setTransition(transition);
    }
  }, [optInStartTransition, pendingState, renderDfd, router.window]);
  // When the new location finally renders and is committed to the DOM, this
  // effect will run to resolve the transition
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
    if (renderDfd && pendingState && state.location.key === pendingState.location.key) {
      renderDfd.resolve();
    }
  }, [renderDfd, transition, state.location, pendingState]);
  // If we get interrupted with a new navigation during a transition, we skip
  // the active transition, let it cleanup, then kick it off again here
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
    if (!vtContext.isTransitioning && interruption) {
      setPendingState(interruption.state);
      setVtContext({
        isTransitioning: true,
        flushSync: false,
        currentLocation: interruption.currentLocation,
        nextLocation: interruption.nextLocation
      });
      setInterruption(undefined);
    }
  }, [vtContext.isTransitioning, interruption]);
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
     true ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_warning)(fallbackElement == null || !router.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using " + "`v7_partialHydration`, use a `HydrateFallback` component instead") : 0;
    // Only log this once on initial mount
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, []);
  let navigator = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => {
    return {
      createHref: router.createHref,
      encodeLocation: router.encodeLocation,
      go: n => router.navigate(n),
      push: (to, state, opts) => router.navigate(to, {
        state,
        preventScrollReset: opts == null ? void 0 : opts.preventScrollReset
      }),
      replace: (to, state, opts) => router.navigate(to, {
        replace: true,
        state,
        preventScrollReset: opts == null ? void 0 : opts.preventScrollReset
      })
    };
  }, [router]);
  let basename = router.basename || "/";
  let dataRouterContext = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => ({
    router,
    navigator,
    static: false,
    basename
  }), [router, navigator, basename]);
  let routerFuture = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => ({
    v7_relativeSplatPath: router.future.v7_relativeSplatPath
  }), [router.future.v7_relativeSplatPath]);
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => (0,react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_logV6DeprecationWarnings)(future, router.future), [future, router.future]);
  // The fragment and {null} here are important!  We need them to keep React 18's
  // useId happy when we are server-rendering since we may have a <script> here
  // containing the hydrated server-side staticContext (from StaticRouterProvider).
  // useId relies on the component tree structure to generate deterministic id's
  // so we need to ensure it remains the same on the client even though
  // we don't need the <script> tag
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_DataRouterContext.Provider, {
    value: dataRouterContext
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_DataRouterStateContext.Provider, {
    value: state
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(FetchersContext.Provider, {
    value: fetcherData.current
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(ViewTransitionContext.Provider, {
    value: vtContext
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router__WEBPACK_IMPORTED_MODULE_3__.Router, {
    basename: basename,
    location: state.location,
    navigationType: state.historyAction,
    navigator: navigator,
    future: routerFuture
  }, state.initialized || router.future.v7_partialHydration ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(MemoizedDataRoutes, {
    routes: router.routes,
    future: router.future,
    state: state
  }) : fallbackElement))))), null);
}
// Memoize to avoid re-renders when updating `ViewTransitionContext`
const MemoizedDataRoutes = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.memo(DataRoutes);
function DataRoutes(_ref3) {
  let {
    routes,
    future,
    state
  } = _ref3;
  return (0,react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_useRoutesImpl)(routes, undefined, state, future);
}
/**
 * A `<Router>` for use in web browsers. Provides the cleanest URLs.
 */
function BrowserRouter(_ref4) {
  let {
    basename,
    children,
    future,
    window
  } = _ref4;
  let historyRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
  if (historyRef.current == null) {
    historyRef.current = (0,react_router__WEBPACK_IMPORTED_MODULE_2__.createBrowserHistory)({
      window,
      v5Compat: true
    });
  }
  let history = historyRef.current;
  let [state, setStateImpl] = react__WEBPACK_IMPORTED_MODULE_0__.useState({
    action: history.action,
    location: history.location
  });
  let {
    v7_startTransition
  } = future || {};
  let setState = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(newState => {
    v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);
  }, [setStateImpl, v7_startTransition]);
  react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => history.listen(setState), [history, setState]);
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => (0,react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_logV6DeprecationWarnings)(future), [future]);
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router__WEBPACK_IMPORTED_MODULE_3__.Router, {
    basename: basename,
    children: children,
    location: state.location,
    navigationType: state.action,
    navigator: history,
    future: future
  });
}
/**
 * A `<Router>` for use in web browsers. Stores the location in the hash
 * portion of the URL so it is not sent to the server.
 */
function HashRouter(_ref5) {
  let {
    basename,
    children,
    future,
    window
  } = _ref5;
  let historyRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
  if (historyRef.current == null) {
    historyRef.current = (0,react_router__WEBPACK_IMPORTED_MODULE_2__.createHashHistory)({
      window,
      v5Compat: true
    });
  }
  let history = historyRef.current;
  let [state, setStateImpl] = react__WEBPACK_IMPORTED_MODULE_0__.useState({
    action: history.action,
    location: history.location
  });
  let {
    v7_startTransition
  } = future || {};
  let setState = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(newState => {
    v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);
  }, [setStateImpl, v7_startTransition]);
  react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => history.listen(setState), [history, setState]);
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => (0,react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_logV6DeprecationWarnings)(future), [future]);
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router__WEBPACK_IMPORTED_MODULE_3__.Router, {
    basename: basename,
    children: children,
    location: state.location,
    navigationType: state.action,
    navigator: history,
    future: future
  });
}
/**
 * A `<Router>` that accepts a pre-instantiated history object. It's important
 * to note that using your own history object is highly discouraged and may add
 * two versions of the history library to your bundles unless you use the same
 * version of the history library that React Router uses internally.
 */
function HistoryRouter(_ref6) {
  let {
    basename,
    children,
    future,
    history
  } = _ref6;
  let [state, setStateImpl] = react__WEBPACK_IMPORTED_MODULE_0__.useState({
    action: history.action,
    location: history.location
  });
  let {
    v7_startTransition
  } = future || {};
  let setState = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(newState => {
    v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);
  }, [setStateImpl, v7_startTransition]);
  react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => history.listen(setState), [history, setState]);
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => (0,react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_logV6DeprecationWarnings)(future), [future]);
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router__WEBPACK_IMPORTED_MODULE_3__.Router, {
    basename: basename,
    children: children,
    location: state.location,
    navigationType: state.action,
    navigator: history,
    future: future
  });
}
if (true) {
  HistoryRouter.displayName = "unstable_HistoryRouter";
}
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
/**
 * The public API for rendering a history-aware `<a>`.
 */
const Link = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function LinkWithRef(_ref7, ref) {
  let {
      onClick,
      relative,
      reloadDocument,
      replace,
      state,
      target,
      to,
      preventScrollReset,
      viewTransition
    } = _ref7,
    rest = _objectWithoutPropertiesLoose(_ref7, _excluded);
  let {
    basename
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_NavigationContext);
  // Rendered into <a href> for absolute URLs
  let absoluteHref;
  let isExternal = false;
  if (typeof to === "string" && ABSOLUTE_URL_REGEX.test(to)) {
    // Render the absolute href server- and client-side
    absoluteHref = to;
    // Only check for external origins client-side
    if (isBrowser) {
      try {
        let currentUrl = new URL(window.location.href);
        let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
        let path = (0,react_router__WEBPACK_IMPORTED_MODULE_2__.stripBasename)(targetUrl.pathname, basename);
        if (targetUrl.origin === currentUrl.origin && path != null) {
          // Strip the protocol/origin/basename for same-origin absolute URLs
          to = path + targetUrl.search + targetUrl.hash;
        } else {
          isExternal = true;
        }
      } catch (e) {
        // We can't do external URL detection without a valid URL
         true ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_warning)(false, "<Link to=\"" + to + "\"> contains an invalid URL which will probably break " + "when clicked - please update to a valid URL path.") : 0;
      }
    }
  }
  // Rendered into <a href> for relative URLs
  let href = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useHref)(to, {
    relative
  });
  let internalOnClick = useLinkClickHandler(to, {
    replace,
    state,
    target,
    preventScrollReset,
    relative,
    viewTransition
  });
  function handleClick(event) {
    if (onClick) onClick(event);
    if (!event.defaultPrevented) {
      internalOnClick(event);
    }
  }
  return (
    /*#__PURE__*/
    // eslint-disable-next-line jsx-a11y/anchor-has-content
    react__WEBPACK_IMPORTED_MODULE_0__.createElement("a", _extends({}, rest, {
      href: absoluteHref || href,
      onClick: isExternal || reloadDocument ? onClick : handleClick,
      ref: ref,
      target: target
    }))
  );
});
if (true) {
  Link.displayName = "Link";
}
/**
 * A `<Link>` wrapper that knows if it's "active" or not.
 */
const NavLink = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function NavLinkWithRef(_ref8, ref) {
  let {
      "aria-current": ariaCurrentProp = "page",
      caseSensitive = false,
      className: classNameProp = "",
      end = false,
      style: styleProp,
      to,
      viewTransition,
      children
    } = _ref8,
    rest = _objectWithoutPropertiesLoose(_ref8, _excluded2);
  let path = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useResolvedPath)(to, {
    relative: rest.relative
  });
  let location = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useLocation)();
  let routerState = react__WEBPACK_IMPORTED_MODULE_0__.useContext(react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_DataRouterStateContext);
  let {
    navigator,
    basename
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_NavigationContext);
  let isTransitioning = routerState != null &&
  // Conditional usage is OK here because the usage of a data router is static
  // eslint-disable-next-line react-hooks/rules-of-hooks
  useViewTransitionState(path) && viewTransition === true;
  let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname;
  let locationPathname = location.pathname;
  let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;
  if (!caseSensitive) {
    locationPathname = locationPathname.toLowerCase();
    nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
    toPathname = toPathname.toLowerCase();
  }
  if (nextLocationPathname && basename) {
    nextLocationPathname = (0,react_router__WEBPACK_IMPORTED_MODULE_2__.stripBasename)(nextLocationPathname, basename) || nextLocationPathname;
  }
  // If the `to` has a trailing slash, look at that exact spot.  Otherwise,
  // we're looking for a slash _after_ what's in `to`.  For example:
  //
  // <NavLink to="/users"> and <NavLink to="/users/">
  // both want to look for a / at index 6 to match URL `/users/matt`
  const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
  let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
  let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/");
  let renderProps = {
    isActive,
    isPending,
    isTransitioning
  };
  let ariaCurrent = isActive ? ariaCurrentProp : undefined;
  let className;
  if (typeof classNameProp === "function") {
    className = classNameProp(renderProps);
  } else {
    // If the className prop is not a function, we use a default `active`
    // class for <NavLink />s that are active. In v5 `active` was the default
    // value for `activeClassName`, but we are removing that API and can still
    // use the old default behavior for a cleaner upgrade path and keep the
    // simple styling rules working as they currently do.
    className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null, isTransitioning ? "transitioning" : null].filter(Boolean).join(" ");
  }
  let style = typeof styleProp === "function" ? styleProp(renderProps) : styleProp;
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Link, _extends({}, rest, {
    "aria-current": ariaCurrent,
    className: className,
    ref: ref,
    style: style,
    to: to,
    viewTransition: viewTransition
  }), typeof children === "function" ? children(renderProps) : children);
});
if (true) {
  NavLink.displayName = "NavLink";
}
/**
 * A `@remix-run/router`-aware `<form>`. It behaves like a normal form except
 * that the interaction with the server is with `fetch` instead of new document
 * requests, allowing components to add nicer UX to the page as the form is
 * submitted and returns with data.
 */
const Form = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((_ref9, forwardedRef) => {
  let {
      fetcherKey,
      navigate,
      reloadDocument,
      replace,
      state,
      method = defaultMethod,
      action,
      onSubmit,
      relative,
      preventScrollReset,
      viewTransition
    } = _ref9,
    props = _objectWithoutPropertiesLoose(_ref9, _excluded3);
  let submit = useSubmit();
  let formAction = useFormAction(action, {
    relative
  });
  let formMethod = method.toLowerCase() === "get" ? "get" : "post";
  let submitHandler = event => {
    onSubmit && onSubmit(event);
    if (event.defaultPrevented) return;
    event.preventDefault();
    let submitter = event.nativeEvent.submitter;
    let submitMethod = (submitter == null ? void 0 : submitter.getAttribute("formmethod")) || method;
    submit(submitter || event.currentTarget, {
      fetcherKey,
      method: submitMethod,
      navigate,
      replace,
      state,
      relative,
      preventScrollReset,
      viewTransition
    });
  };
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("form", _extends({
    ref: forwardedRef,
    method: formMethod,
    action: formAction,
    onSubmit: reloadDocument ? onSubmit : submitHandler
  }, props));
});
if (true) {
  Form.displayName = "Form";
}
/**
 * This component will emulate the browser's scroll restoration on location
 * changes.
 */
function ScrollRestoration(_ref10) {
  let {
    getKey,
    storageKey
  } = _ref10;
  useScrollRestoration({
    getKey,
    storageKey
  });
  return null;
}
if (true) {
  ScrollRestoration.displayName = "ScrollRestoration";
}
//#endregion
////////////////////////////////////////////////////////////////////////////////
//#region Hooks
////////////////////////////////////////////////////////////////////////////////
var DataRouterHook;
(function (DataRouterHook) {
  DataRouterHook["UseScrollRestoration"] = "useScrollRestoration";
  DataRouterHook["UseSubmit"] = "useSubmit";
  DataRouterHook["UseSubmitFetcher"] = "useSubmitFetcher";
  DataRouterHook["UseFetcher"] = "useFetcher";
  DataRouterHook["useViewTransitionState"] = "useViewTransitionState";
})(DataRouterHook || (DataRouterHook = {}));
var DataRouterStateHook;
(function (DataRouterStateHook) {
  DataRouterStateHook["UseFetcher"] = "useFetcher";
  DataRouterStateHook["UseFetchers"] = "useFetchers";
  DataRouterStateHook["UseScrollRestoration"] = "useScrollRestoration";
})(DataRouterStateHook || (DataRouterStateHook = {}));
// Internal hooks
function getDataRouterConsoleError(hookName) {
  return hookName + " must be used within a data router.  See https://reactrouter.com/v6/routers/picking-a-router.";
}
function useDataRouterContext(hookName) {
  let ctx = react__WEBPACK_IMPORTED_MODULE_0__.useContext(react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_DataRouterContext);
  !ctx ?  true ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_invariant)(false, getDataRouterConsoleError(hookName)) : 0 : void 0;
  return ctx;
}
function useDataRouterState(hookName) {
  let state = react__WEBPACK_IMPORTED_MODULE_0__.useContext(react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_DataRouterStateContext);
  !state ?  true ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_invariant)(false, getDataRouterConsoleError(hookName)) : 0 : void 0;
  return state;
}
// External hooks
/**
 * Handles the click behavior for router `<Link>` components. This is useful if
 * you need to create custom `<Link>` components with the same click behavior we
 * use in our exported `<Link>`.
 */
function useLinkClickHandler(to, _temp) {
  let {
    target,
    replace: replaceProp,
    state,
    preventScrollReset,
    relative,
    viewTransition
  } = _temp === void 0 ? {} : _temp;
  let navigate = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();
  let location = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useLocation)();
  let path = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useResolvedPath)(to, {
    relative
  });
  return react__WEBPACK_IMPORTED_MODULE_0__.useCallback(event => {
    if (shouldProcessLinkClick(event, target)) {
      event.preventDefault();
      // If the URL hasn't changed, a regular <a> will do a replace instead of
      // a push, so do the same here unless the replace prop is explicitly set
      let replace = replaceProp !== undefined ? replaceProp : (0,react_router__WEBPACK_IMPORTED_MODULE_2__.createPath)(location) === (0,react_router__WEBPACK_IMPORTED_MODULE_2__.createPath)(path);
      navigate(to, {
        replace,
        state,
        preventScrollReset,
        relative,
        viewTransition
      });
    }
  }, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative, viewTransition]);
}
/**
 * A convenient wrapper for reading and writing search parameters via the
 * URLSearchParams interface.
 */
function useSearchParams(defaultInit) {
   true ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_warning)(typeof URLSearchParams !== "undefined", "You cannot use the `useSearchParams` hook in a browser that does not " + "support the URLSearchParams API. If you need to support Internet " + "Explorer 11, we recommend you load a polyfill such as " + "https://github.com/ungap/url-search-params.") : 0;
  let defaultSearchParamsRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(createSearchParams(defaultInit));
  let hasSetSearchParamsRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false);
  let location = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useLocation)();
  let searchParams = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() =>
  // Only merge in the defaults if we haven't yet called setSearchParams.
  // Once we call that we want those to take precedence, otherwise you can't
  // remove a param with setSearchParams({}) if it has an initial value
  getSearchParamsForLocation(location.search, hasSetSearchParamsRef.current ? null : defaultSearchParamsRef.current), [location.search]);
  let navigate = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useNavigate)();
  let setSearchParams = react__WEBPACK_IMPORTED_MODULE_0__.useCallback((nextInit, navigateOptions) => {
    const newSearchParams = createSearchParams(typeof nextInit === "function" ? nextInit(searchParams) : nextInit);
    hasSetSearchParamsRef.current = true;
    navigate("?" + newSearchParams, navigateOptions);
  }, [navigate, searchParams]);
  return [searchParams, setSearchParams];
}
function validateClientSideSubmission() {
  if (typeof document === "undefined") {
    throw new Error("You are calling submit during the server render. " + "Try calling submit within a `useEffect` or callback instead.");
  }
}
let fetcherId = 0;
let getUniqueFetcherId = () => "__" + String(++fetcherId) + "__";
/**
 * Returns a function that may be used to programmatically submit a form (or
 * some arbitrary data) to the server.
 */
function useSubmit() {
  let {
    router
  } = useDataRouterContext(DataRouterHook.UseSubmit);
  let {
    basename
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_NavigationContext);
  let currentRouteId = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_useRouteId)();
  return react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (target, options) {
    if (options === void 0) {
      options = {};
    }
    validateClientSideSubmission();
    let {
      action,
      method,
      encType,
      formData,
      body
    } = getFormSubmissionInfo(target, basename);
    if (options.navigate === false) {
      let key = options.fetcherKey || getUniqueFetcherId();
      router.fetch(key, currentRouteId, options.action || action, {
        preventScrollReset: options.preventScrollReset,
        formData,
        body,
        formMethod: options.method || method,
        formEncType: options.encType || encType,
        flushSync: options.flushSync
      });
    } else {
      router.navigate(options.action || action, {
        preventScrollReset: options.preventScrollReset,
        formData,
        body,
        formMethod: options.method || method,
        formEncType: options.encType || encType,
        replace: options.replace,
        state: options.state,
        fromRouteId: currentRouteId,
        flushSync: options.flushSync,
        viewTransition: options.viewTransition
      });
    }
  }, [router, basename, currentRouteId]);
}
// v7: Eventually we should deprecate this entirely in favor of using the
// router method directly?
function useFormAction(action, _temp2) {
  let {
    relative
  } = _temp2 === void 0 ? {} : _temp2;
  let {
    basename
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_NavigationContext);
  let routeContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_RouteContext);
  !routeContext ?  true ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_invariant)(false, "useFormAction must be used inside a RouteContext") : 0 : void 0;
  let [match] = routeContext.matches.slice(-1);
  // Shallow clone path so we can modify it below, otherwise we modify the
  // object referenced by useMemo inside useResolvedPath
  let path = _extends({}, (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useResolvedPath)(action ? action : ".", {
    relative
  }));
  // If no action was specified, browsers will persist current search params
  // when determining the path, so match that behavior
  // https://github.com/remix-run/remix/issues/927
  let location = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useLocation)();
  if (action == null) {
    // Safe to write to this directly here since if action was undefined, we
    // would have called useResolvedPath(".") which will never include a search
    path.search = location.search;
    // When grabbing search params from the URL, remove any included ?index param
    // since it might not apply to our contextual route.  We add it back based
    // on match.route.index below
    let params = new URLSearchParams(path.search);
    let indexValues = params.getAll("index");
    let hasNakedIndexParam = indexValues.some(v => v === "");
    if (hasNakedIndexParam) {
      params.delete("index");
      indexValues.filter(v => v).forEach(v => params.append("index", v));
      let qs = params.toString();
      path.search = qs ? "?" + qs : "";
    }
  }
  if ((!action || action === ".") && match.route.index) {
    path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
  }
  // If we're operating within a basename, prepend it to the pathname prior
  // to creating the form action.  If this is a root navigation, then just use
  // the raw basename which allows the basename to have full control over the
  // presence of a trailing slash on root actions
  if (basename !== "/") {
    path.pathname = path.pathname === "/" ? basename : (0,react_router__WEBPACK_IMPORTED_MODULE_2__.joinPaths)([basename, path.pathname]);
  }
  return (0,react_router__WEBPACK_IMPORTED_MODULE_2__.createPath)(path);
}
// TODO: (v7) Change the useFetcher generic default from `any` to `unknown`
/**
 * Interacts with route loaders and actions without causing a navigation. Great
 * for any interaction that stays on the same page.
 */
function useFetcher(_temp3) {
  var _route$matches;
  let {
    key
  } = _temp3 === void 0 ? {} : _temp3;
  let {
    router
  } = useDataRouterContext(DataRouterHook.UseFetcher);
  let state = useDataRouterState(DataRouterStateHook.UseFetcher);
  let fetcherData = react__WEBPACK_IMPORTED_MODULE_0__.useContext(FetchersContext);
  let route = react__WEBPACK_IMPORTED_MODULE_0__.useContext(react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_RouteContext);
  let routeId = (_route$matches = route.matches[route.matches.length - 1]) == null ? void 0 : _route$matches.route.id;
  !fetcherData ?  true ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_invariant)(false, "useFetcher must be used inside a FetchersContext") : 0 : void 0;
  !route ?  true ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_invariant)(false, "useFetcher must be used inside a RouteContext") : 0 : void 0;
  !(routeId != null) ?  true ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_invariant)(false, "useFetcher can only be used on routes that contain a unique \"id\"") : 0 : void 0;
  // Fetcher key handling
  // OK to call conditionally to feature detect `useId`
  // eslint-disable-next-line react-hooks/rules-of-hooks
  let defaultKey = useIdImpl ? useIdImpl() : "";
  let [fetcherKey, setFetcherKey] = react__WEBPACK_IMPORTED_MODULE_0__.useState(key || defaultKey);
  if (key && key !== fetcherKey) {
    setFetcherKey(key);
  } else if (!fetcherKey) {
    // We will only fall through here when `useId` is not available
    setFetcherKey(getUniqueFetcherId());
  }
  // Registration/cleanup
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
    router.getFetcher(fetcherKey);
    return () => {
      // Tell the router we've unmounted - if v7_fetcherPersist is enabled this
      // will not delete immediately but instead queue up a delete after the
      // fetcher returns to an `idle` state
      router.deleteFetcher(fetcherKey);
    };
  }, [router, fetcherKey]);
  // Fetcher additions
  let load = react__WEBPACK_IMPORTED_MODULE_0__.useCallback((href, opts) => {
    !routeId ?  true ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_invariant)(false, "No routeId available for fetcher.load()") : 0 : void 0;
    router.fetch(fetcherKey, routeId, href, opts);
  }, [fetcherKey, routeId, router]);
  let submitImpl = useSubmit();
  let submit = react__WEBPACK_IMPORTED_MODULE_0__.useCallback((target, opts) => {
    submitImpl(target, _extends({}, opts, {
      navigate: false,
      fetcherKey
    }));
  }, [fetcherKey, submitImpl]);
  let FetcherForm = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => {
    let FetcherForm = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef((props, ref) => {
      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Form, _extends({}, props, {
        navigate: false,
        fetcherKey: fetcherKey,
        ref: ref
      }));
    });
    if (true) {
      FetcherForm.displayName = "fetcher.Form";
    }
    return FetcherForm;
  }, [fetcherKey]);
  // Exposed FetcherWithComponents
  let fetcher = state.fetchers.get(fetcherKey) || react_router__WEBPACK_IMPORTED_MODULE_2__.IDLE_FETCHER;
  let data = fetcherData.get(fetcherKey);
  let fetcherWithComponents = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => _extends({
    Form: FetcherForm,
    submit,
    load
  }, fetcher, {
    data
  }), [FetcherForm, submit, load, fetcher, data]);
  return fetcherWithComponents;
}
/**
 * Provides all fetchers currently on the page. Useful for layouts and parent
 * routes that need to provide pending/optimistic UI regarding the fetch.
 */
function useFetchers() {
  let state = useDataRouterState(DataRouterStateHook.UseFetchers);
  return Array.from(state.fetchers.entries()).map(_ref11 => {
    let [key, fetcher] = _ref11;
    return _extends({}, fetcher, {
      key
    });
  });
}
const SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions";
let savedScrollPositions = {};
/**
 * When rendered inside a RouterProvider, will restore scroll positions on navigations
 */
function useScrollRestoration(_temp4) {
  let {
    getKey,
    storageKey
  } = _temp4 === void 0 ? {} : _temp4;
  let {
    router
  } = useDataRouterContext(DataRouterHook.UseScrollRestoration);
  let {
    restoreScrollPosition,
    preventScrollReset
  } = useDataRouterState(DataRouterStateHook.UseScrollRestoration);
  let {
    basename
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(react_router__WEBPACK_IMPORTED_MODULE_3__.UNSAFE_NavigationContext);
  let location = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useLocation)();
  let matches = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useMatches)();
  let navigation = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useNavigation)();
  // Trigger manual scroll restoration while we're active
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
    window.history.scrollRestoration = "manual";
    return () => {
      window.history.scrollRestoration = "auto";
    };
  }, []);
  // Save positions on pagehide
  usePageHide(react__WEBPACK_IMPORTED_MODULE_0__.useCallback(() => {
    if (navigation.state === "idle") {
      let key = (getKey ? getKey(location, matches) : null) || location.key;
      savedScrollPositions[key] = window.scrollY;
    }
    try {
      sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions));
    } catch (error) {
       true ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_warning)(false, "Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (" + error + ").") : 0;
    }
    window.history.scrollRestoration = "auto";
  }, [storageKey, getKey, navigation.state, location, matches]));
  // Read in any saved scroll locations
  if (typeof document !== "undefined") {
    // eslint-disable-next-line react-hooks/rules-of-hooks
    react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => {
      try {
        let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY);
        if (sessionPositions) {
          savedScrollPositions = JSON.parse(sessionPositions);
        }
      } catch (e) {
        // no-op, use default empty object
      }
    }, [storageKey]);
    // Enable scroll restoration in the router
    // eslint-disable-next-line react-hooks/rules-of-hooks
    react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => {
      let getKeyWithoutBasename = getKey && basename !== "/" ? (location, matches) => getKey( // Strip the basename to match useLocation()
      _extends({}, location, {
        pathname: (0,react_router__WEBPACK_IMPORTED_MODULE_2__.stripBasename)(location.pathname, basename) || location.pathname
      }), matches) : getKey;
      let disableScrollRestoration = router == null ? void 0 : router.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKeyWithoutBasename);
      return () => disableScrollRestoration && disableScrollRestoration();
    }, [router, basename, getKey]);
    // Restore scrolling when state.restoreScrollPosition changes
    // eslint-disable-next-line react-hooks/rules-of-hooks
    react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => {
      // Explicit false means don't do anything (used for submissions)
      if (restoreScrollPosition === false) {
        return;
      }
      // been here before, scroll to it
      if (typeof restoreScrollPosition === "number") {
        window.scrollTo(0, restoreScrollPosition);
        return;
      }
      // try to scroll to the hash
      if (location.hash) {
        let el = document.getElementById(decodeURIComponent(location.hash.slice(1)));
        if (el) {
          el.scrollIntoView();
          return;
        }
      }
      // Don't reset if this navigation opted out
      if (preventScrollReset === true) {
        return;
      }
      // otherwise go to the top on new locations
      window.scrollTo(0, 0);
    }, [location, restoreScrollPosition, preventScrollReset]);
  }
}
/**
 * Setup a callback to be fired on the window's `beforeunload` event. This is
 * useful for saving some data to `window.localStorage` just before the page
 * refreshes.
 *
 * Note: The `callback` argument should be a function created with
 * `React.useCallback()`.
 */
function useBeforeUnload(callback, options) {
  let {
    capture
  } = options || {};
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
    let opts = capture != null ? {
      capture
    } : undefined;
    window.addEventListener("beforeunload", callback, opts);
    return () => {
      window.removeEventListener("beforeunload", callback, opts);
    };
  }, [callback, capture]);
}
/**
 * Setup a callback to be fired on the window's `pagehide` event. This is
 * useful for saving some data to `window.localStorage` just before the page
 * refreshes.  This event is better supported than beforeunload across browsers.
 *
 * Note: The `callback` argument should be a function created with
 * `React.useCallback()`.
 */
function usePageHide(callback, options) {
  let {
    capture
  } = options || {};
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
    let opts = capture != null ? {
      capture
    } : undefined;
    window.addEventListener("pagehide", callback, opts);
    return () => {
      window.removeEventListener("pagehide", callback, opts);
    };
  }, [callback, capture]);
}
/**
 * Wrapper around useBlocker to show a window.confirm prompt to users instead
 * of building a custom UI with useBlocker.
 *
 * Warning: This has *a lot of rough edges* and behaves very differently (and
 * very incorrectly in some cases) across browsers if user click addition
 * back/forward navigations while the confirm is open.  Use at your own risk.
 */
function usePrompt(_ref12) {
  let {
    when,
    message
  } = _ref12;
  let blocker = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useBlocker)(when);
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
    if (blocker.state === "blocked") {
      let proceed = window.confirm(message);
      if (proceed) {
        // This timeout is needed to avoid a weird "race" on POP navigations
        // between the `window.history` revert navigation and the result of
        // `window.confirm`
        setTimeout(blocker.proceed, 0);
      } else {
        blocker.reset();
      }
    }
  }, [blocker, message]);
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
    if (blocker.state === "blocked" && !when) {
      blocker.reset();
    }
  }, [blocker, when]);
}
/**
 * Return a boolean indicating if there is an active view transition to the
 * given href.  You can use this value to render CSS classes or viewTransitionName
 * styles onto your elements
 *
 * @param href The destination href
 * @param [opts.relative] Relative routing type ("route" | "path")
 */
function useViewTransitionState(to, opts) {
  if (opts === void 0) {
    opts = {};
  }
  let vtContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(ViewTransitionContext);
  !(vtContext != null) ?  true ? (0,react_router__WEBPACK_IMPORTED_MODULE_2__.UNSAFE_invariant)(false, "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  " + "Did you accidentally import `RouterProvider` from `react-router`?") : 0 : void 0;
  let {
    basename
  } = useDataRouterContext(DataRouterHook.useViewTransitionState);
  let path = (0,react_router__WEBPACK_IMPORTED_MODULE_3__.useResolvedPath)(to, {
    relative: opts.relative
  });
  if (!vtContext.isTransitioning) {
    return false;
  }
  let currentPath = (0,react_router__WEBPACK_IMPORTED_MODULE_2__.stripBasename)(vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
  let nextPath = (0,react_router__WEBPACK_IMPORTED_MODULE_2__.stripBasename)(vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
  // Transition is active if we're going to or coming from the indicated
  // destination.  This ensures that other PUSH navigations that reverse
  // an indicated transition apply.  I.e., on the list view you have:
  //
  //   <NavLink to="/details/1" viewTransition>
  //
  // If you click the breadcrumb back to the list view:
  //
  //   <NavLink to="/list" viewTransition>
  //
  // We should apply the transition because it's indicated as active going
  // from /list -> /details/1 and therefore should be active on the reverse
  // (even though this isn't strictly a POP reverse)
  return (0,react_router__WEBPACK_IMPORTED_MODULE_2__.matchPath)(path.pathname, nextPath) != null || (0,react_router__WEBPACK_IMPORTED_MODULE_2__.matchPath)(path.pathname, currentPath) != null;
}
//#endregion


//# sourceMappingURL=index.js.map


/***/ }),

/***/ "./node_modules/react-router/dist/index.js":
/*!*************************************************!*\
  !*** ./node_modules/react-router/dist/index.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AbortedDeferredError: () => (/* reexport safe */ _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.AbortedDeferredError),
/* harmony export */   Await: () => (/* binding */ Await),
/* harmony export */   MemoryRouter: () => (/* binding */ MemoryRouter),
/* harmony export */   Navigate: () => (/* binding */ Navigate),
/* harmony export */   NavigationType: () => (/* reexport safe */ _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.Action),
/* harmony export */   Outlet: () => (/* binding */ Outlet),
/* harmony export */   Route: () => (/* binding */ Route),
/* harmony export */   Router: () => (/* binding */ Router),
/* harmony export */   RouterProvider: () => (/* binding */ RouterProvider),
/* harmony export */   Routes: () => (/* binding */ Routes),
/* harmony export */   UNSAFE_DataRouterContext: () => (/* binding */ DataRouterContext),
/* harmony export */   UNSAFE_DataRouterStateContext: () => (/* binding */ DataRouterStateContext),
/* harmony export */   UNSAFE_LocationContext: () => (/* binding */ LocationContext),
/* harmony export */   UNSAFE_NavigationContext: () => (/* binding */ NavigationContext),
/* harmony export */   UNSAFE_RouteContext: () => (/* binding */ RouteContext),
/* harmony export */   UNSAFE_logV6DeprecationWarnings: () => (/* binding */ logV6DeprecationWarnings),
/* harmony export */   UNSAFE_mapRouteProperties: () => (/* binding */ mapRouteProperties),
/* harmony export */   UNSAFE_useRouteId: () => (/* binding */ useRouteId),
/* harmony export */   UNSAFE_useRoutesImpl: () => (/* binding */ useRoutesImpl),
/* harmony export */   createMemoryRouter: () => (/* binding */ createMemoryRouter),
/* harmony export */   createPath: () => (/* reexport safe */ _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.createPath),
/* harmony export */   createRoutesFromChildren: () => (/* binding */ createRoutesFromChildren),
/* harmony export */   createRoutesFromElements: () => (/* binding */ createRoutesFromChildren),
/* harmony export */   defer: () => (/* reexport safe */ _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.defer),
/* harmony export */   generatePath: () => (/* reexport safe */ _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.generatePath),
/* harmony export */   isRouteErrorResponse: () => (/* reexport safe */ _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.isRouteErrorResponse),
/* harmony export */   json: () => (/* reexport safe */ _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.json),
/* harmony export */   matchPath: () => (/* reexport safe */ _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.matchPath),
/* harmony export */   matchRoutes: () => (/* reexport safe */ _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.matchRoutes),
/* harmony export */   parsePath: () => (/* reexport safe */ _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.parsePath),
/* harmony export */   redirect: () => (/* reexport safe */ _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.redirect),
/* harmony export */   redirectDocument: () => (/* reexport safe */ _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.redirectDocument),
/* harmony export */   renderMatches: () => (/* binding */ renderMatches),
/* harmony export */   replace: () => (/* reexport safe */ _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.replace),
/* harmony export */   resolvePath: () => (/* reexport safe */ _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.resolvePath),
/* harmony export */   useActionData: () => (/* binding */ useActionData),
/* harmony export */   useAsyncError: () => (/* binding */ useAsyncError),
/* harmony export */   useAsyncValue: () => (/* binding */ useAsyncValue),
/* harmony export */   useBlocker: () => (/* binding */ useBlocker),
/* harmony export */   useHref: () => (/* binding */ useHref),
/* harmony export */   useInRouterContext: () => (/* binding */ useInRouterContext),
/* harmony export */   useLoaderData: () => (/* binding */ useLoaderData),
/* harmony export */   useLocation: () => (/* binding */ useLocation),
/* harmony export */   useMatch: () => (/* binding */ useMatch),
/* harmony export */   useMatches: () => (/* binding */ useMatches),
/* harmony export */   useNavigate: () => (/* binding */ useNavigate),
/* harmony export */   useNavigation: () => (/* binding */ useNavigation),
/* harmony export */   useNavigationType: () => (/* binding */ useNavigationType),
/* harmony export */   useOutlet: () => (/* binding */ useOutlet),
/* harmony export */   useOutletContext: () => (/* binding */ useOutletContext),
/* harmony export */   useParams: () => (/* binding */ useParams),
/* harmony export */   useResolvedPath: () => (/* binding */ useResolvedPath),
/* harmony export */   useRevalidator: () => (/* binding */ useRevalidator),
/* harmony export */   useRouteError: () => (/* binding */ useRouteError),
/* harmony export */   useRouteLoaderData: () => (/* binding */ useRouteLoaderData),
/* harmony export */   useRoutes: () => (/* binding */ useRoutes)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _remix_run_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @remix-run/router */ "./node_modules/@remix-run/router/dist/router.js");
/**
 * React Router v6.30.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */




function _extends() {
  _extends = Object.assign ? Object.assign.bind() : function (target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
    return target;
  };
  return _extends.apply(this, arguments);
}

// Create react-specific types from the agnostic types in @remix-run/router to
// export from react-router
const DataRouterContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);
if (true) {
  DataRouterContext.displayName = "DataRouter";
}
const DataRouterStateContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);
if (true) {
  DataRouterStateContext.displayName = "DataRouterState";
}
const AwaitContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);
if (true) {
  AwaitContext.displayName = "Await";
}

/**
 * A Navigator is a "location changer"; it's how you get to different locations.
 *
 * Every history instance conforms to the Navigator interface, but the
 * distinction is useful primarily when it comes to the low-level `<Router>` API
 * where both the location and a navigator must be provided separately in order
 * to avoid "tearing" that may occur in a suspense-enabled app if the action
 * and/or location were to be read directly from the history instance.
 */

const NavigationContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);
if (true) {
  NavigationContext.displayName = "Navigation";
}
const LocationContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);
if (true) {
  LocationContext.displayName = "Location";
}
const RouteContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext({
  outlet: null,
  matches: [],
  isDataRoute: false
});
if (true) {
  RouteContext.displayName = "Route";
}
const RouteErrorContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);
if (true) {
  RouteErrorContext.displayName = "RouteError";
}

/**
 * Returns the full href for the given "to" value. This is useful for building
 * custom links that are also accessible and preserve right-click behavior.
 *
 * @see https://reactrouter.com/v6/hooks/use-href
 */
function useHref(to, _temp) {
  let {
    relative
  } = _temp === void 0 ? {} : _temp;
  !useInRouterContext() ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, // TODO: This error is probably because they somehow have 2 versions of the
  // router loaded. We can help them understand how to avoid that.
  "useHref() may be used only in the context of a <Router> component.") : 0 : void 0;
  let {
    basename,
    navigator
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);
  let {
    hash,
    pathname,
    search
  } = useResolvedPath(to, {
    relative
  });
  let joinedPathname = pathname;

  // If we're operating within a basename, prepend it to the pathname prior
  // to creating the href.  If this is a root navigation, then just use the raw
  // basename which allows the basename to have full control over the presence
  // of a trailing slash on root links
  if (basename !== "/") {
    joinedPathname = pathname === "/" ? basename : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.joinPaths)([basename, pathname]);
  }
  return navigator.createHref({
    pathname: joinedPathname,
    search,
    hash
  });
}

/**
 * Returns true if this component is a descendant of a `<Router>`.
 *
 * @see https://reactrouter.com/v6/hooks/use-in-router-context
 */
function useInRouterContext() {
  return react__WEBPACK_IMPORTED_MODULE_0__.useContext(LocationContext) != null;
}

/**
 * Returns the current location object, which represents the current URL in web
 * browsers.
 *
 * Note: If you're using this it may mean you're doing some of your own
 * "routing" in your app, and we'd like to know what your use case is. We may
 * be able to provide something higher-level to better suit your needs.
 *
 * @see https://reactrouter.com/v6/hooks/use-location
 */
function useLocation() {
  !useInRouterContext() ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, // TODO: This error is probably because they somehow have 2 versions of the
  // router loaded. We can help them understand how to avoid that.
  "useLocation() may be used only in the context of a <Router> component.") : 0 : void 0;
  return react__WEBPACK_IMPORTED_MODULE_0__.useContext(LocationContext).location;
}

/**
 * Returns the current navigation action which describes how the router came to
 * the current location, either by a pop, push, or replace on the history stack.
 *
 * @see https://reactrouter.com/v6/hooks/use-navigation-type
 */
function useNavigationType() {
  return react__WEBPACK_IMPORTED_MODULE_0__.useContext(LocationContext).navigationType;
}

/**
 * Returns a PathMatch object if the given pattern matches the current URL.
 * This is useful for components that need to know "active" state, e.g.
 * `<NavLink>`.
 *
 * @see https://reactrouter.com/v6/hooks/use-match
 */
function useMatch(pattern) {
  !useInRouterContext() ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, // TODO: This error is probably because they somehow have 2 versions of the
  // router loaded. We can help them understand how to avoid that.
  "useMatch() may be used only in the context of a <Router> component.") : 0 : void 0;
  let {
    pathname
  } = useLocation();
  return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.matchPath)(pattern, (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_decodePath)(pathname)), [pathname, pattern]);
}

/**
 * The interface for the navigate() function returned from useNavigate().
 */

const navigateEffectWarning = "You should call navigate() in a React.useEffect(), not when " + "your component is first rendered.";

// Mute warnings for calls to useNavigate in SSR environments
function useIsomorphicLayoutEffect(cb) {
  let isStatic = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext).static;
  if (!isStatic) {
    // We should be able to get rid of this once react 18.3 is released
    // See: https://github.com/facebook/react/pull/26395
    // eslint-disable-next-line react-hooks/rules-of-hooks
    react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(cb);
  }
}

/**
 * Returns an imperative method for changing the location. Used by `<Link>`s, but
 * may also be used by other elements to change the location.
 *
 * @see https://reactrouter.com/v6/hooks/use-navigate
 */
function useNavigate() {
  let {
    isDataRoute
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);
  // Conditional usage is OK here because the usage of a data router is static
  // eslint-disable-next-line react-hooks/rules-of-hooks
  return isDataRoute ? useNavigateStable() : useNavigateUnstable();
}
function useNavigateUnstable() {
  !useInRouterContext() ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, // TODO: This error is probably because they somehow have 2 versions of the
  // router loaded. We can help them understand how to avoid that.
  "useNavigate() may be used only in the context of a <Router> component.") : 0 : void 0;
  let dataRouterContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterContext);
  let {
    basename,
    future,
    navigator
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);
  let {
    matches
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);
  let {
    pathname: locationPathname
  } = useLocation();
  let routePathnamesJson = JSON.stringify((0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_getResolveToMatches)(matches, future.v7_relativeSplatPath));
  let activeRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false);
  useIsomorphicLayoutEffect(() => {
    activeRef.current = true;
  });
  let navigate = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (to, options) {
    if (options === void 0) {
      options = {};
    }
     true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_warning)(activeRef.current, navigateEffectWarning) : 0;

    // Short circuit here since if this happens on first render the navigate
    // is useless because we haven't wired up our history listener yet
    if (!activeRef.current) return;
    if (typeof to === "number") {
      navigator.go(to);
      return;
    }
    let path = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.resolveTo)(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path");

    // If we're operating within a basename, prepend it to the pathname prior
    // to handing off to history (but only if we're not in a data router,
    // otherwise it'll prepend the basename inside of the router).
    // If this is a root navigation, then we navigate to the raw basename
    // which allows the basename to have full control over the presence of a
    // trailing slash on root links
    if (dataRouterContext == null && basename !== "/") {
      path.pathname = path.pathname === "/" ? basename : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.joinPaths)([basename, path.pathname]);
    }
    (!!options.replace ? navigator.replace : navigator.push)(path, options.state, options);
  }, [basename, navigator, routePathnamesJson, locationPathname, dataRouterContext]);
  return navigate;
}
const OutletContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createContext(null);

/**
 * Returns the context (if provided) for the child route at this level of the route
 * hierarchy.
 * @see https://reactrouter.com/v6/hooks/use-outlet-context
 */
function useOutletContext() {
  return react__WEBPACK_IMPORTED_MODULE_0__.useContext(OutletContext);
}

/**
 * Returns the element for the child route at this level of the route
 * hierarchy. Used internally by `<Outlet>` to render child routes.
 *
 * @see https://reactrouter.com/v6/hooks/use-outlet
 */
function useOutlet(context) {
  let outlet = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext).outlet;
  if (outlet) {
    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(OutletContext.Provider, {
      value: context
    }, outlet);
  }
  return outlet;
}

/**
 * Returns an object of key/value pairs of the dynamic params from the current
 * URL that were matched by the route path.
 *
 * @see https://reactrouter.com/v6/hooks/use-params
 */
function useParams() {
  let {
    matches
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);
  let routeMatch = matches[matches.length - 1];
  return routeMatch ? routeMatch.params : {};
}

/**
 * Resolves the pathname of the given `to` value against the current location.
 *
 * @see https://reactrouter.com/v6/hooks/use-resolved-path
 */
function useResolvedPath(to, _temp2) {
  let {
    relative
  } = _temp2 === void 0 ? {} : _temp2;
  let {
    future
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);
  let {
    matches
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);
  let {
    pathname: locationPathname
  } = useLocation();
  let routePathnamesJson = JSON.stringify((0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_getResolveToMatches)(matches, future.v7_relativeSplatPath));
  return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.resolveTo)(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]);
}

/**
 * Returns the element of the route that matched the current location, prepared
 * with the correct context to render the remainder of the route tree. Route
 * elements in the tree must render an `<Outlet>` to render their child route's
 * element.
 *
 * @see https://reactrouter.com/v6/hooks/use-routes
 */
function useRoutes(routes, locationArg) {
  return useRoutesImpl(routes, locationArg);
}

// Internal implementation with accept optional param for RouterProvider usage
function useRoutesImpl(routes, locationArg, dataRouterState, future) {
  !useInRouterContext() ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, // TODO: This error is probably because they somehow have 2 versions of the
  // router loaded. We can help them understand how to avoid that.
  "useRoutes() may be used only in the context of a <Router> component.") : 0 : void 0;
  let {
    navigator
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);
  let {
    matches: parentMatches
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);
  let routeMatch = parentMatches[parentMatches.length - 1];
  let parentParams = routeMatch ? routeMatch.params : {};
  let parentPathname = routeMatch ? routeMatch.pathname : "/";
  let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/";
  let parentRoute = routeMatch && routeMatch.route;
  if (true) {
    // You won't get a warning about 2 different <Routes> under a <Route>
    // without a trailing *, but this is a best-effort warning anyway since we
    // cannot even give the warning unless they land at the parent route.
    //
    // Example:
    //
    // <Routes>
    //   {/* This route path MUST end with /* because otherwise
    //       it will never match /blog/post/123 */}
    //   <Route path="blog" element={<Blog />} />
    //   <Route path="blog/feed" element={<BlogFeed />} />
    // </Routes>
    //
    // function Blog() {
    //   return (
    //     <Routes>
    //       <Route path="post/:id" element={<Post />} />
    //     </Routes>
    //   );
    // }
    let parentPath = parentRoute && parentRoute.path || "";
    warningOnce(parentPathname, !parentRoute || parentPath.endsWith("*"), "You rendered descendant <Routes> (or called `useRoutes()`) at " + ("\"" + parentPathname + "\" (under <Route path=\"" + parentPath + "\">) but the ") + "parent route path has no trailing \"*\". This means if you navigate " + "deeper, the parent won't match anymore and therefore the child " + "routes will never render.\n\n" + ("Please change the parent <Route path=\"" + parentPath + "\"> to <Route ") + ("path=\"" + (parentPath === "/" ? "*" : parentPath + "/*") + "\">."));
  }
  let locationFromContext = useLocation();
  let location;
  if (locationArg) {
    var _parsedLocationArg$pa;
    let parsedLocationArg = typeof locationArg === "string" ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.parsePath)(locationArg) : locationArg;
    !(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, "When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, " + "the location pathname must begin with the portion of the URL pathname that was " + ("matched by all parent routes. The current pathname base is \"" + parentPathnameBase + "\" ") + ("but pathname \"" + parsedLocationArg.pathname + "\" was given in the `location` prop.")) : 0 : void 0;
    location = parsedLocationArg;
  } else {
    location = locationFromContext;
  }
  let pathname = location.pathname || "/";
  let remainingPathname = pathname;
  if (parentPathnameBase !== "/") {
    // Determine the remaining pathname by removing the # of URL segments the
    // parentPathnameBase has, instead of removing based on character count.
    // This is because we can't guarantee that incoming/outgoing encodings/
    // decodings will match exactly.
    // We decode paths before matching on a per-segment basis with
    // decodeURIComponent(), but we re-encode pathnames via `new URL()` so they
    // match what `window.location.pathname` would reflect.  Those don't 100%
    // align when it comes to encoded URI characters such as % and &.
    //
    // So we may end up with:
    //   pathname:           "/descendant/a%25b/match"
    //   parentPathnameBase: "/descendant/a%b"
    //
    // And the direct substring removal approach won't work :/
    let parentSegments = parentPathnameBase.replace(/^\//, "").split("/");
    let segments = pathname.replace(/^\//, "").split("/");
    remainingPathname = "/" + segments.slice(parentSegments.length).join("/");
  }
  let matches = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.matchRoutes)(routes, {
    pathname: remainingPathname
  });
  if (true) {
     true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_warning)(parentRoute || matches != null, "No routes matched location \"" + location.pathname + location.search + location.hash + "\" ") : 0;
     true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_warning)(matches == null || matches[matches.length - 1].route.element !== undefined || matches[matches.length - 1].route.Component !== undefined || matches[matches.length - 1].route.lazy !== undefined, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" " + "does not have an element or Component. This means it will render an <Outlet /> with a " + "null value by default resulting in an \"empty\" page.") : 0;
  }
  let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, {
    params: Object.assign({}, parentParams, match.params),
    pathname: (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.joinPaths)([parentPathnameBase,
    // Re-encode pathnames that were decoded inside matchRoutes
    navigator.encodeLocation ? navigator.encodeLocation(match.pathname).pathname : match.pathname]),
    pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.joinPaths)([parentPathnameBase,
    // Re-encode pathnames that were decoded inside matchRoutes
    navigator.encodeLocation ? navigator.encodeLocation(match.pathnameBase).pathname : match.pathnameBase])
  })), parentMatches, dataRouterState, future);

  // When a user passes in a `locationArg`, the associated routes need to
  // be wrapped in a new `LocationContext.Provider` in order for `useLocation`
  // to use the scoped location instead of the global location.
  if (locationArg && renderedMatches) {
    return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(LocationContext.Provider, {
      value: {
        location: _extends({
          pathname: "/",
          search: "",
          hash: "",
          state: null,
          key: "default"
        }, location),
        navigationType: _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.Action.Pop
      }
    }, renderedMatches);
  }
  return renderedMatches;
}
function DefaultErrorComponent() {
  let error = useRouteError();
  let message = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.isRouteErrorResponse)(error) ? error.status + " " + error.statusText : error instanceof Error ? error.message : JSON.stringify(error);
  let stack = error instanceof Error ? error.stack : null;
  let lightgrey = "rgba(200,200,200, 0.5)";
  let preStyles = {
    padding: "0.5rem",
    backgroundColor: lightgrey
  };
  let codeStyles = {
    padding: "2px 4px",
    backgroundColor: lightgrey
  };
  let devInfo = null;
  if (true) {
    console.error("Error handled by React Router default ErrorBoundary:", error);
    devInfo = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "\uD83D\uDCBF Hey developer \uD83D\uDC4B"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("code", {
      style: codeStyles
    }, "ErrorBoundary"), " or", " ", /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("code", {
      style: codeStyles
    }, "errorElement"), " prop on your route."));
  }
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h2", null, "Unexpected Application Error!"), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("h3", {
    style: {
      fontStyle: "italic"
    }
  }, message), stack ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("pre", {
    style: preStyles
  }, stack) : null, devInfo);
}
const defaultErrorElement = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(DefaultErrorComponent, null);
class RenderErrorBoundary extends react__WEBPACK_IMPORTED_MODULE_0__.Component {
  constructor(props) {
    super(props);
    this.state = {
      location: props.location,
      revalidation: props.revalidation,
      error: props.error
    };
  }
  static getDerivedStateFromError(error) {
    return {
      error: error
    };
  }
  static getDerivedStateFromProps(props, state) {
    // When we get into an error state, the user will likely click "back" to the
    // previous page that didn't have an error. Because this wraps the entire
    // application, that will have no effect--the error page continues to display.
    // This gives us a mechanism to recover from the error when the location changes.
    //
    // Whether we're in an error state or not, we update the location in state
    // so that when we are in an error state, it gets reset when a new location
    // comes in and the user recovers from the error.
    if (state.location !== props.location || state.revalidation !== "idle" && props.revalidation === "idle") {
      return {
        error: props.error,
        location: props.location,
        revalidation: props.revalidation
      };
    }

    // If we're not changing locations, preserve the location but still surface
    // any new errors that may come through. We retain the existing error, we do
    // this because the error provided from the app state may be cleared without
    // the location changing.
    return {
      error: props.error !== undefined ? props.error : state.error,
      location: state.location,
      revalidation: props.revalidation || state.revalidation
    };
  }
  componentDidCatch(error, errorInfo) {
    console.error("React Router caught the following error during render", error, errorInfo);
  }
  render() {
    return this.state.error !== undefined ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteContext.Provider, {
      value: this.props.routeContext
    }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteErrorContext.Provider, {
      value: this.state.error,
      children: this.props.component
    })) : this.props.children;
  }
}
function RenderedRoute(_ref) {
  let {
    routeContext,
    match,
    children
  } = _ref;
  let dataRouterContext = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterContext);

  // Track how deep we got in our render pass to emulate SSR componentDidCatch
  // in a DataStaticRouter
  if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match.route.errorElement || match.route.ErrorBoundary)) {
    dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;
  }
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RouteContext.Provider, {
    value: routeContext
  }, children);
}
function _renderMatches(matches, parentMatches, dataRouterState, future) {
  var _dataRouterState;
  if (parentMatches === void 0) {
    parentMatches = [];
  }
  if (dataRouterState === void 0) {
    dataRouterState = null;
  }
  if (future === void 0) {
    future = null;
  }
  if (matches == null) {
    var _future;
    if (!dataRouterState) {
      return null;
    }
    if (dataRouterState.errors) {
      // Don't bail if we have data router errors so we can render them in the
      // boundary.  Use the pre-matched (or shimmed) matches
      matches = dataRouterState.matches;
    } else if ((_future = future) != null && _future.v7_partialHydration && parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) {
      // Don't bail if we're initializing with partial hydration and we have
      // router matches.  That means we're actively running `patchRoutesOnNavigation`
      // so we should render down the partial matches to the appropriate
      // `HydrateFallback`.  We only do this if `parentMatches` is empty so it
      // only impacts the root matches for `RouterProvider` and no descendant
      // `<Routes>`
      matches = dataRouterState.matches;
    } else {
      return null;
    }
  }
  let renderedMatches = matches;

  // If we have data errors, trim matches to the highest error boundary
  let errors = (_dataRouterState = dataRouterState) == null ? void 0 : _dataRouterState.errors;
  if (errors != null) {
    let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]) !== undefined);
    !(errorIndex >= 0) ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, "Could not find a matching route for errors on route IDs: " + Object.keys(errors).join(",")) : 0 : void 0;
    renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));
  }

  // If we're in a partial hydration mode, detect if we need to render down to
  // a given HydrateFallback while we load the rest of the hydration data
  let renderFallback = false;
  let fallbackIndex = -1;
  if (dataRouterState && future && future.v7_partialHydration) {
    for (let i = 0; i < renderedMatches.length; i++) {
      let match = renderedMatches[i];
      // Track the deepest fallback up until the first route without data
      if (match.route.HydrateFallback || match.route.hydrateFallbackElement) {
        fallbackIndex = i;
      }
      if (match.route.id) {
        let {
          loaderData,
          errors
        } = dataRouterState;
        let needsToRunLoader = match.route.loader && loaderData[match.route.id] === undefined && (!errors || errors[match.route.id] === undefined);
        if (match.route.lazy || needsToRunLoader) {
          // We found the first route that's not ready to render (waiting on
          // lazy, or has a loader that hasn't run yet).  Flag that we need to
          // render a fallback and render up until the appropriate fallback
          renderFallback = true;
          if (fallbackIndex >= 0) {
            renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);
          } else {
            renderedMatches = [renderedMatches[0]];
          }
          break;
        }
      }
    }
  }
  return renderedMatches.reduceRight((outlet, match, index) => {
    // Only data routers handle errors/fallbacks
    let error;
    let shouldRenderHydrateFallback = false;
    let errorElement = null;
    let hydrateFallbackElement = null;
    if (dataRouterState) {
      error = errors && match.route.id ? errors[match.route.id] : undefined;
      errorElement = match.route.errorElement || defaultErrorElement;
      if (renderFallback) {
        if (fallbackIndex < 0 && index === 0) {
          warningOnce("route-fallback", false, "No `HydrateFallback` element provided to render during initial hydration");
          shouldRenderHydrateFallback = true;
          hydrateFallbackElement = null;
        } else if (fallbackIndex === index) {
          shouldRenderHydrateFallback = true;
          hydrateFallbackElement = match.route.hydrateFallbackElement || null;
        }
      }
    }
    let matches = parentMatches.concat(renderedMatches.slice(0, index + 1));
    let getChildren = () => {
      let children;
      if (error) {
        children = errorElement;
      } else if (shouldRenderHydrateFallback) {
        children = hydrateFallbackElement;
      } else if (match.route.Component) {
        // Note: This is a de-optimized path since React won't re-use the
        // ReactElement since it's identity changes with each new
        // React.createElement call.  We keep this so folks can use
        // `<Route Component={...}>` in `<Routes>` but generally `Component`
        // usage is only advised in `RouterProvider` when we can convert it to
        // `element` ahead of time.
        children = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(match.route.Component, null);
      } else if (match.route.element) {
        children = match.route.element;
      } else {
        children = outlet;
      }
      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderedRoute, {
        match: match,
        routeContext: {
          outlet,
          matches,
          isDataRoute: dataRouterState != null
        },
        children: children
      });
    };
    // Only wrap in an error boundary within data router usages when we have an
    // ErrorBoundary/errorElement on this route.  Otherwise let it bubble up to
    // an ancestor ErrorBoundary/errorElement
    return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(RenderErrorBoundary, {
      location: dataRouterState.location,
      revalidation: dataRouterState.revalidation,
      component: errorElement,
      error: error,
      children: getChildren(),
      routeContext: {
        outlet: null,
        matches,
        isDataRoute: true
      }
    }) : getChildren();
  }, null);
}
var DataRouterHook = /*#__PURE__*/function (DataRouterHook) {
  DataRouterHook["UseBlocker"] = "useBlocker";
  DataRouterHook["UseRevalidator"] = "useRevalidator";
  DataRouterHook["UseNavigateStable"] = "useNavigate";
  return DataRouterHook;
}(DataRouterHook || {});
var DataRouterStateHook = /*#__PURE__*/function (DataRouterStateHook) {
  DataRouterStateHook["UseBlocker"] = "useBlocker";
  DataRouterStateHook["UseLoaderData"] = "useLoaderData";
  DataRouterStateHook["UseActionData"] = "useActionData";
  DataRouterStateHook["UseRouteError"] = "useRouteError";
  DataRouterStateHook["UseNavigation"] = "useNavigation";
  DataRouterStateHook["UseRouteLoaderData"] = "useRouteLoaderData";
  DataRouterStateHook["UseMatches"] = "useMatches";
  DataRouterStateHook["UseRevalidator"] = "useRevalidator";
  DataRouterStateHook["UseNavigateStable"] = "useNavigate";
  DataRouterStateHook["UseRouteId"] = "useRouteId";
  return DataRouterStateHook;
}(DataRouterStateHook || {});
function getDataRouterConsoleError(hookName) {
  return hookName + " must be used within a data router.  See https://reactrouter.com/v6/routers/picking-a-router.";
}
function useDataRouterContext(hookName) {
  let ctx = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterContext);
  !ctx ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, getDataRouterConsoleError(hookName)) : 0 : void 0;
  return ctx;
}
function useDataRouterState(hookName) {
  let state = react__WEBPACK_IMPORTED_MODULE_0__.useContext(DataRouterStateContext);
  !state ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, getDataRouterConsoleError(hookName)) : 0 : void 0;
  return state;
}
function useRouteContext(hookName) {
  let route = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);
  !route ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, getDataRouterConsoleError(hookName)) : 0 : void 0;
  return route;
}

// Internal version with hookName-aware debugging
function useCurrentRouteId(hookName) {
  let route = useRouteContext(hookName);
  let thisRoute = route.matches[route.matches.length - 1];
  !thisRoute.route.id ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, hookName + " can only be used on routes that contain a unique \"id\"") : 0 : void 0;
  return thisRoute.route.id;
}

/**
 * Returns the ID for the nearest contextual route
 */
function useRouteId() {
  return useCurrentRouteId(DataRouterStateHook.UseRouteId);
}

/**
 * Returns the current navigation, defaulting to an "idle" navigation when
 * no navigation is in progress
 */
function useNavigation() {
  let state = useDataRouterState(DataRouterStateHook.UseNavigation);
  return state.navigation;
}

/**
 * Returns a revalidate function for manually triggering revalidation, as well
 * as the current state of any manual revalidations
 */
function useRevalidator() {
  let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator);
  let state = useDataRouterState(DataRouterStateHook.UseRevalidator);
  return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => ({
    revalidate: dataRouterContext.router.revalidate,
    state: state.revalidation
  }), [dataRouterContext.router.revalidate, state.revalidation]);
}

/**
 * Returns the active route matches, useful for accessing loaderData for
 * parent/child routes or the route "handle" property
 */
function useMatches() {
  let {
    matches,
    loaderData
  } = useDataRouterState(DataRouterStateHook.UseMatches);
  return react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => matches.map(m => (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_convertRouteMatchToUiMatch)(m, loaderData)), [matches, loaderData]);
}

/**
 * Returns the loader data for the nearest ancestor Route loader
 */
function useLoaderData() {
  let state = useDataRouterState(DataRouterStateHook.UseLoaderData);
  let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);
  if (state.errors && state.errors[routeId] != null) {
    console.error("You cannot `useLoaderData` in an errorElement (routeId: " + routeId + ")");
    return undefined;
  }
  return state.loaderData[routeId];
}

/**
 * Returns the loaderData for the given routeId
 */
function useRouteLoaderData(routeId) {
  let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData);
  return state.loaderData[routeId];
}

/**
 * Returns the action data for the nearest ancestor Route action
 */
function useActionData() {
  let state = useDataRouterState(DataRouterStateHook.UseActionData);
  let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);
  return state.actionData ? state.actionData[routeId] : undefined;
}

/**
 * Returns the nearest ancestor Route error, which could be a loader/action
 * error or a render error.  This is intended to be called from your
 * ErrorBoundary/errorElement to display a proper error message.
 */
function useRouteError() {
  var _state$errors;
  let error = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteErrorContext);
  let state = useDataRouterState(DataRouterStateHook.UseRouteError);
  let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError);

  // If this was a render error, we put it in a RouteError context inside
  // of RenderErrorBoundary
  if (error !== undefined) {
    return error;
  }

  // Otherwise look for errors from our data router state
  return (_state$errors = state.errors) == null ? void 0 : _state$errors[routeId];
}

/**
 * Returns the happy-path data from the nearest ancestor `<Await />` value
 */
function useAsyncValue() {
  let value = react__WEBPACK_IMPORTED_MODULE_0__.useContext(AwaitContext);
  return value == null ? void 0 : value._data;
}

/**
 * Returns the error from the nearest ancestor `<Await />` value
 */
function useAsyncError() {
  let value = react__WEBPACK_IMPORTED_MODULE_0__.useContext(AwaitContext);
  return value == null ? void 0 : value._error;
}
let blockerId = 0;

/**
 * Allow the application to block navigations within the SPA and present the
 * user a confirmation dialog to confirm the navigation.  Mostly used to avoid
 * using half-filled form data.  This does not handle hard-reloads or
 * cross-origin navigations.
 */
function useBlocker(shouldBlock) {
  let {
    router,
    basename
  } = useDataRouterContext(DataRouterHook.UseBlocker);
  let state = useDataRouterState(DataRouterStateHook.UseBlocker);
  let [blockerKey, setBlockerKey] = react__WEBPACK_IMPORTED_MODULE_0__.useState("");
  let blockerFunction = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(arg => {
    if (typeof shouldBlock !== "function") {
      return !!shouldBlock;
    }
    if (basename === "/") {
      return shouldBlock(arg);
    }

    // If they provided us a function and we've got an active basename, strip
    // it from the locations we expose to the user to match the behavior of
    // useLocation
    let {
      currentLocation,
      nextLocation,
      historyAction
    } = arg;
    return shouldBlock({
      currentLocation: _extends({}, currentLocation, {
        pathname: (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.stripBasename)(currentLocation.pathname, basename) || currentLocation.pathname
      }),
      nextLocation: _extends({}, nextLocation, {
        pathname: (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.stripBasename)(nextLocation.pathname, basename) || nextLocation.pathname
      }),
      historyAction
    });
  }, [basename, shouldBlock]);

  // This effect is in charge of blocker key assignment and deletion (which is
  // tightly coupled to the key)
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
    let key = String(++blockerId);
    setBlockerKey(key);
    return () => router.deleteBlocker(key);
  }, [router]);

  // This effect handles assigning the blockerFunction.  This is to handle
  // unstable blocker function identities, and happens only after the prior
  // effect so we don't get an orphaned blockerFunction in the router with a
  // key of "".  Until then we just have the IDLE_BLOCKER.
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
    if (blockerKey !== "") {
      router.getBlocker(blockerKey, blockerFunction);
    }
  }, [router, blockerKey, blockerFunction]);

  // Prefer the blocker from `state` not `router.state` since DataRouterContext
  // is memoized so this ensures we update on blocker state updates
  return blockerKey && state.blockers.has(blockerKey) ? state.blockers.get(blockerKey) : _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.IDLE_BLOCKER;
}

/**
 * Stable version of useNavigate that is used when we are in the context of
 * a RouterProvider.
 */
function useNavigateStable() {
  let {
    router
  } = useDataRouterContext(DataRouterHook.UseNavigateStable);
  let id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable);
  let activeRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(false);
  useIsomorphicLayoutEffect(() => {
    activeRef.current = true;
  });
  let navigate = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function (to, options) {
    if (options === void 0) {
      options = {};
    }
     true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_warning)(activeRef.current, navigateEffectWarning) : 0;

    // Short circuit here since if this happens on first render the navigate
    // is useless because we haven't wired up our router subscriber yet
    if (!activeRef.current) return;
    if (typeof to === "number") {
      router.navigate(to);
    } else {
      router.navigate(to, _extends({
        fromRouteId: id
      }, options));
    }
  }, [router, id]);
  return navigate;
}
const alreadyWarned$1 = {};
function warningOnce(key, cond, message) {
  if (!cond && !alreadyWarned$1[key]) {
    alreadyWarned$1[key] = true;
     true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_warning)(false, message) : 0;
  }
}

const alreadyWarned = {};
function warnOnce(key, message) {
  if ( true && !alreadyWarned[message]) {
    alreadyWarned[message] = true;
    console.warn(message);
  }
}
const logDeprecation = (flag, msg, link) => warnOnce(flag, "\u26A0\uFE0F React Router Future Flag Warning: " + msg + ". " + ("You can use the `" + flag + "` future flag to opt-in early. ") + ("For more information, see " + link + "."));
function logV6DeprecationWarnings(renderFuture, routerFuture) {
  if ((renderFuture == null ? void 0 : renderFuture.v7_startTransition) === undefined) {
    logDeprecation("v7_startTransition", "React Router will begin wrapping state updates in `React.startTransition` in v7", "https://reactrouter.com/v6/upgrading/future#v7_starttransition");
  }
  if ((renderFuture == null ? void 0 : renderFuture.v7_relativeSplatPath) === undefined && (!routerFuture || routerFuture.v7_relativeSplatPath === undefined)) {
    logDeprecation("v7_relativeSplatPath", "Relative route resolution within Splat routes is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath");
  }
  if (routerFuture) {
    if (routerFuture.v7_fetcherPersist === undefined) {
      logDeprecation("v7_fetcherPersist", "The persistence behavior of fetchers is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist");
    }
    if (routerFuture.v7_normalizeFormMethod === undefined) {
      logDeprecation("v7_normalizeFormMethod", "Casing of `formMethod` fields is being normalized to uppercase in v7", "https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod");
    }
    if (routerFuture.v7_partialHydration === undefined) {
      logDeprecation("v7_partialHydration", "`RouterProvider` hydration behavior is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_partialhydration");
    }
    if (routerFuture.v7_skipActionErrorRevalidation === undefined) {
      logDeprecation("v7_skipActionErrorRevalidation", "The revalidation behavior after 4xx/5xx `action` responses is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation");
    }
  }
}

/**
  Webpack + React 17 fails to compile on any of the following because webpack
  complains that `startTransition` doesn't exist in `React`:
  * import { startTransition } from "react"
  * import * as React from from "react";
    "startTransition" in React ? React.startTransition(() => setState()) : setState()
  * import * as React from from "react";
    "startTransition" in React ? React["startTransition"](() => setState()) : setState()

  Moving it to a constant such as the following solves the Webpack/React 17 issue:
  * import * as React from from "react";
    const START_TRANSITION = "startTransition";
    START_TRANSITION in React ? React[START_TRANSITION](() => setState()) : setState()

  However, that introduces webpack/terser minification issues in production builds
  in React 18 where minification/obfuscation ends up removing the call of
  React.startTransition entirely from the first half of the ternary.  Grabbing
  this exported reference once up front resolves that issue.

  See https://github.com/remix-run/react-router/issues/10579
*/
const START_TRANSITION = "startTransition";
const startTransitionImpl = react__WEBPACK_IMPORTED_MODULE_0__[START_TRANSITION];

/**
 * Given a Remix Router instance, render the appropriate UI
 */
function RouterProvider(_ref) {
  let {
    fallbackElement,
    router,
    future
  } = _ref;
  let [state, setStateImpl] = react__WEBPACK_IMPORTED_MODULE_0__.useState(router.state);
  let {
    v7_startTransition
  } = future || {};
  let setState = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(newState => {
    if (v7_startTransition && startTransitionImpl) {
      startTransitionImpl(() => setStateImpl(newState));
    } else {
      setStateImpl(newState);
    }
  }, [setStateImpl, v7_startTransition]);

  // Need to use a layout effect here so we are subscribed early enough to
  // pick up on any render-driven redirects/navigations (useEffect/<Navigate>)
  react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => router.subscribe(setState), [router, setState]);
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
     true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_warning)(fallbackElement == null || !router.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using " + "`v7_partialHydration`, use a `HydrateFallback` component instead") : 0;
    // Only log this once on initial mount
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, []);
  let navigator = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => {
    return {
      createHref: router.createHref,
      encodeLocation: router.encodeLocation,
      go: n => router.navigate(n),
      push: (to, state, opts) => router.navigate(to, {
        state,
        preventScrollReset: opts == null ? void 0 : opts.preventScrollReset
      }),
      replace: (to, state, opts) => router.navigate(to, {
        replace: true,
        state,
        preventScrollReset: opts == null ? void 0 : opts.preventScrollReset
      })
    };
  }, [router]);
  let basename = router.basename || "/";
  let dataRouterContext = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => ({
    router,
    navigator,
    static: false,
    basename
  }), [router, navigator, basename]);
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => logV6DeprecationWarnings(future, router.future), [router, future]);

  // The fragment and {null} here are important!  We need them to keep React 18's
  // useId happy when we are server-rendering since we may have a <script> here
  // containing the hydrated server-side staticContext (from StaticRouterProvider).
  // useId relies on the component tree structure to generate deterministic id's
  // so we need to ensure it remains the same on the client even though
  // we don't need the <script> tag
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(DataRouterContext.Provider, {
    value: dataRouterContext
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(DataRouterStateContext.Provider, {
    value: state
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Router, {
    basename: basename,
    location: state.location,
    navigationType: state.historyAction,
    navigator: navigator,
    future: {
      v7_relativeSplatPath: router.future.v7_relativeSplatPath
    }
  }, state.initialized || router.future.v7_partialHydration ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(DataRoutes, {
    routes: router.routes,
    future: router.future,
    state: state
  }) : fallbackElement))), null);
}
function DataRoutes(_ref2) {
  let {
    routes,
    future,
    state
  } = _ref2;
  return useRoutesImpl(routes, undefined, state, future);
}
/**
 * A `<Router>` that stores all entries in memory.
 *
 * @see https://reactrouter.com/v6/router-components/memory-router
 */
function MemoryRouter(_ref3) {
  let {
    basename,
    children,
    initialEntries,
    initialIndex,
    future
  } = _ref3;
  let historyRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
  if (historyRef.current == null) {
    historyRef.current = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.createMemoryHistory)({
      initialEntries,
      initialIndex,
      v5Compat: true
    });
  }
  let history = historyRef.current;
  let [state, setStateImpl] = react__WEBPACK_IMPORTED_MODULE_0__.useState({
    action: history.action,
    location: history.location
  });
  let {
    v7_startTransition
  } = future || {};
  let setState = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(newState => {
    v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);
  }, [setStateImpl, v7_startTransition]);
  react__WEBPACK_IMPORTED_MODULE_0__.useLayoutEffect(() => history.listen(setState), [history, setState]);
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => logV6DeprecationWarnings(future), [future]);
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Router, {
    basename: basename,
    children: children,
    location: state.location,
    navigationType: state.action,
    navigator: history,
    future: future
  });
}
/**
 * Changes the current location.
 *
 * Note: This API is mostly useful in React.Component subclasses that are not
 * able to use hooks. In functional components, we recommend you use the
 * `useNavigate` hook instead.
 *
 * @see https://reactrouter.com/v6/components/navigate
 */
function Navigate(_ref4) {
  let {
    to,
    replace,
    state,
    relative
  } = _ref4;
  !useInRouterContext() ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, // TODO: This error is probably because they somehow have 2 versions of
  // the router loaded. We can help them understand how to avoid that.
  "<Navigate> may be used only in the context of a <Router> component.") : 0 : void 0;
  let {
    future,
    static: isStatic
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(NavigationContext);
   true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_warning)(!isStatic, "<Navigate> must not be used on the initial render in a <StaticRouter>. " + "This is a no-op, but you should modify your code so the <Navigate> is " + "only ever rendered in response to some user interaction or state change.") : 0;
  let {
    matches
  } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(RouteContext);
  let {
    pathname: locationPathname
  } = useLocation();
  let navigate = useNavigate();

  // Resolve the path outside of the effect so that when effects run twice in
  // StrictMode they navigate to the same place
  let path = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.resolveTo)(to, (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_getResolveToMatches)(matches, future.v7_relativeSplatPath), locationPathname, relative === "path");
  let jsonPath = JSON.stringify(path);
  react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => navigate(JSON.parse(jsonPath), {
    replace,
    state,
    relative
  }), [navigate, jsonPath, relative, replace, state]);
  return null;
}
/**
 * Renders the child route's element, if there is one.
 *
 * @see https://reactrouter.com/v6/components/outlet
 */
function Outlet(props) {
  return useOutlet(props.context);
}
/**
 * Declares an element that should be rendered at a certain URL path.
 *
 * @see https://reactrouter.com/v6/components/route
 */
function Route(_props) {
   true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, "A <Route> is only ever to be used as the child of <Routes> element, " + "never rendered directly. Please wrap your <Route> in a <Routes>.") : 0 ;
}
/**
 * Provides location context for the rest of the app.
 *
 * Note: You usually won't render a `<Router>` directly. Instead, you'll render a
 * router that is more specific to your environment such as a `<BrowserRouter>`
 * in web browsers or a `<StaticRouter>` for server rendering.
 *
 * @see https://reactrouter.com/v6/router-components/router
 */
function Router(_ref5) {
  let {
    basename: basenameProp = "/",
    children = null,
    location: locationProp,
    navigationType = _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.Action.Pop,
    navigator,
    static: staticProp = false,
    future
  } = _ref5;
  !!useInRouterContext() ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, "You cannot render a <Router> inside another <Router>." + " You should never have more than one in your app.") : 0 : void 0;

  // Preserve trailing slashes on basename, so we can let the user control
  // the enforcement of trailing slashes throughout the app
  let basename = basenameProp.replace(/^\/*/, "/");
  let navigationContext = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => ({
    basename,
    navigator,
    static: staticProp,
    future: _extends({
      v7_relativeSplatPath: false
    }, future)
  }), [basename, future, navigator, staticProp]);
  if (typeof locationProp === "string") {
    locationProp = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.parsePath)(locationProp);
  }
  let {
    pathname = "/",
    search = "",
    hash = "",
    state = null,
    key = "default"
  } = locationProp;
  let locationContext = react__WEBPACK_IMPORTED_MODULE_0__.useMemo(() => {
    let trailingPathname = (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.stripBasename)(pathname, basename);
    if (trailingPathname == null) {
      return null;
    }
    return {
      location: {
        pathname: trailingPathname,
        search,
        hash,
        state,
        key
      },
      navigationType
    };
  }, [basename, pathname, search, hash, state, key, navigationType]);
   true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_warning)(locationContext != null, "<Router basename=\"" + basename + "\"> is not able to match the URL " + ("\"" + pathname + search + hash + "\" because it does not start with the ") + "basename, so the <Router> won't render anything.") : 0;
  if (locationContext == null) {
    return null;
  }
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(NavigationContext.Provider, {
    value: navigationContext
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(LocationContext.Provider, {
    children: children,
    value: locationContext
  }));
}
/**
 * A container for a nested tree of `<Route>` elements that renders the branch
 * that best matches the current location.
 *
 * @see https://reactrouter.com/v6/components/routes
 */
function Routes(_ref6) {
  let {
    children,
    location
  } = _ref6;
  return useRoutes(createRoutesFromChildren(children), location);
}
/**
 * Component to use for rendering lazily loaded data from returning defer()
 * in a loader function
 */
function Await(_ref7) {
  let {
    children,
    errorElement,
    resolve
  } = _ref7;
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(AwaitErrorBoundary, {
    resolve: resolve,
    errorElement: errorElement
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(ResolveAwait, null, children));
}
var AwaitRenderStatus = /*#__PURE__*/function (AwaitRenderStatus) {
  AwaitRenderStatus[AwaitRenderStatus["pending"] = 0] = "pending";
  AwaitRenderStatus[AwaitRenderStatus["success"] = 1] = "success";
  AwaitRenderStatus[AwaitRenderStatus["error"] = 2] = "error";
  return AwaitRenderStatus;
}(AwaitRenderStatus || {});
const neverSettledPromise = new Promise(() => {});
class AwaitErrorBoundary extends react__WEBPACK_IMPORTED_MODULE_0__.Component {
  constructor(props) {
    super(props);
    this.state = {
      error: null
    };
  }
  static getDerivedStateFromError(error) {
    return {
      error
    };
  }
  componentDidCatch(error, errorInfo) {
    console.error("<Await> caught the following error during render", error, errorInfo);
  }
  render() {
    let {
      children,
      errorElement,
      resolve
    } = this.props;
    let promise = null;
    let status = AwaitRenderStatus.pending;
    if (!(resolve instanceof Promise)) {
      // Didn't get a promise - provide as a resolved promise
      status = AwaitRenderStatus.success;
      promise = Promise.resolve();
      Object.defineProperty(promise, "_tracked", {
        get: () => true
      });
      Object.defineProperty(promise, "_data", {
        get: () => resolve
      });
    } else if (this.state.error) {
      // Caught a render error, provide it as a rejected promise
      status = AwaitRenderStatus.error;
      let renderError = this.state.error;
      promise = Promise.reject().catch(() => {}); // Avoid unhandled rejection warnings
      Object.defineProperty(promise, "_tracked", {
        get: () => true
      });
      Object.defineProperty(promise, "_error", {
        get: () => renderError
      });
    } else if (resolve._tracked) {
      // Already tracked promise - check contents
      promise = resolve;
      status = "_error" in promise ? AwaitRenderStatus.error : "_data" in promise ? AwaitRenderStatus.success : AwaitRenderStatus.pending;
    } else {
      // Raw (untracked) promise - track it
      status = AwaitRenderStatus.pending;
      Object.defineProperty(resolve, "_tracked", {
        get: () => true
      });
      promise = resolve.then(data => Object.defineProperty(resolve, "_data", {
        get: () => data
      }), error => Object.defineProperty(resolve, "_error", {
        get: () => error
      }));
    }
    if (status === AwaitRenderStatus.error && promise._error instanceof _remix_run_router__WEBPACK_IMPORTED_MODULE_1__.AbortedDeferredError) {
      // Freeze the UI by throwing a never resolved promise
      throw neverSettledPromise;
    }
    if (status === AwaitRenderStatus.error && !errorElement) {
      // No errorElement, throw to the nearest route-level error boundary
      throw promise._error;
    }
    if (status === AwaitRenderStatus.error) {
      // Render via our errorElement
      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(AwaitContext.Provider, {
        value: promise,
        children: errorElement
      });
    }
    if (status === AwaitRenderStatus.success) {
      // Render children with resolved value
      return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(AwaitContext.Provider, {
        value: promise,
        children: children
      });
    }

    // Throw to the suspense boundary
    throw promise;
  }
}

/**
 * @private
 * Indirection to leverage useAsyncValue for a render-prop API on `<Await>`
 */
function ResolveAwait(_ref8) {
  let {
    children
  } = _ref8;
  let data = useAsyncValue();
  let toRender = typeof children === "function" ? children(data) : children;
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, toRender);
}

///////////////////////////////////////////////////////////////////////////////
// UTILS
///////////////////////////////////////////////////////////////////////////////

/**
 * Creates a route config from a React "children" object, which is usually
 * either a `<Route>` element or an array of them. Used internally by
 * `<Routes>` to create a route config from its children.
 *
 * @see https://reactrouter.com/v6/utils/create-routes-from-children
 */
function createRoutesFromChildren(children, parentPath) {
  if (parentPath === void 0) {
    parentPath = [];
  }
  let routes = [];
  react__WEBPACK_IMPORTED_MODULE_0__.Children.forEach(children, (element, index) => {
    if (! /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.isValidElement(element)) {
      // Ignore non-elements. This allows people to more easily inline
      // conditionals in their route config.
      return;
    }
    let treePath = [...parentPath, index];
    if (element.type === react__WEBPACK_IMPORTED_MODULE_0__.Fragment) {
      // Transparently support React.Fragment and its children.
      routes.push.apply(routes, createRoutesFromChildren(element.props.children, treePath));
      return;
    }
    !(element.type === Route) ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, "[" + (typeof element.type === "string" ? element.type : element.type.name) + "] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>") : 0 : void 0;
    !(!element.props.index || !element.props.children) ?  true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_invariant)(false, "An index route cannot have child routes.") : 0 : void 0;
    let route = {
      id: element.props.id || treePath.join("-"),
      caseSensitive: element.props.caseSensitive,
      element: element.props.element,
      Component: element.props.Component,
      index: element.props.index,
      path: element.props.path,
      loader: element.props.loader,
      action: element.props.action,
      errorElement: element.props.errorElement,
      ErrorBoundary: element.props.ErrorBoundary,
      hasErrorBoundary: element.props.ErrorBoundary != null || element.props.errorElement != null,
      shouldRevalidate: element.props.shouldRevalidate,
      handle: element.props.handle,
      lazy: element.props.lazy
    };
    if (element.props.children) {
      route.children = createRoutesFromChildren(element.props.children, treePath);
    }
    routes.push(route);
  });
  return routes;
}

/**
 * Renders the result of `matchRoutes()` into a React element.
 */
function renderMatches(matches) {
  return _renderMatches(matches);
}

function mapRouteProperties(route) {
  let updates = {
    // Note: this check also occurs in createRoutesFromChildren so update
    // there if you change this -- please and thank you!
    hasErrorBoundary: route.ErrorBoundary != null || route.errorElement != null
  };
  if (route.Component) {
    if (true) {
      if (route.element) {
         true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_warning)(false, "You should not include both `Component` and `element` on your route - " + "`Component` will be used.") : 0;
      }
    }
    Object.assign(updates, {
      element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(route.Component),
      Component: undefined
    });
  }
  if (route.HydrateFallback) {
    if (true) {
      if (route.hydrateFallbackElement) {
         true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_warning)(false, "You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - " + "`HydrateFallback` will be used.") : 0;
      }
    }
    Object.assign(updates, {
      hydrateFallbackElement: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(route.HydrateFallback),
      HydrateFallback: undefined
    });
  }
  if (route.ErrorBoundary) {
    if (true) {
      if (route.errorElement) {
         true ? (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.UNSAFE_warning)(false, "You should not include both `ErrorBoundary` and `errorElement` on your route - " + "`ErrorBoundary` will be used.") : 0;
      }
    }
    Object.assign(updates, {
      errorElement: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(route.ErrorBoundary),
      ErrorBoundary: undefined
    });
  }
  return updates;
}
function createMemoryRouter(routes, opts) {
  return (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.createRouter)({
    basename: opts == null ? void 0 : opts.basename,
    future: _extends({}, opts == null ? void 0 : opts.future, {
      v7_prependBasename: true
    }),
    history: (0,_remix_run_router__WEBPACK_IMPORTED_MODULE_1__.createMemoryHistory)({
      initialEntries: opts == null ? void 0 : opts.initialEntries,
      initialIndex: opts == null ? void 0 : opts.initialIndex
    }),
    hydrationData: opts == null ? void 0 : opts.hydrationData,
    routes,
    mapRouteProperties,
    dataStrategy: opts == null ? void 0 : opts.dataStrategy,
    patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation
  }).initialize();
}


//# sourceMappingURL=index.js.map


/***/ }),

/***/ "./node_modules/react/cjs/react-jsx-runtime.development.js":
/*!*****************************************************************!*\
  !*** ./node_modules/react/cjs/react-jsx-runtime.development.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

/**
 * @license React
 * react-jsx-runtime.development.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.
 */



if (true) {
  (function() {
'use strict';

var React = __webpack_require__(/*! react */ "react");

// ATTENTION
// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
// The Symbol used to tag the ReactElement-like types.
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
var REACT_MEMO_TYPE = Symbol.for('react.memo');
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';
function getIteratorFn(maybeIterable) {
  if (maybeIterable === null || typeof maybeIterable !== 'object') {
    return null;
  }

  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];

  if (typeof maybeIterator === 'function') {
    return maybeIterator;
  }

  return null;
}

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

function error(format) {
  {
    {
      for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
        args[_key2 - 1] = arguments[_key2];
      }

      printWarning('error', format, args);
    }
  }
}

function printWarning(level, format, args) {
  // When changing this logic, you might want to also
  // update consoleWithStackDev.www.js as well.
  {
    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
    var stack = ReactDebugCurrentFrame.getStackAddendum();

    if (stack !== '') {
      format += '%s';
      args = args.concat([stack]);
    } // eslint-disable-next-line react-internal/safe-string-coercion


    var argsWithFormat = args.map(function (item) {
      return String(item);
    }); // Careful: RN currently depends on this prefix

    argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
    // breaks IE9: https://github.com/facebook/react/issues/13610
    // eslint-disable-next-line react-internal/no-production-logging

    Function.prototype.apply.call(console[level], console, argsWithFormat);
  }
}

// -----------------------------------------------------------------------------

var enableScopeAPI = false; // Experimental Create Event Handle API.
var enableCacheElement = false;
var enableTransitionTracing = false; // No known bugs, but needs performance testing

var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
// stuff. Intended to enable React core members to more easily debug scheduling
// issues in DEV builds.

var enableDebugTracing = false; // Track which Fiber(s) schedule render work.

var REACT_MODULE_REFERENCE;

{
  REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
}

function isValidElementType(type) {
  if (typeof type === 'string' || typeof type === 'function') {
    return true;
  } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).


  if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing  || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden  || type === REACT_OFFSCREEN_TYPE || enableScopeAPI  || enableCacheElement  || enableTransitionTracing ) {
    return true;
  }

  if (typeof type === 'object' && type !== null) {
    if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
    // types supported by any Flight configuration anywhere since
    // we don't know which Flight build this will end up being used
    // with.
    type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
      return true;
    }
  }

  return false;
}

function getWrappedName(outerType, innerType, wrapperName) {
  var displayName = outerType.displayName;

  if (displayName) {
    return displayName;
  }

  var functionName = innerType.displayName || innerType.name || '';
  return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
} // Keep in sync with react-reconciler/getComponentNameFromFiber


function getContextName(type) {
  return type.displayName || 'Context';
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.


function getComponentNameFromType(type) {
  if (type == null) {
    // Host root, text node or just invalid type.
    return null;
  }

  {
    if (typeof type.tag === 'number') {
      error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
    }
  }

  if (typeof type === 'function') {
    return type.displayName || type.name || null;
  }

  if (typeof type === 'string') {
    return type;
  }

  switch (type) {
    case REACT_FRAGMENT_TYPE:
      return 'Fragment';

    case REACT_PORTAL_TYPE:
      return 'Portal';

    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';

  }

  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_CONTEXT_TYPE:
        var context = type;
        return getContextName(context) + '.Consumer';

      case REACT_PROVIDER_TYPE:
        var provider = type;
        return getContextName(provider._context) + '.Provider';

      case REACT_FORWARD_REF_TYPE:
        return getWrappedName(type, type.render, 'ForwardRef');

      case REACT_MEMO_TYPE:
        var outerName = type.displayName || null;

        if (outerName !== null) {
          return outerName;
        }

        return getComponentNameFromType(type.type) || 'Memo';

      case REACT_LAZY_TYPE:
        {
          var lazyComponent = type;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;

          try {
            return getComponentNameFromType(init(payload));
          } catch (x) {
            return null;
          }
        }

      // eslint-disable-next-line no-fallthrough
    }
  }

  return null;
}

var assign = Object.assign;

// Helpers to patch console.logs to avoid logging during side-effect free
// replaying on render function. This currently only patches the object
// lazily which won't cover if the log function was extracted eagerly.
// We could also eagerly patch the method.
var disabledDepth = 0;
var prevLog;
var prevInfo;
var prevWarn;
var prevError;
var prevGroup;
var prevGroupCollapsed;
var prevGroupEnd;

function disabledLog() {}

disabledLog.__reactDisabledLog = true;
function disableLogs() {
  {
    if (disabledDepth === 0) {
      /* eslint-disable react-internal/no-production-logging */
      prevLog = console.log;
      prevInfo = console.info;
      prevWarn = console.warn;
      prevError = console.error;
      prevGroup = console.group;
      prevGroupCollapsed = console.groupCollapsed;
      prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099

      var props = {
        configurable: true,
        enumerable: true,
        value: disabledLog,
        writable: true
      }; // $FlowFixMe Flow thinks console is immutable.

      Object.defineProperties(console, {
        info: props,
        log: props,
        warn: props,
        error: props,
        group: props,
        groupCollapsed: props,
        groupEnd: props
      });
      /* eslint-enable react-internal/no-production-logging */
    }

    disabledDepth++;
  }
}
function reenableLogs() {
  {
    disabledDepth--;

    if (disabledDepth === 0) {
      /* eslint-disable react-internal/no-production-logging */
      var props = {
        configurable: true,
        enumerable: true,
        writable: true
      }; // $FlowFixMe Flow thinks console is immutable.

      Object.defineProperties(console, {
        log: assign({}, props, {
          value: prevLog
        }),
        info: assign({}, props, {
          value: prevInfo
        }),
        warn: assign({}, props, {
          value: prevWarn
        }),
        error: assign({}, props, {
          value: prevError
        }),
        group: assign({}, props, {
          value: prevGroup
        }),
        groupCollapsed: assign({}, props, {
          value: prevGroupCollapsed
        }),
        groupEnd: assign({}, props, {
          value: prevGroupEnd
        })
      });
      /* eslint-enable react-internal/no-production-logging */
    }

    if (disabledDepth < 0) {
      error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
    }
  }
}

var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name, source, ownerFn) {
  {
    if (prefix === undefined) {
      // Extract the VM specific prefix used by each line.
      try {
        throw Error();
      } catch (x) {
        var match = x.stack.trim().match(/\n( *(at )?)/);
        prefix = match && match[1] || '';
      }
    } // We use the prefix to ensure our stacks line up with native stack frames.


    return '\n' + prefix + name;
  }
}
var reentry = false;
var componentFrameCache;

{
  var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
  componentFrameCache = new PossiblyWeakMap();
}

function describeNativeComponentFrame(fn, construct) {
  // If something asked for a stack inside a fake render, it should get ignored.
  if ( !fn || reentry) {
    return '';
  }

  {
    var frame = componentFrameCache.get(fn);

    if (frame !== undefined) {
      return frame;
    }
  }

  var control;
  reentry = true;
  var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.

  Error.prepareStackTrace = undefined;
  var previousDispatcher;

  {
    previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
    // for warnings.

    ReactCurrentDispatcher.current = null;
    disableLogs();
  }

  try {
    // This should throw.
    if (construct) {
      // Something should be setting the props in the constructor.
      var Fake = function () {
        throw Error();
      }; // $FlowFixMe


      Object.defineProperty(Fake.prototype, 'props', {
        set: function () {
          // We use a throwing setter instead of frozen or non-writable props
          // because that won't throw in a non-strict mode function.
          throw Error();
        }
      });

      if (typeof Reflect === 'object' && Reflect.construct) {
        // We construct a different control for this case to include any extra
        // frames added by the construct call.
        try {
          Reflect.construct(Fake, []);
        } catch (x) {
          control = x;
        }

        Reflect.construct(fn, [], Fake);
      } else {
        try {
          Fake.call();
        } catch (x) {
          control = x;
        }

        fn.call(Fake.prototype);
      }
    } else {
      try {
        throw Error();
      } catch (x) {
        control = x;
      }

      fn();
    }
  } catch (sample) {
    // This is inlined manually because closure doesn't do it for us.
    if (sample && control && typeof sample.stack === 'string') {
      // This extracts the first frame from the sample that isn't also in the control.
      // Skipping one frame that we assume is the frame that calls the two.
      var sampleLines = sample.stack.split('\n');
      var controlLines = control.stack.split('\n');
      var s = sampleLines.length - 1;
      var c = controlLines.length - 1;

      while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
        // We expect at least one stack frame to be shared.
        // Typically this will be the root most one. However, stack frames may be
        // cut off due to maximum stack limits. In this case, one maybe cut off
        // earlier than the other. We assume that the sample is longer or the same
        // and there for cut off earlier. So we should find the root most frame in
        // the sample somewhere in the control.
        c--;
      }

      for (; s >= 1 && c >= 0; s--, c--) {
        // Next we find the first one that isn't the same which should be the
        // frame that called our sample function and the control.
        if (sampleLines[s] !== controlLines[c]) {
          // In V8, the first line is describing the message but other VMs don't.
          // If we're about to return the first line, and the control is also on the same
          // line, that's a pretty good indicator that our sample threw at same line as
          // the control. I.e. before we entered the sample frame. So we ignore this result.
          // This can happen if you passed a class to function component, or non-function.
          if (s !== 1 || c !== 1) {
            do {
              s--;
              c--; // We may still have similar intermediate frames from the construct call.
              // The next one that isn't the same should be our match though.

              if (c < 0 || sampleLines[s] !== controlLines[c]) {
                // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
                var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
                // but we have a user-provided "displayName"
                // splice it in to make the stack more readable.


                if (fn.displayName && _frame.includes('<anonymous>')) {
                  _frame = _frame.replace('<anonymous>', fn.displayName);
                }

                {
                  if (typeof fn === 'function') {
                    componentFrameCache.set(fn, _frame);
                  }
                } // Return the line we found.


                return _frame;
              }
            } while (s >= 1 && c >= 0);
          }

          break;
        }
      }
    }
  } finally {
    reentry = false;

    {
      ReactCurrentDispatcher.current = previousDispatcher;
      reenableLogs();
    }

    Error.prepareStackTrace = previousPrepareStackTrace;
  } // Fallback to just using the name if we couldn't make it throw.


  var name = fn ? fn.displayName || fn.name : '';
  var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';

  {
    if (typeof fn === 'function') {
      componentFrameCache.set(fn, syntheticFrame);
    }
  }

  return syntheticFrame;
}
function describeFunctionComponentFrame(fn, source, ownerFn) {
  {
    return describeNativeComponentFrame(fn, false);
  }
}

function shouldConstruct(Component) {
  var prototype = Component.prototype;
  return !!(prototype && prototype.isReactComponent);
}

function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {

  if (type == null) {
    return '';
  }

  if (typeof type === 'function') {
    {
      return describeNativeComponentFrame(type, shouldConstruct(type));
    }
  }

  if (typeof type === 'string') {
    return describeBuiltInComponentFrame(type);
  }

  switch (type) {
    case REACT_SUSPENSE_TYPE:
      return describeBuiltInComponentFrame('Suspense');

    case REACT_SUSPENSE_LIST_TYPE:
      return describeBuiltInComponentFrame('SuspenseList');
  }

  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_FORWARD_REF_TYPE:
        return describeFunctionComponentFrame(type.render);

      case REACT_MEMO_TYPE:
        // Memo may contain any component type so we recursively resolve it.
        return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);

      case REACT_LAZY_TYPE:
        {
          var lazyComponent = type;
          var payload = lazyComponent._payload;
          var init = lazyComponent._init;

          try {
            // Lazy may contain any component type so we recursively resolve it.
            return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
          } catch (x) {}
        }
    }
  }

  return '';
}

var hasOwnProperty = Object.prototype.hasOwnProperty;

var loggedTypeFailures = {};
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;

function setCurrentlyValidatingElement(element) {
  {
    if (element) {
      var owner = element._owner;
      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
      ReactDebugCurrentFrame.setExtraStackFrame(stack);
    } else {
      ReactDebugCurrentFrame.setExtraStackFrame(null);
    }
  }
}

function checkPropTypes(typeSpecs, values, location, componentName, element) {
  {
    // $FlowFixMe This is okay but Flow doesn't know it.
    var has = Function.call.bind(hasOwnProperty);

    for (var typeSpecName in typeSpecs) {
      if (has(typeSpecs, typeSpecName)) {
        var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
        // fail the render phase where it didn't fail before. So we log it.
        // After these have been cleaned up, we'll let them throw.

        try {
          // This is intentionally an invariant that gets caught. It's the same
          // behavior as without this statement except with a better message.
          if (typeof typeSpecs[typeSpecName] !== 'function') {
            // eslint-disable-next-line react-internal/prod-error-codes
            var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
            err.name = 'Invariant Violation';
            throw err;
          }

          error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
        } catch (ex) {
          error$1 = ex;
        }

        if (error$1 && !(error$1 instanceof Error)) {
          setCurrentlyValidatingElement(element);

          error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);

          setCurrentlyValidatingElement(null);
        }

        if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
          // Only monitor this failure once because there tends to be a lot of the
          // same error.
          loggedTypeFailures[error$1.message] = true;
          setCurrentlyValidatingElement(element);

          error('Failed %s type: %s', location, error$1.message);

          setCurrentlyValidatingElement(null);
        }
      }
    }
  }
}

var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare

function isArray(a) {
  return isArrayImpl(a);
}

/*
 * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
 * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
 *
 * The functions in this module will throw an easier-to-understand,
 * easier-to-debug exception with a clear errors message message explaining the
 * problem. (Instead of a confusing exception thrown inside the implementation
 * of the `value` object).
 */
// $FlowFixMe only called in DEV, so void return is not possible.
function typeName(value) {
  {
    // toStringTag is needed for namespaced types like Temporal.Instant
    var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
    var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
    return type;
  }
} // $FlowFixMe only called in DEV, so void return is not possible.


function willCoercionThrow(value) {
  {
    try {
      testStringCoercion(value);
      return false;
    } catch (e) {
      return true;
    }
  }
}

function testStringCoercion(value) {
  // If you ended up here by following an exception call stack, here's what's
  // happened: you supplied an object or symbol value to React (as a prop, key,
  // DOM attribute, CSS property, string ref, etc.) and when React tried to
  // coerce it to a string using `'' + value`, an exception was thrown.
  //
  // The most common types that will cause this exception are `Symbol` instances
  // and Temporal objects like `Temporal.Instant`. But any object that has a
  // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
  // exception. (Library authors do this to prevent users from using built-in
  // numeric operators like `+` or comparison operators like `>=` because custom
  // methods are needed to perform accurate arithmetic or comparison.)
  //
  // To fix the problem, coerce this object or symbol value to a string before
  // passing it to React. The most reliable way is usually `String(value)`.
  //
  // To find which value is throwing, check the browser or debugger console.
  // Before this exception was thrown, there should be `console.error` output
  // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
  // problem and how that type was used: key, atrribute, input value prop, etc.
  // In most cases, this console output also shows the component and its
  // ancestor components where the exception happened.
  //
  // eslint-disable-next-line react-internal/safe-string-coercion
  return '' + value;
}
function checkKeyStringCoercion(value) {
  {
    if (willCoercionThrow(value)) {
      error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));

      return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
    }
  }
}

var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
var RESERVED_PROPS = {
  key: true,
  ref: true,
  __self: true,
  __source: true
};
var specialPropKeyWarningShown;
var specialPropRefWarningShown;
var didWarnAboutStringRefs;

{
  didWarnAboutStringRefs = {};
}

function hasValidRef(config) {
  {
    if (hasOwnProperty.call(config, 'ref')) {
      var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;

      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }

  return config.ref !== undefined;
}

function hasValidKey(config) {
  {
    if (hasOwnProperty.call(config, 'key')) {
      var getter = Object.getOwnPropertyDescriptor(config, 'key').get;

      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }

  return config.key !== undefined;
}

function warnIfStringRefCannotBeAutoConverted(config, self) {
  {
    if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
      var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);

      if (!didWarnAboutStringRefs[componentName]) {
        error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);

        didWarnAboutStringRefs[componentName] = true;
      }
    }
  }
}

function defineKeyPropWarningGetter(props, displayName) {
  {
    var warnAboutAccessingKey = function () {
      if (!specialPropKeyWarningShown) {
        specialPropKeyWarningShown = true;

        error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
      }
    };

    warnAboutAccessingKey.isReactWarning = true;
    Object.defineProperty(props, 'key', {
      get: warnAboutAccessingKey,
      configurable: true
    });
  }
}

function defineRefPropWarningGetter(props, displayName) {
  {
    var warnAboutAccessingRef = function () {
      if (!specialPropRefWarningShown) {
        specialPropRefWarningShown = true;

        error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
      }
    };

    warnAboutAccessingRef.isReactWarning = true;
    Object.defineProperty(props, 'ref', {
      get: warnAboutAccessingRef,
      configurable: true
    });
  }
}
/**
 * Factory method to create a new React element. This no longer adheres to
 * the class pattern, so do not use new to call it. Also, instanceof check
 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
 * if something is a React Element.
 *
 * @param {*} type
 * @param {*} props
 * @param {*} key
 * @param {string|object} ref
 * @param {*} owner
 * @param {*} self A *temporary* helper to detect places where `this` is
 * different from the `owner` when React.createElement is called, so that we
 * can warn. We want to get rid of owner and replace string `ref`s with arrow
 * functions, and as long as `this` and owner are the same, there will be no
 * change in behavior.
 * @param {*} source An annotation object (added by a transpiler or otherwise)
 * indicating filename, line number, and/or other information.
 * @internal
 */


var ReactElement = function (type, key, ref, self, source, owner, props) {
  var element = {
    // This tag allows us to uniquely identify this as a React Element
    $$typeof: REACT_ELEMENT_TYPE,
    // Built-in properties that belong on the element
    type: type,
    key: key,
    ref: ref,
    props: props,
    // Record the component responsible for creating this element.
    _owner: owner
  };

  {
    // The validation flag is currently mutative. We put it on
    // an external backing store so that we can freeze the whole object.
    // This can be replaced with a WeakMap once they are implemented in
    // commonly used development environments.
    element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
    // the validation flag non-enumerable (where possible, which should
    // include every environment we run tests in), so the test framework
    // ignores it.

    Object.defineProperty(element._store, 'validated', {
      configurable: false,
      enumerable: false,
      writable: true,
      value: false
    }); // self and source are DEV only properties.

    Object.defineProperty(element, '_self', {
      configurable: false,
      enumerable: false,
      writable: false,
      value: self
    }); // Two elements created in two different places should be considered
    // equal for testing purposes and therefore we hide it from enumeration.

    Object.defineProperty(element, '_source', {
      configurable: false,
      enumerable: false,
      writable: false,
      value: source
    });

    if (Object.freeze) {
      Object.freeze(element.props);
      Object.freeze(element);
    }
  }

  return element;
};
/**
 * https://github.com/reactjs/rfcs/pull/107
 * @param {*} type
 * @param {object} props
 * @param {string} key
 */

function jsxDEV(type, config, maybeKey, source, self) {
  {
    var propName; // Reserved names are extracted

    var props = {};
    var key = null;
    var ref = null; // Currently, key can be spread in as a prop. This causes a potential
    // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
    // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
    // but as an intermediary step, we will use jsxDEV for everything except
    // <div {...props} key="Hi" />, because we aren't currently able to tell if
    // key is explicitly declared to be undefined or not.

    if (maybeKey !== undefined) {
      {
        checkKeyStringCoercion(maybeKey);
      }

      key = '' + maybeKey;
    }

    if (hasValidKey(config)) {
      {
        checkKeyStringCoercion(config.key);
      }

      key = '' + config.key;
    }

    if (hasValidRef(config)) {
      ref = config.ref;
      warnIfStringRefCannotBeAutoConverted(config, self);
    } // Remaining properties are added to a new props object


    for (propName in config) {
      if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
        props[propName] = config[propName];
      }
    } // Resolve default props


    if (type && type.defaultProps) {
      var defaultProps = type.defaultProps;

      for (propName in defaultProps) {
        if (props[propName] === undefined) {
          props[propName] = defaultProps[propName];
        }
      }
    }

    if (key || ref) {
      var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;

      if (key) {
        defineKeyPropWarningGetter(props, displayName);
      }

      if (ref) {
        defineRefPropWarningGetter(props, displayName);
      }
    }

    return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
  }
}

var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;

function setCurrentlyValidatingElement$1(element) {
  {
    if (element) {
      var owner = element._owner;
      var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
      ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
    } else {
      ReactDebugCurrentFrame$1.setExtraStackFrame(null);
    }
  }
}

var propTypesMisspellWarningShown;

{
  propTypesMisspellWarningShown = false;
}
/**
 * Verifies the object is a ReactElement.
 * See https://reactjs.org/docs/react-api.html#isvalidelement
 * @param {?object} object
 * @return {boolean} True if `object` is a ReactElement.
 * @final
 */


function isValidElement(object) {
  {
    return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  }
}

function getDeclarationErrorAddendum() {
  {
    if (ReactCurrentOwner$1.current) {
      var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);

      if (name) {
        return '\n\nCheck the render method of `' + name + '`.';
      }
    }

    return '';
  }
}

function getSourceInfoErrorAddendum(source) {
  {
    if (source !== undefined) {
      var fileName = source.fileName.replace(/^.*[\\\/]/, '');
      var lineNumber = source.lineNumber;
      return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
    }

    return '';
  }
}
/**
 * Warn if there's no key explicitly set on dynamic arrays of children or
 * object keys are not valid. This allows us to keep track of children between
 * updates.
 */


var ownerHasKeyUseWarning = {};

function getCurrentComponentErrorInfo(parentType) {
  {
    var info = getDeclarationErrorAddendum();

    if (!info) {
      var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;

      if (parentName) {
        info = "\n\nCheck the top-level render call using <" + parentName + ">.";
      }
    }

    return info;
  }
}
/**
 * Warn if the element doesn't have an explicit key assigned to it.
 * This element is in an array. The array could grow and shrink or be
 * reordered. All children that haven't already been validated are required to
 * have a "key" property assigned to it. Error statuses are cached so a warning
 * will only be shown once.
 *
 * @internal
 * @param {ReactElement} element Element that requires a key.
 * @param {*} parentType element's parent's type.
 */


function validateExplicitKey(element, parentType) {
  {
    if (!element._store || element._store.validated || element.key != null) {
      return;
    }

    element._store.validated = true;
    var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);

    if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
      return;
    }

    ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
    // property, it may be the creator of the child that's responsible for
    // assigning it a key.

    var childOwner = '';

    if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
      // Give the component that originally created this child.
      childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
    }

    setCurrentlyValidatingElement$1(element);

    error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);

    setCurrentlyValidatingElement$1(null);
  }
}
/**
 * Ensure that every element either is passed in a static location, in an
 * array with an explicit keys property defined, or in an object literal
 * with valid key property.
 *
 * @internal
 * @param {ReactNode} node Statically passed child of any type.
 * @param {*} parentType node's parent's type.
 */


function validateChildKeys(node, parentType) {
  {
    if (typeof node !== 'object') {
      return;
    }

    if (isArray(node)) {
      for (var i = 0; i < node.length; i++) {
        var child = node[i];

        if (isValidElement(child)) {
          validateExplicitKey(child, parentType);
        }
      }
    } else if (isValidElement(node)) {
      // This element was passed in a valid location.
      if (node._store) {
        node._store.validated = true;
      }
    } else if (node) {
      var iteratorFn = getIteratorFn(node);

      if (typeof iteratorFn === 'function') {
        // Entry iterators used to provide implicit keys,
        // but now we print a separate warning for them later.
        if (iteratorFn !== node.entries) {
          var iterator = iteratorFn.call(node);
          var step;

          while (!(step = iterator.next()).done) {
            if (isValidElement(step.value)) {
              validateExplicitKey(step.value, parentType);
            }
          }
        }
      }
    }
  }
}
/**
 * Given an element, validate that its props follow the propTypes definition,
 * provided by the type.
 *
 * @param {ReactElement} element
 */


function validatePropTypes(element) {
  {
    var type = element.type;

    if (type === null || type === undefined || typeof type === 'string') {
      return;
    }

    var propTypes;

    if (typeof type === 'function') {
      propTypes = type.propTypes;
    } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
    // Inner props are checked in the reconciler.
    type.$$typeof === REACT_MEMO_TYPE)) {
      propTypes = type.propTypes;
    } else {
      return;
    }

    if (propTypes) {
      // Intentionally inside to avoid triggering lazy initializers:
      var name = getComponentNameFromType(type);
      checkPropTypes(propTypes, element.props, 'prop', name, element);
    } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
      propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:

      var _name = getComponentNameFromType(type);

      error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
    }

    if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
      error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
    }
  }
}
/**
 * Given a fragment, validate that it can only be provided with fragment props
 * @param {ReactElement} fragment
 */


function validateFragmentProps(fragment) {
  {
    var keys = Object.keys(fragment.props);

    for (var i = 0; i < keys.length; i++) {
      var key = keys[i];

      if (key !== 'children' && key !== 'key') {
        setCurrentlyValidatingElement$1(fragment);

        error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);

        setCurrentlyValidatingElement$1(null);
        break;
      }
    }

    if (fragment.ref !== null) {
      setCurrentlyValidatingElement$1(fragment);

      error('Invalid attribute `ref` supplied to `React.Fragment`.');

      setCurrentlyValidatingElement$1(null);
    }
  }
}

var didWarnAboutKeySpread = {};
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
  {
    var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
    // succeed and there will likely be errors in render.

    if (!validType) {
      var info = '';

      if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
        info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
      }

      var sourceInfo = getSourceInfoErrorAddendum(source);

      if (sourceInfo) {
        info += sourceInfo;
      } else {
        info += getDeclarationErrorAddendum();
      }

      var typeString;

      if (type === null) {
        typeString = 'null';
      } else if (isArray(type)) {
        typeString = 'array';
      } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
        typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
        info = ' Did you accidentally export a JSX literal instead of a component?';
      } else {
        typeString = typeof type;
      }

      error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
    }

    var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
    // TODO: Drop this when these are no longer allowed as the type argument.

    if (element == null) {
      return element;
    } // Skip key warning if the type isn't valid since our key validation logic
    // doesn't expect a non-string/function type and can throw confusing errors.
    // We don't want exception behavior to differ between dev and prod.
    // (Rendering will throw with a helpful message and as soon as the type is
    // fixed, the key warnings will appear.)


    if (validType) {
      var children = props.children;

      if (children !== undefined) {
        if (isStaticChildren) {
          if (isArray(children)) {
            for (var i = 0; i < children.length; i++) {
              validateChildKeys(children[i], type);
            }

            if (Object.freeze) {
              Object.freeze(children);
            }
          } else {
            error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
          }
        } else {
          validateChildKeys(children, type);
        }
      }
    }

    {
      if (hasOwnProperty.call(props, 'key')) {
        var componentName = getComponentNameFromType(type);
        var keys = Object.keys(props).filter(function (k) {
          return k !== 'key';
        });
        var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';

        if (!didWarnAboutKeySpread[componentName + beforeExample]) {
          var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';

          error('A props object containing a "key" prop is being spread into JSX:\n' + '  let props = %s;\n' + '  <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + '  let props = %s;\n' + '  <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);

          didWarnAboutKeySpread[componentName + beforeExample] = true;
        }
      }
    }

    if (type === REACT_FRAGMENT_TYPE) {
      validateFragmentProps(element);
    } else {
      validatePropTypes(element);
    }

    return element;
  }
} // These two functions exist to still get child warnings in dev
// even with the prod transform. This means that jsxDEV is purely
// opt-in behavior for better messages but that we won't stop
// giving you warnings if you use production apis.

function jsxWithValidationStatic(type, props, key) {
  {
    return jsxWithValidation(type, props, key, true);
  }
}
function jsxWithValidationDynamic(type, props, key) {
  {
    return jsxWithValidation(type, props, key, false);
  }
}

var jsx =  jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
// for now we can ship identical prod functions

var jsxs =  jsxWithValidationStatic ;

exports.Fragment = REACT_FRAGMENT_TYPE;
exports.jsx = jsx;
exports.jsxs = jsxs;
  })();
}


/***/ }),

/***/ "./node_modules/react/jsx-runtime.js":
/*!*******************************************!*\
  !*** ./node_modules/react/jsx-runtime.js ***!
  \*******************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {



if (false) // removed by dead control flow
{} else {
  module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ "./node_modules/react/cjs/react-jsx-runtime.development.js");
}


/***/ }),

/***/ "./src/App.js":
/*!********************!*\
  !*** ./src/App.js ***!
  \********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_Header__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/Header */ "./src/components/Header.js");
/* harmony import */ var _components_Sidebar__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/Sidebar */ "./src/components/Sidebar.js");
/* harmony import */ var _utils_sidebarItems__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/sidebarItems */ "./src/utils/sidebarItems.js");
/* harmony import */ var _components_Canvas__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/Canvas */ "./src/components/Canvas.js");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router-dom/dist/index.js");
/* harmony import */ var _bsf_force_ui__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @bsf/force-ui */ "./node_modules/@bsf/force-ui/dist/force-ui.js");








const App = () => {
  // Remove admin bar padding.
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    document.querySelector('html.wp-toolbar').style.paddingTop = 0;
  }, []);
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react_router_dom__WEBPACK_IMPORTED_MODULE_6__.BrowserRouter, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "ast-tb-app"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_Header__WEBPACK_IMPORTED_MODULE_1__["default"], null), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_5__.Container, {
    className: "h-full ast-tb-container overflow-hidden ast-tb-sidebar",
    gap: "none"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_Sidebar__WEBPACK_IMPORTED_MODULE_2__["default"], {
    items: _utils_sidebarItems__WEBPACK_IMPORTED_MODULE_3__["default"]
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_Canvas__WEBPACK_IMPORTED_MODULE_4__["default"], null))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (App);

/***/ }),

/***/ "./src/components/Breadcrumbs.js":
/*!***************************************!*\
  !*** ./src/components/Breadcrumbs.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _bsf_force_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @bsf/force-ui */ "./node_modules/@bsf/force-ui/dist/force-ui.js");




const Breadcrumbs = () => {
  const {
    astra_base_url
  } = astra_theme_builder;
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_2__.Breadcrumb, {
    size: "sm"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_2__.Breadcrumb.List, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_2__.Breadcrumb.Item, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_2__.Breadcrumb.Link, {
    href: astra_base_url,
    className: "font-medium text-base leading-6 tracking-normal hover:no-underline focus:outline-none focus:ring-0 focus:border-transparent transition-none"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Dashboard', 'astra'))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "mt-2"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_2__.Breadcrumb.Separator, null)), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_2__.Breadcrumb.Item, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_2__.Breadcrumb.Page, {
    className: "font-medium text-base leading-6 tracking-normal"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Site Builder', 'astra')))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Breadcrumbs);

/***/ }),

/***/ "./src/components/Canvas.js":
/*!**********************************!*\
  !*** ./src/components/Canvas.js ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Layouts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Layouts */ "./src/components/Layouts.js");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router/dist/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _bsf_force_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @bsf/force-ui */ "./node_modules/@bsf/force-ui/dist/force-ui.js");
/* harmony import */ var _ProButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ProButton */ "./src/components/ProButton.js");







const Canvas = () => {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "bg-background-secondary flex-grow relative overflow-y-auto py-6 px-8 "
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_3__.Container, {
    className: "flex w-full justify-between items-center border-b border-gray-300 ast-tb-canvas-header",
    gap: "none"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", {
    className: "font-semibold text-text-primary text-[20px] leading-[30px] tracking-[-0.005em]"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Start customizing every part of your website.', 'astra')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_ProButton__WEBPACK_IMPORTED_MODULE_4__["default"], {
    className: "ast-upgrade-btn",
    disableSpinner: true
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "ast-tb-canvas-content"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Routes, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react_router_dom__WEBPACK_IMPORTED_MODULE_5__.Route, {
    path: "*",
    element: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Layouts__WEBPACK_IMPORTED_MODULE_1__["default"], null)
  })))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Canvas);

/***/ }),

/***/ "./src/components/Card.js":
/*!********************************!*\
  !*** ./src/components/Card.js ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _bsf_force_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @bsf/force-ui */ "./node_modules/@bsf/force-ui/dist/force-ui.js");
/* harmony import */ var _ProButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ProButton */ "./src/components/ProButton.js");






function Card({
  title,
  icon
}) {
  const [isHovered, setIsHovered] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  const handleMouseEnter = () => {
    setIsHovered(true);
  };
  const handleMouseLeave = () => {
    setIsHovered(false);
  };
  const getDescription = title => {
    switch (title) {
      case 'Header':
        return 'Replace the current site header with custom layout content';
      case 'Footer':
        return 'Replace the current site footer with custom layout content';
      case 'Single':
        return 'Create a custom template for Single Posts using the Site Builder';
      case 'Archive':
        return 'Create a custom template for Archives using the Site Builder';
      case 'Inside Post/Page':
        return 'Design a layout in one place and display it on multiple pages/posts';
      case 'Hooks':
        return 'Insert custom code or content using Astra hooks';
      case '404 Page':
        return 'Change the design of your 404 page using the Site Builder';
      default:
        return `This is a ${title}`;
    }
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "ast-tb-card-parent relative",
    onMouseEnter: handleMouseEnter,
    onMouseLeave: handleMouseLeave
  }, icon && isHovered && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "ast-tb-locked absolute inset-0 bg-white bg-opacity-90 flex flex-col items-center justify-center z-10 rounded-md hover:bg-[#141338]"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_2__.Badge, {
    className: "p-0.5",
    label: "PRO",
    size: "sm",
    type: "rounded"
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h3", {
    className: "font-semibold text-center px-4 font-normal text-[18px] leading-[16px] text-text-on-color text-center"
  }, title), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
    className: "text-center px-4 mt-[-20px] font-normal text-[12px] leading-[16px] text-text-on-color text-center"
  }, getDescription(title)), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_ProButton__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "ast-upgrade-btn",
    disableSpinner: true
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "ast-tb-card min-w-[228px] max-w-[352px] rounded-md shadow-md bg-white"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: `flex justify-center items-center h-full ${isHovered ? 'ast-tb-card-icon-wrapper-hover' : ''}`
  }, icon), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "ast-tb-card-title-wrapper border-[#e9e9e9] p-[10px]"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h3", {
    className: "m-0 text-center text-text-primary font-semibold text-base leading-6"
  }, title))));
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Card);

/***/ }),

/***/ "./src/components/Header.js":
/*!**********************************!*\
  !*** ./src/components/Header.js ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _bsf_force_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @bsf/force-ui */ "./node_modules/@bsf/force-ui/dist/force-ui.js");
/* harmony import */ var _Breadcrumbs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Breadcrumbs */ "./src/components/Breadcrumbs.js");




const Header = () => {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_1__.Topbar, {
    className: "z-999999 h-[80px] shadow-sm"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_1__.Topbar.Left, {
    gap: "xs"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_1__.Topbar.Item, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
    width: "48",
    height: "48",
    viewBox: "0 0 40 40",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", {
    width: "40",
    height: "40",
    rx: "20",
    fill: "url(#paint0_linear_6786_60902)"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M19.7688 8.00063C19.7679 7.99979 19.7688 7.99979 19.7688 8.00063C16.5122 14.6651 13.2557 21.333 10 27.9975C11.3949 27.9975 12.7907 27.9975 14.1865 27.9975C16.8208 22.8376 19.4568 17.6759 22.0919 12.5126L19.7688 8.00063Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M24.1092 16.2694C22.7652 18.976 21.4213 21.6833 20.0774 24.3899L19.9996 24.5408H20.0774C21.3695 24.5408 22.6615 24.5408 23.9536 24.5408C24.4704 25.6933 24.9873 26.8475 25.5041 28C27.0027 28 28.5014 28 30 28C28.0364 24.0881 26.0719 20.1788 24.1092 16.2694Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("defs", null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("linearGradient", {
    id: "paint0_linear_6786_60902",
    x1: "-5.96046e-07",
    y1: "40",
    x2: "47.0588",
    y2: "28.2353",
    gradientUnits: "userSpaceOnUse"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("stop", {
    stopColor: "#492CDD"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("stop", {
    offset: "1",
    stopColor: "#AD38E2"
  })))))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_1__.Topbar.Middle, {
    align: "left"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_1__.Topbar.Item, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "flex items-center gap-3"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", {
    className: "ast-tb-main-title font-semibold text-[24px] leading-[32px] tracking-[-0.006em] align-middle"
  }, astra_theme_builder.title), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Breadcrumbs__WEBPACK_IMPORTED_MODULE_2__["default"], null)))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_1__.Topbar.Right, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_1__.Topbar.Item, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "cursor-pointer",
    onClick: () => window.location.href = astra_theme_builder.astra_base_url
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 24 24",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M6 18L18 6M6 6L18 18",
    stroke: "#475569",
    strokeWidth: "1.5",
    strokeLinecap: "round",
    strokeLinejoin: "round"
  }))))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Header);

/***/ }),

/***/ "./src/components/Layouts.js":
/*!***********************************!*\
  !*** ./src/components/Layouts.js ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Card__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Card */ "./src/components/Card.js");
/* harmony import */ var _utils_layoutItems__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/layoutItems */ "./src/utils/layoutItems.js");
/* harmony import */ var _bsf_force_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @bsf/force-ui */ "./node_modules/@bsf/force-ui/dist/force-ui.js");





const Layouts = () => {
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_3__.Container, {
    containerType: "grid",
    className: "grid-cols-[repeat(auto-fill,_minmax(250px,_1fr))] mt-7 ast-tb-canvas-content gap-[30px] w-full"
  }, _utils_layoutItems__WEBPACK_IMPORTED_MODULE_2__["default"].map((item, index) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_Card__WEBPACK_IMPORTED_MODULE_1__["default"], {
    key: index,
    title: item.label,
    icon: item.icon
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Layouts);

/***/ }),

/***/ "./src/components/ProButton.js":
/*!*************************************!*\
  !*** ./src/components/ProButton.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _astra_utils_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @astra-utils/helpers */ "../utils/helpers.js");
/* harmony import */ var lucide_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lucide-react */ "./node_modules/lucide-react/dist/esm/icons/arrow-up-right.js");
/* harmony import */ var _bsf_force_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @bsf/force-ui */ "./node_modules/@bsf/force-ui/dist/force-ui.js");





const ProButton = ({
  className,
  isLink = false,
  url = astra_theme_builder.astra_pricing_page_url,
  children = (0,_astra_utils_helpers__WEBPACK_IMPORTED_MODULE_2__.getAstraProTitle)(),
  disableSpinner = false,
  spinnerPosition = 'left',
  Icon = lucide_react__WEBPACK_IMPORTED_MODULE_4__["default"],
  target = '_blank',
  rel = 'noreferrer',
  campaign = '',
  iconPosition = 'right' // <-- default position here
}) => {
  const onGetAstraPro = e => {
    (0,_astra_utils_helpers__WEBPACK_IMPORTED_MODULE_2__.handleGetAstraPro)(e, {
      url,
      campaign,
      disableSpinner,
      spinnerPosition
    });
  };
  const linkProps = isLink && {
    href: url,
    target,
    rel
  };
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_3__.Button, {
    variant: isLink ? 'link' : 'primary',
    className: (0,_astra_utils_helpers__WEBPACK_IMPORTED_MODULE_2__.classNames)('inline-flex items-center', isLink ? 'gap-0 focus:ring-0 focus:ring-offset-0 focus:shadow-none focus:outline-none hover:no-underline [&>svg]:w-4 [&>svg]:h-4' : '', className),
    onClick: onGetAstraPro,
    icon: Icon && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Icon, {
      size: 16
    }),
    iconPosition: iconPosition // <-- this is now dynamic
    ,
    ...linkProps
  }, children);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProButton);

/***/ }),

/***/ "./src/components/Sidebar.js":
/*!***********************************!*\
  !*** ./src/components/Sidebar.js ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _SidebarItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SidebarItem */ "./src/components/SidebarItem.js");
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router/dist/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _bsf_force_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @bsf/force-ui */ "./node_modules/@bsf/force-ui/dist/force-ui.js");
/* harmony import */ var lucide_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lucide-react */ "./node_modules/lucide-react/dist/esm/icons/layout-grid.js");
/* harmony import */ var lucide_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lucide-react */ "./node_modules/lucide-react/dist/esm/icons/circle-help.js");
/* harmony import */ var lucide_react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! lucide-react */ "./node_modules/lucide-react/dist/esm/icons/crown.js");
/* harmony import */ var _ProButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ProButton */ "./src/components/ProButton.js");

// Sidebar.js








const CustomSidebar = ({
  items
}) => {
  const location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_5__.useLocation)();
  const query = new URLSearchParams(location.search);
  const page = query.get('page');
  const path = query.get('path');
  const isSelectedItem = 'theme-builder' === page && 'all-layouts' === path;
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_3__.Sidebar, {
    className: "ast-tb-sidebar w-[15rem] py-6 px-6 py-4",
    borderOn: false
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_3__.Sidebar.Header, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: ` ast-tb-sidebar-header ${isSelectedItem ? 'ast-tb-sidebar-item-selected' : ''}`
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "ast-tb-sidebar-header-left"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(lucide_react__WEBPACK_IMPORTED_MODULE_6__["default"], {
    className: "w-6 h-6 text-gray-600"
  }), " ", (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h2", {
    className: "text-text-secondary font-figtree font-normal text-base leading-6 tracking-normal"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('All Layouts', 'astra'))))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_3__.Sidebar.Body, {
    className: "pb-5"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "ast-tb-sidebar-subtitle"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("h3", {
    className: "text-text-tertiary"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Website Parts', 'astra'))), items.map((item, index) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_SidebarItem__WEBPACK_IMPORTED_MODULE_1__["default"], {
    key: index,
    label: item.label,
    icon: item.icon,
    layout: item.layout,
    template: item.template
  })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "ast-tb-help-divider"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "ast-tb-sidebar-help ast-tb-sidebar-item py-3 rounded-md hover:bg-[#F3F3F8] hover:[color:#141338]",
    onClick: () => window.open(astra_theme_builder.astra_docs_page_url, '_blank')
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(lucide_react__WEBPACK_IMPORTED_MODULE_7__["default"], {
    className: "w-5 h-5 text-gray-400 w-[20px] h-[20px] text-icon-secondary group-hover:stroke-[#141338]"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "font-normal text-[16px] leading-[24px] text-text-secondary"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Help', 'astra'))), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "ast-tb-sidebar-help ast-tb-sidebar-item py-3 rounded-md hover:bg-[#F3F3F8] hover:[color:#141338]"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_ProButton__WEBPACK_IMPORTED_MODULE_4__["default"], {
    className: "ast-tb-sidebar-help text-link-primary font-figtree font-semibold text-base leading-6 tracking-normal",
    isLink: true,
    url: astra_theme_builder.astra_pricing_page_url,
    Icon: lucide_react__WEBPACK_IMPORTED_MODULE_8__["default"],
    iconPosition: "left",
    disableSpinner: true
  }))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CustomSidebar);

/***/ }),

/***/ "./src/components/SidebarItem.js":
/*!***************************************!*\
  !*** ./src/components/SidebarItem.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ "./node_modules/react-router/dist/index.js");
/* harmony import */ var _bsf_force_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @bsf/force-ui */ "./node_modules/@bsf/force-ui/dist/force-ui.js");
/* harmony import */ var lucide_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lucide-react */ "./node_modules/lucide-react/dist/esm/icons/lock.js");

// SidebarItem.js




const SidebarItem = ({
  label,
  icon,
  layout,
  template
}) => {
  const location = (0,react_router_dom__WEBPACK_IMPORTED_MODULE_2__.useLocation)();
  const [isHovered, setIsHovered] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  const query = new URLSearchParams(location.search);
  const page = query.get("page");
  const path = query.get("path");
  const isSelected = "theme-builder" === page && layout === path;
  const selectedClass = isSelected ? "ast-tb-sidebar-item-selected" : "";
  return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_bsf_force_ui__WEBPACK_IMPORTED_MODULE_1__.Sidebar.Item, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: `group ast-tb-sidebar-item ${selectedClass} pr-4 pl-4 ml-[-5px] py-3 rounded-md hover:bg-[#F3F3F8]`,
    onMouseEnter: () => setIsHovered(true),
    onMouseLeave: () => setIsHovered(false)
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "ast-tb-sidebar-item-left flex items-center gap-3"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: "ast-tb-sidebar-item-icon flex items-center justify-center"
  }, icon), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", {
    className: `text-text-secondary font-figtree font-normal text-base leading-6 tracking-normal group-hover:[color:#141338] ${label === "404 Page" || label === "Archive" ? "ast-tb-sidebar-item-svg" : ""}`
  }, label)), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
    className: "ast-tb-sidebar-item-right"
  }, isHovered && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(lucide_react__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "w-4 h-4 text-gray-400 group-hover:text-[#141338]"
  }))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SidebarItem);

/***/ }),

/***/ "./src/style/index.scss":
/*!******************************!*\
  !*** ./src/style/index.scss ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
// extracted by mini-css-extract-plugin


/***/ }),

/***/ "./src/utils/layoutItems.js":
/*!**********************************!*\
  !*** ./src/utils/layoutItems.js ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);


const layoutItems = [{
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Header", "astra"),
  layout: "header",
  icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
    width: "270",
    height: "270",
    viewBox: "0 0 270 270",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M37 45.5C37 41.0817 40.5817 37.5 45 37.5H225C229.418 37.5 233 41.0817 233 45.5V69.5H37V45.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("circle", {
    cx: "53",
    cy: "53.5",
    r: "6",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M119 53.5C119 52.9477 119.448 52.5 120 52.5H134C134.552 52.5 135 52.9477 135 53.5C135 54.0523 134.552 54.5 134 54.5H120C119.448 54.5 119 54.0523 119 53.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M141 53.5C141 52.9477 141.448 52.5 142 52.5H156C156.552 52.5 157 52.9477 157 53.5C157 54.0523 156.552 54.5 156 54.5H142C141.448 54.5 141 54.0523 141 53.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M163 53.5C163 52.9477 163.448 52.5 164 52.5H178C178.552 52.5 179 52.9477 179 53.5C179 54.0523 178.552 54.5 178 54.5H164C163.448 54.5 163 54.0523 163 53.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M185 53.5C185 52.9477 185.448 52.5 186 52.5H200C200.552 52.5 201 52.9477 201 53.5C201 54.0523 200.552 54.5 200 54.5H186C185.448 54.5 185 54.0523 185 53.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M207 53.5C207 52.9477 207.448 52.5 208 52.5H222C222.552 52.5 223 52.9477 223 53.5C223 54.0523 222.552 54.5 222 54.5H208C207.448 54.5 207 54.0523 207 53.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M45 38.5H225C228.866 38.5 232 41.634 232 45.5V225.5C232 229.366 228.866 232.5 225 232.5H45C41.134 232.5 38 229.366 38 225.5V45.5L38.0088 45.1396C38.1963 41.4411 41.2549 38.5 45 38.5Z",
    stroke: "#E6E6EF",
    "stroke-width": "2"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", {
    x: "37",
    y: "67.5",
    width: "196",
    height: "2",
    fill: "#E6E6EF"
  }))
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Footer", "astra"),
  layout: "footer",
  icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
    width: "270",
    height: "270",
    viewBox: "0 0 270 270",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M37 225.5C37 229.918 40.5817 233.5 45 233.5H225C229.418 233.5 233 229.918 233 225.5V189.5H37V225.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("circle", {
    cx: "53",
    cy: "208.5",
    r: "6",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M117 217.5C117 216.948 117.448 216.5 118 216.5H138C138.552 216.5 139 216.948 139 217.5C139 218.052 138.552 218.5 138 218.5H118C117.448 218.5 117 218.052 117 217.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M145 217.5C145 216.948 145.448 216.5 146 216.5H166C166.552 216.5 167 216.948 167 217.5C167 218.052 166.552 218.5 166 218.5H146C145.448 218.5 145 218.052 145 217.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M173 217.5C173 216.948 173.448 216.5 174 216.5H194C194.552 216.5 195 216.948 195 217.5C195 218.052 194.552 218.5 194 218.5H174C173.448 218.5 173 218.052 173 217.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M201 217.5C201 216.948 201.448 216.5 202 216.5H222C222.552 216.5 223 216.948 223 217.5C223 218.052 222.552 218.5 222 218.5H202C201.448 218.5 201 218.052 201 217.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M117 211.5C117 210.948 117.448 210.5 118 210.5H138C138.552 210.5 139 210.948 139 211.5C139 212.052 138.552 212.5 138 212.5H118C117.448 212.5 117 212.052 117 211.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M145 211.5C145 210.948 145.448 210.5 146 210.5H166C166.552 210.5 167 210.948 167 211.5C167 212.052 166.552 212.5 166 212.5H146C145.448 212.5 145 212.052 145 211.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M173 211.5C173 210.948 173.448 210.5 174 210.5H194C194.552 210.5 195 210.948 195 211.5C195 212.052 194.552 212.5 194 212.5H174C173.448 212.5 173 212.052 173 211.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M201 211.5C201 210.948 201.448 210.5 202 210.5H222C222.552 210.5 223 210.948 223 211.5C223 212.052 222.552 212.5 222 212.5H202C201.448 212.5 201 212.052 201 211.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M117 205.5C117 204.948 117.448 204.5 118 204.5H138C138.552 204.5 139 204.948 139 205.5C139 206.052 138.552 206.5 138 206.5H118C117.448 206.5 117 206.052 117 205.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M145 205.5C145 204.948 145.448 204.5 146 204.5H166C166.552 204.5 167 204.948 167 205.5C167 206.052 166.552 206.5 166 206.5H146C145.448 206.5 145 206.052 145 205.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M173 205.5C173 204.948 173.448 204.5 174 204.5H194C194.552 204.5 195 204.948 195 205.5C195 206.052 194.552 206.5 194 206.5H174C173.448 206.5 173 206.052 173 205.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M201 205.5C201 204.948 201.448 204.5 202 204.5H222C222.552 204.5 223 204.948 223 205.5C223 206.052 222.552 206.5 222 206.5H202C201.448 206.5 201 206.052 201 205.5Z",
    fill: "white"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M45 38.5H225C228.866 38.5 232 41.634 232 45.5V225.5C232 229.366 228.866 232.5 225 232.5H45C41.134 232.5 38 229.366 38 225.5V45.5L38.0088 45.1396C38.1963 41.4411 41.2549 38.5 45 38.5Z",
    stroke: "#E6E6EF",
    "stroke-width": "2"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", {
    x: "37",
    y: "189.5",
    width: "196",
    height: "2",
    fill: "#E6E6EF"
  }))
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Hooks", "astra"),
  layout: "hooks",
  icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
    width: "270",
    height: "270",
    viewBox: "0 0 270 270",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 133.5C67 135.709 68.7909 137.5 71 137.5H199C201.209 137.5 203 135.709 203 133.5V71.5C203 69.2909 201.209 67.5 199 67.5H71C68.7909 67.5 67 69.2909 67 71.5V133.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M147 110.5L155 102.5L147 94.5",
    stroke: "white",
    "stroke-width": "1.25",
    "stroke-linecap": "round",
    "stroke-linejoin": "round"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M123 94.5L115 102.5L123 110.5",
    stroke: "white",
    "stroke-width": "1.25",
    "stroke-linecap": "round",
    "stroke-linejoin": "round"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M140 86.5L130 118.5",
    stroke: "white",
    "stroke-width": "1.25",
    "stroke-linecap": "round",
    "stroke-linejoin": "round"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 146.5C67 147.052 67.4477 147.5 68 147.5H202C202.552 147.5 203 147.052 203 146.5C203 145.948 202.552 145.5 202 145.5H68C67.4477 145.5 67 145.948 67 146.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 154.5C67 155.052 67.4477 155.5 68 155.5H202C202.552 155.5 203 155.052 203 154.5C203 153.948 202.552 153.5 202 153.5H68C67.4477 153.5 67 153.948 67 154.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 162.5C67 163.052 67.4477 163.5 68 163.5H202C202.552 163.5 203 163.052 203 162.5C203 161.948 202.552 161.5 202 161.5H68C67.4477 161.5 67 161.948 67 162.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 170.5C67 171.052 67.4477 171.5 68 171.5H202C202.552 171.5 203 171.052 203 170.5C203 169.948 202.552 169.5 202 169.5H68C67.4477 169.5 67 169.948 67 170.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 178.5C67 179.052 67.4477 179.5 68 179.5H202C202.552 179.5 203 179.052 203 178.5C203 177.948 202.552 177.5 202 177.5H68C67.4477 177.5 67 177.948 67 178.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 186.5C67 187.052 67.4477 187.5 68 187.5H202C202.552 187.5 203 187.052 203 186.5C203 185.948 202.552 185.5 202 185.5H68C67.4477 185.5 67 185.948 67 186.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 194.5C67 195.052 67.4477 195.5 68 195.5H202C202.552 195.5 203 195.052 203 194.5C203 193.948 202.552 193.5 202 193.5H68C67.4477 193.5 67 193.948 67 194.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 202.5C67 203.052 67.4477 203.5 68 203.5H162C162.552 203.5 163 203.052 163 202.5C163 201.948 162.552 201.5 162 201.5H68C67.4477 201.5 67 201.948 67 202.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M45 38.5H225C228.866 38.5 232 41.634 232 45.5V225.5C232 229.366 228.866 232.5 225 232.5H45C41.134 232.5 38 229.366 38 225.5V45.5L38.0088 45.1396C38.1963 41.4411 41.2549 38.5 45 38.5Z",
    stroke: "#E6E6EF",
    "stroke-width": "2"
  }))
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Inside Post/Page", "astra"),
  layout: "content",
  icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
    width: "270",
    height: "270",
    viewBox: "0 0 270 270",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 133.5C67 135.709 68.7909 137.5 71 137.5H199C201.209 137.5 203 135.709 203 133.5V71.5C203 69.2909 201.209 67.5 199 67.5H71C68.7909 67.5 67 69.2909 67 71.5V133.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M147 110.5L155 102.5L147 94.5",
    stroke: "white",
    "stroke-width": "1.25",
    "stroke-linecap": "round",
    "stroke-linejoin": "round"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M123 94.5L115 102.5L123 110.5",
    stroke: "white",
    "stroke-width": "1.25",
    "stroke-linecap": "round",
    "stroke-linejoin": "round"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M140 86.5L130 118.5",
    stroke: "white",
    "stroke-width": "1.25",
    "stroke-linecap": "round",
    "stroke-linejoin": "round"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 146.5C67 147.052 67.4477 147.5 68 147.5H202C202.552 147.5 203 147.052 203 146.5C203 145.948 202.552 145.5 202 145.5H68C67.4477 145.5 67 145.948 67 146.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 154.5C67 155.052 67.4477 155.5 68 155.5H202C202.552 155.5 203 155.052 203 154.5C203 153.948 202.552 153.5 202 153.5H68C67.4477 153.5 67 153.948 67 154.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 162.5C67 163.052 67.4477 163.5 68 163.5H202C202.552 163.5 203 163.052 203 162.5C203 161.948 202.552 161.5 202 161.5H68C67.4477 161.5 67 161.948 67 162.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 170.5C67 171.052 67.4477 171.5 68 171.5H202C202.552 171.5 203 171.052 203 170.5C203 169.948 202.552 169.5 202 169.5H68C67.4477 169.5 67 169.948 67 170.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 178.5C67 179.052 67.4477 179.5 68 179.5H202C202.552 179.5 203 179.052 203 178.5C203 177.948 202.552 177.5 202 177.5H68C67.4477 177.5 67 177.948 67 178.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 186.5C67 187.052 67.4477 187.5 68 187.5H202C202.552 187.5 203 187.052 203 186.5C203 185.948 202.552 185.5 202 185.5H68C67.4477 185.5 67 185.948 67 186.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 194.5C67 195.052 67.4477 195.5 68 195.5H202C202.552 195.5 203 195.052 203 194.5C203 193.948 202.552 193.5 202 193.5H68C67.4477 193.5 67 193.948 67 194.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 202.5C67 203.052 67.4477 203.5 68 203.5H162C162.552 203.5 163 203.052 163 202.5C163 201.948 162.552 201.5 162 201.5H68C67.4477 201.5 67 201.948 67 202.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M45 38.5H225C228.866 38.5 232 41.634 232 45.5V225.5C232 229.366 228.866 232.5 225 232.5H45C41.134 232.5 38 229.366 38 225.5V45.5L38.0088 45.1396C38.1963 41.4411 41.2549 38.5 45 38.5Z",
    stroke: "#E6E6EF",
    "stroke-width": "2"
  }))
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Single", "astra"),
  layout: "template",
  template: "single",
  icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
    width: "270",
    height: "269",
    viewBox: "0 0 270 269",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 133C67 135.209 68.7909 137 71 137H199C201.209 137 203 135.209 203 133V87C203 84.7909 201.209 83 199 83H71C68.7909 83 67 84.7909 67 87V133Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("circle", {
    cx: "73",
    cy: "73",
    r: "6",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M85 70.5C85 71.0523 85.4477 71.5 86 71.5H100C100.552 71.5 101 71.0523 101 70.5C101 69.9477 100.552 69.5 100 69.5H86C85.4477 69.5 85 69.9477 85 70.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M85 75.5C85 76.0523 85.4477 76.5 86 76.5H120C120.552 76.5 121 76.0523 121 75.5C121 74.9477 120.552 74.5 120 74.5H86C85.4477 74.5 85 74.9477 85 75.5Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 146C67 146.552 67.4477 147 68 147H202C202.552 147 203 146.552 203 146C203 145.448 202.552 145 202 145H68C67.4477 145 67 145.448 67 146Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 154C67 154.552 67.4477 155 68 155H202C202.552 155 203 154.552 203 154C203 153.448 202.552 153 202 153H68C67.4477 153 67 153.448 67 154Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 162C67 162.552 67.4477 163 68 163H202C202.552 163 203 162.552 203 162C203 161.448 202.552 161 202 161H68C67.4477 161 67 161.448 67 162Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 170C67 170.552 67.4477 171 68 171H202C202.552 171 203 170.552 203 170C203 169.448 202.552 169 202 169H68C67.4477 169 67 169.448 67 170Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 178C67 178.552 67.4477 179 68 179H202C202.552 179 203 178.552 203 178C203 177.448 202.552 177 202 177H68C67.4477 177 67 177.448 67 178Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 186C67 186.552 67.4477 187 68 187H202C202.552 187 203 186.552 203 186C203 185.448 202.552 185 202 185H68C67.4477 185 67 185.448 67 186Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 194C67 194.552 67.4477 195 68 195H202C202.552 195 203 194.552 203 194C203 193.448 202.552 193 202 193H68C67.4477 193 67 193.448 67 194Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 202C67 202.552 67.4477 203 68 203H162C162.552 203 163 202.552 163 202C163 201.448 162.552 201 162 201H68C67.4477 201 67 201.448 67 202Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M45 38H225C228.866 38 232 41.134 232 45V225C232 228.866 228.866 232 225 232H45C41.134 232 38 228.866 38 225V45L38.0088 44.6396C38.1963 40.9411 41.2549 38 45 38Z",
    stroke: "#E6E6EF",
    "stroke-width": "2"
  }))
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Archive", "astra"),
  layout: "template",
  template: "archive",
  icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
    width: "270",
    height: "269",
    viewBox: "0 0 270 269",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 101C67 103.209 68.7909 105 71 105H125C127.209 105 129 103.209 129 101V71C129 68.7909 127.209 67 125 67H71C68.7909 67 67 68.7909 67 71V101Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 112C67 112.552 67.4477 113 68 113H128C128.552 113 129 112.552 129 112C129 111.448 128.552 111 128 111H68C67.4477 111 67 111.448 67 112Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 120C67 120.552 67.4477 121 68 121H128C128.552 121 129 120.552 129 120C129 119.448 128.552 119 128 119H68C67.4477 119 67 119.448 67 120Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 128C67 128.552 67.4477 129 68 129H108C108.552 129 109 128.552 109 128C109 127.448 108.552 127 108 127H68C67.4477 127 67 127.448 67 128Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 175C67 177.209 68.7909 179 71 179H125C127.209 179 129 177.209 129 175V145C129 142.791 127.209 141 125 141H71C68.7909 141 67 142.791 67 145V175Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 186C67 186.552 67.4477 187 68 187H128C128.552 187 129 186.552 129 186C129 185.448 128.552 185 128 185H68C67.4477 185 67 185.448 67 186Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 194C67 194.552 67.4477 195 68 195H128C128.552 195 129 194.552 129 194C129 193.448 128.552 193 128 193H68C67.4477 193 67 193.448 67 194Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M67 202C67 202.552 67.4477 203 68 203H108C108.552 203 109 202.552 109 202C109 201.448 108.552 201 108 201H68C67.4477 201 67 201.448 67 202Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M141 101C141 103.209 142.791 105 145 105H199C201.209 105 203 103.209 203 101V71C203 68.7909 201.209 67 199 67H145C142.791 67 141 68.7909 141 71V101Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M141 112C141 112.552 141.448 113 142 113H202C202.552 113 203 112.552 203 112C203 111.448 202.552 111 202 111H142C141.448 111 141 111.448 141 112Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M141 120C141 120.552 141.448 121 142 121H202C202.552 121 203 120.552 203 120C203 119.448 202.552 119 202 119H142C141.448 119 141 119.448 141 120Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M141 128C141 128.552 141.448 129 142 129H182C182.552 129 183 128.552 183 128C183 127.448 182.552 127 182 127H142C141.448 127 141 127.448 141 128Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M141 175C141 177.209 142.791 179 145 179H199C201.209 179 203 177.209 203 175V145C203 142.791 201.209 141 199 141H145C142.791 141 141 142.791 141 145V175Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M141 186C141 186.552 141.448 187 142 187H202C202.552 187 203 186.552 203 186C203 185.448 202.552 185 202 185H142C141.448 185 141 185.448 141 186Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M141 194C141 194.552 141.448 195 142 195H202C202.552 195 203 194.552 203 194C203 193.448 202.552 193 202 193H142C141.448 193 141 193.448 141 194Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M141 202C141 202.552 141.448 203 142 203H182C182.552 203 183 202.552 183 202C183 201.448 182.552 201 182 201H142C141.448 201 141 201.448 141 202Z",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M45 38H225C228.866 38 232 41.134 232 45V225C232 228.866 228.866 232 225 232H45C41.134 232 38 228.866 38 225V45L38.0088 44.6396C38.1963 40.9411 41.2549 38 45 38Z",
    stroke: "#E6E6EF",
    "stroke-width": "2"
  }))
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("404 Page", "astra"),
  layout: "404-page",
  icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
    width: "270",
    height: "269",
    viewBox: "0 0 270 269",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("circle", {
    cx: "50",
    cy: "53",
    r: "3",
    fill: "#D2D3E2"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("circle", {
    cx: "60",
    cy: "53",
    r: "3",
    fill: "#D2D3E2"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("circle", {
    cx: "70",
    cy: "53",
    r: "3",
    fill: "#D2D3E2"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M45 38H225C228.866 38 232 41.134 232 45V225C232 228.866 228.866 232 225 232H45C41.134 232 38 228.866 38 225V45L38.0088 44.6396C38.1963 40.9411 41.2549 38 45 38Z",
    stroke: "#E6E6EF",
    "stroke-width": "2"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", {
    x: "37",
    y: "67",
    width: "196",
    height: "2",
    fill: "#E6E6EF"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M109.825 162V155.547H98.4091V153.81L109.825 137.182H112.059V153.455H117.413V155.547H112.059V162H109.825ZM101.21 153.455H109.825V140.834L101.21 153.455Z",
    fill: "#D2D3E2"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M135 163.637C142.531 163.637 148.636 157.532 148.636 150.001C148.636 142.469 142.531 136.364 135 136.364C127.469 136.364 121.364 142.469 121.364 150.001C121.364 157.532 127.469 163.637 135 163.637Z",
    stroke: "#D2D3E2",
    "stroke-width": "1.70455",
    "stroke-linecap": "round",
    "stroke-linejoin": "round"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M135 144.546V150",
    stroke: "#D2D3E2",
    "stroke-width": "1.70455",
    "stroke-linecap": "round",
    "stroke-linejoin": "round"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M135 155.455H135.014",
    stroke: "#D2D3E2",
    "stroke-width": "1.70455",
    "stroke-linecap": "round",
    "stroke-linejoin": "round"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M164.553 162V155.547H153.136V153.81L164.553 137.182H166.786V153.455H172.14V155.547H166.786V162H164.553ZM155.937 153.455H164.553V140.834L155.937 153.455Z",
    fill: "#D2D3E2"
  }))
}];
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (layoutItems);

/***/ }),

/***/ "./src/utils/sidebarItems.js":
/*!***********************************!*\
  !*** ./src/utils/sidebarItems.js ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var lucide_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lucide-react */ "./node_modules/lucide-react/dist/esm/icons/panel-top.js");
/* harmony import */ var lucide_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lucide-react */ "./node_modules/lucide-react/dist/esm/icons/panel-bottom.js");
/* harmony import */ var lucide_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lucide-react */ "./node_modules/lucide-react/dist/esm/icons/code-xml.js");
/* harmony import */ var lucide_react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lucide-react */ "./node_modules/lucide-react/dist/esm/icons/list.js");
/* harmony import */ var lucide_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lucide-react */ "./node_modules/lucide-react/dist/esm/icons/layout-list.js");
/* harmony import */ var lucide_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lucide-react */ "./node_modules/lucide-react/dist/esm/icons/archive.js");



(0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(lucide_react__WEBPACK_IMPORTED_MODULE_2__["default"], null);
const sidebarItems = [{
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Header', 'astra'),
  layout: 'header',
  template: '',
  icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(lucide_react__WEBPACK_IMPORTED_MODULE_2__["default"], {
    className: "w-[20px] h-[20px] text-icon-secondary group-hover:stroke-[#141338]"
  })
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Footer', 'astra'),
  layout: 'footer',
  template: '',
  icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(lucide_react__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "w-[20px] h-[20px] text-icon-secondary group-hover:stroke-[#141338]"
  })
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Hooks', 'astra'),
  layout: 'hooks',
  template: '',
  icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(lucide_react__WEBPACK_IMPORTED_MODULE_4__["default"], {
    className: "w-[20px] h-[20px] text-icon-secondary group-hover:stroke-[#141338]"
  })
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Inside Post/Page', 'astra'),
  layout: 'content',
  template: '',
  icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(lucide_react__WEBPACK_IMPORTED_MODULE_5__["default"], {
    className: "w-[20px] h-[20px] text-icon-secondary group-hover:stroke-[#141338]"
  })
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Single', 'astra'),
  layout: 'template',
  template: 'single',
  icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(lucide_react__WEBPACK_IMPORTED_MODULE_6__["default"], {
    className: "w-[20px] h-[20px] text-icon-secondary group-hover:stroke-[#141338]"
  })
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Archive', 'astra'),
  layout: 'template',
  template: 'archive',
  icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(lucide_react__WEBPACK_IMPORTED_MODULE_7__["default"], {
    className: "w-[20px] h-[20px] text-icon-secondary group-hover:stroke-[#141338]"
  })
}, {
  label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('404 Page', 'astra'),
  layout: '404-page',
  template: '',
  icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", {
    width: "24",
    height: "24",
    viewBox: "0 0 20 21",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    class: "text-[#6F6B99] group-hover:text-[#141338]"
  }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M15.8333 3H4.16667C3.24619 3 2.5 3.74619 2.5 4.66667V16.3333C2.5 17.2538 3.24619 18 4.16667 18H15.8333C16.7538 18 17.5 17.2538 17.5 16.3333V4.66667C17.5 3.74619 16.7538 3 15.8333 3Z",
    stroke: "currentColor",
    "stroke-width": "1.25",
    "stroke-linecap": "round",
    "stroke-linejoin": "round"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M14.572 13.8327V12.5876H12.2689V12.0342L14.2953 6.88281H15.5526V11.7616H16.1955V12.5876H15.5526V13.8327H14.572ZM13.3431 11.7616H14.572V10.7362L14.6778 8.40055H14.5476L13.3431 11.7616Z",
    fill: "currentColor"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M9.94548 13.8942C9.78 13.8942 9.59825 13.8698 9.40023 13.821C9.20492 13.7721 9.01774 13.6772 8.8387 13.5361C8.66238 13.3924 8.51725 13.1821 8.40332 12.9054C8.28939 12.6287 8.23242 12.2625 8.23242 11.8068V8.86898C8.23242 8.41054 8.29074 8.04568 8.40739 7.77441C8.52403 7.50043 8.67188 7.29563 8.85091 7.15999C9.02995 7.02165 9.21712 6.93077 9.41243 6.88737C9.61046 6.84397 9.78814 6.82227 9.94548 6.82227C10.0974 6.82227 10.2696 6.84261 10.4622 6.8833C10.6548 6.92399 10.8407 7.01215 11.0197 7.14779C11.1987 7.28071 11.3466 7.48416 11.4632 7.75814C11.5799 8.03212 11.6382 8.4024 11.6382 8.86898V11.8068C11.6382 12.2625 11.5785 12.6287 11.4591 12.9054C11.3425 13.1821 11.1933 13.3924 11.0116 13.5361C10.8325 13.6772 10.6467 13.7721 10.4541 13.821C10.2642 13.8698 10.0947 13.8942 9.94548 13.8942ZM9.94548 13.0723C10.1544 13.0723 10.3103 13.0072 10.4134 12.877C10.5165 12.7467 10.568 12.5379 10.568 12.2503V8.48649C10.568 8.18538 10.5165 7.96566 10.4134 7.82731C10.3103 7.68625 10.1544 7.61572 9.94548 7.61572C9.73117 7.61572 9.57113 7.68625 9.46533 7.82731C9.36225 7.96566 9.31071 8.18538 9.31071 8.48649V12.2503C9.31071 12.5379 9.36225 12.7467 9.46533 12.877C9.57113 13.0072 9.73117 13.0723 9.94548 13.0723Z",
    fill: "currentColor"
  }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("path", {
    d: "M5.94564 13.8327V12.5876H3.64258V12.0342L5.66895 6.88281H6.92627V11.7616H7.56917V12.5876H6.92627V13.8327H5.94564ZM4.7168 11.7616H5.94564V10.7362L6.05143 8.40055H5.92122L4.7168 11.7616Z",
    fill: "currentColor"
  }))
}];
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (sidebarItems);

/***/ }),

/***/ "@wordpress/api-fetch":
/*!**********************************!*\
  !*** external ["wp","apiFetch"] ***!
  \**********************************/
/***/ ((module) => {

module.exports = window["wp"]["apiFetch"];

/***/ }),

/***/ "@wordpress/i18n":
/*!******************************!*\
  !*** external ["wp","i18n"] ***!
  \******************************/
/***/ ((module) => {

module.exports = window["wp"]["i18n"];

/***/ }),

/***/ "react":
/*!************************!*\
  !*** external "React" ***!
  \************************/
/***/ ((module) => {

module.exports = window["React"];

/***/ }),

/***/ "react-dom":
/*!***************************!*\
  !*** external "ReactDOM" ***!
  \***************************/
/***/ ((module) => {

module.exports = window["ReactDOM"];

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/create fake namespace object */
/******/ 	(() => {
/******/ 		var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
/******/ 		var leafPrototypes;
/******/ 		// create a fake namespace object
/******/ 		// mode & 1: value is a module id, require it
/******/ 		// mode & 2: merge all properties of value into the ns
/******/ 		// mode & 4: return value when already ns object
/******/ 		// mode & 16: return value when it's Promise-like
/******/ 		// mode & 8|1: behave like require
/******/ 		__webpack_require__.t = function(value, mode) {
/******/ 			if(mode & 1) value = this(value);
/******/ 			if(mode & 8) return value;
/******/ 			if(typeof value === 'object' && value) {
/******/ 				if((mode & 4) && value.__esModule) return value;
/******/ 				if((mode & 16) && typeof value.then === 'function') return value;
/******/ 			}
/******/ 			var ns = Object.create(null);
/******/ 			__webpack_require__.r(ns);
/******/ 			var def = {};
/******/ 			leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
/******/ 			for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
/******/ 				Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
/******/ 			}
/******/ 			def['default'] = () => (value);
/******/ 			__webpack_require__.d(ns, def);
/******/ 			return ns;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
(() => {
/*!**********************!*\
  !*** ./src/index.js ***!
  \**********************/
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "react-dom");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _App__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./App */ "./src/App.js");
/* harmony import */ var _style_index_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style/index.scss */ "./src/style/index.scss");





/**
 * Import the stylesheet for the plugin.
 */

if (document.getElementById('ast-tb-app-root')) {
  react_dom__WEBPACK_IMPORTED_MODULE_1___default().render((0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_App__WEBPACK_IMPORTED_MODULE_2__["default"], null), document.getElementById('ast-tb-app-root'));
}
})();

/******/ })()
;
//# sourceMappingURL=index.js.map